It is currently Mon Jun 24, 2019 11:14 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 746 posts ]  Go to page Previous  1 ... 46, 47, 48, 49, 50
Author Message
 Post subject: Re: Mesen - NES Emulator
PostPosted: Fri May 17, 2019 1:36 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 1019
Location: cypress, texas
Sour wrote:
I'm not entirely sure I'm following what you're saying.
Like I said though, Mesen has no concept of label scope - it can't redefine the same label multiple times because of this.
If multiple identical labels existed, the debugger would have no idea which one was being referred to by a given line of code, which makes it harder/impossible to display a corresponding tooltip, or to navigate to the label, or to open the label in the hex editor, etc.
I guess I don't understand how the PRG Addresses work. Does the assembler asm6 translate each of my identical labels in each our lower banks into PRG Addresses listed in the ROM (the .nes file)? Or does Mesen create the PRG Addresses so that the mlb file can work?

Regardless, I will try again. Somehow you must have access to the ROM addresses to emulate a NES. I thought it might be possible to specify a ROM address in your mlb file (i.e. $9000). That would be just one address. But, you'd have to get your assembler to treat those addresses with the same method you use to translate my identical labels into the PRG Addresses. For example, in each of the lower banks ($8000-$BFFF) in our MMC1 game (note: the 2 higher banks ($C000-$FFFF) can be either bank 15 or bank 31) there are certain bytes with identical labels, let's pretend one of those labels is named abyte and is always labeling address $9000. So my idea was to somehow specify in your mlb file that abyte points to address $9000.

Like:
  • P:*9000:abyte or
  • I:9000:abyte| note: I for identical

Then when reaching a '*' or the 'I' you would have to use that address specified in the same way you interpret each of the abytes that, we are pretending, are sitting in the same ROM address spot in each of the lower banks in our game.

Somehow when switching banks the PRG Address for abyte changes to the appropriate value... so you already have that code written. Just was wondering if it was possible to reuse that code so that when trying to label $9000, you might be able to translate that $9000 into the appropriate PRG Address depending on what bank is selected in the emulated game? :)

Sour wrote:
When I mentioned improving asm6f, I strictly meant the .mlb file export feature it contains, not the actual assembler.
"R" in the mlb label files refers to the 2kb of internal RAM that the NES has (e.g $0000 to $1FFF in CPU memory)
Oh ok! :D Great choice of "R". :)


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Fri May 17, 2019 2:07 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 671
The "PRG ROM" labels are not based on the address of bytes in the CPU's memory (e.g $0000-$FFFF), but rather based on their offset in the .nes file (excluding the header). i.e it's an offset in the entire PRG ROM.

So while your first "abyte" might be at offset $1000, the 2nd one could be at $23000, for example (even though at runtime they are both mapped to $9000 in the CPU's address space, in the actual .nes rom, they refer to different bytes). Mesen treats these as completely independent labels. If it was possible to give 2 different bytes in the PRG ROM the same label, some functionality would no longer work properly (e.g right-click, edit in memory viewer, etc.)


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Fri May 17, 2019 3:19 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 1019
Location: cypress, texas
Ok, remember that I'm around understanding level 0.7 and you must be at understanding level 10. Could you make

  • O:9000:abyte| note: O refers to ROM

so that abyte is a label to whatever byte, in the .nes rom, is mapped to $9000 in the CPU's address space? :)


Maybe that is a bad question, but am just wondering. I'm done asking; thank you Sour for responding each time.

p.s. Then, when right-click or edit in memory viewer you could have Mesen zero-in on whatever byte, in the .nes rom, is mapped to the specified part (byte) in the CPU's address space. :)


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Mon May 20, 2019 1:29 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 1019
Location: cypress, texas
Sour wrote:
The "PRG ROM" labels are not based on the address of bytes in the CPU's memory (e.g $0000-$FFFF)
Sigh, sorry Sour, this opening statement of yours must have escaped me. :(

Regardless, my last question would have made so much more sense if it would have used:
  • C:9000:abyte | note: C represents CPU address space

But, you just said the "PRG ROM" labels are not based on the CPU's address space... so you would have to make a new "CPU address space" label. That seems like a lot of work so it's probably not worth it. :) It's not a crucial detail... just thought it would be cool.

tldr: nm :)


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Mon May 20, 2019 2:21 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 671
You can try using the "register" ("G" in mlb files for 'global') type labels for your scenario, maybe it'll work as you expect it to.
Essentially, they are CPU memory labels ($0000-$FFFF) that ignore all banking, etc. This is the type of label used to define the PPU/APU registers. The rules for them to be used in the disassembly window are slightly different, but might work for your case.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Mon May 20, 2019 2:55 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 1019
Location: cypress, texas
Thank you so much Sour, that works! :D


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Jun 13, 2019 3:33 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 1019
Location: cypress, texas
Even after running the latest MesenDevWin, this is still a problem that I can't understand.
Here is a screenshot of my asm6 .lst file and Mesen's debugger...

Image

Somehow the last two bytes from my jsr attributetable have both been pushed forward two bytes and into a new fake instruction. And thus, the following rts has decended two bytes. :?

(I'm in the midst of debugging my first try at self-modifying code. It has been going pretty good! :))

asm6_'s .lst file is different. Is this a problem with my asm6_? I don't think so bc the assembler was never changed; we just attempted to change .lst file creation. I'm lost. :oops: :?


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Jun 13, 2019 3:49 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 1019
Location: cypress, texas
^ :oops: nm, my init_PRGRAM function in ROM wasn't correct... now seei in my PRGRAM is written correctly. Sorry for wasting your space and time. :(


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Sun Jun 23, 2019 12:05 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 671
9 months and nearly 300 commits later, 0.9.8 is finally out.
The online documentation has also been updated.

If you find anything that's broken, please let me know!


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Sun Jun 23, 2019 5:15 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 671
Just a heads up, 0.9.8 had an issue causing FDS games to load incorrectly. It's fixed and I've recompiled a new build of 0.9.8, but if you upgraded to 0.9.8 already, you'll need to manually download 0.9.8 from the website or github to get the fixed build. Sorry!


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Sun Jun 23, 2019 6:07 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2302
Location: Fukuoka, Japan
A new build, ye! ;) I need to go check for the linux build now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 746 posts ]  Go to page Previous  1 ... 46, 47, 48, 49, 50

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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