Resource icon

lolSnes git 01/01/2014

I hope this project will bring some new life into the SNES-on-DS scene. It looks like all the existing emulators for the DS are dormant or discontinued, which is sad.

lolSnes is a project I had started two years ago. I wanted to make a SNES emulator for the DS, that could render most sane games without glitches. But I followed a wrong approach with the PPU side: trying to make a line-accurate software renderer. The DS just isn't powerful enough to handle such a renderer. That discovery pretty much shattered my motivation and the project stayed dormant for two years.

And now, for some reason, I felt like working on it again. I trashed the software PPU attempt and coded the PPU using the DS's 2D video hardware.

So far, SMW is playable, to some extent. The background layer tends to obstruct text like menus and info boxes because per-tile priorities aren't emulated yet.

You also can't get past Donut Plains 2: for some reason, the camera keeps rewinding and moving forward a bit at the start of the level, keeping you from going further. Aside from this bug, gameplay is near perfect. The game also runs at fullspeed (albeit with a speedhack).

What's in?

* Main CPU: 99% -- all opcodes emulated, may miss some unimportant bits though
* PPU: ~30% -- Mode 1 BG and OBJ supported, as well as some of the priority
* SPC700: 80% -- most useful opcodes implemented, as well as I/O (SPC/CPU comm, timers)
* DSP: 0% -- what it says. No sound yet.
* Joypad input for joypad 1

Issues

* There is no interface for selecting a ROM-- it is hardcoded to load snes/rom.smc
* Tearing and black pixels tend to appear when backgrounds scroll, because writes to the BG scroll registers are applied directly and not synced to the DS display
* CPU bugs are hidden in the main CPU core, and possibly the SPC700 core. They may bite you when you expect it the least.

Github repo

For those who are interested, the source code is available in a Github repo.

Even though it isn't explicitly mentioned in the code files, the code is under the GPL license.

A lot of this is written in ARM ASM. If you don't have some knowledge of ARM ASM and GCC calling convention, the code may look like black magic to you...

If you're crazy enough to try it out

At the time of writing this, the latest revision should run on a DS, but there is no guarantee that it will always be the case. I mostly test on desmume, which is not 100% accurate. As such, issues may go unnoticed on desmume and cause trouble on a DS. Such issues being mainly accesses to invalid addresses-- desmume doesn't seem to emulate the memory protection unit.

Feel free to try it though, any feedback is recommended.

You need a recent devKitPro to build it. Then, place lolSnes.nds on your flashcart/whatever. Create a folder named 'snes' there, and put your ROM in it, under the name 'rom.smc'.

Run lolSnes.nds and it should automatically load your ROM. You'll get to see it either launch your game, or explode.


Have fun! ;)
General chit-chat
Help Users
  • Julie_Pilgrim @ Julie_Pilgrim:
    that game's engine is really fucking intensive so it runs like literal shit on xbox 360 and ps3
  • Veho @ Veho:
    Nah I'm getting value creep again. I look at a $50 console "but for just a few more dollars you could get XYZ" and I end up considering the Steam Deck.
    +2
  • Julie_Pilgrim @ Julie_Pilgrim:
    like the lighting in that game was genuinely so good
  • Veho @ Veho:
    Not getting dragged into that again.
  • Julie_Pilgrim @ Julie_Pilgrim:
    i dont get why they didn't port the one game that ran the worst on consoles, to pc
  • Julie_Pilgrim @ Julie_Pilgrim:
    like you port everything to pc except the one game where it would make the most sense. why. what do you gain from this
  • Julie_Pilgrim @ Julie_Pilgrim:
    is sega just personally fucking with me? are they laughing while watching me through my kinect camera as i get up to restart my xbox for the third time because the game froze again
  • K3Nv2 @ K3Nv2:
    Buy handhelds from five below better quality
  • K3Nv2 @ K3Nv2:
    Valve probably going to do another refresh of the deck this fall with rog ally like specs tbh
    +1
  • Veho @ Veho:
    A smaller form factor would be nice too.
    +1
  • K3Nv2 @ K3Nv2:
    A shield portable 2 would be nice aye Nvidia
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    The big leap in all things tech is when carbon based chips start hitting.
  • Psionic Roshambo @ Psionic Roshambo:
    Longer battery life cooler temps and faster! What's not to like lol (probably expensive as hell)
  • AncientBoi @ AncientBoi:
    [checks my dildo(s) batteries, coolant and lube] :O [promptly replaces them] :D
    +1
  • BigOnYa @ BigOnYa:
    Lol not even for sale yet to public, and already sold out. I'd like to get one but ill wait for the hype to calm down.
    +1
  • a_username_that_is_cool @ a_username_that_is_cool:
    I'm pretty sure I wasn't on GBAtemp at all yesterday, whenever I tried to go onto the website I got an unexpected database error
  • BigOnYa @ BigOnYa:
    We all teamed together and decided you needed a day off, so we blocked you.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    No one expects the database errors!!!
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Hey a thought occurred to me... If they are unexpected database errors, are there expected database errors?
    +1
  • K3Nv2 @ K3Nv2:
    @BigOnYa, that's just a pre-order term to make the product look better it's not sold out
    +1
  • K3Nv2 @ K3Nv2:
    Never expect a website to last 24/7 it's like section 8
    K3Nv2 @ K3Nv2: Never expect a website to last 24/7 it's like section 8