[hatari-devel] Moonspeeder problem : joystick question

Eero Tamminen eerot at users.berlios.de
Sun Jan 31 12:20:05 CET 2010


Hi,

On Sunday 31 January 2010, Laurent Sallafranque wrote:
> I was looking at moonspeeder. There's no interaction in the main menu.
> Everything works, but the "mouse pointer" doesn't move.
>
> While tracing a little, I 've seen the following calls to address
> $ff9201 and $ff9202
> These addresses are related to joystick.
>
> Can't the problem be somewhere in this part of code ?
>
> (the joystick doesn't move the "mouse pointer" as it should ?
> (I really don't know how this works in hatari, so that's why I ask).

Nicolas and Thomas know this better, but AFAIK the mouse and joystick are
handled normally with IKBD.  When tracing Moonspeader with the "ikbd_all"
option, there were actually no calls to IKBD.

From the disasm trace below it seems that it's writing to the joystick
direction register word and then checking a byte of the joystick fire button
register?  Sometimes it's reading also the direction register after writing
to it.

According to joy.c, when writing or reading either of these registers, its
value is set according to the SDL joystick state, so that's fine.

However, there's nothing done for the value that the program tries to write
to the register, not even IoMem_Read() to check what that value was, the
register is just overwritten with the SDL joystick values.  But for some
reason Moonspeader seems to be writing different values to the direction
register, why?  Is it some kind of expected response mask?

There are quite many different values it writes there:
      $007f
      $00bf
      $00df
      $00ef
      $00f7
      $00fb
      $00fd
      $00fe


	- Eero

PS. While looking at this, I noticed that these registers are also in
the ioMemTabTT.c set for STE joysticks.  However, according to my
documentation, they're not supported on TT...  I guess they should
be changed.  Thomas?


> 00053aba: 31fc 00fb 9202 0838 0001 MOVE.W #$00fb,$ffffffffffff9202
> 00053ac0: 0838 0001 9201 6714 31fc BTST.B #$0001,$ffffffffffff9201
> 00053ac6: 6714 31fc 00bf 9202 0838 BEQ.B #$00000014 == 00053adc (FALSE)
> 00053ac8: 31fc 00bf 9202 0838 0003 MOVE.W #$00bf,$ffffffffffff9202
> 00053ace: 0838 0003 9201 6706 4a2e BTST.B #$0003,$ffffffffffff9201
> 00053ad4: 6706 4a2e 0158 6704 0016 BEQ.B #$00000006 == 00053adc (FALSE)
> 00053ad6: 4a2e 0158 6704 0016 0040 TST.B (A6,$0158) == $000af9bc
> 00053ada: 6704 0016 0040 31fc 00fe BEQ.B #$00000004 == 00053ae0 (TRUE)
> 00053ae0: 31fc 00fe 9202 0838 0000 MOVE.W #$00fe,$ffffffffffff9202
> 00053ae6: 0838 0000 9201 670e 31fc BTST.B #$0000,$ffffffffffff9201
> 00053aec: 670e 31fc 00ef 9202 0838 BEQ.B #$0000000e == 00053afc (FALSE)
> 00053aee: 31fc 00ef 9202 0838 0002 MOVE.W #$00ef,$ffffffffffff9202
> 00053af4: 0838 0002 9201 6606 002e BTST.B #$0002,$ffffffffffff9201
> 00053afa: 6606 002e 0001 0001 31fc BNE.B #$00000006 == 00053b02 (TRUE)
> 00053b02: 31fc 00fd 9202 0838 0001 MOVE.W #$00fd,$ffffffffffff9202
> 00053b08: 0838 0001 9201 670e 31fc BTST.B #$0001,$ffffffffffff9201
> 00053b0e: 670e 31fc 00df 9202 0838 BEQ.B #$0000000e == 00053b1e (FALSE)
> 00053b10: 31fc 00df 9202 0838 0003 MOVE.W #$00df,$ffffffffffff9202
> 00053b16: 0838 0003 9201 6604 0016 BTST.B #$0003,$ffffffffffff9201
> 00053b1c: 6604 0016 0020 31fc 00fd BNE.B #$00000004 == 00053b22 (TRUE)
> 00053b22: 31fc 00fd 9202 0838 0003 MOVE.W #$00fd,$ffffffffffff9202
> 00053b28: 0838 0003 9202 670e 31fc BTST.B #$0003,$ffffffffffff9202
> 00053b2e: 670e 31fc 00df 9202 0838 BEQ.B #$0000000e == 00053b3e (FALSE)
> 00053b30: 31fc 00df 9202 0838 0007 MOVE.W #$00df,$ffffffffffff9202
> 00053b36: 0838 0007 9202 6606 002e BTST.B #$0007,$ffffffffffff9202
> 00053b3c: 6606 002e 0010 0001 31fc BNE.B #$00000006 == 00053b44 (TRUE)
> 00053b44: 31fc 00fb 9202 0838 0003 MOVE.W #$00fb,$ffffffffffff9202
> 00053b4a: 0838 0003 9202 670e 31fc BTST.B #$0003,$ffffffffffff9202
> 00053b50: 670e 31fc 00bf 9202 0838 BEQ.B #$0000000e == 00053b60 (FALSE)
> 00053b52: 31fc 00bf 9202 0838 0007 MOVE.W #$00bf,$ffffffffffff9202
> 00053b58: 0838 0007 9202 6606 002e BTST.B #$0007,$ffffffffffff9202
> 00053b5e: 6606 002e 0020 0001 31fc BNE.B #$00000006 == 00053b66 (TRUE)
> 00053b66: 31fc 00fe 9202 0838 0001 MOVE.W #$00fe,$ffffffffffff9202
> 00053b6c: 0838 0001 9201 670e 31fc BTST.B #$0001,$ffffffffffff9201
> 00053b72: 670e 31fc 00ef 9202 0838 BEQ.B #$0000000e == 00053b82 (FALSE)
> 00053b74: 31fc 00ef 9202 0838 0003 MOVE.W #$00ef,$ffffffffffff9202
> 00053b7a: 0838 0003 9201 6604 0016 BTST.B #$0003,$ffffffffffff9201
> 00053b80: 6604 0016 0010 31fc 00f7 BNE.B #$00000004 == 00053b86 (TRUE)
> 00053b86: 31fc 00f7 9202 0838 0000 MOVE.W #$00f7,$ffffffffffff9202
> 00053b8c: 0838 0000 9202 670e 31fc BTST.B #$0000,$ffffffffffff9202
> 00053b92: 670e 31fc 007f 9202 0838 BEQ.B #$0000000e == 00053ba2 (FALSE)
> 00053b94: 31fc 007f 9202 0838 0004 MOVE.W #$007f,$ffffffffffff9202
> 00053b9a: 0838 0004 9202 6606 002e BTST.B #$0004,$ffffffffffff9202
> 00053ba0: 6606 002e 0008 0001 31fc BNE.B #$00000006 == 00053ba8 (TRUE)
> 00053ba8: 31fc 00fe 9202 1038 9202 MOVE.W #$00fe,$ffffffffffff9202
> 00053bae: 1038 9202 4640 0240 000f MOVE.B $ffffffffffff9202,D0
> 00053bb2: 4640 0240 000f 8116 31fc NOT.W D0
> 00053bb4: 0240 000f 8116 31fc 00ef AND.W #$000f,D0
> 00053bb8: 8116 31fc 00ef 9202 1038 OR.B D0,(A6)
> 00053bba: 31fc 00ef 9202 1038 9202 MOVE.W #$00ef,$ffffffffffff9202
> 00053bc0: 1038 9202 4640 e808 8116 MOVE.B $ffffffffffff9202,D0
> 00053bc4: 4640 e808 8116 4a2e 015b NOT.W D0
> 00053bc6: e808 8116 4a2e 015b 6704 LSR.B #$00000004,D0
> 00053bc8: 8116 4a2e 015b 6704 0016 OR.B D0,(A6)
> 00053bca: 4a2e 015b 6704 0016 0020 TST.B (A6,$015b) == $000af9bf
> 00053bce: 6704 0016 0020 4a2e 013e BEQ.B #$00000004 == 00053bd4 (TRUE)
> 00053bd4: 4a2e 013e 6704 0016 0010 TST.B (A6,$013e) == $000af9a2
> 00053bd8: 6704 0016 0010 4cdf 4001 BEQ.B #$00000004 == 00053bde (TRUE)
> 00053bde: 4cdf 4001 4e75 48e7 f800 MVMEL.L #$4001,(A7)+
> 00053be2: 4e75 48e7 f800 4cb9 0003 RTS.L
>
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel





More information about the hatari-devel mailing list