It is currently Tue Sep 18, 2018 8:42 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Sep 03, 2018 3:22 pm 
Offline
User avatar

Joined: Mon Sep 03, 2018 2:41 pm
Posts: 3
Hi all, long time lurker here! :) Been hacking for a while, but now I'm in dire need for some help about something I can't wrap my head around regarding nestest.log.

On line 8981 the rom does a STA, where A is 02, to $4015. My emu writes 02 to this address (which should be APU status reg?), but according to the log it looks like it should be writing FF somehow? Up until that point everything matches to my emu.

Code:
...
  C689  A9 02     LDA #$02                        A:00 X:FF Y:15 P:27 SP:FB CYC: 80 SL:212
> C68B  8D 15 40  STA $4015 = FF                  A:02 X:FF Y:15 P:25 SP:FB CYC: 86 SL:212
  C68E  A9 3F     LDA #$3F                        A:02 X:FF Y:15 P:25 SP:FB CYC: 98 SL:212
...


Am I missing something fundamental about the log or the behaviour of the CPU/APU? Up until this point I have been assuming that " = XX" in the log indicates what value is being written.

Thanks for a great community and resource!


Top
 Profile  
 
PostPosted: Mon Sep 03, 2018 3:34 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6801
Location: Canada
Are you talking about the "= FF" part? This is indicating a value at the prospective write before this instruction takes place. In the case of registers in that region, for that particular instruction I don't think it's a meaningful value in the log (maybe just a default open bus value that the emulator assigned?). For variables in RAM, though, it should indicate the last value that had been stored there. For similar reasons, some of the variables written at the beginning of the log have "meaningless" starting values too, which would on a real thing be random/unreliable.


Top
 Profile  
 
PostPosted: Mon Sep 03, 2018 3:40 pm 
Offline
User avatar

Joined: Mon Sep 03, 2018 2:41 pm
Posts: 3
Aha! I was thinking along those lines, but it didn't make sense to me since $4015 should be set to 0x00 at init?


Top
 Profile  
 
PostPosted: Mon Sep 03, 2018 3:46 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6801
Location: Canada
$4015 doesn't work like a RAM address. What you write to it doesn't really match what you'll read back from it. Its read function is a status poll.

So... I would assume whatever the emulator uses as it's inspected pre-instruction value is treating something like that as special, and $FF is just the default 'nothing connected' value there, not really indicative of anything.


Top
 Profile  
 
PostPosted: Mon Sep 03, 2018 3:50 pm 
Offline
User avatar

Joined: Mon Sep 03, 2018 2:41 pm
Posts: 3
Makes sense! Thanks man for the help, really been scratching my head at this. :)


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: Google [Bot] and 1 guest


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