Rockbox Development > Starting Development and Compiling

PLUGIN_RAM full and NES emu

(1/2) > >>

MikeT:
I'm startting to port InfoNES (an NES emulator) to Rockbox ( http://www.geocities.com/tm_lockheart/ ).  however I get an error [region PLUGIN_RAM is full] when I try to increase my memory usage. Is there an easy way to overcome this limit?

Also, is there anyone else working on an NES emulator for Rockbox?

nls:
Try increasing PLUGIN_BUFFER_SIZE in you targets' config-*.h file in firmware/export
This hould only be done while developing though and the emu shouldn't require a buffer increase. If you really need more ram you can steal the music buffer.

linuxstb:
As nls said, increasing PLUGIN_BUFFER_SIZE would only be a temporary solution - it's unlikely that this value will be increased in the official Rockbox builds.

Rockbox has a 512KB (on swcodec targets, only 32KB on hwcodec) plugin buffer, where the plugin.rock file loaded and executed.  So your main binary (and constant/initialised data) can not exceed this size.

If your plugin needs more than 512KB to run, then the plugin needs to grab the main audio buffer (around 28MB on most targets) and manage that memory itself.

Another issue to be aware of is stack size - plugins run in the main thread, which has an 8KB stack.  So you can't declare large buffers locally inside functions - they need to be global (or marked static).  This is a problem you will only experience on an actual device - the UI sim has much larger stacks.

The other large plugins (rockboy, doom, mpegplayer) all do this, so you may find their source helpful.  Or come to IRC if you have questions.

LambdaCalculus:

--- Quote from: MikeT on September 08, 2007, 07:01:43 AM ---Also, is there anyone else working on an NES emulator for Rockbox?

--- End quote ---

Yes, I was helping research one at this forum thread:

http://forums.rockbox.org/index.php?topic=11843.0

The plugin progress will be slow, since this is being written by two guys who are learning C, and are students.

Our base is TuxNES, which is also open source and under the GPL. Research is already completed and some very preliminary work was started with coding. The TuxNES plugin borrows code from FCE Ultra (some mapper and sound support) and TuxNES itself (6502 emulation and control code).

Have you made sure that InfoNES is GPL'd before starting this work? If you want a reason why this is so, ask any of the developers or admins here why we're very strict on GPL code.

AlexP:
Well the source archive contains a copy of the GPL v2, but the front page says this:


--- Quote ---    Please mail me, when you redistribute this software
   Please mail me, when you introduce this software on your magazine, etc
   If you do not agree with these terms do not use this software
--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version