NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Can someone please answer a joypad question?  
Posted byzero soul
Posted on3/15/02 10:03 PM



try returning just 0x00 if the button is not pressed and 0x01 if it is. games may expect all but the lowest bit to be clear; if they use the zero flag to test if a button is pressed (for example:

 LDA A_BUTTON_READ
BEQ BUTTON_NOT_PRESSED
), then using 0x40/0x41 will screw it up. (because the zero flag will always be reset if either value is LDA'd).
also, games that shift data to keep all the button presses in one byte (eg., they load the a-button read, ASL A, ORA $4016 to get the b-button read, etc) will be screwed up if one bit is always set.

and why do you return 0x40/0x41 anyway? the other bits are only used for the light gun thing. yes, one bit is set if the trigger is released, and reset if the trigger is pulled, but the only games that would actually check this are games that are expecting you to use the light gun. all other games will expect- and rightfully so- all but the low bit to always be 0.

ideally, games should LDA $4016 and then do AND #$01, but not all games do. I don't do it in *my* demos; I just read it and store it as-is.

and about the 'strobing' business: if nothing else, you should reset the counter to zero after a game strobes the joystick, although it sounds like, from your description, that games will always do the full 8 reads. but still.


...just another vision... Studios

-
Entire Thread
Subject  Posted byPosted On
*Can someone please answer a joypad question?  777Nes3/15/02 8:11 PM
.*I fixed the problem...  777Nes3/18/02 7:36 PM
..Re: Can someone please answer a joypad question?  zero soul3/15/02 10:03 PM
..*Re: Can someone please answer a joypad question?  777Nes3/15/02 11:25 PM
...*Re: Can someone please answer a joypad question?  Jsr3/16/02 11:08 PM
...*Re: Can someone please answer a joypad question?  zero soul3/16/02 08:23 AM
...*Re: Can someone please answer a joypad question?  mcmartin3/16/02 04:41 AM
....*Re: Can someone please answer a joypad question?  777Nes3/16/02 06:03 AM
.....*Re: Can someone please answer a joypad question?  mcmartin3/17/02 04:44 AM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo