Commit 77f7e976 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Remove SDD1 Load / Save Log Data

parent f22625f9
Pipeline #457 passed with stages
in 1 minute and 12 seconds
......@@ -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;
}
}
*/
}
}
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment