Ninja tap

Page 15/19
8 | 9 | 10 | 11 | 12 | 13 | 14 | | 16 | 17 | 18 | 19

By Jipe

Paragon (1603)

Jipe's picture

04-11-2022, 10:58

tested on BlueMSX
you have to stand in front of PLAYER on each player
blue control player by default
red control w
green control joystick 1 up
yellow control joystick 2 up
only after push Space Key for starting

By Danjovic

Champion (325)

Danjovic's picture

04-11-2022, 12:17

Oh!! Then it is a menu selection for each player!
I haven't realized that at the beginning!
Thanks Jipe!

By Sebbeug

Champion (397)

Sebbeug's picture

04-11-2022, 17:44

Just test it on SX2, as Jipe said, i can use 2 controllers in game after menu.
When a NinjaTap is plugged, no joystick detected Wink

By Danjovic

Champion (325)

Danjovic's picture

05-11-2022, 21:14

Disassembled and analyzed MuhonMourn 3 and wrote the patch code, but not tested yet (away from home).
Wrote an article with some technical details (here)

In few words, it is necessary to intercept the scan at 08669h and fulfill the following memory region with tap data considering key or button pressed as '1'

By Danjovic

Champion (325)

Danjovic's picture

06-11-2022, 13:49

I think it is possible to add SELECT and START buttons from a FM Towns controller without add extra hardware.

; ntap access
GETNIN:
 ....
 ....
;/////////////////////////
   ld   a,h
   pop   hl
   call addSelStart
   ld   (hl),a      ;joy1
   inc   hl
   ld a,e
   call addSelStart
   ld   (hl),a ;  e      ;joy2
   inc   hl
   ld a,d
   call addSelStart
   ld   (hl),a ;  d      ;joy3
   inc   hl
   ld a,c
   call addSelStart
   ld   (hl),a ;  c      ;joy4
   inc   hl
     
; restore port (6,7,8=h)
   ld   de,0ff3fh
   call   porsel
;   ld   a,15
;   out   (0a0h),a
;   in   a,(0a2h)
;   or   3fh
;   out   (0a1h),a
   pop   af
   ret

And this is the function that replaces UP+DOWN with SELECT and LEFT+RIGHT with START(RUN)

; process FM towns extra buttons
; a = A B Sl St Up Dw Lf Rg 
  addSelStart:
  ld b,a            
TestForSelect:      
  and 11110011b     ; test only wanted bits 
  jr nz, TestForRun ; if U+D not active at the same time, test for L+R
  ld a,00001100b    ; deactivate up+down bits
  or b              
  and  11011111b    ; activate Select bit
  ld b,a              
TestForRun:         
  and 11111100b     ; test only wanted bits
  ld a,b            ; last return value  
  ret nz            ; if U+D not active at the same time, return last value
  ld a,00000011b    ; deactivate left+right bits
  or b              
  and  11101111b    ; activate Run (start) bit
  ret

By Jipe

Paragon (1603)

Jipe's picture

06-11-2022, 14:17

Hi Danjovic
I try your patch but the game does not work
after the first screen with redef characters i have a black screen
memory from 8000h to FFFFh is filled with FFh in BlueMSX
memory from 8000h to FFFFh is filled with D0h DAh in OpenMSX
I tried on a real MSX with and without the Ninja Tap and I have the same result

By Danjovic

Champion (325)

Danjovic's picture

06-11-2022, 14:39

Hi Jipe. Thanks for testing.
This morning I was able to set the openMSXdebugger to keep testing the patch. I had the same behaviour -> black screen. Investigating if further I have found that the game fulfills the space after 0xd400 up to df92.
Then I changed the patch to begin at 0xe000 and made some tests with the debugger and it seems to be working, by inserting manually the bytes that shoud be read from the ninja tap on the emulator addresses and running step by step.
I have uploaded the new patch code and a disk image with the patched binary (Q) and the Tap Function (M) and a basic loader (muhonP.bas) to github.

By aoineko

Paladin (895)

aoineko's picture

06-11-2022, 15:34

Danjovic wrote:

I think it is possible to add SELECT and START buttons from a FM Towns controller without add extra hardware.

In MSXgl, I added support for FM Towns joystick triggers in the software layer using the direction information.

By Danjovic

Champion (325)

Danjovic's picture

06-11-2022, 15:51

aoineko wrote:

In MSXgl, I added support for FM Towns joystick triggers in the software layer using the direction information.

You had already did that? I must have missed that Smile
Great!!!

By aoineko

Paladin (895)

aoineko's picture

06-11-2022, 16:11

It's just defines that say RUN is RIGHT+LEFT and SELECT is UP+DOWN.
So we can call NTap_IsPressed(0, NTAP_FMT_RUN); for example.
I didn't add these buttons to the START/SELECT bits of the Ninja Tap because for me it's not the same thing: these bits are reserved for real buttons like the ones on the NES controller.

Page 15/19
8 | 9 | 10 | 11 | 12 | 13 | 14 | | 16 | 17 | 18 | 19