Mesen - NES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

mkwong98
Posts: 221
Joined: Mon May 30, 2011 9:01 pm

Re: Mesen - NES Emulator

Post by mkwong98 » Wed Jun 26, 2019 10:45 am

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

lidnariq
Posts: 8690
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Mesen - NES Emulator

Post by lidnariq » Wed Jun 26, 2019 11:15 am

Why do you think that's a problem in the Nametable viewer?

You see the same thing in FCEUX's nametable viewer.

User avatar
koitsu
Posts: 4214
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Mesen - NES Emulator

Post by koitsu » Wed Jun 26, 2019 1:05 pm

Definitely not a bug; game is using some per-scanline/at-runtime PPU trickery that cannot be reflected in the nametable directly.

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

Re: Mesen - NES Emulator

Post by Sour » Wed Jun 26, 2019 1:44 pm

Like koitsu & lidnariq said, this isn't a bug.

The game probably switches CHR banks in the middle of screen, but the nametable viewer can only display the nametable using whatever CHR banks are currently in use. To see the top portion of the screen correctly, you'll need to change the scanline value at the bottom of the ppu viewer window - this defaults to 241, but try setting it to 40-50 and you should be able to see the top portion (which will cause the bottom part to look incorrect)

mkwong98
Posts: 221
Joined: Mon May 30, 2011 9:01 pm

Re: Mesen - NES Emulator

Post by mkwong98 » Wed Jun 26, 2019 4:20 pm

Thanks, I'll try that.

User avatar
Zepper
Formerly Fx3
Posts: 3190
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Mesen - NES Emulator

Post by Zepper » Thu Jun 27, 2019 7:11 pm

koitsu wrote:Definitely not a bug; game is using some per-scanline/at-runtime PPU trickery that cannot be reflected in the nametable directly.
PPU IRQs, much like the scorebar in SMB3.

lidnariq
Posts: 8690
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Mesen - NES Emulator

Post by lidnariq » Thu Jun 27, 2019 7:27 pm

Pedantically, the Bandai game in the screen shot is using an M2-timed IRQ.

unregistered
Posts: 1038
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered » Thu Jul 11, 2019 10:35 am

Sour, something I don't understand about your Tile Updates in Mesen's Nametable Viewer is: why does 8bit row 24 and row 25 never become red? The full screen always changes appropriately, but even when running at [Emulation Speed] 1%, rows 24 and 25 are never highlighted red. :(

Our game now draws the background horizontally a 32bit tall row during each vblank, while each screen is being drawn. So an 8th of screen per vblank. Maybe this info will somehow help?

oh, instead of highlighting rows 24 and 25, rows 28 and 29 are highlighted. Which should only happen the next frame when, afterward but still in vblank, the screen is colored.


I'm sorry if this becomes another waste of your time and space.

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

Re: Mesen - NES Emulator

Post by Sour » Thu Jul 11, 2019 9:44 pm

It's a bit hard to know with the information you've given. As far as I can tell, any of the rows can get highlighted on my end.
Do the rows physically change in the PPU viewer but don't show any highlight?
Make sure you haven't enabled the "ignore writes that do not alter data" option and try setting the window to refresh at 60fps instead of the default 30, just in case (but this shouldn't matter if you're already running the emulation at a slow speed)

Pokun
Posts: 1234
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - NES Emulator

Post by Pokun » Sun Jul 28, 2019 3:27 am

Another problem when using the keyboard. The Alt key is conveniently used as the Famicom's GRPH key by default, but when pressing Alt an emulator menu option is selected. This makes using the GRPH key inconvenient, especially as it's used as a modifier key and pressing Alt + another key may trigger a menu option in the emulator interface. Is there a way to disable this behaviour of the Alt key?
If you want to test this quickly, run Family BASIC V3, press the KANA key to enter kana mode and then press the "A" key which should normally type a "サ" and a "ザ" if the GRPH key is held.


Finally I have a feature request. Nestopia and some other emulators like OpenMSX has a paste macro for automatically typing characters in the clipboard into the emulated machine. In Nestopia you press F12 (or click the menu option) to "paste" the text into the emulated Famicom. In OpenMSX there is a text box in the emulator interface that characters can be typed or pasted into and then be automatically typed on the emulated MSX with a button click. Both approaches works quite well, although I like the OpenMSX approach more since you can see what text you paste and easily make any edits before you start the typing macro. One small annoyance in Nestopia is that it doesn't seem to recognize katakana characters in the clipboard (or at least I don't know how to get it to work using UTF-8), meaning programs using katakana strings will have empty strings and must be modified manually in Family BASIC (I guess this would require to keep track on the kana mode and use the GRPH key for dakuten and handakuten characters). Also although Family BASIC doesn't have lower case letters, keyboard Famiclone programs and pirate versions of Family BASIC do using the SHIFT key, so since it already supports Subor Famiclones, case sensitivity might also be a consideration.

This is the final feature that forces me to keep using Nestopia for Family BASIC stuff, and it's a great feature I'd like to see on Mesen. It's a great way to quickly test a Family BASIC program typed on a computer without having to type it out again. Although I have Family BASIC and keyboard I more often develop programs on my computer and paste them in Nestopia. My computer have better tools and I can save programs on it without having to use tapes, this speeds up work greatly (once a cool program is done I might type it out on my real hardware though and save it on tape though).

User avatar
rainwarrior
Posts: 7636
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - NES Emulator

Post by rainwarrior » Sun Jul 28, 2019 3:31 am

Feature request: display of "cycles since last resume"

This is one thing that I keep going back to FCEUX for. It's very useful for verifying cycle timed loops when there's branches involved. E.g. for sample playback I could breakpoint on $4011 and then resume 100 times in a row watching that counter to make sure it's the expected number of cycles each time.

Mesen seems to have an editable cycles field, which is OK if you want to time something just once, but not very useful for repetition like that, which is usually what I need when I'm writing cycle timed code. A simple way to do this might be an option/checkbox to reset that field to 0 automatically on every resume?

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

Re: Mesen - NES Emulator

Post by Sour » Sun Jul 28, 2019 8:47 am

Pokun wrote:Is there a way to disable this behaviour of the Alt key?
Probably not at the moment - I should be able to disable the behavior whenever "keyboard mode" is enabled though. I'll add it to the list and try to take a look soon.

RE: Pasting, it's been on my list of things to do forever, just never got around to it. In one release I implemented ~15 peripherals and it took a month to get it all done - at that point I was just tired and needed it to end, so paste ability ended up being cut :p I'll try to take a look and see how simple it would be to implement - can't imagine it would be too hard.
rainwarrior wrote:This is one thing that I keep going back to FCEUX for. It's very useful for verifying cycle timed loops when there's branches involved. E.g. for sample playback I could breakpoint on $4011 and then resume 100 times in a row watching that counter to make sure it's the expected number of cycles each time.
The debugger window does display the number of cycles since the previous break at the bottom right in the status bar - that sounds like what you're asking for, but I might be misunderstanding?

User avatar
rainwarrior
Posts: 7636
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - NES Emulator

Post by rainwarrior » Sun Jul 28, 2019 12:57 pm

Sour wrote:The debugger window does display the number of cycles since the previous break at the bottom right in the status bar - that sounds like what you're asking for, but I might be misunderstanding?
Ah, that does it! Awesome! No I just never saw it down there.

Pokun
Posts: 1234
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - NES Emulator

Post by Pokun » Mon Jul 29, 2019 3:07 pm

Sour wrote:
Pokun wrote:Is there a way to disable this behaviour of the Alt key?
Probably not at the moment - I should be able to disable the behavior whenever "keyboard mode" is enabled though. I'll add it to the list and try to take a look soon.
Thanks, I was worried it couldn't be fixed so easily.

Sour wrote:RE: Pasting, it's been on my list of things to do forever, just never got around to it. In one release I implemented ~15 peripherals and it took a month to get it all done - at that point I was just tired and needed it to end, so paste ability ended up being cut :p I'll try to take a look and see how simple it would be to implement - can't imagine it would be too hard.
Good to hear that you were planning this already. I'll eagerly be waiting for this feature. :D
BTW, while I mentioned case sensitivity being a good idea, in the case of Family BASIC (except for the Chinese/Russian hacked versions) it may be a good idea to be able to turn case sensitivity off since it can't type letters at all if SHIFT is pressed.

unregistered
Posts: 1038
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Mesen - NES Emulator

Post by unregistered » Fri Aug 02, 2019 1:55 pm

Sour, thank you for your response, I'm not sure if that was fixed after following your advise. Just checked and currently both the Ignore writes that do not alter data box is unchecked and the nametable viewer is refreshing now at 60hz. Thank you for your help too. :)


Another problem, for me, I've found is that after creating "labels" without labels, but just filling out the Comment: box, after pressing F2, destroys Mesen after a while. This has happened twice. Eventually the .mlb file size increases dramaticly (like from 9kb to something like 32mb) and this causes the debugger to load extremely slow and resets to take extremely long.

The 9kb and 32mb .mlb files are entirely the same, except that each line that appears like: P:3D788::RLE loop begins\n(sets and uses carry) or P:3D78F::\neven (notice the two colons beside each other due to missing label) is repeated and repeated and repeated many many many times.

To restore Mesen's speed both times I've had to delete all-1 of each of those :: lines and then load that updated .mlb file. Currently I've created 4 comment only "labels".


Comment only "labels" were never planned? For me they help the debugging process... :)

p.s. I do not use fasm to create mlb files... rather I just keep editing the mlb and cdl files (with and without Mesen's help) manually. Maybe that causes this problem?

Post Reply