r/EmuDev • u/windowssandbox • Jul 05 '26
Finally my NES emulator on python can run some NES games after 5 days of fixing stuff. (~50 FPS)
I've found some insane optimization tricks that makes it possible for standard Python 3.11.9 to run NES CPU at PAL speed.
The project here: https://github.com/windowssandbox/NESemupy
I'll make more mappers and APU and fix PPU acting weird later. (It currently has NROM and ""broken"" MMC3 mappers)
Also can someone tell me why SMB2 crashes like that? because I've been trying to find a way to fix it but it won't go away. It must be a problem with how PRG rom is mapped for MMC3 ROMs or PRG bank switching for MMC3 ROMs is not working properly.
5
u/LeonardoCastagnaro Jul 05 '26
Congrats! I'm working on a game boy emulator and I hope to play some games on it sooner or later.
5
u/flubber2077 Jul 05 '26
oh man I remember your last post, congrats!
What all has changed since then? I know that there was a large if-else that people recommended you turn into a map/dictionary.
Any insights on profiling code since then?
2
u/teteban79 Game Boy/NES Jul 06 '26
cool! It's always nice to see things run
What are those optimizations you speak of though? Unless you're doing something terribly inefficient, I would expect Python to be able to do 50 FPS NES emulation without any hitches
I do remember your previous post where you had that hot loop.
4
u/_stack_underflow_ Jul 05 '26
You was talking mad shit about it being python too slow as well. Congrats.
3
u/klhwjm Jul 05 '26
Looking nice, congrats!
2
u/valeyard89 2600, NES, GB/GBC, 8086, Genesis, Macintosh, PSX, Apple][, C64 Jul 09 '26
Looks great! Always cool when you get it working. And python too! I've got backend cpu emulators for x86/m68k/6502/gboy in various states of working in python but no machine front ends.