It is currently Thu Dec 14, 2017 9:45 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Mar 21, 2016 6:43 pm 
Offline
User avatar

Joined: Wed Aug 26, 2015 8:24 am
Posts: 21
Location: Ontario, Canada
I'm having some trouble getting controller input to work with the Nestest rom. My controls appear to be working in other games. One of the problems I'm having here is related to the controller strobe. Most games write a 1, then a 0 as expected. But Nestest writes a 9, then an 8. Here is the output of my emulator at what I believe is this point:

1188904 - C5D0: STA 8D absolute 2006 0 A:0 X:0 Y:FE P:37 SP:F8 - stack: top ||<- 0,0,24,37,8f,c2,83,c0,
1188909 - C5D3: LDX A2 immediate C5D4 0 A:0 X:0 Y:FE P:37 SP:F8 - stack: top ||<- 0,0,24,37,8f,c2,83,c0,
1188912 - C5D5: STX 8E absolute 4016 0 A:0 X:9 Y:FE P:35 SP:F8 - stack: top ||<- 0,0,24,37,8f,c2,83,c0,
1188917 - C5D8: DEX CA implied - - A:0 X:9 Y:FE P:35 SP:F8 - stack: top ||<- 0,0,24,37,8f,c2,83,c0,
1188920 - C5D9: STX 8E absolute 4016 0 A:0 X:8 Y:FE P:35 SP:F8 - stack: top ||<- 0,0,24,37,8f,c2,83,c0,
1188925 - C5DC: LDA AD absolute 4016 0 A:0 X:8 Y:FE P:35 SP:F8 - stack: top ||<- 0,0,24,37,8f,c2,83,c0,

Note the red lines are the writes to 4016. I've checked with fcuex and it also writes a 9 then an 8.
How should the emulator handle this 9/8 strobe? As far as i've read on nesdev, bit 0 should be the only bit to strobe.

Thank you.

_________________
Aliasmk- GitHub :: Twitter :: Website
Current ALIAneS Emulator Progress: CPU complete, PPU indev - we have graphics and sprites!


Top
 Profile  
 
PostPosted: Mon Mar 21, 2016 9:56 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Aliasmk wrote:
How should the emulator handle this 9/8 strobe? As far as i've read on nesdev, bit 0 should be the only bit to strobe.

Thank you.



As you said... bit 0 is the only bit in the strobe. The other bits are irrelevant.

AND whatever is written with $01 to isolate the strobe bit and discard the rest. 9/8 becomes 1/0


Top
 Profile  
 
PostPosted: Tue Mar 22, 2016 4:05 am 
Offline
User avatar

Joined: Wed Aug 26, 2015 8:24 am
Posts: 21
Location: Ontario, Canada
Thank you... Perhaps I should have thought about it a little bit more eh :roll:
I'll blame this one on not being able to think straight after programming other stuff for hours prior to this question xD

Any particular reason nestest would strobe with a value of 8 and 9 rather than 0 and 1?

_________________
Aliasmk- GitHub :: Twitter :: Website
Current ALIAneS Emulator Progress: CPU complete, PPU indev - we have graphics and sprites!


Top
 Profile  
 
PostPosted: Tue Mar 22, 2016 6:43 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
Just guessing, but perhaps to test for exactly the programming error you had made. I guess it worked.


Top
 Profile  
 
PostPosted: Tue Mar 22, 2016 7:22 am 
Offline
User avatar

Joined: Wed Aug 26, 2015 8:24 am
Posts: 21
Location: Ontario, Canada
I suppose it did! :lol:

Thanks for the help everyone :)

_________________
Aliasmk- GitHub :: Twitter :: Website
Current ALIAneS Emulator Progress: CPU complete, PPU indev - we have graphics and sprites!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group