Project Nested - NES emulator for SNES

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Nokia3310
Posts: 12
Joined: Mon Nov 02, 2020 1:52 pm

Re: Project Nested - NES emulator for SNES

Post by Nokia3310 »

I'm enjoying this project too. I never expected to see the SNES being backwards compatible three decades on. Amazing!! Can someone point me to the patches for Bomberman and Wagyan Land please?
Myself086
Posts: 158
Joined: Sat Nov 10, 2018 2:49 pm

Re: Project Nested - NES emulator for SNES

Post by Myself086 »

Nokia3310 wrote: Wed Apr 28, 2021 10:58 pm I'm enjoying this project too. I never expected to see the SNES being backwards compatible three decades on. Amazing!! Can someone point me to the patches for Bomberman and Wagyan Land please?
I post patches on the E column of the compatibility sheet here: https://docs.google.com/spreadsheets/d/ ... sp=sharing

Bomberman plays well.
Wagyan has background issues and I thought it was a bad header at the time. The notes for this game were incomplete on the sheet, I just updated them.
Nokia3310
Posts: 12
Joined: Mon Nov 02, 2020 1:52 pm

Re: Project Nested - NES emulator for SNES

Post by Nokia3310 »

Myself086 wrote: Wed Apr 28, 2021 11:36 pmI post patches on the E column of the compatibility sheet here: https://docs.google.com/spreadsheets/d/ ... sp=sharing
Great!! Bomberman plays well (albeit without explosion sound effects). It glitched out after a few plays (Bomberman became a garbage graphic) but a quick reset fixes that. The 'Continue' screen is glitched but usable. Overall, a good representation of NES Bomberman playing on a SNES :D

Wagyan Land doesn't seem to have any major issues on the Japanese version that I've tested. The music has shortened notes for some tunes but it works. I haven't tried the English patched version yet.

Speaking of patched versions, I've been playing Donkey Kong Redux (same game with improved graphics). It looks and plays very nicely.

Seicross is a game that I hadn't played before but plays great. A very fun NES racing game with a futuristic setting.

If anyone has any suggestions for hacked/patched games that may work on Project Nested, please drop your suggestions. I tried SMB2 (Japan - lost levels) since SMB1 works great but this doesn't work at present (incompatible mapper used on Loopy's NES version).

Seriously, Project Nested is a brilliant project. I can't praise this enough
Patrick FR
Posts: 78
Joined: Tue Jan 19, 2010 10:35 am
Location: Lyon

Re: Project Nested - NES emulator for SNES

Post by Patrick FR »

Hi
I'am the developer of upernes and I tested Nested today. Like Memblers, I would have not believed the jit approach would work. I have often encountered timing issues with upernes so it is nice to see that it may be room to run complex mappers.
The JIT aproach trades off indirect jump list with in game slow downs at start but it is then easier to convert roms.
Nice work! Specially on double sized sprites, "Battle city" works with Nested. How have you done?
Myself086
Posts: 158
Joined: Sat Nov 10, 2018 2:49 pm

Re: Project Nested - NES emulator for SNES

Post by Myself086 »

Patrick FR wrote: Sat May 01, 2021 5:20 am I have often encountered timing issues
I use a queue for any VRAM changes (that I call VramQ), it uses port $2180 for fast queuing since this port is only used to clear WRAM during startup and works great as a queue. Graphics are delayed by 1 frame so nothing misses the VRAM timing, everything is uploaded during vblank while interpreting the queue.
Patrick FR wrote: Sat May 01, 2021 5:20 am The JIT aproach trades off indirect jump list with in game slow downs at start but it is then easier to convert roms.
Not sure I understand this 100% but indirect JMP is down to 81.66 + 11.66 * failed_attempts cycles. It transforms the 16-bit NES address to a 24-bit NES address due to mapper emulation. Then splits it into top 16-bit and bottom 8-bit. The bottom 8-bit is used as index for which list to search, it's 256 linear linked lists.
i.e.: Indirect JMP to $8123 in bank $04 results in searching $0481 in list $23.
Patrick FR wrote: Sat May 01, 2021 5:20 am Specially on double sized sprites, "Battle city" works with Nested. How have you done?
NES has 64 sprites, SNES has 128 sprites. 8x16 sized sprites are using 2x 8x8 sized sprites. Nothing too complicated.

Sprites get converted rather than changing how they're being written in the first place. I'm not sure of the exact timing but the earliest version took about 2500 cycles to convert 8x8 sprites. Current version has conditional timing based on how many sprites are actually used on screen and the CPU registers are used more efficiently. A command is then added to VramQ to upload sprites.


Also, welcome back :D
Patrick FR
Posts: 78
Joined: Tue Jan 19, 2010 10:35 am
Location: Lyon

Re: Project Nested - NES emulator for SNES

Post by Patrick FR »

Also, welcome back
Thanks, it is nice to see people working on nes to snes conversions. It refreshes the point of view and sets new grounds for improvement.
I use a queue for any VRAM changes (that I call VramQ), it uses port $2180 for fast queuing since this port is only used to clear WRAM during startup and works great as a queue.
Very interesting, strangely I was thinking about it recently but, it may be really valid only for a subset of system accesses.
From what I remember this does not work with "Ballon fight", but I do not remember the details. It has to do with the stars changing colour in the background or something.

Thanks for the tip on battle city.
Myself086
Posts: 158
Joined: Sat Nov 10, 2018 2:49 pm

Re: Project Nested - NES emulator for SNES

Post by Myself086 »

Patrick FR wrote: Tue May 04, 2021 2:14 pm it may be really valid only for a subset of system accesses.
Using a queue is valid for everything that the SNES can only update during vblank. Keep in mind that the queue does NOT replace system accesses, it simply removes the need to scan a long list of conditions. I know your project at some point could only update either 1 row or 1 column on the background per frame due to compare time or something.

For example, a write to $2007 will make changes to the emulated NES VRAM and additionally queue the appropriate change for the SNES VRAM. If the byte being written to doesn't change, a "read" is queued instead (I'm aware of a bug between this and nametable mirror changes).
Crystalis updates the entire palette and the entire tile attribute table every frame.
niuus
Posts: 8
Joined: Wed May 05, 2021 1:30 am

Re: Project Nested - NES emulator for SNES

Post by niuus »

Myself086 wrote: Sun Jul 26, 2020 1:20 pm Project Nested uses a JIT+AOT compiler to convert NES games into SNES games. It runs at roughly full speed depending on the game, 60 fps and mapper support.

Main github page: https://github.com/Myself086/Project-Nested
Download: https://github.com/Myself086/Project-Nested/releases
Awesome project. :beer:

Is there a trick to force patch roms? I see games like Super Mario Bros. 3, Metal Gear, Mega Man 2, Zelda, etc. being used, but everytime i try to patch them, i only get "Mapper 17 not supported", and the ROM is never generated. Used patcher 1.0 up to 1.3 to no avail, Windows 7 x64.

Also tried making profiles based on the compatibility list for those games and others like Ninja Gaiden, but it won't let me patch them if it says that the Mapper is not supported.
Myself086
Posts: 158
Joined: Sat Nov 10, 2018 2:49 pm

Re: Project Nested - NES emulator for SNES

Post by Myself086 »

You have the wrong ROMs. From what I understand, this mapper was used for a copying device. I'm not sure if you can revert them back to their original mapper because part of the code may have been altered.

I've had a similar report of games using mapper 14 instead of 4.

These mappers will take a while to be emulated on SNES and probably not worth my time.
niuus
Posts: 8
Joined: Wed May 05, 2021 1:30 am

Re: Project Nested - NES emulator for SNES

Post by niuus »

Myself086 wrote: Wed May 05, 2021 1:37 pm You have the wrong ROMs. From what I understand, this mapper was used for a copying device. I'm not sure if you can revert them back to their original mapper because part of the code may have been altered.

I've had a similar report of games using mapper 14 instead of 4.
Interesting. I was using No Intro. I'll switch to Cowering for this, then. Thanks for the tip!
Myself086 wrote: Wed May 05, 2021 1:37 pm These mappers will take a while to be emulated on SNES and probably not worth my time.
I understand. Hope you get far with your project, even in its current form it is really exciting to do this, feels great to have this level of backward compatibility on the SNES. :beer:
niuus
Posts: 8
Joined: Wed May 05, 2021 1:30 am

Re: Project Nested - NES emulator for SNES

Post by niuus »

Additional to your notes on the spreadsheet for making the games run, some tests with Project Nested 1.3:

* These games improve performance substantially when using an SRM file:
Adventure Island II (USA)
Batman - The Videogame (USA): will start slowing down a bit at 1-2.

* These games improve the micro-pauses and glitched black lines that appear over the graphics when using an SRM file:
Chip 'n Dale - Rescue Rangers (USA): some slowness when enemies appear.
Darkwing Duck (USA): some slowness when enemies appear or when you shoot.
DuckTales 2 (USA): some slowness when enemies appear or against some backgrounds.
Mega Man 2 (USA): only tested Quick Man stage, you will die when you are crossing the first time on each of the first 3 screens at the scene where you are dropping down and the lasers come from the wall, this will stop happening when you use the SRM. When i got to the boss scene, the energy refill and the battle boss were slow, but both situations will improve when the SRM is used.
Ninja Gaiden (USA): runs great, missing an instrument, i think. Crashes completely on Game Over.
Super Mario Bros. (World): besides the wonky sound when you lose a life, runs perfect.

I'm guessing that most, if not all games that exhibit these problems will always improve by using an SRM.

* Others:
Akumajou Dracula (JAP): runs, but it is very slow.
Days of Thunder (USA) (Prototype) [Compiled PRG+CHR]: "please report it including the value of 0x0087F3"
Hook (USA): Lots of garbage during text screens. Some slowdowns while playing.
Little Medusa (2018) (Mega Cat Studios): Disable Stack Native Return, use an SRM file. Still crashes some seconds after starting the game.
Metal Gear (USA) : screen is vertically off-limits. Title screen is garbage but fixes if you let the first demo run and press start to go back.
Metal Storm (USA) : crashes on the beginning of the first level.

* Some minor bugs i have found in the application:
- Manually choosing a profile does not load any options/patches, unless the name matches with the ROM. A bit bothersome since the profiles can't have more than 32 chars and the ROMs tend to have longer names.
- Unhandled exception when Project_Nested.smc is not present. Maybe it should warn the user.


Quick questions: is the SRM more useful the longer you play, watch cutscenes/screens, etc.? Should i always use a non-SRM-patched ROM to generate the SRM file?
Myself086
Posts: 158
Joined: Sat Nov 10, 2018 2:49 pm

Re: Project Nested - NES emulator for SNES

Post by Myself086 »

niuus wrote: Thu May 06, 2021 6:39 pm Quick questions: is the SRM more useful the longer you play, watch cutscenes/screens, etc.? Should i always use a non-SRM-patched ROM to generate the SRM file?
Yes, the SRM becomes more useful the longer you play, it contains pointers to where the code is, pointers are added as soon as you get lag spikes when something new happens. You can use an SRM-patched ROM to generate more feedback.

Super Mario Bros. 3 requires going through SRM feedback twice due to memory leaks.

Thanks for the feedback!
niuus
Posts: 8
Joined: Wed May 05, 2021 1:30 am

Re: Project Nested - NES emulator for SNES

Post by niuus »

Myself086 wrote: Thu May 06, 2021 8:56 pm Yes, the SRM becomes more useful the longer you play, it contains pointers to where the code is, pointers are added as soon as you get lag spikes when something new happens. You can use an SRM-patched ROM to generate more feedback.
Ah! Great. I'll do that now.
Myself086 wrote: Thu May 06, 2021 8:56 pm Super Mario Bros. 3 requires going through SRM feedback twice due to memory leaks.

Thanks for the feedback!
Awesome, thanks for your work. I'll keep an eye on this project. :beer:
niuus
Posts: 8
Joined: Wed May 05, 2021 1:30 am

Re: Project Nested - NES emulator for SNES

Post by niuus »

Myself086 wrote: Thu May 06, 2021 8:56 pmThanks for the feedback!
I've got some games working that are not on the list, others that don't, and finished some. How do i contribute to your spreadsheet?

Are profiles being shared somewhere, btw?
Myself086
Posts: 158
Joined: Sat Nov 10, 2018 2:49 pm

Re: Project Nested - NES emulator for SNES

Post by Myself086 »

niuus wrote: Tue May 11, 2021 5:03 pm I've got some games working that are not on the list, others that don't, and finished some. How do i contribute to your spreadsheet?

Are profiles being shared somewhere, btw?
Either DM me or add comments to the sheet. There's no database for profiles yet, we simply describe what settings to change compared to default settings.
Post Reply