From cbbfa871ae3d9db3852d9122a6d8355896c073ed Mon Sep 17 00:00:00 2001 From: João Silva Date: Mon, 16 Jan 2017 22:39:57 +0000 Subject: Many cleanups. --- source/spc7110.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) (limited to 'source/spc7110.c') diff --git a/source/spc7110.c b/source/spc7110.c index acc4666..66bfecc 100644 --- a/source/spc7110.c +++ b/source/spc7110.c @@ -57,29 +57,27 @@ typedef struct SPC7110DecompressionLocationStruct //this maps an index.bin table to the decompression pack typedef struct SPC7110DecompressionIndexStruct { - int table; - bool is_file; + int table; + bool is_file; Data7110 location[256]; } Index7110; //this contains all the data for the decompression pack. typedef struct SPC7110DecompressionPackStructure { - uint8_t* binfiles[MAX_TABLES]; + uint8_t* binfiles[MAX_TABLES]; Index7110 tableEnts[MAX_TABLES]; - int last_table; - int idx; - uint8_t last_idx; - uint16_t last_offset; + int last_table; + int idx; + uint8_t last_idx; + uint16_t last_offset; } Pack7110; - -char pfold[9]; //hack variable for log naming (each game makes a different log) -Pack7110* decompack = - NULL; //decompression pack uses a fair chunk of RAM, so dynalloc it. -SPC7110Regs s7r; //SPC7110 registers, about 33KB -S7RTC rtc_f9; //FEOEZ (and Shounen Jump no SHou) RTC -void S9xUpdateRTC(); //S-RTC function hacked to work with the RTC +char pfold[9]; // Hack variable for log naming (each game makes a different log) +Pack7110* decompack = NULL; // Decompression pack uses a fair chunk of RAM, so dynalloc it. +SPC7110Regs s7r; // SPC7110 registers, about 33KB +S7RTC rtc_f9; // FEOEZ (and Shounen Jump no SHou) RTC +void S9xUpdateRTC(); // S-RTC function hacked to work with the RTC //Emulate power on state void S9xSpc7110Init() @@ -141,7 +139,6 @@ void S9xSpc7110Init() memset(s7r.bank50, 0x00, DECOMP_BUFFER_SIZE); } - //full cache decompression routine (memcpy) Method 1 void MovePackData() { @@ -224,8 +221,7 @@ void MovePackData() } } - -//this is similar to the last function, but it keeps the last 5 accessed files open, +// This is similar to the last function, but it keeps the last 5 accessed files open, // and reads the data directly. Method 2 void ReadPackData() { @@ -1390,12 +1386,10 @@ int S9xRTCDaysInMonth(int month, int year) return mdays; } - #define DAYTICKS (60*60*24) #define HOURTICKS (60*60) #define MINUTETICKS 60 - /**********************************************************************************************/ /* S9xUpdateRTC() */ /* Advance the RTC time */ @@ -1595,7 +1589,6 @@ bool Load7110Index(char* filename) return true; } - //Cache 1 load function void SPC7110Load(char* dirname) { @@ -1690,7 +1683,6 @@ void SPC7110Open(char* dirname) Copy7110 = &ReadPackData; CleanUp7110 = &Close7110Gfx; - } //Cache 3's load function @@ -1764,8 +1756,6 @@ void SPC7110Grab(char* dirname) Copy7110 = &GetPackData; CleanUp7110 = &Drop7110Gfx; - - } //Cache 1 clean up function @@ -1906,7 +1896,6 @@ void S9xSpc7110Reset() memset(s7r.bank50, 0x00, DECOMP_BUFFER_SIZE); } - //outputs a cumulative log for the game. //there's nothing really weird here, just //reading the old log, and writing a new one. @@ -2109,6 +2098,7 @@ void Do7110Logging() } } } + bool S9xSaveSPC7110RTC(S7RTC* rtc_f9) { FILE* fp; @@ -2167,4 +2157,3 @@ bool S9xLoadSPC7110RTC(S7RTC* rtc_f9) fclose(fp); return (true); } - -- cgit v1.2.3