mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
giz port, restructuring
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@257 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
c9077ab4b9
commit
ea8c405fa7
30 changed files with 1706 additions and 970 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "menu.h"
|
||||
#include "../common/arm_utils.h"
|
||||
#include "../common/menu.h"
|
||||
#include "../common/emu.h"
|
||||
#include "../common/readpng.h"
|
||||
#include "version.h"
|
||||
#include "kgsdk/Framework.h"
|
||||
|
@ -28,22 +29,17 @@
|
|||
#include <Pico/Patch.h>
|
||||
#include <zlib/zlib.h>
|
||||
|
||||
extern char romFileName[MAX_PATH];
|
||||
extern char *rom_data;
|
||||
extern int state_slot;
|
||||
extern int config_slot, config_slot_current;
|
||||
|
||||
#define gizKeyUnkn "???"
|
||||
static const char * const gizKeyNames[] = {
|
||||
"LEFT", "RIGHT", "UP", "DOWN", "STOP", "PLAY", "FORWARD", "REWIND",
|
||||
"LEFT_SHOULDER", "RIGHT_SHOULDER", "HOME", "VOLUME", "BRIGHTNESS", "ALARM", "POWER", gizKeyUnkn,
|
||||
gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn,
|
||||
gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn,
|
||||
gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn, gizKeyUnkn
|
||||
};
|
||||
|
||||
static unsigned char bg_buffer[321*240*2];
|
||||
unsigned char menu_screen[321*240*2]; /* draw here and blit later, to avoid flicker */
|
||||
char menuErrorMsg[40] = {0, };
|
||||
static unsigned char *bg_buffer = gfx_buffer + 321*240*2;
|
||||
unsigned char *menu_screen = gfx_buffer; /* draw here and blit later, to avoid flicker */
|
||||
|
||||
static void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
|
||||
static void menu_prepare_bg(int use_game_bg);
|
||||
|
@ -502,7 +498,7 @@ static void state_check_slots(void)
|
|||
|
||||
for (slot = 0; slot < 10; slot++)
|
||||
{
|
||||
if (emu_check_save_file(slot))
|
||||
if (emu_checkSaveFile(slot))
|
||||
{
|
||||
state_slot_flags |= 1 << slot;
|
||||
}
|
||||
|
@ -530,10 +526,10 @@ static void draw_savestate_bg(int slot)
|
|||
|
||||
if (strcmp(fname + strlen(fname) - 3, ".gz") == 0) {
|
||||
file = gzopen(fname, "rb");
|
||||
emu_set_save_cbs(1);
|
||||
emu_setSaveStateCbs(1);
|
||||
} else {
|
||||
file = fopen(fname, "rb");
|
||||
emu_set_save_cbs(0);
|
||||
emu_setSaveStateCbs(0);
|
||||
}
|
||||
|
||||
if (file) {
|
||||
|
@ -551,7 +547,7 @@ static void draw_savestate_bg(int slot)
|
|||
areaClose(file);
|
||||
}
|
||||
|
||||
emu_forced_frame();
|
||||
emu_forcedFrame();
|
||||
menu_prepare_bg(1);
|
||||
|
||||
memcpy(Pico.vram, tmp_vram, sizeof(Pico.vram));
|
||||
|
@ -888,17 +884,17 @@ static void cd_menu_loop_options(void)
|
|||
menu_id selected_id;
|
||||
char *bios, *p;
|
||||
|
||||
if (find_bios(4, &bios)) { // US
|
||||
if (emu_findBios(4, &bios)) { // US
|
||||
for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;
|
||||
strncpy(bios_names.us, p, sizeof(bios_names.us)); bios_names.us[sizeof(bios_names.us)-1] = 0;
|
||||
} else strcpy(bios_names.us, "NOT FOUND");
|
||||
|
||||
if (find_bios(8, &bios)) { // EU
|
||||
if (emu_findBios(8, &bios)) { // EU
|
||||
for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;
|
||||
strncpy(bios_names.eu, p, sizeof(bios_names.eu)); bios_names.eu[sizeof(bios_names.eu)-1] = 0;
|
||||
} else strcpy(bios_names.eu, "NOT FOUND");
|
||||
|
||||
if (find_bios(1, &bios)) { // JP
|
||||
if (emu_findBios(1, &bios)) { // JP
|
||||
for (p = bios+strlen(bios)-1; p > bios && *p != '/'; p--); p++;
|
||||
strncpy(bios_names.jp, p, sizeof(bios_names.jp)); bios_names.jp[sizeof(bios_names.jp)-1] = 0;
|
||||
} else strcpy(bios_names.jp, "NOT FOUND");
|
||||
|
@ -930,21 +926,21 @@ static void cd_menu_loop_options(void)
|
|||
}
|
||||
switch (selected_id) { // BIOS testers
|
||||
case MA_CDOPT_TESTBIOS_USA:
|
||||
if (find_bios(4, &bios)) { // test US
|
||||
if (emu_findBios(4, &bios)) { // test US
|
||||
strcpy(romFileName, bios);
|
||||
engineState = PGS_ReloadRom;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case MA_CDOPT_TESTBIOS_EUR:
|
||||
if (find_bios(8, &bios)) { // test EU
|
||||
if (emu_findBios(8, &bios)) { // test EU
|
||||
strcpy(romFileName, bios);
|
||||
engineState = PGS_ReloadRom;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case MA_CDOPT_TESTBIOS_JAP:
|
||||
if (find_bios(1, &bios)) { // test JP
|
||||
if (emu_findBios(1, &bios)) { // test JP
|
||||
strcpy(romFileName, bios);
|
||||
engineState = PGS_ReloadRom;
|
||||
return;
|
||||
|
@ -1188,7 +1184,6 @@ static void menu_options_save(void)
|
|||
// unbind XYZ MODE, just in case
|
||||
unbind_action(0xf00);
|
||||
}
|
||||
scaling_update();
|
||||
}
|
||||
|
||||
static int menu_loop_options(void)
|
||||
|
@ -1617,7 +1612,7 @@ int menu_loop_tray(void)
|
|||
selfname = romsel_loop(curr_path);
|
||||
if (selfname) {
|
||||
int ret = -1, cd_type;
|
||||
cd_type = emu_cd_check(NULL);
|
||||
cd_type = emu_cdCheck(NULL);
|
||||
if (cd_type > 0)
|
||||
ret = Insert_CD(romFileName, cd_type == 2);
|
||||
if (ret != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue