aboutsummaryrefslogtreecommitdiff
path: root/source/spc7110.c
diff options
context:
space:
mode:
authorJoão Silva2017-01-16 22:39:57 +0000
committerJoão Silva2017-01-16 22:39:57 +0000
commitcbbfa871ae3d9db3852d9122a6d8355896c073ed (patch)
tree73e7755d117b8dd9eea499977c632727deb20d00 /source/spc7110.c
parent7ed90abe19954aaf1fa56657a08e3cae4c8a67ce (diff)
downloadsnes9x2005-cbbfa871ae3d9db3852d9122a6d8355896c073ed.tar.gz
snes9x2005-cbbfa871ae3d9db3852d9122a6d8355896c073ed.tar.bz2
snes9x2005-cbbfa871ae3d9db3852d9122a6d8355896c073ed.zip
Many cleanups.
Diffstat (limited to 'source/spc7110.c')
-rw-r--r--source/spc7110.c39
1 files changed, 14 insertions, 25 deletions
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);
}
-