forked from len0rd/rockbox
Major Rockboy update.
1) Adapt Rockboy to smaller screens (H10, X5, and iPod Nano). 2) Add the ability to use a preset palette on color targets. Choose 'Set Palette' from the main menu. 3) Clean up the code to remove any unused code and variables. 4) Changed tabs to spaces. 5) Disable reading and writing sound when sound is disabled. 6) Disbable writing to the RTC since it is not implemented yet. 7) Minor optimizations from WAC gnuboy CE and iBoy. 8) Massive clean up of code to make it appear consistent. 9) Change all C++ style comments to C style. 10) Completely reorganize dynarec. Add fixmes to all unimplemented opcodes. Add debug writes for all opcodes. Attempt to implement a few opcodes myself. 11) Silence some warnings when built using dynarec. 12) Minor reshuffling of IRAM, may or not offer a speed increase. 13) Include fixes found in the short-lived gnuboy CVS. All in all, there's about a 10% improvement on my test roms when sound is disabled and slight improvement with sound. Especially noticable when there are few sprites on screen and less action is occurring. See FS #6567. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12216 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1026c0f5b2
commit
2882b26a99
48 changed files with 4891 additions and 5419 deletions
|
@ -3,95 +3,42 @@
|
|||
|
||||
#include "rockmacros.h"
|
||||
#include "input.h"
|
||||
#include "rc.h"
|
||||
#include "exports.h"
|
||||
#include "emu.h"
|
||||
#include "loader.h"
|
||||
#include "hw.h"
|
||||
|
||||
//#include "Version"
|
||||
|
||||
|
||||
static char *defaultconfig[] =
|
||||
{
|
||||
"bind up +up",
|
||||
"bind down +down",
|
||||
"bind left +left",
|
||||
"bind right +right",
|
||||
"bind joy0 +b",
|
||||
"bind joy1 +a",
|
||||
"bind joy2 +select",
|
||||
"bind joy3 +start",
|
||||
"bind ins savestate",
|
||||
"bind del loadstate",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
void doevents()
|
||||
{
|
||||
event_t ev;
|
||||
int st;
|
||||
event_t ev;
|
||||
int st;
|
||||
|
||||
ev_poll();
|
||||
while (ev_getevent(&ev))
|
||||
{
|
||||
if (ev.type != EV_PRESS && ev.type != EV_RELEASE)
|
||||
continue;
|
||||
st = (ev.type != EV_RELEASE);
|
||||
pad_set(ev.code, st);
|
||||
}
|
||||
ev_poll();
|
||||
while (ev_getevent(&ev))
|
||||
{
|
||||
if (ev.type != EV_PRESS && ev.type != EV_RELEASE)
|
||||
continue;
|
||||
st = (ev.type != EV_RELEASE);
|
||||
pad_set(ev.code, st);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* convenience macro for printing loading state */
|
||||
#define PUTS(str) do { \
|
||||
rb->lcd_putsxy(1, y, (unsigned char *)str); \
|
||||
rb->lcd_getstringsize((unsigned char *)str, &w, &h); \
|
||||
y += h + 1; \
|
||||
} while (0)
|
||||
|
||||
int gnuboy_main(char *rom)
|
||||
{
|
||||
int i, w, h, y;
|
||||
|
||||
y = 1;
|
||||
// Avoid initializing video if we don't have to
|
||||
// If we have special perms, drop them ASAP!
|
||||
PUTS("Init exports");
|
||||
init_exports();
|
||||
|
||||
PUTS("Loading default config");
|
||||
for (i = 0; defaultconfig[i]; i++)
|
||||
rc_command(defaultconfig[i]);
|
||||
|
||||
// sprintf(cmd, "source %s", rom);
|
||||
// s = strchr(cmd, '.');
|
||||
// if (s) *s = 0;
|
||||
// strcat(cmd, ".rc");
|
||||
// rc_command(cmd);
|
||||
|
||||
// FIXME - make interface modules responsible for atexit()
|
||||
PUTS("Init video");
|
||||
vid_init();
|
||||
PUTS("Init sound");
|
||||
pcm_init();
|
||||
PUTS("Loading rom");
|
||||
loader_init(rom);
|
||||
if(shut)
|
||||
return PLUGIN_ERROR;
|
||||
PUTS("Emu reset");
|
||||
emu_reset();
|
||||
PUTS("Emu run");
|
||||
#if (LCD_HEIGHT > 144) || (LCD_WIDTH > 160)
|
||||
rb->lcd_puts(0,0,"Init video");
|
||||
vid_init();
|
||||
rb->lcd_puts(0,1,"Init sound");
|
||||
pcm_init();
|
||||
rb->lcd_puts(0,2,"Loading rom");
|
||||
loader_init(rom);
|
||||
if(shut)
|
||||
return PLUGIN_ERROR;
|
||||
rb->lcd_puts(0,3,"Emu reset");
|
||||
emu_reset();
|
||||
rb->lcd_puts(0,4,"Emu run");
|
||||
rb->lcd_clear_display();
|
||||
// rb->lcd_drawrect((LCD_WIDTH-160)/2-1, (LCD_HEIGHT-144)/2-1, 162, 146);
|
||||
rb->lcd_update();
|
||||
#endif
|
||||
emu_run();
|
||||
emu_run();
|
||||
|
||||
// never reached
|
||||
return PLUGIN_OK;
|
||||
/* never reached */
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
#undef PUTS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue