# === Pico core ===
# Pico
-OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \
+OBJS += pico/state.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \
pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o pico/sms.o \
pico/misc.o pico/eeprom.o pico/patch.o pico/debug.o
# CD
OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
- pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
+ pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
# 32X
OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
# Pico
endif
# --- Z80 ---
-ifeq "$(use_mz80)" "1"
-DEFINES += _USE_MZ80
-OBJS += cpu/mz80/mz80.o
-endif
-#
ifeq "$(use_drz80)" "1"
DEFINES += _USE_DRZ80
OBJS += cpu/DrZ80/drz80.o
#include <version.h>\r
#include <revision.h>\r
\r
-#include <pico/pico_int.h>\r
+#include <pico/pico.h>\r
#include <pico/patch.h>\r
\r
static char static_buff[64];\r
\r
static void draw_savestate_bg(int slot)\r
{\r
- struct PicoVideo tmp_pv;\r
- unsigned short tmp_cram[0x40];\r
- unsigned short tmp_vsram[0x40];\r
- void *tmp_vram;\r
const char *fname;\r
+ void *tmp_state;\r
\r
fname = emu_get_save_fname(1, 0, slot);\r
- if (!fname) return;\r
-\r
- tmp_vram = malloc(sizeof(Pico.vram));\r
- if (tmp_vram == NULL) return;\r
+ if (!fname)\r
+ return;\r
\r
- memcpy(tmp_vram, Pico.vram, sizeof(Pico.vram));\r
- memcpy(tmp_cram, Pico.cram, sizeof(Pico.cram));\r
- memcpy(tmp_vsram, Pico.vsram, sizeof(Pico.vsram));\r
- memcpy(&tmp_pv, &Pico.video, sizeof(Pico.video));\r
+ tmp_state = PicoTmpStateSave();\r
\r
- PicoStateLoadVDP(fname);\r
+ PicoStateLoadGfx(fname);\r
\r
/* do a frame and fetch menu bg */\r
pemu_forced_frame(POPT_EN_SOFTSCALE);\r
menu_enter(1);\r
\r
- memcpy(Pico.vram, tmp_vram, sizeof(Pico.vram));\r
- memcpy(Pico.cram, tmp_cram, sizeof(Pico.cram));\r
- memcpy(Pico.vsram, tmp_vsram, sizeof(Pico.vsram));\r
- memcpy(&Pico.video, &tmp_pv, sizeof(Pico.video));\r
- free(tmp_vram);\r
+ PicoTmpStateRestore(tmp_state);\r
}\r
\r
static void draw_savestate_menu(int menu_sel, int is_loading)\r
static int menu_sel = 10;\r
int menu_sel_max = 10;\r
unsigned long inp = 0;\r
+ int ret = 0;\r
\r
state_check_slots();\r
\r
state_slot = menu_sel;\r
if (emu_save_load_game(is_loading, 0)) {\r
me_update_msg(is_loading ? "Load failed" : "Save failed");\r
- return 0;\r
+ break;\r
}\r
- return 1;\r
+ ret = 1;\r
+ break;\r
}\r
- return 0;\r
+ break;\r
}\r
if (inp & PBTN_MBACK)\r
- return 0;\r
+ break;\r
}\r
+\r
+ return ret;\r
}\r
\r
// -------------- key config --------------\r