mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-12-26 00:31:44 +00:00
Streamline CPU tracing codepaths and remove some deadc0de
This commit is contained in:
parent
1de71d1ff4
commit
51d2efba03
@ -47,10 +47,6 @@
|
|||||||
bl CALL(cpu65_trace_prologue);
|
bl CALL(cpu65_trace_prologue);
|
||||||
# define TRACE_ARG \
|
# define TRACE_ARG \
|
||||||
bl CALL(cpu65_trace_arg);
|
bl CALL(cpu65_trace_arg);
|
||||||
# define TRACE_ARG1 \
|
|
||||||
bl CALL(cpu65_trace_arg1);
|
|
||||||
# define TRACE_ARG2 \
|
|
||||||
bl CALL(cpu65_trace_arg2);
|
|
||||||
# define TRACE_EPILOGUE \
|
# define TRACE_EPILOGUE \
|
||||||
CommonSaveCPUState; \
|
CommonSaveCPUState; \
|
||||||
bl CALL(cpu65_trace_epilogue);
|
bl CALL(cpu65_trace_epilogue);
|
||||||
@ -59,8 +55,6 @@
|
|||||||
#else
|
#else
|
||||||
# define TRACE_PROLOGUE
|
# define TRACE_PROLOGUE
|
||||||
# define TRACE_ARG
|
# define TRACE_ARG
|
||||||
# define TRACE_ARG1
|
|
||||||
# define TRACE_ARG2
|
|
||||||
# define TRACE_EPILOGUE
|
# define TRACE_EPILOGUE
|
||||||
# define TRACE_IRQ
|
# define TRACE_IRQ
|
||||||
#endif
|
#endif
|
||||||
@ -128,12 +122,12 @@
|
|||||||
AddUint16(PC_Reg, #2) \
|
AddUint16(PC_Reg, #2) \
|
||||||
ldr r1, [reg_vmem_r, EffectiveAddr, LSL PTR_SHIFT]; \
|
ldr r1, [reg_vmem_r, EffectiveAddr, LSL PTR_SHIFT]; \
|
||||||
blx r1; \
|
blx r1; \
|
||||||
TRACE_ARG1 \
|
TRACE_ARG \
|
||||||
mov lo_byte, r0; \
|
mov lo_byte, r0; \
|
||||||
IncUint16(EffectiveAddr) \
|
IncUint16(EffectiveAddr) \
|
||||||
ldr r1, [reg_vmem_r, EffectiveAddr, LSL PTR_SHIFT]; \
|
ldr r1, [reg_vmem_r, EffectiveAddr, LSL PTR_SHIFT]; \
|
||||||
blx r1; \
|
blx r1; \
|
||||||
TRACE_ARG2; \
|
TRACE_ARG; \
|
||||||
mov hi_byte, hi_byte, LSL #8; \
|
mov hi_byte, hi_byte, LSL #8; \
|
||||||
orr r0, hi_byte, lo_byte;
|
orr r0, hi_byte, lo_byte;
|
||||||
|
|
||||||
@ -2408,14 +2402,6 @@ continue:
|
|||||||
add r1, r1, cycles_exe
|
add r1, r1, cycles_exe
|
||||||
str r1, [reg_args, #CPU65_CYCLE_COUNT]
|
str r1, [reg_args, #CPU65_CYCLE_COUNT]
|
||||||
|
|
||||||
#if CONFORMANT_IRQ_CHECKPOINT
|
|
||||||
# error 2018/01/15 untested ...
|
|
||||||
ldr r1, [reg_args, #CPU_IRQCHECK] // AppleWin : CheckInterruptSources()
|
|
||||||
subs r1, r1, cycles_exe
|
|
||||||
str r1, [reg_args, #CPU_IRQCHECK]
|
|
||||||
bmi irq_checkpoint
|
|
||||||
#endif
|
|
||||||
|
|
||||||
continue1: ldr r1, [reg_args, #CPU65_CYCLES_TO_EXECUTE]
|
continue1: ldr r1, [reg_args, #CPU65_CYCLES_TO_EXECUTE]
|
||||||
subs r1, r1, cycles_exe
|
subs r1, r1, cycles_exe
|
||||||
str r1, [reg_args, #CPU65_CYCLES_TO_EXECUTE]
|
str r1, [reg_args, #CPU65_CYCLES_TO_EXECUTE]
|
||||||
@ -2428,16 +2414,6 @@ continue2: ldrb r0, [reg_args, #CPU65__SIGNAL]
|
|||||||
CPUStatsReset
|
CPUStatsReset
|
||||||
JumpNextInstruction
|
JumpNextInstruction
|
||||||
|
|
||||||
#if CONFORMANT_IRQ_CHECKPOINT
|
|
||||||
# error 2018/01/15 untested ...
|
|
||||||
irq_checkpoint:
|
|
||||||
bl CALL(cpu_irqCheck);
|
|
||||||
//eor r1, r1, r1
|
|
||||||
mov r1, #IRQ_CHECK_CYCLES
|
|
||||||
str r1, [reg_args, #CPU_IRQCHECK]
|
|
||||||
b continue1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------
|
||||||
Exception handlers
|
Exception handlers
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* This file is auto-generated for a specific architecture ABI */
|
/* This file is auto-generated for a specific architecture ABI */
|
||||||
#define CPU_IRQCHECK 0
|
#define UNUSED0 0
|
||||||
#define CPU65_TRACE_PROLOGUE 4
|
#define CPU65_TRACE_PROLOGUE 4
|
||||||
#define CPU65_TRACE_ARG 8
|
#define CPU65_TRACE_ARG 8
|
||||||
#define CPU65_TRACE_ARG1 12
|
#define UNUSED1 12
|
||||||
#define CPU65_TRACE_ARG2 16
|
#define UNUSED2 16
|
||||||
#define CPU65_TRACE_EPILOGUE 20
|
#define CPU65_TRACE_EPILOGUE 20
|
||||||
#define CPU65_TRACE_IRQ 24
|
#define CPU65_TRACE_IRQ 24
|
||||||
#define DEBUG_ILLEGAL_BCD 28
|
#define DEBUG_ILLEGAL_BCD 28
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#define GC_CYCLES_TIMER_1 124
|
#define GC_CYCLES_TIMER_1 124
|
||||||
#define CPU65_CYCLES_TO_EXECUTE 128
|
#define CPU65_CYCLES_TO_EXECUTE 128
|
||||||
#define CPU65_CYCLE_COUNT 132
|
#define CPU65_CYCLE_COUNT 132
|
||||||
#define IRQ_CHECK_TIMEOUT 136
|
#define UNUSED3 136
|
||||||
#define INTERRUPT_VECTOR 140
|
#define INTERRUPT_VECTOR 140
|
||||||
#define RESET_VECTOR 142
|
#define RESET_VECTOR 142
|
||||||
#define CPU65_PC 144
|
#define CPU65_PC 144
|
||||||
|
@ -610,9 +610,6 @@ static void init_flags_conversion_tables(void) {
|
|||||||
static __attribute__((constructor)) void __init_cpu65(void) {
|
static __attribute__((constructor)) void __init_cpu65(void) {
|
||||||
// emulator_registerStartupCallback(CTOR_PRIORITY_LATE, &_init_cpu65); -- 2018/01/15 NOTE : too late for testcpu.c
|
// emulator_registerStartupCallback(CTOR_PRIORITY_LATE, &_init_cpu65); -- 2018/01/15 NOTE : too late for testcpu.c
|
||||||
|
|
||||||
extern void (*cpu_irqCheck)(uint16_t, uint8_t);
|
|
||||||
run_args.cpu_irqCheck = cpu_irqCheck;
|
|
||||||
|
|
||||||
run_args.cpu65_vmem_r = &cpu65_vmem_r[0];
|
run_args.cpu65_vmem_r = &cpu65_vmem_r[0];
|
||||||
run_args.cpu65_vmem_w = &cpu65_vmem_w[0];
|
run_args.cpu65_vmem_w = &cpu65_vmem_w[0];
|
||||||
run_args.cpu65_flags_encode = &cpu65_flags_encode[0];
|
run_args.cpu65_flags_encode = &cpu65_flags_encode[0];
|
||||||
@ -628,10 +625,6 @@ static __attribute__((constructor)) void __init_cpu65(void) {
|
|||||||
run_args.cpu65_trace_prologue = cpu65_trace_prologue;
|
run_args.cpu65_trace_prologue = cpu65_trace_prologue;
|
||||||
extern void (*cpu65_trace_arg)(uint16_t, uint8_t);
|
extern void (*cpu65_trace_arg)(uint16_t, uint8_t);
|
||||||
run_args.cpu65_trace_arg = cpu65_trace_arg;
|
run_args.cpu65_trace_arg = cpu65_trace_arg;
|
||||||
extern void (*cpu65_trace_arg1)(uint16_t, uint8_t);
|
|
||||||
run_args.cpu65_trace_arg1 = cpu65_trace_arg1;
|
|
||||||
extern void (*cpu65_trace_arg2)(uint16_t, uint8_t);
|
|
||||||
run_args.cpu65_trace_arg2 = cpu65_trace_arg2;
|
|
||||||
extern void (*cpu65_trace_epilogue)(uint16_t, uint8_t);
|
extern void (*cpu65_trace_epilogue)(uint16_t, uint8_t);
|
||||||
run_args.cpu65_trace_epilogue = cpu65_trace_epilogue;
|
run_args.cpu65_trace_epilogue = cpu65_trace_epilogue;
|
||||||
extern void (*cpu65_trace_irq)(uint16_t, uint8_t);
|
extern void (*cpu65_trace_irq)(uint16_t, uint8_t);
|
||||||
@ -798,20 +791,6 @@ GLUE_C_WRITE(cpu65_trace_arg)
|
|||||||
opargs[nargs++] = b;
|
opargs[nargs++] = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(cpu65_trace_arg1)
|
|
||||||
{
|
|
||||||
assert(nargs <= 2);
|
|
||||||
opargs[2] = b;
|
|
||||||
++nargs;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLUE_C_WRITE(cpu65_trace_arg2)
|
|
||||||
{
|
|
||||||
assert(nargs <= 2);
|
|
||||||
opargs[1] = b;
|
|
||||||
++nargs;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLUE_C_WRITE(cpu65_trace_epilogue)
|
GLUE_C_WRITE(cpu65_trace_epilogue)
|
||||||
{
|
{
|
||||||
int8_t arg1 = opargs[1];
|
int8_t arg1 = opargs[1];
|
||||||
@ -888,11 +867,11 @@ GLUE_C_WRITE(cpu65_trace_epilogue)
|
|||||||
char fmt[64];
|
char fmt[64];
|
||||||
if (UNLIKELY(run_args.cpu65_opcycles >= 10)) {
|
if (UNLIKELY(run_args.cpu65_opcycles >= 10)) {
|
||||||
// occurs rarely for interrupt + opcode
|
// occurs rarely for interrupt + opcode
|
||||||
snprintf(fmt, 64, "%s", " %s CY:%u irqChk:%d totCyc:%d EA:%04X");
|
snprintf(fmt, 64, "%s", " %s CY:%u totCyc:%d EA:%04X");
|
||||||
} else {
|
} else {
|
||||||
snprintf(fmt, 64, "%s", " %s CYC:%u irqChk:%d totCyc:%d EA:%04X");
|
snprintf(fmt, 64, "%s", " %s CYC:%u totCyc:%d EA:%04X");
|
||||||
}
|
}
|
||||||
fprintf(cpu_trace_fp, fmt, flags_buf, run_args.cpu65_opcycles, (run_args.irq_check_timeout - run_args.cpu65_opcycles), (cycles_count_total + run_args.cpu65_opcycles), run_args.cpu65_ea);
|
fprintf(cpu_trace_fp, fmt, flags_buf, run_args.cpu65_opcycles, (cycles_count_total + run_args.cpu65_opcycles), run_args.cpu65_ea);
|
||||||
|
|
||||||
sprintf(fmt, " %s %s", opcodes_65c02[run_args.cpu65_opcode].mnemonic, disasm_templates[opcodes_65c02[run_args.cpu65_opcode].mode]);
|
sprintf(fmt, " %s %s", opcodes_65c02[run_args.cpu65_opcode].mnemonic, disasm_templates[opcodes_65c02[run_args.cpu65_opcode].mode]);
|
||||||
|
|
||||||
|
@ -62,8 +62,6 @@ void cpu65_trace_checkpoint(void);
|
|||||||
|
|
||||||
#endif /* !__ASSEMBLER__ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#define IRQ_CHECK_CYCLES 128
|
|
||||||
|
|
||||||
#define ResetSig 0x02
|
#define ResetSig 0x02
|
||||||
#define IRQ6522 0x08
|
#define IRQ6522 0x08
|
||||||
#define IRQSpeech 0x10
|
#define IRQSpeech 0x10
|
||||||
|
@ -19,12 +19,12 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
printf("/* This file is auto-generated for a specific architecture ABI */\n");
|
printf("/* This file is auto-generated for a specific architecture ABI */\n");
|
||||||
|
|
||||||
OUTPUT_CPU_IRQCHECK();
|
OUTPUT_UNUSED0();
|
||||||
|
|
||||||
OUTPUT_CPU65_TRACE_PROLOGUE();
|
OUTPUT_CPU65_TRACE_PROLOGUE();
|
||||||
OUTPUT_CPU65_TRACE_ARG();
|
OUTPUT_CPU65_TRACE_ARG();
|
||||||
OUTPUT_CPU65_TRACE_ARG1();
|
OUTPUT_UNUSED1();
|
||||||
OUTPUT_CPU65_TRACE_ARG2();
|
OUTPUT_UNUSED2();
|
||||||
OUTPUT_CPU65_TRACE_EPILOGUE();
|
OUTPUT_CPU65_TRACE_EPILOGUE();
|
||||||
OUTPUT_CPU65_TRACE_IRQ();
|
OUTPUT_CPU65_TRACE_IRQ();
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
OUTPUT_CPU65_CYCLES_TO_EXECUTE();
|
OUTPUT_CPU65_CYCLES_TO_EXECUTE();
|
||||||
OUTPUT_CPU65_CYCLE_COUNT();
|
OUTPUT_CPU65_CYCLE_COUNT();
|
||||||
OUTPUT_IRQ_CHECK_TIMEOUT();
|
OUTPUT_UNUSED3();
|
||||||
|
|
||||||
OUTPUT_INTERRUPT_VECTOR();
|
OUTPUT_INTERRUPT_VECTOR();
|
||||||
OUTPUT_RESET_VECTOR();
|
OUTPUT_RESET_VECTOR();
|
||||||
|
19
src/glue.h
19
src/glue.h
@ -76,19 +76,21 @@
|
|||||||
// Stack struct assembly bridge (avoiding all PIC nastiness)
|
// Stack struct assembly bridge (avoiding all PIC nastiness)
|
||||||
typedef struct cpu65_run_args_s {
|
typedef struct cpu65_run_args_s {
|
||||||
|
|
||||||
void (*cpu_irqCheck)(uint16_t, uint8_t);
|
void (*unused0)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU_IRQCHECK() printf("#define CPU_IRQCHECK %ld\n", offsetof(cpu65_run_args_s, cpu_irqCheck))
|
#define OUTPUT_UNUSED0() printf("#define UNUSED0 %ld\n", offsetof(cpu65_run_args_s, unused0))
|
||||||
|
|
||||||
void (*cpu65_trace_prologue)(uint16_t, uint8_t);
|
void (*cpu65_trace_prologue)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU65_TRACE_PROLOGUE() printf("#define CPU65_TRACE_PROLOGUE %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_prologue))
|
#define OUTPUT_CPU65_TRACE_PROLOGUE() printf("#define CPU65_TRACE_PROLOGUE %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_prologue))
|
||||||
void (*cpu65_trace_arg)(uint16_t, uint8_t);
|
void (*cpu65_trace_arg)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU65_TRACE_ARG() printf("#define CPU65_TRACE_ARG %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_arg))
|
#define OUTPUT_CPU65_TRACE_ARG() printf("#define CPU65_TRACE_ARG %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_arg))
|
||||||
void (*cpu65_trace_arg1)(uint16_t, uint8_t);
|
void (*unused1)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU65_TRACE_ARG1() printf("#define CPU65_TRACE_ARG1 %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_arg1))
|
#define OUTPUT_UNUSED1() printf("#define UNUSED1 %ld\n", offsetof(cpu65_run_args_s, unused1))
|
||||||
void (*cpu65_trace_arg2)(uint16_t, uint8_t);
|
void (*unused2)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU65_TRACE_ARG2() printf("#define CPU65_TRACE_ARG2 %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_arg2))
|
#define OUTPUT_UNUSED2() printf("#define UNUSED2 %ld\n", offsetof(cpu65_run_args_s, unused2))
|
||||||
|
|
||||||
void (*cpu65_trace_epilogue)(uint16_t, uint8_t);
|
void (*cpu65_trace_epilogue)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU65_TRACE_EPILOGUE() printf("#define CPU65_TRACE_EPILOGUE %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_epilogue))
|
#define OUTPUT_CPU65_TRACE_EPILOGUE() printf("#define CPU65_TRACE_EPILOGUE %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_epilogue))
|
||||||
|
|
||||||
void (*cpu65_trace_irq)(uint16_t, uint8_t);
|
void (*cpu65_trace_irq)(uint16_t, uint8_t);
|
||||||
#define OUTPUT_CPU65_TRACE_IRQ() printf("#define CPU65_TRACE_IRQ %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_irq))
|
#define OUTPUT_CPU65_TRACE_IRQ() printf("#define CPU65_TRACE_IRQ %ld\n", offsetof(cpu65_run_args_s, cpu65_trace_irq))
|
||||||
|
|
||||||
@ -153,8 +155,9 @@ typedef struct cpu65_run_args_s {
|
|||||||
#define OUTPUT_CPU65_CYCLES_TO_EXECUTE() printf("#define CPU65_CYCLES_TO_EXECUTE %ld\n", offsetof(cpu65_run_args_s, cpu65_cycles_to_execute))
|
#define OUTPUT_CPU65_CYCLES_TO_EXECUTE() printf("#define CPU65_CYCLES_TO_EXECUTE %ld\n", offsetof(cpu65_run_args_s, cpu65_cycles_to_execute))
|
||||||
int32_t cpu65_cycle_count; // cycles currently excuted by cpu65_run()
|
int32_t cpu65_cycle_count; // cycles currently excuted by cpu65_run()
|
||||||
#define OUTPUT_CPU65_CYCLE_COUNT() printf("#define CPU65_CYCLE_COUNT %ld\n", offsetof(cpu65_run_args_s, cpu65_cycle_count))
|
#define OUTPUT_CPU65_CYCLE_COUNT() printf("#define CPU65_CYCLE_COUNT %ld\n", offsetof(cpu65_run_args_s, cpu65_cycle_count))
|
||||||
int32_t irq_check_timeout; // cycles to check for raised IRQ
|
|
||||||
#define OUTPUT_IRQ_CHECK_TIMEOUT() printf("#define IRQ_CHECK_TIMEOUT %ld\n", offsetof(cpu65_run_args_s, irq_check_timeout))
|
int32_t unused3;
|
||||||
|
#define OUTPUT_UNUSED3() printf("#define UNUSED3 %ld\n", offsetof(cpu65_run_args_s, unused3))
|
||||||
|
|
||||||
uint16_t interrupt_vector;
|
uint16_t interrupt_vector;
|
||||||
#define OUTPUT_INTERRUPT_VECTOR() printf("#define INTERRUPT_VECTOR %ld\n", offsetof(cpu65_run_args_s, interrupt_vector))
|
#define OUTPUT_INTERRUPT_VECTOR() printf("#define INTERRUPT_VECTOR %ld\n", offsetof(cpu65_run_args_s, interrupt_vector))
|
||||||
|
@ -51,7 +51,6 @@ static void testcpu_setup(void *arg) {
|
|||||||
cpu65_uninterrupt(0xff);
|
cpu65_uninterrupt(0xff);
|
||||||
run_args.cpu65_cycle_count = 0;
|
run_args.cpu65_cycle_count = 0;
|
||||||
run_args.cpu65_cycles_to_execute = 1;
|
run_args.cpu65_cycles_to_execute = 1;
|
||||||
run_args.irq_check_timeout = 255;
|
|
||||||
|
|
||||||
run_args.cpu65_pc = TEST_LOC;
|
run_args.cpu65_pc = TEST_LOC;
|
||||||
run_args.cpu65_a = 0x0;
|
run_args.cpu65_a = 0x0;
|
||||||
|
@ -145,7 +145,6 @@ void reinitialize(void) {
|
|||||||
|
|
||||||
cycles_count_total = 0;
|
cycles_count_total = 0;
|
||||||
g_dwCyclesThisFrame = 0;
|
g_dwCyclesThisFrame = 0;
|
||||||
run_args.irq_check_timeout = IRQ_CHECK_CYCLES;
|
|
||||||
#if TESTING
|
#if TESTING
|
||||||
extern unsigned long (*testing_getCyclesCount)(void);
|
extern unsigned long (*testing_getCyclesCount)(void);
|
||||||
if (testing_getCyclesCount) {
|
if (testing_getCyclesCount) {
|
||||||
|
6
src/vm.c
6
src/vm.c
@ -913,12 +913,6 @@ GLUE_C_READ(debug_illegal_bcd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(cpu_irqCheck)
|
|
||||||
{
|
|
||||||
MB_UpdateCycles();
|
|
||||||
// TODO : other peripheral card interrupt handling
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static void _initialize_iie_switches(void) {
|
static void _initialize_iie_switches(void) {
|
||||||
|
@ -35,10 +35,6 @@
|
|||||||
callLQ *CPU65_TRACE_PROLOGUE(reg_args);
|
callLQ *CPU65_TRACE_PROLOGUE(reg_args);
|
||||||
# define TRACE_ARG \
|
# define TRACE_ARG \
|
||||||
callLQ *CPU65_TRACE_ARG(reg_args);
|
callLQ *CPU65_TRACE_ARG(reg_args);
|
||||||
# define TRACE_ARG1 \
|
|
||||||
callLQ *CPU65_TRACE_ARG1(reg_args);
|
|
||||||
# define TRACE_ARG2 \
|
|
||||||
callLQ *CPU65_TRACE_ARG2(reg_args);
|
|
||||||
# define TRACE_EPILOGUE \
|
# define TRACE_EPILOGUE \
|
||||||
pushLQ _XAX; \
|
pushLQ _XAX; \
|
||||||
CommonSaveCPUState; \
|
CommonSaveCPUState; \
|
||||||
@ -49,8 +45,6 @@
|
|||||||
#else
|
#else
|
||||||
# define TRACE_PROLOGUE
|
# define TRACE_PROLOGUE
|
||||||
# define TRACE_ARG
|
# define TRACE_ARG
|
||||||
# define TRACE_ARG1
|
|
||||||
# define TRACE_ARG2
|
|
||||||
# define TRACE_EPILOGUE
|
# define TRACE_EPILOGUE
|
||||||
# define TRACE_IRQ
|
# define TRACE_IRQ
|
||||||
#endif
|
#endif
|
||||||
@ -67,14 +61,14 @@
|
|||||||
|
|
||||||
#define GetFromPC_W \
|
#define GetFromPC_W \
|
||||||
movLQ PC_Reg_X, EffectiveAddr_X; \
|
movLQ PC_Reg_X, EffectiveAddr_X; \
|
||||||
incw EffectiveAddr; \
|
|
||||||
addw $2, PC_Reg; \
|
addw $2, PC_Reg; \
|
||||||
CALL_IND(CPU65_VMEM_R,EffectiveAddr_X); \
|
CALL_IND(CPU65_VMEM_R,EffectiveAddr_X); \
|
||||||
decw EffectiveAddr; \
|
TRACE_ARG; \
|
||||||
TRACE_ARG2; \
|
|
||||||
movb %al, %ah; \
|
movb %al, %ah; \
|
||||||
|
incw EffectiveAddr; \
|
||||||
CALL_IND(CPU65_VMEM_R,EffectiveAddr_X); \
|
CALL_IND(CPU65_VMEM_R,EffectiveAddr_X); \
|
||||||
TRACE_ARG1;
|
TRACE_ARG; \
|
||||||
|
xchgb %al, %ah;
|
||||||
|
|
||||||
#define CPUStatsReset \
|
#define CPUStatsReset \
|
||||||
movb $0, CPU65_OPCYCLES(reg_args); \
|
movb $0, CPU65_OPCYCLES(reg_args); \
|
||||||
@ -2108,36 +2102,19 @@ continue:
|
|||||||
addb CPU65_OPCYCLES(reg_args), %al
|
addb CPU65_OPCYCLES(reg_args), %al
|
||||||
movb %al, CPU65_OPCYCLES(reg_args)
|
movb %al, CPU65_OPCYCLES(reg_args)
|
||||||
TRACE_EPILOGUE
|
TRACE_EPILOGUE
|
||||||
|
|
||||||
addl %eax, CPU65_CYCLE_COUNT(reg_args)
|
addl %eax, CPU65_CYCLE_COUNT(reg_args)
|
||||||
subl %eax, GC_CYCLES_TIMER_0(reg_args)
|
subl %eax, GC_CYCLES_TIMER_0(reg_args)
|
||||||
subl %eax, GC_CYCLES_TIMER_1(reg_args)
|
subl %eax, GC_CYCLES_TIMER_1(reg_args)
|
||||||
#if CONFORMANT_IRQ_CHECKPOINT
|
|
||||||
# error 2018/01/15 untested ...
|
|
||||||
subl %eax, IRQ_CHECK_TIMEOUT(reg_args)
|
|
||||||
jl irq_checkpoint // AppleWin : CheckInterruptSources()
|
|
||||||
#endif
|
|
||||||
continue1: subl %eax, CPU65_CYCLES_TO_EXECUTE(reg_args)
|
continue1: subl %eax, CPU65_CYCLES_TO_EXECUTE(reg_args)
|
||||||
jle exit_cpu65_run
|
jle exit_cpu65_run
|
||||||
|
|
||||||
continue2: xorLQ _XAX, _XAX
|
continue2: xorLQ _XAX, _XAX
|
||||||
orb CPU65__SIGNAL(reg_args), %al
|
orb CPU65__SIGNAL(reg_args), %al
|
||||||
jnz exception
|
jnz exception
|
||||||
CPUStatsReset
|
CPUStatsReset
|
||||||
JumpNextInstruction
|
JumpNextInstruction
|
||||||
|
|
||||||
#if CONFORMANT_IRQ_CHECKPOINT
|
|
||||||
# error 2018/01/15 untested ...
|
|
||||||
irq_checkpoint:
|
|
||||||
#if __PIC__ && __i386__
|
|
||||||
pushl %ebx
|
|
||||||
#endif
|
|
||||||
callLQ *CPU_IRQCHECK(reg_args)
|
|
||||||
#if __PIC__ && __i386__
|
|
||||||
popl %ebx
|
|
||||||
#endif
|
|
||||||
movl $IRQ_CHECK_CYCLES, IRQ_CHECK_TIMEOUT(reg_args)
|
|
||||||
jmp continue1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------
|
/* -------------------------------------------------------------------------
|
||||||
Exception handlers
|
Exception handlers
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* This file is auto-generated for a specific architecture ABI */
|
/* This file is auto-generated for a specific architecture ABI */
|
||||||
#define CPU_IRQCHECK 0
|
#define UNUSED0 0
|
||||||
#define CPU65_TRACE_PROLOGUE 4
|
#define CPU65_TRACE_PROLOGUE 4
|
||||||
#define CPU65_TRACE_ARG 8
|
#define CPU65_TRACE_ARG 8
|
||||||
#define CPU65_TRACE_ARG1 12
|
#define UNUSED1 12
|
||||||
#define CPU65_TRACE_ARG2 16
|
#define UNUSED2 16
|
||||||
#define CPU65_TRACE_EPILOGUE 20
|
#define CPU65_TRACE_EPILOGUE 20
|
||||||
#define CPU65_TRACE_IRQ 24
|
#define CPU65_TRACE_IRQ 24
|
||||||
#define DEBUG_ILLEGAL_BCD 28
|
#define DEBUG_ILLEGAL_BCD 28
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#define GC_CYCLES_TIMER_1 124
|
#define GC_CYCLES_TIMER_1 124
|
||||||
#define CPU65_CYCLES_TO_EXECUTE 128
|
#define CPU65_CYCLES_TO_EXECUTE 128
|
||||||
#define CPU65_CYCLE_COUNT 132
|
#define CPU65_CYCLE_COUNT 132
|
||||||
#define IRQ_CHECK_TIMEOUT 136
|
#define UNUSED3 136
|
||||||
#define INTERRUPT_VECTOR 140
|
#define INTERRUPT_VECTOR 140
|
||||||
#define RESET_VECTOR 142
|
#define RESET_VECTOR 142
|
||||||
#define CPU65_PC 144
|
#define CPU65_PC 144
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* This file is auto-generated for a specific architecture ABI */
|
/* This file is auto-generated for a specific architecture ABI */
|
||||||
#define CPU_IRQCHECK 0
|
#define UNUSED0 0
|
||||||
#define CPU65_TRACE_PROLOGUE 8
|
#define CPU65_TRACE_PROLOGUE 8
|
||||||
#define CPU65_TRACE_ARG 16
|
#define CPU65_TRACE_ARG 16
|
||||||
#define CPU65_TRACE_ARG1 24
|
#define UNUSED1 24
|
||||||
#define CPU65_TRACE_ARG2 32
|
#define UNUSED2 32
|
||||||
#define CPU65_TRACE_EPILOGUE 40
|
#define CPU65_TRACE_EPILOGUE 40
|
||||||
#define CPU65_TRACE_IRQ 48
|
#define CPU65_TRACE_IRQ 48
|
||||||
#define DEBUG_ILLEGAL_BCD 56
|
#define DEBUG_ILLEGAL_BCD 56
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#define GC_CYCLES_TIMER_1 240
|
#define GC_CYCLES_TIMER_1 240
|
||||||
#define CPU65_CYCLES_TO_EXECUTE 244
|
#define CPU65_CYCLES_TO_EXECUTE 244
|
||||||
#define CPU65_CYCLE_COUNT 248
|
#define CPU65_CYCLE_COUNT 248
|
||||||
#define IRQ_CHECK_TIMEOUT 252
|
#define UNUSED3 252
|
||||||
#define INTERRUPT_VECTOR 256
|
#define INTERRUPT_VECTOR 256
|
||||||
#define RESET_VECTOR 258
|
#define RESET_VECTOR 258
|
||||||
#define CPU65_PC 260
|
#define CPU65_PC 260
|
||||||
|
Loading…
Reference in New Issue
Block a user