mirror of
https://github.com/ksherlock/mpw.git
synced 2025-02-03 05:30:28 +00:00
flag for global debugging
This commit is contained in:
parent
92b94373f3
commit
00c83dce1a
@ -8,6 +8,7 @@ extern "C" {
|
|||||||
// new functions
|
// new functions
|
||||||
|
|
||||||
extern void memorySetMemory(uint8_t *memory, uint32_t size);
|
extern void memorySetMemory(uint8_t *memory, uint32_t size);
|
||||||
|
extern void memorySetGlobalLog(uint32_t globalLog);
|
||||||
|
|
||||||
|
|
||||||
/* Memory access functions */
|
/* Memory access functions */
|
||||||
|
18
cpu/memory.c
18
cpu/memory.c
@ -46,6 +46,7 @@ static void memoryOddWrite(ULO address)
|
|||||||
|
|
||||||
static uint8_t *Memory = NULL;
|
static uint8_t *Memory = NULL;
|
||||||
static uint32_t MemorySize = 0;
|
static uint32_t MemorySize = 0;
|
||||||
|
static uint32_t MemoryGlobalLog = 0;
|
||||||
|
|
||||||
void memorySetMemory(uint8_t *memory, uint32_t size)
|
void memorySetMemory(uint8_t *memory, uint32_t size)
|
||||||
{
|
{
|
||||||
@ -53,10 +54,15 @@ void memorySetMemory(uint8_t *memory, uint32_t size)
|
|||||||
MemorySize = size;
|
MemorySize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void memorySetGlobalLog(uint32_t globalLog)
|
||||||
|
{
|
||||||
|
MemoryGlobalLog = globalLog;
|
||||||
|
}
|
||||||
|
|
||||||
UBY memoryReadByte(ULO address)
|
UBY memoryReadByte(ULO address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (address < 0x10000)
|
if (address < MemoryGlobalLog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "memoryReadByte(%08x)\n", address);
|
fprintf(stderr, "memoryReadByte(%08x)\n", address);
|
||||||
}
|
}
|
||||||
@ -70,7 +76,7 @@ UBY memoryReadByte(ULO address)
|
|||||||
UWO memoryReadWord(ULO address)
|
UWO memoryReadWord(ULO address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (address < 0x10000)
|
if (address < MemoryGlobalLog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "memoryReadWord(%08x)\n", address);
|
fprintf(stderr, "memoryReadWord(%08x)\n", address);
|
||||||
}
|
}
|
||||||
@ -87,7 +93,7 @@ UWO memoryReadWord(ULO address)
|
|||||||
|
|
||||||
ULO memoryReadLong(ULO address)
|
ULO memoryReadLong(ULO address)
|
||||||
{
|
{
|
||||||
if (address < 0x10000)
|
if (address < MemoryGlobalLog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "memoryReadLong(%08x)\n", address);
|
fprintf(stderr, "memoryReadLong(%08x)\n", address);
|
||||||
}
|
}
|
||||||
@ -105,7 +111,7 @@ ULO memoryReadLong(ULO address)
|
|||||||
}
|
}
|
||||||
void memoryWriteByte(UBY data, ULO address)
|
void memoryWriteByte(UBY data, ULO address)
|
||||||
{
|
{
|
||||||
if (address < 0x10000)
|
if (address < MemoryGlobalLog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "memoryWriteByte(%02x, %08x)\n", data, address);
|
fprintf(stderr, "memoryWriteByte(%02x, %08x)\n", data, address);
|
||||||
}
|
}
|
||||||
@ -119,7 +125,7 @@ void memoryWriteByte(UBY data, ULO address)
|
|||||||
void memoryWriteWord(UWO data, ULO address)
|
void memoryWriteWord(UWO data, ULO address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (address < 0x10000)
|
if (address < MemoryGlobalLog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "memoryWriteWord(%04x, %08x)\n", data, address);
|
fprintf(stderr, "memoryWriteWord(%04x, %08x)\n", data, address);
|
||||||
}
|
}
|
||||||
@ -136,7 +142,7 @@ void memoryWriteWord(UWO data, ULO address)
|
|||||||
void memoryWriteLong(ULO data, ULO address)
|
void memoryWriteLong(ULO data, ULO address)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (address < 0x10000)
|
if (address < MemoryGlobalLog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "memoryWriteLong(%08x, %08x)\n", data, address);
|
fprintf(stderr, "memoryWriteLong(%08x, %08x)\n", data, address);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user