mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
fonts, buffer aligment, save progress
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@51 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
cea6590346
commit
76276b0bc0
13 changed files with 371 additions and 126 deletions
|
@ -14,6 +14,8 @@
|
|||
// sn76496
|
||||
extern int *sn76496_regs;
|
||||
|
||||
void (*PicoStateProgressCB)(const char *str) = 0;
|
||||
|
||||
|
||||
typedef enum {
|
||||
CHUNK_M68K = 1,
|
||||
|
@ -43,6 +45,34 @@ typedef enum {
|
|||
} chunk_name_e;
|
||||
|
||||
|
||||
static char *chunk_names[] = {
|
||||
"Saving.. M68K state",
|
||||
"Saving.. RAM",
|
||||
"Saving.. VRAM",
|
||||
"Saving.. ZRAM",
|
||||
"Saving.. CRAM", // 5
|
||||
"Saving.. VSRAM",
|
||||
"Saving.. emu state",
|
||||
"Saving.. VIDEO",
|
||||
"Saving.. Z80 state",
|
||||
"Saving.. PSG", // 10
|
||||
"Saving.. FM",
|
||||
// CD stuff
|
||||
"Saving.. S68K state",
|
||||
"Saving.. PRG_RAM",
|
||||
"Saving.. WORD_RAM",
|
||||
"Saving.. PCM_RAM", // 15
|
||||
"Saving.. BRAM",
|
||||
"Saving.. GATE ARRAY regs",
|
||||
"Saving.. PCM state",
|
||||
"Saving.. CDC",
|
||||
"Saving.. CDD", // 20
|
||||
"Saving.. SCD",
|
||||
"Saving.. GFX chip",
|
||||
"Saving.. MCD state",
|
||||
};
|
||||
|
||||
|
||||
static int write_chunk(chunk_name_e name, int len, void *data, void *file)
|
||||
{
|
||||
size_t bwritten = 0;
|
||||
|
@ -55,9 +85,11 @@ static int write_chunk(chunk_name_e name, int len, void *data, void *file)
|
|||
|
||||
|
||||
#define CHECKED_WRITE(name,len,data) \
|
||||
if (PicoStateProgressCB) PicoStateProgressCB(chunk_names[name]); \
|
||||
if (!write_chunk(name, len, data, file)) return 1;
|
||||
|
||||
#define CHECKED_WRITE_BUFF(name,buff) \
|
||||
if (PicoStateProgressCB) PicoStateProgressCB(chunk_names[name]); \
|
||||
if (!write_chunk(name, sizeof(buff), &buff, file)) return 1;
|
||||
|
||||
int PicoCdSaveState(void *file)
|
||||
|
@ -88,7 +120,6 @@ int PicoCdSaveState(void *file)
|
|||
if(PicoOpt&1)
|
||||
CHECKED_WRITE(CHUNK_FM, 0x200+4, ym2612_regs);
|
||||
|
||||
// TODO: cd stuff
|
||||
if (PicoMCD & 1)
|
||||
{
|
||||
Pico_mcd->m.audio_offset = mp3_get_offset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue