summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dma.c48
-rw-r--r--src/memmap.h3
-rw-r--r--src/sdd1.c48
-rw-r--r--src/sdd1.h6
4 files changed, 2 insertions, 103 deletions
diff --git a/src/dma.c b/src/dma.c
index b501c43..4d69b00 100644
--- a/src/dma.c
+++ b/src/dma.c
@@ -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;
diff --git a/src/sdd1.c b/src/sdd1.c
index 25bdfc2..5b3a63a 100644
--- a/src/sdd1.c
+++ b/src/sdd1.c
@@ -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);
- }
-}
diff --git a/src/sdd1.h b/src/sdd1.h
index 311d7ed..8b7178a 100644
--- a/src/sdd1.h
+++ b/src/sdd1.h
@@ -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