It is currently Tue Jan 22, 2019 10:09 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 656 posts ]  Go to page Previous  1 ... 37, 38, 39, 40, 41, 42, 43, 44  Next
Author Message
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 1:40 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7118
Location: Canada
Why is that a reason not to show the palette memory at the address that you would read or write it? It's still what you'd find at that PPU address.

nesrocks wrote:
Hi. When using the PPU Memory viewer tool, is there a reason it doesn't show the palette values at the end? Starting at $3F00. Fceux shows it, so I was wondering the reason for the inconsistency. Thanks!

There is a "palette RAM" option to view it, at least, which might even be more convenient, but I agree that I'd expect the palettes to appear in the PPU memory view, and it would more intuitively represent how that address space is organized.

I don't think there's really value in showing the "underlying" RAM. In almost all cases it's just a mirror anyway, but in the rare cases that it's not I suppose the CHR RAM view suffices?


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 2:31 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11099
Location: Rio de Janeiro - Brazil
rainwarrior wrote:
Why is that a reason not to show the palette memory at the address that you would read or write it? It's still what you'd find at that PPU address.

Actually, palette RAM is overlaid on top of actual VRAM, so you could argue that the viewer in Mesen shows the contents of the memory chip rather than what you'd get if you hypothetically read that address via the PPU registers. There are normally only NT mirrors at $3F00-$3FFF, but there could be unique RAM there too, and it can be read with some mild trickery (source). I'm not sure how you could write data there though, without bankswitching.

To me it makes more sense to show the underlying memory than the overlaid palette RAM, because AFAIK they're are no other means to see that data (if it's unique instead of mirrored), while palette RAM has its own dedicated viewer.

Sure it may be one of those "who's ever gonna need this?" cases, but the fact is that deliberately hiding something and making it inaccessible just because most people have no use for it is a bad design choice. Palette RAM is *NOT* part of VRAM and I feel like it's important to show it's treated differently (it's even read differently).


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 3:52 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 355
Location: Rio de Janeiro - Brazil
Yeah I agree, if it's the real accurate thing, then that's what it is.
I would like an export feature that had ppu chr0, chr1, nam, pal and oam all in one file. That would be for loading that into the tool I'm making. So far fceux has the complete bg part, while mesen offers the oam export.

_________________
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 5:25 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7118
Location: Canada
tokumaru wrote:
Actually, palette RAM is overlaid on top of actual VRAM, so you could argue that the viewer in Mesen shows the contents of the memory chip rather than what you'd get if you hypothetically read that address via the PPU registers.

Yes, but this is a view of the PPU address space, not VRAM. The area from 0000-1FFF is another chip entirely, and bankable, etc. Even the VRAM itself might be replaced by other things.

An "internal VRAM" view might make sense (though TBH, I think it's easiest to understand in its place at $2000-2FFF) but I don't really get the purpose of the "underlying" concept here. It is simply not accessible by the PPU addressing, and the palettes are.

nesrocks wrote:
I would like an export feature that had ppu chr0, chr1, nam, pal and oam all in one file. That would be for loading that into the tool I'm making. So far fceux has the complete bg part, while mesen offers the oam export.

You can view the OAM in the hex editor in interim builds of FCEUX (and save it to disk).


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 5:27 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11099
Location: Rio de Janeiro - Brazil
nesrocks wrote:
I would like an export feature that had ppu chr0, chr1, nam, pal and oam all in one file.

All of this in a single file? That would make it harder to create labels for each part in a project that includes this file, don't you think?

Quote:
That would be for loading that into the tool I'm making.

Even if it's just for importing in tools, that means that the tools have to accept whatever file format the emulator author decides to use for packing all this stuff together.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 5:44 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11099
Location: Rio de Janeiro - Brazil
rainwarrior wrote:
It is simply not accessible by the PPU addressing, and the palettes are.

It's readable at least... A read from $3F00-$3FFF will immediately return a value from palette RAM, but will also copy the VRAM value to the read buffer. Then, if you change the VRAM address to something below $3F00, you can read $2007 to get the buffered value. Like I said, this falls into the "who's ever gonna need that?" category, but even though they're mapped to different areas in the same addressing space, only writes behave the same, reads are completely different, so treating the whole thing as an uniform block of memory is quite misleading IMO. Palette RAM is more like OAM I think, only it didn't get its own addressing space and access registers like OAM did.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 5:51 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 355
Location: Rio de Janeiro - Brazil
There doesn't need to be a format or labels. It's just sequences of raw bytes of fixed length at known locations. No wonder both emulator's PPU memory dump features already work, with the exception of mesen's palette, which isn't exported on that file. I just read the correct byte ranges from the file and it works. Are there exceptions? It worked with most games, and the ones that didn't I figured it was because they change data mid-frame.

_________________
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 6:22 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7118
Location: Canada
nesrocks wrote:
There doesn't need to be a format or labels. It's just sequences of raw bytes of fixed length at known locations. No wonder both emulator's PPU memory dump features already work, with the exception of mesen's palette, which isn't exported on that file. I just read the correct byte ranges from the file and it works. Are there exceptions? It worked with most games, and the ones that didn't I figured it was because they change data mid-frame.

A dump either at the start of NMI, or end of NMI should be fine, but yeah mid-frame banking (or other rendering changes) is very common and will throw it off.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 7:13 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11099
Location: Rio de Janeiro - Brazil
One way to support raster effects like that in a tool is to grab multiple dumps from the emulator and tell the tool in which scanlines the changes are supposed to happen. That should be enough to simulate the output of the emulator. Exporting the from the tool would be trickier though, you'd probably have to write code for specific mappers to handle the necessary raster effects.

nesrocks wrote:
There doesn't need to be a format or labels.

Labels aren't necessary if you're importing the data into a tool, but they're convenient if you're importing from an .asm file. I guess you can manually create labels by adding offsets and such, or INCBIN sections of a larger file, but it's not as versatile (e.g. compression for examplegets very impractical). And by "format" I mean basically the order in which things are stored in the large file. Does OAM come before or after VRAM? Is palette RAM at $3F00 or as a separate chunk? Things like that.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 7:36 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 355
Location: Rio de Janeiro - Brazil
Yeah but isn't it possible to have mid-scanline changes? That'd be crazy. Maybe stop the support at mid-frame changes, but at full scanline. Anyway, this is just a bonus feature on my tool, I guess adding support for all effects would be overkill and out of purpose. I don't know of any practical reason to add such a feature to an emulator anyway.

It would be magical though to include OAM at the end of the file to load bg+sprites with one click, but I guess it doesn't hurt for it to be a two step process.

_________________
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 7:45 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7977
Location: Seattle
tokumaru wrote:
It's readable at least... A read from $3F00-$3FFF will immediately return a value from palette RAM, but will also copy the VRAM value to the read buffer.
Not only that, but the older PPUs (rev B/C, all the Vs. System alternate PPUs, maybe others?) reads from $3Fxx just go from the underlying RAM: there's no way to read the palette RAM.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Thu Nov 22, 2018 9:41 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7118
Location: Canada
lidnariq wrote:
Not only that, but the older PPUs (rev B/C, all the Vs. System alternate PPUs, maybe others?) reads from $3Fxx just go from the underlying RAM: there's no way to read the palette RAM.

Woah, now that I did not know about! (I never had a use for reading the palette, personally, but I did test it on my NES! I never realized it wasn't always supported.)

I can actually understand that as a conceptual reason to do the PPU memory viewer this way... though I still think for practical purposes: people will expect palette data to appear where it was written and it's useful to be able to find it here (nesrocks demonstrates one reason why), and I doubt anyone will have practical use for reading CHR RAM data from here.

nesrocks wrote:
Yeah but isn't it possible to have mid-scanline changes? That'd be crazy. Maybe stop the support at mid-frame changes, but at full scanline. Anyway, this is just a bonus feature on my tool, I guess adding support for all effects would be overkill and out of purpose. I don't know of any practical reason to add such a feature to an emulator anyway.

If you know how the raster split is done, you can set breakpoints on the write that causes it and do a couple of dumps. I've done this several times to make diagrams...

Actually on Mesen you can use "Scanline == 100" or similar for a breakpoint condition, so maybe it's pretty easy to manually set a few breakpoints to dump a frame, which is pretty cool! (I haven't yet done this in Mesen, but noticing it's there I'm sure I will someday.)

Edit: ...or you can click on the "Break on..." button at the top right and type a scanline number for a one time advance-and-break to a specific scanline! I didn't notice that before. Ha ha Mesen is so good.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Sun Dec 09, 2018 8:01 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21011
Location: NE Indiana, USA (NTSC)
never-obsolete wrote:
Found an issue with the debugger [when jumping into the middle of an instruction]

Should be fixed as of revision 70ad89a.


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Tue Dec 11, 2018 2:53 am 
Offline

Joined: Sat Nov 18, 2017 9:15 pm
Posts: 61
Mesen 0.9.7 seems to have a substantial memory leak when using the Event Viewer while the emulator is not paused. It got as far as ~119 GB of private bytes before starting to give me OOM exceptions such as this:

---------------------------
Mesen
---------------------------
An unexpected error has occurred.

Error details:
System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.CheckErrorStatus(Int32 status) at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height) at System.Drawing.Graphics.DrawImage(Image image, Rectangle rect) at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
---------------------------
OK
---------------------------


Top
 Profile  
 
 Post subject: Re: Mesen - NES Emulator
PostPosted: Tue Dec 11, 2018 4:12 am 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 582
Fiskbit wrote:
Mesen 0.9.7 seems to have a substantial memory leak when using the Event Viewer
This was fixed a couple of weeks ago (someone else reported the same problem on GitHub). If you try the latest appveyor dev build, the leak should be gone.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 656 posts ]  Go to page Previous  1 ... 37, 38, 39, 40, 41, 42, 43, 44  Next

All times are UTC - 7 hours


Who is online

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