fixed more missing functions

This commit is contained in:
Markus Fröschle
2013-12-29 23:44:09 +00:00
parent 7b4e8fa3a4
commit 14ac39a052
7 changed files with 5577 additions and 5598 deletions

View File

@@ -116,13 +116,14 @@ CSRCS= \
radeon_cursor.c \ radeon_cursor.c \
radeon_monitor.c \ radeon_monitor.c \
\ \
biosemu.c \
decode.c \ decode.c \
sys.c \ sys.c \
debug.c \ debug.c \
prim_ops.c \ prim_ops.c \
ops.c \ ops.c \
ops2.c \ ops2.c \
fpu.c \
biosemu.c \
x86pcibios.c \ x86pcibios.c \
\ \
basflash.c \ basflash.c \

View File

@@ -86,11 +86,12 @@ SECTIONS
OBJDIR/fbmodedb.o OBJDIR/fbmodedb.o
OBJDIR/offscreen.o OBJDIR/offscreen.o
OBJDIR/biosemu.o
OBJDIR/decode.o OBJDIR/decode.o
OBJDIR/ops.o OBJDIR/ops.o
OBJDIR/ops2.o OBJDIR/ops2.o
OBJDIR/fpu.o
OBJDIR/sys.o OBJDIR/sys.o
OBJDIR/biosemu.o
OBJDIR/debug.o OBJDIR/debug.o
OBJDIR/prim_ops.o OBJDIR/prim_ops.o
OBJDIR/x86pcibios.o OBJDIR/x86pcibios.o

View File

@@ -99,7 +99,7 @@ int run_bios_int(int num)
return 1; return 1;
} }
static uint8_t inb(uint16_t port) uint8_t inb(uint16_t port)
{ {
uint8_t val = 0; uint8_t val = 0;
@@ -113,7 +113,7 @@ static uint8_t inb(uint16_t port)
return val; return val;
} }
static uint16_t inw(uint16_t port) uint16_t inw(uint16_t port)
{ {
uint16_t val = 0; uint16_t val = 0;
@@ -126,7 +126,7 @@ static uint16_t inw(uint16_t port)
return val; return val;
} }
static uint32_t inl(uint16_t port) uint32_t inl(uint16_t port)
{ {
uint32_t val = 0; uint32_t val = 0;
if ((port >= offset_port) && (port <= offset_port+0xFF)) if ((port >= offset_port) && (port <= offset_port+0xFF))

View File

@@ -176,6 +176,7 @@ void x86emu_decode_printf2 (char *x, int y)
{ {
char temp[100], *p; char temp[100], *p;
doprnt(xaddchar, x, y);
#ifdef DBG_X86EMU #ifdef DBG_X86EMU
{ {
p = temp; p = temp;

View File

@@ -181,10 +181,8 @@ void x86emuOp_illegal_op(
if (M.x86.R_SP != 0) { if (M.x86.R_SP != 0) {
DECODE_PRINTF("ILLEGAL X86 OPCODE\r\n"); DECODE_PRINTF("ILLEGAL X86 OPCODE\r\n");
TRACE_REGS(); TRACE_REGS();
DPRINTVALHEXWORD("", M.x86.R_CS); dbg("%x:%x: %x\r\n", M.x86.R_CS, M.x86.R_IP - 1, op1);
DPRINTVALHEXWORD(":", M.x86.R_IP-1); dbg(" ILLEGAL X86 OPCODE!\r\n");
DPRINTVALHEXBYTE(": ", op1);
DPRINT(" ILLEGAL X86 OPCODE!\r\n");
HALT_SYS(); HALT_SYS();
} }
else { else {

View File

@@ -58,10 +58,8 @@ void x86emuOp2_illegal_op(
START_OF_INSTR(); START_OF_INSTR();
DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\r\n"); DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\r\n");
TRACE_REGS(); TRACE_REGS();
DPRINTVALHEXWORD("", M.x86.R_CS); dbg("%x:%x: %x", M.x86.R_CS, M.x86.R_IP - 2, op2);
DPRINTVALHEXWORD(":", M.x86.R_IP-2); dbg(" ILLEGAL EXTENDED X86 OPCODE!\r\n");
DPRINTVALHEXBYTE(": ", op2);
DPRINT(" ILLEGAL EXTENDED X86 OPCODE!\r\n");
HALT_SYS(); HALT_SYS();
END_OF_INSTR(); END_OF_INSTR();
} }
@@ -1089,13 +1087,11 @@ void x86emuOp2_btX_I(uint8_t X86EMU_UNUSED(op2))
DECODE_PRINTF("BTC\t"); DECODE_PRINTF("BTC\t");
break; break;
default: default:
DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n"); dbg("ILLEGAL EXTENDED X86 OPCODE\n");
TRACE_REGS(); TRACE_REGS();
DPRINTVALHEXWORD("", M.x86.R_CS); dbg("%x:%x: %x", M.x86.R_CS, M.x86.R_IP - 3, op2);
DPRINTVALHEXWORD(":", M.x86.R_IP-3); dbg(" %x", (mod << 6) | (rh << 3) | rl);
DPRINTVALHEXBYTE(": ", op2); dbg(" ILLEGAL EXTENDED X86 OPCODE EXTENSION!\r\n");
DPRINTVALHEXBYTE("", (mod<<6)|(rh<<3)|rl);
DPRINT(" ILLEGAL EXTENDED X86 OPCODE EXTENSION!\r\n");
HALT_SYS(); HALT_SYS();
} }
if (mod < 3) { if (mod < 3) {

View File

@@ -60,8 +60,6 @@ extern uint32_t inl(uint16_t port);
extern void outb(uint8_t val, uint16_t port); extern void outb(uint8_t val, uint16_t port);
extern void outw(uint16_t val, uint16_t port); extern void outw(uint16_t val, uint16_t port);
extern void outl(uint32_t val, uint16_t port); extern void outl(uint32_t val, uint16_t port);
extern uint16_t swap_short(uint16_t val);
extern uint32_t swap_long(uint32_t val);
/*------------------------- Global Variables ------------------------------*/ /*------------------------- Global Variables ------------------------------*/
@@ -202,7 +200,7 @@ uint32_t X86API rdl(uint32_t addr)
#ifdef DEBUG_X86EMU_PCI #ifdef DEBUG_X86EMU_PCI
DPRINTVALHEX("rdl(", addr); DPRINTVALHEX("rdl(", addr);
#endif #endif
val = swap_long(*(uint32_t *)(offset_mem+addr)); val = swpl(*(uint32_t *)(offset_mem+addr));
#ifdef DEBUG_X86EMU_PCI #ifdef DEBUG_X86EMU_PCI
DPRINTVALHEX(") = ", val); DPRINTVALHEX(") = ", val);
DPRINT("\r\n"); DPRINT("\r\n");
@@ -227,7 +225,7 @@ uint32_t X86API rdl(uint32_t addr)
DPRINT("\r\n"); DPRINT("\r\n");
} }
#endif #endif
val = swap_long(*(uint32_t *)(M.mem_base + addr)); val = swpl(*(uint32_t *)(M.mem_base + addr));
// val = *(uint32_t *)(M.mem_base + addr); // val = *(uint32_t *)(M.mem_base + addr);
} }
DB(if (DEBUG_MEM_TRACE()) DB(if (DEBUG_MEM_TRACE())
@@ -302,15 +300,7 @@ void X86API wrw(uint32_t addr, uint16_t val)
DPRINTVALHEX(") = ", val); DPRINTVALHEX(") = ", val);
DPRINT("\r\n"); DPRINT("\r\n");
#endif #endif
#ifdef DIRECT_ACCESS *(uint16_t *)(offset_mem+addr) = swpw(val);
*(uint16_t *)(offset_mem+addr) = swap_short(val);
#else
#ifdef PCI_XBIOS
write_mem_word(rinfo_biosemu->handle, offset_mem+addr, val);
#else
Write_mem_word(rinfo_biosemu->handle, offset_mem+addr, val);
#endif
#endif
} }
else else
{ {
@@ -358,15 +348,7 @@ void X86API wrl(uint32_t addr, uint32_t val)
DPRINTVALHEX(") = ", val); DPRINTVALHEX(") = ", val);
DPRINT("\r\n"); DPRINT("\r\n");
#endif #endif
#ifdef DIRECT_ACCESS *(uint32_t *)(offset_mem+addr) = swpl(val);
*(uint32_t *)(offset_mem+addr) = swap_long(val);
#else
#ifdef PCI_XBIOS
write_mem_longword(rinfo_biosemu->handle, offset_mem+addr, val);
#else
Write_mem_longword(rinfo_biosemu->handle, offset_mem+addr, val);
#endif
#endif
} }
else else
{ {
@@ -385,7 +367,7 @@ void X86API wrl(uint32_t addr, uint32_t val)
DPRINT("\r\n"); DPRINT("\r\n");
} }
#endif #endif
*(uint32_t *)(M.mem_base + addr) = swap_long(val); *(uint32_t *)(M.mem_base + addr) = swpl(val);
// *(uint32_t *)(M.mem_base + addr) = val; // *(uint32_t *)(M.mem_base + addr) = val;
} }
DB(if (DEBUG_MEM_TRACE()) DB(if (DEBUG_MEM_TRACE())