NEC Vx0: Rename the logging functions.

This commit is contained in:
OBattler
2026-01-30 08:58:48 +01:00
parent e8eb606510
commit 561a7171c3
2 changed files with 34 additions and 34 deletions

View File

@@ -6,7 +6,7 @@
*
* This file is part of the 86Box distribution.
*
* 808x CPU emulation, mostly ported from reenigne's XTCE, which
* Vx0 CPU emulation, mostly ported from reenigne's XTCE, which
* is cycle-accurate.
*
* Authors: Andrew Jenner, <https://www.reenigne.org>
@@ -317,25 +317,25 @@ static uint8_t modrm_cycs_post[256] = { [MODRM_ADDR_BX_SI] = 0,
[MODRM_ADDR_BX_DISP16] = 2,
[0x88 ... 0xff] = 0 };
#ifdef ENABLE_808X_LOG
#ifdef ENABLE_VX0_LOG
#if 0
void dumpregs(int);
#endif
int x808x_do_log = ENABLE_808X_LOG;
int vx0_do_log = ENABLE_VX0_LOG;
static void
x808x_log(const char *fmt, ...)
vx0_log(const char *fmt, ...)
{
va_list ap;
if (x808x_do_log) {
if (vx0_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
#else
# define x808x_log(fmt, ...)
# define vx0_log(fmt, ...)
#endif
static i8080 emulated_processor;
@@ -584,7 +584,7 @@ geteal(void)
uint32_t ret;
if (cpu_mod == 3) {
fatal("808x register geteal()\n");
fatal("Vx0 register geteal()\n");
ret = 0xffffffff;
} else
ret = readmeml(easeg, cpu_state.eaaddr);
@@ -599,7 +599,7 @@ geteaq(void)
uint32_t ret;
if (cpu_mod == 3) {
fatal("808x register geteaq()\n");
fatal("Vx0 register geteaq()\n");
ret = 0xffffffff;
} else
ret = readmemq(easeg, cpu_state.eaaddr);
@@ -669,7 +669,7 @@ static void
seteal(uint32_t val)
{
if (cpu_mod == 3) {
fatal("808x register seteal()\n");
fatal("Vx0 register seteal()\n");
return;
} else
writememl(easeg, cpu_state.eaaddr, val);
@@ -679,7 +679,7 @@ static void
seteaq(uint64_t val)
{
if (cpu_mod == 3) {
fatal("808x register seteaq()\n");
fatal("Vx0 register seteaq()\n");
return;
} else
writememq(easeg, cpu_state.eaaddr, val);
@@ -1023,7 +1023,7 @@ intr_routine(uint16_t intr, int skip_first)
if (!(cpu_state.flags & MD_FLAG) && is_nec) {
sync_from_i8080();
x808x_log("CALLN/INT#/NMI#\n");
vx0_log("CALLN/INT#/NMI#\n");
}
if (!skip_first)
@@ -1268,7 +1268,7 @@ sw_int(uint16_t intr)
if (!(cpu_state.flags & MD_FLAG) && is_nec) {
sync_from_i8080();
x808x_log("CALLN/INT#/NMI#\n");
vx0_log("CALLN/INT#/NMI#\n");
}
do_cycles_i(3);
@@ -1344,7 +1344,7 @@ interrupt_brkem(uint16_t addr)
push(&old_ip);
sync_to_i8080();
x808x_log("BRKEM mode\n");
vx0_log("BRKEM mode\n");
}
void
@@ -1367,7 +1367,7 @@ retem_i8080(void)
retem = 1;
x808x_log("RETEM mode\n");
vx0_log("RETEM mode\n");
}
void
@@ -1388,7 +1388,7 @@ custom_nmi(void)
if (!(cpu_state.flags & MD_FLAG) && is_nec) {
sync_from_i8080();
x808x_log("CALLN/INT#/NMI#\n");
vx0_log("CALLN/INT#/NMI#\n");
}
do_cycle_i();
@@ -4705,7 +4705,7 @@ execute_instruction(void)
break;
default:
x808x_log("Illegal opcode: %02X\n", opcode);
vx0_log("Illegal opcode: %02X\n", opcode);
biu_pfq_fetchb();
do_cycles(8);
break;
@@ -4759,7 +4759,7 @@ execvx0(int cycs)
oldc = cpu_state.flags & C_FLAG;
}
x808x_log("[%04X:%04X] Opcode: %02X\n", CS, cpu_state.pc, opcode);
vx0_log("[%04X:%04X] Opcode: %02X\n", CS, cpu_state.pc, opcode);
execute_instruction();

View File

@@ -6,7 +6,7 @@
*
* This file is part of the 86Box distribution.
*
* 808x BIU emulation.
* Vx0 BIU emulation.
*
* Authors: Andrew Jenner, <https://www.reenigne.org>
* Miran Grca, <mgrca8@gmail.com>
@@ -86,22 +86,22 @@ static int dma_wait_states = 0;
/* DEBUG stuff. */
const char *lpBiuStates[7] = { "Ti ", "Ti S ", "Ti D ", "Ti R ", "Tw ", "T%i PF", "T%i EU" };
#ifdef ENABLE_808X_BIU_LOG
int x808x_biu_do_log = ENABLE_808X_BIU_LOG;
#ifdef ENABLE_VX0_BIU_LOG
int vx0_biu_do_log = ENABLE_VX0_BIU_LOG;
static void
x808x_biu_log(const char *fmt, ...)
vx0_biu_log(const char *fmt, ...)
{
va_list ap;
if (x808x_biu_do_log) {
if (vx0_biu_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
#else
# define x808x_biu_log(fmt, ...)
# define vx0_biu_log(fmt, ...)
#endif
void
@@ -301,7 +301,7 @@ bus_do_io(int io_type)
{
int old_cycles = cycles;
x808x_biu_log("(%02X) bus_do_io(%02X): %04X\n", opcode, io_type, cpu_state.eaaddr);
vx0_biu_log("(%02X) bus_do_io(%02X): %04X\n", opcode, io_type, cpu_state.eaaddr);
if (io_type & BUS_OUT) {
if (io_type & BUS_WIDE)
@@ -388,18 +388,18 @@ biu_print_cycle(void)
if ((CS == DEBUG_SEG) && (cpu_state.pc >= DEBUG_OFF_L) && (cpu_state.pc <= DEBUG_OFF_H)) {
if (biu_state >= BIU_STATE_PF) {
if (biu_wait) {
x808x_biu_log("[%04X:%04X] [%i, %i] (%i) %s (%i)\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, lpBiuStates[BIU_STATE_WAIT], wait_states);
vx0_biu_log("[%04X:%04X] [%i, %i] (%i) %s (%i)\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, lpBiuStates[BIU_STATE_WAIT], wait_states);
} else {
char temp[16] = { 0 };
sprintf(temp, lpBiuStates[biu_state], biu_cycles + 1);
x808x_biu_log("[%04X:%04X] [%i, %i] (%i) %s\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, temp);
vx0_biu_log("[%04X:%04X] [%i, %i] (%i) %s\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, temp);
}
} else {
x808x_biu_log("[%04X:%04X] [%i, %i] (%i) %s\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, lpBiuStates[biu_state]);
vx0_biu_log("[%04X:%04X] [%i, %i] (%i) %s\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, lpBiuStates[biu_state]);
}
}
}
@@ -456,8 +456,8 @@ static void
biu_cycle_idle(int type)
{
if ((CS == DEBUG_SEG) && (cpu_state.pc >= DEBUG_OFF_L) && (cpu_state.pc <= DEBUG_OFF_H)) {
x808x_biu_log("[%04X:%04X] [%i, %i] (%i) %s\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, lpBiuStates[type]);
vx0_biu_log("[%04X:%04X] [%i, %i] (%i) %s\n", CS, cpu_state.pc, dma_state, dma_wait_states,
pfq_pos, lpBiuStates[type]);
}
run_dma_cycle();
@@ -493,7 +493,7 @@ do_bus_access(void)
{
int io_type = (biu_state == BIU_STATE_EU) ? bus_request_type : BUS_CODE;
x808x_biu_log("[%04X:%04X] %02X bus access %02X\n", CS, cpu_state.pc, opcode, io_type);
vx0_biu_log("[%04X:%04X] %02X bus access %02X\n", CS, cpu_state.pc, opcode, io_type);
if (io_type != 0) {
wait_states = 0;
@@ -707,7 +707,7 @@ biu_eu_request(void)
void
wait_vx0(int c)
{
x808x_biu_log("[%04X:%04X] %02X %i cycles\n", CS, cpu_state.pc, opcode, c);
vx0_biu_log("[%04X:%04X] %02X %i cycles\n", CS, cpu_state.pc, opcode, c);
for (uint8_t i = 0; i < c; i++)
biu_cycle();