It is currently Sun Oct 22, 2017 2:16 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon May 23, 2016 3:06 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 111
Location: Rio de Janeiro - Brazil
Hi guys, this is driving me insane, can someone help? I'm using the Super Pitfall ROM.

When I create a breakpoint for read + write and executes to 0000-FFFF with condition K==#05 it never breaks.
The only breakpoints that are working are to banks #00, #06 and #07.

For testing, I have tried setting 3 forbids for 0000-FFFF RWE to banks #00, #06 and #07 and then setting a breakpoint to any bank with all addresses also for RWE but it never breaks. It will only break on banks 0, 6 and 7... What am I missing here?

_________________
http://nesrocks.com/blog/superpitfall30th/


Top
 Profile  
 
PostPosted: Mon May 23, 2016 3:28 pm 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1785
Location: DIGDUG
My only stupid question. Are you sure the game is going to bank 5 ?

Also, Nintendulator has debugging tools. Maybr try it.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Mon May 23, 2016 3:38 pm 
Offline

Joined: Sun May 03, 2015 8:19 pm
Posts: 89
Ahh this is a tricky one...It's because everything in bank 5 APPEARS to be data.

The game... at least on one thing I checked.... is executing from bank 7 when its reading the data.


Top
 Profile  
 
PostPosted: Mon May 23, 2016 3:44 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 111
Location: Rio de Janeiro - Brazil
Just answering dougeff:
Well, code/data logger marks several addresses as data from ROM addresses 0x14000 forward. I wanted to break on read to some of these to analize how that data is handled, and I calculated that should be bank 5. But there's no way setting breakpoints to those addresses will work. I've even manually "step in" a bunch of times on the debugger until bank 5 was loaded (code is executed there when code/data logger is active, as the little "c" indicates next to each line, then I double click on a line to set a breakpoint which is a way to avoid mistakes, then I go back and play that part and it still doesn't break. I've even started from power on and played for several minutes and nothing. I've tried testing it on a fresh ROM (I figured my deb files may be corrupted) and still nothing. I'm thinking either fceux has a bug on this or I'm not understanding something (which is possible). I'll take a look at nintendulator.

hackfresh:
So, what can I do? That area in the ROM really is data. It's where all objects and enemies are stored. I want to better understand how the game interprets that data.

From my notes. This is all mostly data:

Code:
4020-40EF:    overworld room ID map
40F0-7BFF:    start of each screen mapping in 2x2 metatiles. Each screen is 15x16 (240) bytes long.
   
C020-C0EF:    darkworld room ID map
C0F0-E0CF:    darkworld metatile map
   
10020-100EF:    hidden areas room ID map
100F0-13A1F:   the hidden areas metatile map and possibly some beta version or quest 2 unused version of the overworld
   
13920-13A1F:    an unused test room with gold and ladders
   
14000-1421F:    object list mapping for overworld quest 1
1426B-147F6:    object list for overworld quest 1. Each item takes 3 bytes. First byte is type, second is horizontal position and third is vertical position. Some items take 4 bytes, so the second is a parameter, and the last two are the position
   
14A9F-14C60:    object list for darkworld
   
14E60-14FB8:   object list for big warpzone
14FB9-15015:    object list for medium warpzone
15016-15046:    object list for small warpzone


So banks 2, 3 and 4 are for backgrounds / maps. And bank 5 is for objects. Roughly.

_________________
http://nesrocks.com/blog/superpitfall30th/


Top
 Profile  
 
PostPosted: Mon May 23, 2016 3:54 pm 
Offline

Joined: Sun May 03, 2015 8:19 pm
Posts: 89
The FCEUX bank condition only applies to the bank the code is executing from not from the bank its reading from. At least as I understand it. So leave out the bank restriction.

The data that you want to look at is starts at 0x14010 = 0x14020- header. You can tell from the pointer table at the beginning of the section that its been mapped to 0x8000. So you could set a breakpoint for anytime it reads from 0x8010 thru 0x9034 (the end of the data)

The first one I tried was setting a read breakpoint for 8058. It break on this not long after pressing start for player 1. 8058 refers to 0x14068 in the rom if the header is included.

Image


Top
 Profile  
 
PostPosted: Mon May 23, 2016 4:10 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 111
Location: Rio de Janeiro - Brazil
Hmm wow that's interesting, thanks!

But doesn't fceux's condition only working for the bank it's executed from beat the porpuse of breaking on reads with bank conditions? It must be very often that reads fetch addresses from other banks, no? Mind you this is the first game I'm actually using the debugger, so I have no experience with other games. So I guess when looking for reads one should never set bank conditions unless it's known that it's from the same bank : /

_________________
http://nesrocks.com/blog/superpitfall30th/


Top
 Profile  
 
PostPosted: Mon May 23, 2016 5:39 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 329
Location: FL
According to the documentation, T represents the bank that data is being read from/written to, while K only represents the bank currently being executed.


Top
 Profile  
 
PostPosted: Mon May 23, 2016 6:03 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 111
Location: Rio de Janeiro - Brazil
Revenant wrote:
According to the documentation, T represents the bank that data is being read from/written to, while K only represents the bank currently being executed.

That about clears it up. I didn't get that from reading the documentation, but your description is perfect. Problem solved, thanks!

_________________
http://nesrocks.com/blog/superpitfall30th/


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Nicole 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