Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

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.)
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered »

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. :)
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered »

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 :)
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

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.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered »

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

Re: Mesen - NES Emulator

Post by unregistered »

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: :?
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered »

^ :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. :(
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

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!
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

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!
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Mesen - NES Emulator

Post by Banshaku »

A new build, ye! ;) I need to go check for the linux build now.
pellaken
Posts: 1
Joined: Mon Jun 24, 2019 9:07 pm

Re: Mesen - NES Emulator

Post by pellaken »

hello. I'm trying to get this working on linux, but I'm new to linux and can't figure out how. there does not seem to be a "download for linux" button??
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mesen - NES Emulator

Post by lidnariq »

Instructions are on Mesen's source:
https://github.com/SourMesen/Mesen/#ubuntu wrote: The official releases (same downloads as the Windows builds above) also contain the Linux version of Mesen, built under Ubuntu 16 - you should be able to use that in most cases if you are using Ubuntu.

The Linux version is a standard .NET executable file and requires Mono to run - you may need to configure your environment to allow it to automatically run .exe files through Mono, or manually run Mesen by using mono (e.g: "mono Mesen.exe").

The following packages need to be installed to run Mesen:
  • mono-complete
  • libsdl2-2.0
  • gnome-themes-standard
If you're using something other than Debian or Ubuntu, some details may change.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Mesen - NES Emulator

Post by lidnariq »

It'd be nice if the overscan cropping was a function of NTSC (e.g. 224 scanline) vs PAL (whole field)

Also, it'd be nice if there was a more verbose error than "failed to load XX" in case of a too-small file.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - NES Emulator

Post by Sour »

I feel like the NTSC/PAL overscan has been asked before, too, but was not on my list of ideas, somehow. It shouldn't be too hard to add, especially considering there's already per-game overscan settings.

There is a more verbose message in the log window:

Code: Select all

[iNes] Invalid file (file length does not match header information) - load operation cancelled.
Although I agree it can be easy to overlook.
mkwong98
Posts: 282
Joined: Mon May 30, 2011 9:01 pm

Re: Mesen - NES Emulator

Post by mkwong98 »

Hi Sour, I'm using Nametable viewer and there are problems with 2 games: "Captain Tsubasa Vol. II - Super Striker" and "Dragon Ball Z II - Gekishin Freeza!!". Can that be fixed? Thanks.
Attachments
mesenPPUviewerBug.png
Post Reply