Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#2911 - (S)NES emulator

Attached to Project: Rockbox
Opened by RonSijm (ronsijm) - Thursday, 12 January 2006, 23:51 GMT+2
Last edited by Steve Bavin (pondlife) - Friday, 21 September 2007, 14:02 GMT+2
Task Type Patches
Category Games
Status New
Assigned To No-one
Player type All players
Severity Low
Priority Normal
Reported Version current build
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

Would it be possible to make a (S)nes emulator?
just something like Rockboy, but then for (S)nes roms.

I know it will be hard to just make an emulator, but
maybe there are already open source NES emulators, so
you can just port / edit it so it works on RockBox

Gr. Ron
This task depends upon

2008-02-03: A task closure has been requested.
Comment by Nils Wallménius (nls) - Wednesday, 16 August 2006, 23:37 GMT+2
As you might have noticed the rockboy emulator is pretty slow, especially with color games. The Nes games will be even slower as they are higher resolution and use more processing power. The Snes games will be _very_ (ie not even close to playable) slow on our currently supported targets.
Comment by Jake (Zombieplasticclock) - Monday, 12 March 2007, 19:34 GMT+2
I dunno. I'd still be willing to try it. Rockboy was pretty craptastic when I got it with the December release. However, I just upgraded to the latest version, and (maybe it's just me), but the framerate is higher and animation smoother. it'll take a while to get it up to speed, but I'd download it in a heartbeat, regardless of the quality. (Tales of Phantasia on ipodvid=awesome)
I do have to agree it'll be really hard to get to a playable speed...
Comment by david (miles power) - Thursday, 16 August 2007, 06:53 GMT+2
what if rockboy was modded to play nes games?
Comment by Nils Wallménius (nls) - Friday, 17 August 2007, 00:21 GMT+2
gameboy and NES are two entirely differnt machines, and btw there is one person that has started gathering resources in the wiki relating to a potential NES emulator
Comment by brarei (brarei200) - Saturday, 01 September 2007, 00:15 GMT+2
Actually I don't see why it would run slow? iPod Linux has NES at 100%! SNES would probaly go around 60-70% under my guess?
Comment by Michael Schnier (Mikelx215) - Thursday, 06 September 2007, 20:52 GMT+2
Wasn't the NES less powerful than the Gameboy Color? I mean, there's a NES emulator for the GBC.
The problem would be displaying the graphics on the smaller devices, and the coding of the actual emulator.
Comment by Jake (Zombieplasticclock) - Friday, 07 September 2007, 14:57 GMT+2
The sprites are a higher resolution for the NES (I think), and also the GBC is a gaming system. Most MP3's that are Rockboxed aren't ment for gaming, so a NES emulator that runs well would be difficult.

A NES emulator for the GBC? will wonders ever cease? =D

Brarei, the reason iDarcnes in Ipodlinux works so well is because they're using a part of the ipod (forgot which one, lol :B) to make it run so fast sometimes the sound can't keep up. Something you really need to keep in mind with Rockbox and Ipod Linux; Ipod Linux is only for Ipods. the reason it's (for lack of a better word) better than Rockbox is that they're only working with Ipods, and take advantage of every little part to have excellent performance in programs Rockbox has trouble keeping up with (but at least our Doom has sound >:3 muahaha). Rockbox, on the other hand, is for many different MP3's, and many different functions. that's why Rockboy is slow on the H10, but perfect on the Gigabeat. it's the different systems that make Coding a new program for rockbox in general so difficult.

What I'm saying, Brarei, is to not make too many similarities with Ipodlinux. I like IPL, but it is MUCH different from Rockbox, and you need to keep that in mind when making a technilogical statement or question with Rockbox.
Rockbox is Rockbox and IPL is IPL. done :-)

ahem... getting back on subject...

The graphics and coding difficulty are a given when it comes to anything emulation-related. it's not unique to the nes .

one more thing to think about, Michael. When you aren't playing a Nes emulator on your GBC, play a GBC game. then play that GBC game on an ipod or whatever. notice the difference? As I just said with Brarei, most of the systems that run Rockbox can't run emulators at full speed. and since the GBC is slow, then doesn't that mean the NES'll be slow?

The NES emulator won't be perfect, but I still can't wait to try it.
Comment by Dave Chapman (linuxstb) - Friday, 07 September 2007, 16:30 GMT+2
Jake (Zombieplasticclock),

It's not accurate to say that IPL is better because they are only focused on developing for ipods, and hence take advantage of "every little part".

IMO, the relevant differences are not technical, they are:

1) IPL has active developers with an interest in gaming and emulators. Rockbox doesn't.

2) IPL is split into a distinct kernel and userland, which means they can port non-GPL'd software (such as DarcNES and MAME) to the ipod. Rockbox's all-in-one nature won't allow that, and unfortunately very few emulators are GPL'd.

Comment by Mikhail Tkach (MikeT) - Tuesday, 18 September 2007, 03:58 GMT+2
I'm currently working on a infoNES port. http://www.geocities.com/tm_lockheart
Comment by Nils Wallménius (nls) - Tuesday, 18 September 2007, 21:34 GMT+2
MikeT, I think it would be a good idea to put your work in progress emulator and any info in a page in the rockbox wiki so that it would be easier for others to help out and follow the development.
Comment by Mikhail Tkach (MikeT) - Thursday, 20 September 2007, 00:21 GMT+2
Geocities is overloaded, so I'm uploading the plugin here.
Comment by Alexander Spyridakis (xaviergr) - Thursday, 20 September 2007, 15:04 GMT+2
The emulator unexpectedly works on my H100 (gray scale) and after a one-liner on my F40 too (and sims). I couldn't find a way to change the button configuration on the code and as you say it is slow on H100 too. On F40 it is quite playable.

Good work, though the zip file contains a lot of duplicate code?
I would suggest to you to open a new task (patch, not on feature request) and make an svn diff of your work so that it will be more easy to compile.

Well it is quite awesome, thanks! :)
Comment by Steve Bavin (pondlife) - Friday, 21 September 2007, 14:01 GMT+2
Hey, I guess this is a patch now!
Comment by Mikhail Tkach (MikeT) - Saturday, 22 September 2007, 11:31 GMT+2
I really need to get sound working. This is my first try at a diff so I hope I go it right
Comment by Dave Chapman (linuxstb) - Saturday, 22 September 2007, 13:43 GMT+2
I've modified the way the button definitions are handled to make it easier to support all the targets. I'm attaching two files - a new nes_rockbox.h which includes the target-specific button definitions, and an updated version of InfoNES_System_Rockbox.c which uses these new defines.

The nes_rockbox.h only includes defines for the H10 (the same as the original patch) and the Gigabeat (just an initial attempt - maybe they need changing). Maybe others could add definitions for their devices.

Note that the NES needs 8 buttons - the four directions, A, B, select and start. So for example the ipods will probably need the same approach as rockboy - using the wheel as a touchpad to generate 8 different button locations.
Comment by Mikhail Tkach (MikeT) - Sunday, 23 September 2007, 01:59 GMT+2
Removed unneeded files, minor changes. For some reason the buttons don't work correctly on my simulator but okay on my player.
Comment by Zim (Zim) - Monday, 24 September 2007, 01:35 GMT+2
Any chance of this patch working on the Sansa e260? If it already does, where would I place the files?
Comment by Paul Louden (Llorean) - Monday, 01 October 2007, 05:05 GMT+2
infonessx.diff seems to just hard-lock my gigabeat. It flashes a loading splash, then the player is unusable without toggling the battery switch.
Comment by Oleh Hradowy (MadCow15) - Friday, 05 October 2007, 22:51 GMT+2
Amazing, I can play Contra at what seems like almost full speed on my gigabeat. With some button map changes, I'll be able to actually play NES games.
Comment by Jacob Ellis (shargrath) - Sunday, 07 October 2007, 15:27 GMT+2
in quite a few roms when i try to load then i receive
*PANIC*
Stkov (6)
i then have to do a hard reboot. i dont believe its a problem with the roms as i can run them on fine on znes. also any .snes games wont show up at all.
i believe the viewer needs to turned into a port of znes just like rockboy is a port of gnuboy.
znes has most if not all the features that i think we would require. Game specific button mapping, grayscale support, full stereo sound, frame skip, save/load, emulation speed etc and it is very fast it doesn't look like that much of a resource hog but it might be a bit of a pain to port but theres Snes9x aswell which is very port friendly apparently.
Comment by Thomas Martitz (kugel.) - Sunday, 07 October 2007, 16:48 GMT+2
Hey, can you tell which of the uploaded files I do need? I tried only infonesx.diff, where I added the keys for the e200 series, but it's not responding to the keys(neither sim nor build)
Comment by Chris Miller (criznach) - Monday, 08 October 2007, 07:57 GMT+2
Anyone had any luck building this for an iPod video 5.5? It builds with some warnings but I haven't been able to get my .nes files show up in the file browser yet. What am i missing?

I've have only been working with rockbox for a few days, but I've been building and tweaking plugin code. I had been looking at the other NES port thread and playing with FCEU code, but this one looks promising.
Comment by Jake (Zombieplasticclock) - Monday, 08 October 2007, 13:22 GMT+2
Is SNES9x GPL? or FCEU? remember that the source code needs to be open GPL in order to be put into Rockbox.

oh, and 5.5g version, por favor? that'll be so awesome =D
Comment by Jacob Ellis (shargrath) - Monday, 08 October 2007, 13:38 GMT+2
SNES9x is gpl so is znes
Comment by Chris Miller (criznach) - Monday, 08 October 2007, 17:22 GMT+2
Looks like on my 5.5g iPod the final blt of the frame buffer to the lcd is a major bottleneck. On that platform if I undefine the current copy code and use the 1:1 pixel copy with no scaling, I get maybe a 2x speed improvement. The 5.5's native resolution is 320x240, which is perfect for iNes, but it' still 2x too slow. There are 2-3 function calls and 2 bounds checks per pixel with the current method. I might look at the rockboy code for a faster way. I'm not familiar with how the lcd framebuffer works in rockbox, but I can see that rockboy appears to bypass the drawing api and even use assembly on some platforms. This would be a major speedup. Is there a better place to discuss technical issues of the ines port? Anyone know asm for iPod?
Comment by Chris Miller (criznach) - Tuesday, 09 October 2007, 00:54 GMT+2
So.... InfoNes is not iNES. iNES is another emulator that is not GPL. Wikipedia says it's proprietary license. This page: http://fms.komkon.org/EMUL8/ says it is not GPL and is INCOMPATIBLE with the GPL. You might want to eventually change the name of the plugin, since I'd been searching for iNES all day and discovered I had the wrong one.

I tweaked the InfoNES_LoadFrame function to access the frame buffer directly on my ipod and it runs faster now. Still not fast enough... I also tweaked a few inner loops in the InfoNes line rendering code, but no major speed gains there. Once I get a bit more, I'll try to put together a patch.
Comment by Jake (Zombieplasticclock) - Tuesday, 09 October 2007, 13:12 GMT+2
?

sorry, I'm a little lost, is this the NES emulator everyone's talking about, or an Snes Emulator?

by the way Criznach, I think SNES9x and Znes would be hard to port, since they're higher-end SNES emulators. a low-tech SNES emulator that's GPL'ed would be good

sorry I can't help with Development. My computer has no internet, and I don't think people'll be kosher with me downloading VMware everywhere
Comment by Thomas Martitz (kugel.) - Tuesday, 09 October 2007, 13:23 GMT+2
The last patch is only a NES sim. No actual target could emulate SNES anyway.
Comment by Chris Miller (criznach) - Tuesday, 09 October 2007, 18:50 GMT+2
This is NES only. I just stumbled into this thread from the other NES emu thread. And it is looking like InfoNES is GPL2, but I'm still not sure. The license is in the source tree, and the readme.html contains the string "GPL2", but it's in japanese.
Comment by Thomas Martitz (kugel.) - Tuesday, 09 October 2007, 18:55 GMT+2
Is there any plan of updating this one? It's pretty bugged.
Comment by Nils Wallménius (nls) - Tuesday, 09 October 2007, 19:02 GMT+2
While this might be very interesting to many of you this tracker page is only for technical feedback on the patch and development. Other comments and discussion belongs in the forums and irc.
Comment by Chris Miller (criznach) - Tuesday, 09 October 2007, 19:05 GMT+2
I dunno. Maybe we can get the author of the port to join the thread. I've updated just enough to get it running on my iPod, but there are some issues with some of the games that are also present in the Win32 port. And the controls are screwy on ipod. I'm working on that now.
Comment by Chris Miller (criznach) - Tuesday, 09 October 2007, 19:17 GMT+2
Comment by Chris Miller (criznach) - Tuesday, 09 October 2007, 22:44 GMT+2
Here's a patch containing the work I've done so far.
This includes:
Optimized 1:1 lcd copy for displays as large as or larger than NES frame buffer.
Changed the #ifdefs around frame buffer copy to toggle 1:1 code when appropriate
Optimized sprite to scanline copy (minimal gain, I suspect).
Forced backlight on.
Wrapped non-simulator-compatible code in #ifdefs.
Grafted some ipod scroll wheel code from rockboy, toggled on with platform #ifdefs.
Added rb->yield() to InfoNes_DrawLine that gets executed each frame.
Comment by Thomas Martitz (kugel.) - Tuesday, 09 October 2007, 22:51 GMT+2
And what's about the Sansa scrollwheel?

Nice work anyway, I hope to see more updates.
Comment by Chris Miller (criznach) - Tuesday, 09 October 2007, 22:59 GMT+2
I didn't do anything specific to the sansa. I may have one available to play with (If my girlfriend will let me :)).
Comment by Marvin Miller (Mouser X) - Wednesday, 17 October 2007, 02:39 GMT+2
I can confirm that "infonesx.diff" (http://www.rockbox.org/tracker/task/2911?getfile=14834) is not working on the Gigabeat. When it compiles, a whole slew of warnings fly across the screen. Any idea what's wrong? Anything I can do to help/bug test? If it makes a difference, I was using "Legend of Zelda, The (U)(PRGO)" from the GoodNES set 2.01 (pretty sure it's that one). Good luck and I look forward to improvements.
Comment by Oleh Hradowy (MadCow15) - Wednesday, 17 October 2007, 18:37 GMT+2
It compiles and works I was able to run a bunch of mario games and contra on my gigabeat no problem, with only changing the keymaps. Maybe it's because I'm using an older SVN source. It does give off a ton of warnings, but works fine for the most part.
Comment by Mikhail Tkach (MikeT) - Tuesday, 23 October 2007, 22:57 GMT+2
Fixed color for RGB565SWAPPED targets. Added save/load for small amount of roms. Other small changes.
Comment by eric (fugot) - Sunday, 27 January 2008, 17:58 GMT+2
i cant get the patch to work.
Comment by Michael Carr (Strife89) - Friday, 22 February 2008, 15:16 GMT+2
Can I get some assistance for compiling this in Ubuntu?

Loading...