mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-11 14:30:08 +00:00
Enable abusive CPU_TRACING test
This commit is contained in:
parent
c7c888d218
commit
9144b48885
@ -99,12 +99,10 @@ TEST test_boot_disk_bytes() {
|
||||
PASS();
|
||||
}
|
||||
|
||||
#if 0
|
||||
#error this is not a stable test ... we don't know exactly where the CPU will be at when we begin
|
||||
// This test is fairly abusive ... it creates an ~88MB file in $HOME
|
||||
// ... but if it's correct, you're fairly assured the cpu/vm is working =)
|
||||
#define EXPECTED_CPU_TRACE_FILE_SIZE 87611579
|
||||
#define EXPECTED_CPU_TRACE_SHA "8DE74ED640E0CE4AB1AAC40E95BE9B8507A37434"
|
||||
#define EXPECTED_CPU_TRACE_FILE_SIZE 86057107
|
||||
#define EXPECTED_CPU_TRACE_SHA "525098EDD23E4602791D0167DAE0FB65ACE33ABD"
|
||||
TEST test_boot_disk_cputrace() {
|
||||
char *homedir = getenv("HOME");
|
||||
char *output = NULL;
|
||||
@ -141,7 +139,6 @@ TEST test_boot_disk_cputrace() {
|
||||
|
||||
PASS();
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST test_boot_disk() {
|
||||
BOOT_TO_DOS();
|
||||
@ -3352,9 +3349,7 @@ GREATEST_SUITE(test_suite_vm) {
|
||||
// TESTS --------------------------
|
||||
|
||||
RUN_TESTp(test_boot_disk_bytes);
|
||||
|
||||
//RUN_TESTp(test_boot_disk_cputrace);
|
||||
|
||||
RUN_TESTp(test_boot_disk_cputrace);
|
||||
RUN_TESTp(test_boot_disk);
|
||||
|
||||
RUN_TESTp(test_inithello_dsk);
|
||||
|
@ -24,6 +24,18 @@
|
||||
#define DebugCurrOpcode SN(cpu65_opcode)
|
||||
#define DebugCycleCount SN(cpu65_opcycles)
|
||||
|
||||
#define CommonSaveCPUState() \
|
||||
movw EffectiveAddr, DebugCurrEA; \
|
||||
movb A_Reg, SN(cpu65_a); \
|
||||
xorw %ax, %ax; \
|
||||
movb F_Reg, %al; \
|
||||
SNX_PROLOGUE(cpu65_flags_encode); \
|
||||
movb SNX(cpu65_flags_encode,_XAX,1), %al; \
|
||||
movb %al, SN(cpu65_f); \
|
||||
movb X_Reg, SN(cpu65_x); \
|
||||
movb Y_Reg, SN(cpu65_y); \
|
||||
movb SP_Reg_L, SN(cpu65_sp)
|
||||
|
||||
#if CPU_TRACING
|
||||
# define TRACE_PROLOGUE \
|
||||
movw PC_Reg, SN(cpu65_pc); \
|
||||
@ -35,7 +47,9 @@
|
||||
# define TRACE_ARG2 \
|
||||
callLQ CALL(cpu65_trace_arg2);
|
||||
# define TRACE_EPILOGUE \
|
||||
movw EffectiveAddr, DebugCurrEA; \
|
||||
pushLQ _XAX; \
|
||||
CommonSaveCPUState(); \
|
||||
popLQ _XAX; \
|
||||
callLQ CALL(cpu65_trace_epilogue);
|
||||
#else
|
||||
# define TRACE_PROLOGUE
|
||||
@ -2238,17 +2252,8 @@ E(cpu65_run)
|
||||
|
||||
exit_cpu65_run:
|
||||
// Save CPU state when returning from being called from C
|
||||
movw EffectiveAddr, DebugCurrEA
|
||||
movw PC_Reg, SN(cpu65_pc)
|
||||
movb A_Reg, SN(cpu65_a)
|
||||
xorw %ax, %ax
|
||||
movb F_Reg, %al
|
||||
SNX_PROLOGUE(cpu65_flags_encode)
|
||||
movb SNX(cpu65_flags_encode,_XAX,1), %al
|
||||
movb %al, SN(cpu65_f)
|
||||
movb X_Reg, SN(cpu65_x)
|
||||
movb Y_Reg, SN(cpu65_y)
|
||||
movb SP_Reg_L, SN(cpu65_sp)
|
||||
CommonSaveCPUState()
|
||||
jmp exit_frame
|
||||
|
||||
emul_reinit: movb $0, SN(cpu65__signal)
|
||||
|
Loading…
x
Reference in New Issue
Block a user