Ninja tap

Page 11/17
4 | 5 | 6 | 7 | 8 | 9 | 10 | | 12 | 13 | 14 | 15 | 16

By aoineko

Paladin (810)

aoineko's picture

11-10-2022, 09:31

@Manual: All detection case works just fine with OpenMSX 18.0-97.
Thanks for the fix.
The only remain problem is that we can't plug more than 1 ninjatap device per machine in OpenMSX and so I can't test 8 players case.
BTW, this is a problem I already encountered when I was adding mouse support in MSXgl and could not test to connect 2 mice in OpenMSX.

@Danjovic: MSXgl's sample program on GitHib has been updated (https://github.com/aoineko-fr/MSXgl/raw/main/projects/sample...).
The 3 available drivers are:
- Original DM-System2 driver
- MSXgl custom DM-System2 driver with your patch
- Shinobi driver

By gdx

Enlighted (6005)

gdx's picture

11-10-2022, 10:47

aoineko wrote:

The only remain problem is that we can't plug more than 1 ninjatap device per machine in OpenMSX and so I can't test 8 players case.

This problem is also present with a slot expander and some other devices.

By Manuel

Ascended (19227)

Manuel's picture

11-10-2022, 11:05

Gdx: no, it isn't. Only for pluggables.

By Danjovic

Champion (321)

Danjovic's picture

11-10-2022, 17:15

@aoineko
Tested the version 0.5.17 and it can detect the Ninja Tap with MSXgl driver with both the original Ninja Tap circuit and the fixed version (with diode D1 inverted and resistor R1 removed.
oh and I am using a 74HCT00 instead of the ACT family.

By aoineko

Paladin (810)

aoineko's picture

11-10-2022, 18:12

Nice. So everything seem alright.
I'll made driver to be use under Basic for Jipe... if I found how to do so. ^^

By Danjovic

Champion (321)

Danjovic's picture

11-10-2022, 19:11

aoineko wrote:

Nice. So everything seem alright.
I'll made driver to be use under Basic for Jipe... if I found how to do so. ^^

Do you mean all the driver, including the parts that read the joysticks on the abswnce of a ninja tap, or only the ninja tap detection and reading stuff?

By aoineko

Paladin (810)

aoineko's picture

11-10-2022, 21:40

I'm planning to put all the code (detection + reading).

By Danjovic

Champion (321)

Danjovic's picture

11-10-2022, 22:20

In short it is possible to send the parameters for the ML program and get it back.
for instance you can start with

dim p1(5),p2(5)
defint p,v,s
v1=varptr(p1(0)) : v2=varptr(p2(0))

you can use position 0 to identify the driver and the other positions to identify the players, and get back from the ML program the status of the operation, for instance, if you assume 0 is the DMSystem driver, NZ is MSXgl driver..

p1(0) = 1: st = usr(v1)

Then you check variable st (just remember it is a 16 bit unsigned integer). if you assume return 0 for a common or undetected tap interface, 1 for ninja, 2 for shinobi, etc...

if st = 1 or st =2 then goto xxxx : rem read tap data
goto xxx: rem normal joystick

I know of a good reference for passing parameters to ML code but it is in Portuguese ("aprofundando-se no MSX").

By the way, the DM system 2 drivers have a routine to read the joystick, case no tap is detected, but I think is easier to just detect the tap, and if it's not present, use the bios routines to read the normal joysticks. That is what I meant by "all driver" (read either joystick and multitap) or just the multitap stuff (detect/reading)

By aoineko

Paladin (810)

aoineko's picture

11-10-2022, 23:01

Thanks. I found what I needed in the MRC wiki about USR() Basic function. Seems easy. Smile
Integer type is 2 ? Are you sure it is unsigned?

I like the fact this code handle direct joystick and joystick connected to Ninja Tap the same way.

By Danjovic

Champion (321)

Danjovic's picture

12-10-2022, 00:42

aoineko wrote:

Are you sure it is unsigned?

Sorry, it is signed. The thing is every element of the array takes 2 bytes and they are arranged in little endian, so to fullfill the data you may need to increment HL twice.

Quote:

I like the fact this code handle direct joystick and joystick connected to Ninja Tap the same way.

Indeed that helps Smile

Page 11/17
4 | 5 | 6 | 7 | 8 | 9 | 10 | | 12 | 13 | 14 | 15 | 16