reformatted
This commit is contained in:
@@ -77,13 +77,15 @@ Byte value read from emulator memory.
|
|||||||
REMARKS:
|
REMARKS:
|
||||||
Reads a byte value from the emulator memory.
|
Reads a byte value from the emulator memory.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static uint8_t
|
static uint8_t rdb(struct X86EMU *emu, uint32_t addr)
|
||||||
rdb(struct X86EMU *emu, uint32_t addr)
|
|
||||||
{
|
{
|
||||||
if (addr > emu->mem_size - 1)
|
if (addr > emu->mem_size - 1)
|
||||||
|
{
|
||||||
X86EMU_halt_sys(emu);
|
X86EMU_halt_sys(emu);
|
||||||
|
}
|
||||||
return emu->mem_base[addr];
|
return emu->mem_base[addr];
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
PARAMETERS:
|
PARAMETERS:
|
||||||
addr - Emulator memory address to read
|
addr - Emulator memory address to read
|
||||||
@@ -94,13 +96,15 @@ Word value read from emulator memory.
|
|||||||
REMARKS:
|
REMARKS:
|
||||||
Reads a word value from the emulator memory.
|
Reads a word value from the emulator memory.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static uint16_t
|
static uint16_t rdw(struct X86EMU *emu, uint32_t addr)
|
||||||
rdw(struct X86EMU *emu, uint32_t addr)
|
|
||||||
{
|
{
|
||||||
if (addr > emu->mem_size - 2)
|
if (addr > emu->mem_size - 2)
|
||||||
|
{
|
||||||
X86EMU_halt_sys(emu);
|
X86EMU_halt_sys(emu);
|
||||||
|
}
|
||||||
return le16dec(emu->mem_base + addr);
|
return le16dec(emu->mem_base + addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
PARAMETERS:
|
PARAMETERS:
|
||||||
addr - Emulator memory address to read
|
addr - Emulator memory address to read
|
||||||
@@ -110,13 +114,15 @@ Long value read from emulator memory.
|
|||||||
REMARKS:
|
REMARKS:
|
||||||
Reads a long value from the emulator memory.
|
Reads a long value from the emulator memory.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static uint32_t
|
static uint32_t rdl(struct X86EMU *emu, uint32_t addr)
|
||||||
rdl(struct X86EMU *emu, uint32_t addr)
|
|
||||||
{
|
{
|
||||||
if (addr > emu->mem_size - 4)
|
if (addr > emu->mem_size - 4)
|
||||||
|
{
|
||||||
X86EMU_halt_sys(emu);
|
X86EMU_halt_sys(emu);
|
||||||
|
}
|
||||||
return le32dec(emu->mem_base + addr);
|
return le32dec(emu->mem_base + addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
PARAMETERS:
|
PARAMETERS:
|
||||||
addr - Emulator memory address to read
|
addr - Emulator memory address to read
|
||||||
@@ -125,13 +131,15 @@ val - Value to store
|
|||||||
REMARKS:
|
REMARKS:
|
||||||
Writes a byte value to emulator memory.
|
Writes a byte value to emulator memory.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void
|
static void wrb(struct X86EMU *emu, uint32_t addr, uint8_t val)
|
||||||
wrb(struct X86EMU *emu, uint32_t addr, uint8_t val)
|
|
||||||
{
|
{
|
||||||
if (addr > emu->mem_size - 1)
|
if (addr > emu->mem_size - 1)
|
||||||
|
{
|
||||||
X86EMU_halt_sys(emu);
|
X86EMU_halt_sys(emu);
|
||||||
|
}
|
||||||
emu->mem_base[addr] = val;
|
emu->mem_base[addr] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
PARAMETERS:
|
PARAMETERS:
|
||||||
addr - Emulator memory address to read
|
addr - Emulator memory address to read
|
||||||
@@ -140,11 +148,12 @@ val - Value to store
|
|||||||
REMARKS:
|
REMARKS:
|
||||||
Writes a word value to emulator memory.
|
Writes a word value to emulator memory.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void
|
static void wrw(struct X86EMU *emu, uint32_t addr, uint16_t val)
|
||||||
wrw(struct X86EMU *emu, uint32_t addr, uint16_t val)
|
|
||||||
{
|
{
|
||||||
if (addr > emu->mem_size - 2)
|
if (addr > emu->mem_size - 2)
|
||||||
|
{
|
||||||
X86EMU_halt_sys(emu);
|
X86EMU_halt_sys(emu);
|
||||||
|
}
|
||||||
le16enc(emu->mem_base + addr, val);
|
le16enc(emu->mem_base + addr, val);
|
||||||
}
|
}
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -155,18 +164,18 @@ val - Value to store
|
|||||||
REMARKS:
|
REMARKS:
|
||||||
Writes a long value to emulator memory.
|
Writes a long value to emulator memory.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void
|
static void wrl(struct X86EMU *emu, uint32_t addr, uint32_t val)
|
||||||
wrl(struct X86EMU *emu, uint32_t addr, uint32_t val)
|
|
||||||
{
|
{
|
||||||
if (addr > emu->mem_size - 4)
|
if (addr > emu->mem_size - 4)
|
||||||
|
{
|
||||||
X86EMU_halt_sys(emu);
|
X86EMU_halt_sys(emu);
|
||||||
|
}
|
||||||
le32enc(emu->mem_base + addr, val);
|
le32enc(emu->mem_base + addr, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------- Setup -------------------------------------*/
|
/*----------------------------- Setup -------------------------------------*/
|
||||||
|
|
||||||
void
|
void X86EMU_init_default(struct X86EMU *emu)
|
||||||
X86EMU_init_default(struct X86EMU *emu)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -178,5 +187,7 @@ X86EMU_init_default(struct X86EMU *emu)
|
|||||||
emu->emu_wrl = wrl;
|
emu->emu_wrl = wrl;
|
||||||
|
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
|
{
|
||||||
emu->_X86EMU_intrTab[i] = NULL;
|
emu->_X86EMU_intrTab[i] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user