diff options
author | twinaphex | 2020-10-06 20:58:00 +0200 |
---|---|---|
committer | twinaphex | 2020-10-06 20:58:00 +0200 |
commit | 77f7e9762fbdcacfdeb6dc4784ace328aa63be00 (patch) | |
tree | 05fa24b209c5f31153960d56c9599e1ed8c58356 | |
parent | f22625f9a26ea17d3ac8880e9472af2af6a13806 (diff) | |
download | snes9x2002-77f7e9762fbdcacfdeb6dc4784ace328aa63be00.tar.gz snes9x2002-77f7e9762fbdcacfdeb6dc4784ace328aa63be00.tar.bz2 snes9x2002-77f7e9762fbdcacfdeb6dc4784ace328aa63be00.zip |
Remove SDD1 Load / Save Log Data
-rw-r--r-- | src/dma.c | 48 | ||||
-rw-r--r-- | src/memmap.h | 3 | ||||
-rw-r--r-- | src/sdd1.c | 48 | ||||
-rw-r--r-- | src/sdd1.h | 6 |
4 files changed, 2 insertions, 103 deletions
@@ -132,58 +132,10 @@ void S9xDoDMA(uint8 Channel) }
else
{
-#if 1
void* ptr = bsearch(&address, Memory.SDD1Index,
Memory.SDD1Entries, 12, S9xCompareSDD1IndexEntries);
if (ptr)
in_sdd1_dma = *(uint32*)((uint8*) ptr + 4) + Memory.SDD1Data;
-#else
- uint8* ptr = Memory.SDD1Index;
-
- for (uint32 e = 0; e < Memory.SDD1Entries; e++, ptr += 12)
- {
- if (address == *(uint32*) ptr)
- {
- in_sdd1_dma = *(uint32*)(ptr + 4) + Memory.SDD1Data;
- break;
- }
- }
-#endif
-
- /* if (!in_sdd1_dma)
- {
- // No matching decompressed data found. Must be some new
- // graphics not encountered before. Log it if it hasn't been
- // already.
- uint8 *p = Memory.SDD1LoggedData;
- bool8 found = FALSE;
- uint8 SDD1Bank = Memory.FillRAM [0x4804 + ((d->ABank - 0xc0) >> 4)] | 0xf0;
-
- for (uint32 i = 0; i < Memory.SDD1LoggedDataCount; i++, p += 8)
- {
- if (*p == d->ABank ||
- *(p + 1) == (d->AAddress >> 8) &&
- *(p + 2) == (d->AAddress & 0xff) &&
- *(p + 3) == (count >> 8) &&
- *(p + 4) == (count & 0xff) &&
- *(p + 7) == SDD1Bank)
- {
- found = TRUE;
- break;
- }
- }
- if (!found && Memory.SDD1LoggedDataCount < MEMMAP_MAX_SDD1_LOGGED_ENTRIES)
- {
- *p = d->ABank;
- *(p + 1) = d->AAddress >> 8;
- *(p + 2) = d->AAddress & 0xff;
- *(p + 3) = count >> 8;
- *(p + 4) = count & 0xff;
- *(p + 7) = SDD1Bank;
- Memory.SDD1LoggedDataCount += 1;
- }
- }
- */
}
}
diff --git a/src/memmap.h b/src/memmap.h index 4e0e338..7a7f447 100644 --- a/src/memmap.h +++ b/src/memmap.h @@ -157,9 +157,6 @@ typedef struct uint8* SDD1Index; uint8* SDD1Data; uint32 SDD1Entries; - uint32 SDD1LoggedDataCountPrev; - uint32 SDD1LoggedDataCount; - uint8 SDD1LoggedData [MEMMAP_MAX_SDD1_LOGGED_ENTRIES]; char ROMFilename [_MAX_PATH]; } CMemory; @@ -84,51 +84,3 @@ void S9xSDD1PostLoadState(void) for (i = 0; i < 4; i++) S9xSetSDD1MemoryMap(i, Memory.FillRAM [0x4804 + i]); } - -static int S9xCompareSDD1LoggedDataEntries(const void* p1, const void* p2) -{ - uint8* b1 = (uint8*) p1; - uint8* b2 = (uint8*) p2; - uint32 a1 = (*b1 << 16) + (*(b1 + 1) << 8) + *(b1 + 2); - uint32 a2 = (*b2 << 16) + (*(b2 + 1) << 8) + *(b2 + 2); - - return (a1 - a2); -} - -void S9xSDD1SaveLoggedData() -{ - if (Memory.SDD1LoggedDataCount != Memory.SDD1LoggedDataCountPrev) - { - FILE *fs; - - qsort(Memory.SDD1LoggedData, Memory.SDD1LoggedDataCount, 8, - S9xCompareSDD1LoggedDataEntries); - - fs = fopen(S9xGetFilename(".dat"), "wb"); - - if (fs) - { - fwrite(Memory.SDD1LoggedData, 8, - Memory.SDD1LoggedDataCount, fs); - fclose(fs); - } - Memory.SDD1LoggedDataCountPrev = Memory.SDD1LoggedDataCount; - } -} - -void S9xSDD1LoadLoggedData() -{ - FILE* fs = fopen(S9xGetFilename(".dat"), "rb"); - - Memory.SDD1LoggedDataCount = Memory.SDD1LoggedDataCountPrev = 0; - - if (fs) - { - int c = fread(Memory.SDD1LoggedData, 8, - MEMMAP_MAX_SDD1_LOGGED_ENTRIES, fs); - - if (c != EOF) - Memory.SDD1LoggedDataCount = Memory.SDD1LoggedDataCountPrev = c; - fclose(fs); - } -} @@ -41,8 +41,6 @@ #ifndef _SDD1_H_ #define _SDD1_H_ void S9xSetSDD1MemoryMap(uint32 bank, uint32 value); -void S9xResetSDD1(); -void S9xSDD1PostLoadState(); -void S9xSDD1SaveLoggedData(); -void S9xSDD1LoadLoggedData(); +void S9xResetSDD1(void); +void S9xSDD1PostLoadState(void); #endif |