Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: Jack Sparrow on June 24, 2010, 10:58:22 AM

Title: infoNES emulator for sansa fuze
Post by: Jack Sparrow on June 24, 2010, 10:58:22 AM
I have recently been trying to get the infoNES emulator for my sansa fuze.  I downloaded the patch and the rockbox source code, patched it with cygwin, and tried to compile it.  When I patched it, it came up with this at the end:

Quote
Hunk #1 FAILED at 24
1 out of 1 hunk FAILED -- saving rejects to file apps/plugins/SUBDIRS.rej
patching file apps/plugins/viewers.config
Hunk #1 succeeded at 1 with fuzz 2

Do I need a different version of rockbox?  I am using the current build and I believe the patch is for r22921.  If so, where do I download that version?

With my version the files appeared in my build directory, but when I compiled it they did not compile.  Is this because the hunk failed?  It would make sense to me that if they were patched to the file they would still compile, even if they didn't work, but maybe not.  I would appreciate any hlep because I am new to compiling and don't know what I'm doing.
Title: Re: infoNES emulator for sansa fuze
Post by: torne on June 24, 2010, 11:48:30 AM
r22921 is from October, so you probably don't want to go back that far; you will lose many months of development :)

The hunk that failed is on the file that tells the Rockbox build system what to compile, so that's why it didn't compile the plugin. You need to fix apps/plugins/SUBDIRS yourself by looking at the patch and seeing what it wanted...
Title: Re: infoNES emulator for sansa fuze
Post by: Jack Sparrow on June 24, 2010, 02:02:32 PM
This is the only place in the patch that mentions apps/plugins/SUBDIRS:

Quote
Index: apps/plugins/SUBDIRS
===================================================================
--- apps/plugins/SUBDIRS   (revision 22076)
+++ apps/plugins/SUBDIRS   (working copy)
@@ -24,6 +24,7 @@
 sudoku
 reversi
 goban
+infones
 #ifdef HAVE_LCD_COLOR
 png
 #endif

I have no idea what any of this means, so...?
Title: Re: infoNES emulator for sansa fuze
Post by: torne on June 24, 2010, 02:35:49 PM
...so you'll have to learn how patches work? :)

You need to add a line 'infones' to apps/plugins/SUBDIRS. The patch shows you where, but the surrounding lines have changed since the patch was created, so you'll have to see where the right place is now.
Title: Re: infoNES emulator for sansa fuze
Post by: [Saint] on June 24, 2010, 02:52:11 PM
That's what the ".rej" file(s) are for, they show you what failed and where.
You'l need to hand patch the failing hunk.


[St.]
Title: Re: infoNES emulator for sansa fuze
Post by: Jack Sparrow on June 24, 2010, 05:40:05 PM
You need to add a line 'infones' to apps/plugins/SUBDIRS. The patch shows you where, but the surrounding lines have changed since the patch was created, so you'll have to see where the right place is now.

So how do I see where the right place is now?  Sorry for my ignorance, I just started patching two days ago
Title: Re: infoNES emulator for sansa fuze
Post by: torne on June 24, 2010, 05:43:55 PM
http://en.wikipedia.org/wiki/Diff#Unified_format <- explains what the contents of a patch mean

You need to look at what change the patch makes, and work out by looking at the current version of the file being patched, what the equivalent change now should be.
Title: Re: infoNES emulator for sansa fuze
Post by: saratoga on June 24, 2010, 06:21:11 PM
You need to add a line 'infones' to apps/plugins/SUBDIRS. The patch shows you where, but the surrounding lines have changed since the patch was created, so you'll have to see where the right place is now.

So how do I see where the right place is now?  Sorry for my ignorance, I just started patching two days ago

The line starting with '+' is the one you have to add, the ones without a '+' are the ones that are already there.  Find the 'goban' line and add it there.
Title: Re: infoNES emulator for sansa fuze
Post by: Jack Sparrow on June 24, 2010, 08:20:17 PM
I added it to the SUBDIRS file after goban, patched, and compiled it.  While it was compiling, it brought up a bunch of errors like:

Quote
.../apps/plugins/infones/keymaps.h:616:1: error: unterminated #else
.../apps/plugins/infones/keymaps.h:589:1: error: unterminated #ifndef

After it compiled, there was an infones directory in apps/plugins but it was empty, and when I made the zip file it did not show up at all
Title: Re: infoNES emulator for sansa fuze
Post by: saratoga on June 24, 2010, 08:33:17 PM
I added it to the SUBDIRS file after goban, patched, and compiled it.  While it was compiling, it brought up a bunch of errors like:

Quote
.../apps/plugins/infones/keymaps.h:616:1: error: unterminated #else
.../apps/plugins/infones/keymaps.h:589:1: error: unterminated #ifndef

After it compiled, there was an infones directory in apps/plugins but it was empty, and when I made the zip file it did not show up at all

That means you get to finish writing the plugin!
Title: Re: infoNES emulator for sansa fuze
Post by: Jack Sparrow on June 24, 2010, 08:36:43 PM
That means you get to finish writing the plugin!

Haha! And how do I do that?
Title: Re: infoNES emulator for sansa fuze
Post by: torne on June 25, 2010, 05:56:33 AM
...learn to program in C, probably. The error suggests the patch is broken.
Title: Re: infoNES emulator for sansa fuze
Post by: nls on June 27, 2010, 06:05:01 AM
A wild guess is that it lacks a keymap for your player so no case in a #if ... #elif ... #endif sequence defining the keymaps matches your player.
Title: Re: infoNES emulator for sansa fuze
Post by: jmr on June 29, 2010, 01:42:52 PM
A wild guess is that it lacks a keymap for your player so no case in a #if ... #elif ... #endif sequence defining the keymaps matches your player.
If he's using a Sansa Fuze, I'm pretty sure the keymap isn't the problem.  I added the Fuze keymaps to the latest 'functioning' patch (http://www.rockbox.org/tracker/task/2911?getfile=20189) (and by functioning I mean it worked (http://twitpic.com/cmarb) decently with the builds from August 2009.) 

The later patches are all incomplete attempts at porting other NES emulators to Rockbox which would require significant work to get up and running.

edit: for the record, I haven't attempted compiling / running this since that patch, and I'm no where near enough of a competent programmer to get something like an emulator running.
Title: Re: infoNES emulator for sansa fuze
Post by: zin0099 on June 30, 2010, 11:45:07 PM
any plans to release it if it works?
Title: Re: infoNES emulator for sansa fuze
Post by: torne on July 01, 2010, 07:11:54 AM
None of the people who worked on the various patches appear to be around any more. It doesn't sound like it's finished/working, and thus unless someone volunteers to finish it and sort out any major problems it still has, it won't be committed.