Mesen - Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Sat Feb 04, 2023 7:02 pm
bklD wrote: Sat Feb 04, 2023 6:00 pm SPC7110 games don't work anymore
Thanks, this is fixed.
Thank you for your time and effort! :) Momotaro Dentetsu Happy and Super Power League 4 are working great now. It looks like Tengai Makyou Zero has a problem, though. One check ist not working ("RTC BACKUP: NG") and because of that(?) it isn't starting.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

Sour wrote: Sat Feb 04, 2023 7:02 pm
Pokun wrote: Fri Feb 03, 2023 7:33 pm it would be nice if the SNES mouse was available for the Famicom expansion port (controller 3 and 4 configurations).
If you pick the "2-Player Adapter (Famicom)" expansion device, it should let you connect the SNES mouse to port 3/4. The 4-player adapter (e.g 6 controllers total) isn't compatible with the SNES mouse, afaik, which is why you can't connect the mouse to it.
Ah my bad, it is indeed there. It wasn't in old Mesen and in that one you had to change console type of Famicom to even use the expansion connector. Now you can just plug anything you want that is supported in any connector, which is so much more handy. Oh the Famicom 4-player multitap is supported too. Great work!
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

Cartesius wrote: Sat Feb 04, 2023 10:18 pmCould it be possible to keep every frame from the last like 2 or 3 seconds so that you don't have to emulate these first seconds and thus not have the little delay? Not a huge deal either way, just wondering
It's definitely possible, but it would add complexity to the code, increase RAM usage at all times and probably have a slight impact on performance (esp. when video filters with a high resolution are used, etc.) So essentially I don't really think it's worth the effort/cons at the moment.

bklD wrote: Sat Feb 04, 2023 10:22 pm One check ist not working ("RTC BACKUP: NG") and because of that(?) it isn't starting.
IIRC, this is because the translated text gives the wrong instructions. The translation tells you to "Reset" the system after pressing A, but the original Japanese text tells you to turn off the console and turn it back on. Using "power cycle" instead will make the error go away and fix the problem, so I'm assuming this is normal
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Sun Feb 05, 2023 9:30 am
bklD wrote: Sat Feb 04, 2023 10:22 pm One check ist not working ("RTC BACKUP: NG") and because of that(?) it isn't starting.
IIRC, this is because the translated text gives the wrong instructions. The translation tells you to "Reset" the system after pressing A, but the original Japanese text tells you to turn off the console and turn it back on. Using "power cycle" instead will make the error go away and fix the problem, so I'm assuming this is normal
Thanks. It does work with "power cycle" instead, you are right.
But with ares, bsnes and SNES9x it's working when you reset the system and shows the "RTC BACKUP: OK" message there doing that. Maybe it's worth looking into this again for you someday. But the important thing is that we can start it right now... :D
Coffee'Valentina'Bat
Posts: 1
Joined: Mon Feb 06, 2023 4:55 pm

Re: Mesen - Emulator

Post by Coffee'Valentina'Bat »

Just downloaded the emu for testing and seeing how good its debugger is for Game Boy development, really nice stuff! Although I think the GBS player has some issues regarding timer register writes, most games use the usual VBlank interrupt for music, but some games (in my case, "Das Geheimnis der Happy Hippo-Insel", which has amazing music btw) use TIMA based interrupts to update music much faster, in my case, some tracks in the GBS file (which I got from Zophar's domain) play far far far slower than they should, maybe at quarter speed. I quickly tried the GBS rip for "Ottifanten: Kommando Stoertebeker" which uses the same music driver but it seems to run fine, not sure if this game uses VBlank for music instead.
I also quickly tried a hUGETracker generated file using timer control and it seems to work fine, so the GBS file for Happy Hippo might be writing to the timer registers in a way that Mesen doesn't like :p
User avatar
ISSOtm
Posts: 58
Joined: Fri Jan 04, 2019 5:31 pm
Location: France, right of a pile of consoles
Contact:

Re: Mesen - Emulator

Post by ISSOtm »

Sour wrote: Mon Jan 30, 2023 7:38 pm
ISSOtm wrote: Sun Jan 29, 2023 6:42 pmAh, but the ROM in question wasn't involving DMAs at all.
If you have a specific rom/game where I can try to reproduce this one, let me know. At the moment the only scenario where I've seen this is the dma call.
I tried the ROM again with a debug-mode Mesen after pulling in your recent changes, and I don't get the lock-up any more, so I suppose my bug was a "collateral" :P

I will keep using Mesen2 on Linux, and submit any bugs I find!
The French Lord of Laziness (and a huge Legend of Zelda fan)
https://github.com/ISSOtm
ASMu is laifu <3
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

bklD wrote: Sun Feb 05, 2023 10:38 amwith ares, bsnes and SNES9x it's working when you reset the system
Both bsnes/snes9x don't seem to have a dedicated "power cycle" button, I'm not really sure what their "reset" does exactly - so it's a bit hard to judge based off of this alone. Short of someone being able to test this specifically on a real cart, it would require a decent amount of time to figure this one out (e.g by analyzing what the game is doing/expecting) because reverse engineering assembly code isn't really something I'm good at :p

Coffee'Valentina'Bat wrote: Mon Feb 06, 2023 5:10 pm I think the GBS player has some issues regarding timer register writes
I remember fixing similar issues with GBS files not too long ago, it's very possible there are still some scenarios where it doesn't work correctly, I'll admin I haven't really tested a whole lot of GBS files in the first place. Thanks for the info, I'll take a look!

ISSOtm wrote: Mon Feb 06, 2023 6:08 pm I don't get the lock-up any more, so I suppose my bug was a "collateral"
Great news! Hopefully it was fixed by one of the various freeze/crash fixes I did in the past couple of weeks. Let me know if you find anything else!
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Mesen - Emulator

Post by jeffythedragonslayer »

Sour wrote: Tue Feb 07, 2023 5:10 pm
bklD wrote: Sun Feb 05, 2023 10:38 amwith ares, bsnes and SNES9x it's working when you reset the system
Both bsnes/snes9x don't seem to have a dedicated "power cycle" button, I'm not really sure what their "reset" does exactly
Isn't it just like sliding up the purple Reset button on a real snes console? I noticed in bsnes the other day when my BG offsets got screwed up, they stayed screwed up after I reset, but unloading and loading the game fixed them. That tells me it's pretty much just pointing the program counter to the reset vector and leaving registers unchanged. I observed the exact same behavior when I slid the Reset button on my snes as I did as clicking Reset in bsnes.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - Emulator

Post by rainwarrior »

I saved an NES movie file from the history viewer (full video, not a partial segment). Trying to load the movie with the debugger open now causes a crash. Loading the movie without the debugger open makes it end immediately, but it should be a few minutes long (file is 25k).

The crash happens even if I rename the NES file so that it should have no pre-existing debug information. If I open an unrelated NES ROM and try to play the movie there it seems to crash as well.

(I can share the movie, but unfortunately the ROM is private.)

Also: if I set a read/write breakpoint, wait for it to be hit. If I press Step Back after hitting the breakpoint it seems to jump back a very long way to some time before I can't predict? Step Back only seems to work if I was already stepping through code to begin with?

Mesen-2.0.0-preview1-Windows (2023-01-25 20:52) CRC: 8C1B1E25

Edit: movie deleted.
Last edited by rainwarrior on Wed Feb 08, 2023 2:41 am, edited 2 times in total.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

rainwarrior wrote: Tue Feb 07, 2023 9:15 pm Trying to load the movie with the debugger open now causes a crash.
The rewind feature (+ history viewer) were bugged in the first preview I posted - it wasn't recording the input at all.
So it looks like this ended up making the input log completely empty in the movie file (it's just 2+k completely blank lines) - I'm guessing this is what's causing it to end immediately when played (should probably handle that scenario better, somehow)

I'm not quite sure on the debugger crash yet, haven't tried to reproduce that part yet.

The crash when loading the movie on another ROM is caused by the save state that's embedded in the movie file (this happens even when saving the movie from the start if you have the ram set to random) - it gets loaded on top of the other rom and because some stuff doesn't match (e.g chr ram vs rom, the size of prg rom, etc.), the restored state is invalid, which causes invalid memory accesses and crashes. I have a fix for this (not committed yet)

There's no way to salvage the movie, unfortunately. Try grabbing the latest dev build from the links in the readme (https://github.com/SourMesen/Mesen2#development-builds) - the movies created from the history viewer should be saved correctly in the latest builds
fred
Posts: 67
Joined: Fri Dec 30, 2011 7:15 am
Location: Sweden

Re: Mesen - Emulator

Post by fred »

Just remembered that the leaked proto of super ghouls n ghosts crashes mesen-s and well, it also crashes mesen2! It's playable in both bizhawk and bsnes.
Sour
Posts: 891
Joined: Sun Feb 07, 2016 6:16 pm

Re: Mesen - Emulator

Post by Sour »

fred wrote: Thu Feb 09, 2023 2:29 am Just remembered that the leaked proto of super ghouls n ghosts crashes mesen-s and well, it also crashes mesen2! It's playable in both bizhawk and bsnes.
It seems to be working normally on my end (as far as I can tell?), using a file with the following SHA1: F8F03F9C63300BF3FFA1D182632C17FC606BD569
Does that match what you're using? By crash do you mean mesen itself crashes, or the emulated game crashes?
I tried using both the "preview1" build and the latest dev build but neither crashed
bklD
Posts: 36
Joined: Fri Sep 01, 2017 8:56 am

Re: Mesen - Emulator

Post by bklD »

Sour wrote: Tue Feb 07, 2023 5:10 pm
bklD wrote: Sun Feb 05, 2023 10:38 amwith ares, bsnes and SNES9x it's working when you reset the system
Both bsnes/snes9x don't seem to have a dedicated "power cycle" button, I'm not really sure what their "reset" does exactly - so it's a bit hard to judge based off of this alone. Short of someone being able to test this specifically on a real cart, it would require a decent amount of time to figure this one out (e.g by analyzing what the game is doing/expecting) because reverse engineering assembly code isn't really something I'm good at :p
I see, thanks for your explanation, Sour.


There is another thing I would like to address. It has to do with "blend high resolution" in SNES emulation. It seems to be broken when enabled.

Examples

Tokimeki Memorial - Densetsu no Ki no Shita de (lines in window and broken text)
left -> mesen
right -> ares, bsnes, SNES9x

https://i.imgur.com/wbZEgBA.jpg

More games:
A.S.P. - Air Strike Patrol (USA) (text) -> one of the best examples. See: https://i.imgur.com/SsYxadg.png
Bishoujo Janshi Suchie-Pai (character sprites, before you start a level) -> one oft the best examples. See: https://i.imgur.com/fQhD9Z2.png
Dark Law (text): https://i.imgur.com/lBvyBQN.png
Marvelous (text)
Mouryou Senki Madara 2 (text)
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Mesen - Emulator

Post by Pokun »

What is this mode supposed to do exactly?
Tokimemo uses a checkered pattern to produce a transparent backing in dialog windows. This pattern becomes visible lines when using this mode. Blarg's NTSC filter is better for making it transparent. Text is a bit blurrier with this filter but it's still readable.

On my TV the checkered pattern is visible as a mesh-pattern regardless if I use composite or RGB (but as we concluded in another thread this might be due to me using a high TVL Sony PVM monitor and a 1CHIP SFC, it probably becomes more transparent on a regular consumer TV and especially with an older blurrier SFC model).
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Mesen - Emulator

Post by rainwarrior »

bklD wrote: Thu Feb 09, 2023 3:42 pm Tokimeki Memorial - Densetsu no Ki no Shita de (lines in window and broken text)
A.S.P. - Air Strike Patrol (USA) (text)
Bishoujo Janshi Suchie-Pai (character sprites, before you start a level)
Dark Law (text)
Marvelous (text)
Mouryou Senki Madara 2 (text)
Thanks for the examples. There were a few in there I hadn't seen yet. We've been keeping a list of games that use mode 5 high resolution here, which has additional ones:

SNESDev Wiki: Uncommon graphics mode games
Pokun wrote: Thu Feb 09, 2023 5:02 pmWhat is this mode supposed to do exactly?
It looks like the purpose of this mode is to allow the SNES to render at 256x224/240 despite high-resolution mode. Rather than trying to provide an NTSC or CRT signal blur or filtered blend, it's just downsampling. Maybe the option should be renamed to reflect this? It's different than the "video filter" options which are more suited to the kind of thing you're describing.

Maybe I'd suggest: "Downsample high-resolution to low-resolution" instead of "Blend high resolution modes".

I do feel that this kind of downsampling is worthwhile (esp. trying to run Mesen as a core on a low resolution device) but that is a very different purpose than what people usually might want to do about high resolution graphics and blurring/blending.
Post Reply