mirror of
https://github.com/bradgrantham/apple2e.git
synced 2024-10-01 22:56:48 +00:00
Allow option to free-run 6502 clock
-fast command-line option and "fast" debugger command enable 6502 to essentially run as fast as possible. In "fast mode", execute approximately 10 seconds worth of instructions before UI update. Since UI update is probably locked to 60Hz max, upper limit will be 600x normal speed But my guess is (on my Macbook Pro 13 Retina 2013) it's running about 70x, so there's enough overhead to limit execution to ~70MHz.
This commit is contained in:
parent
eec4926c50
commit
9554f80a00
19
apple2e.cpp
19
apple2e.cpp
@ -1430,7 +1430,7 @@ struct CPU6502
|
||||
void usage(char *progname)
|
||||
{
|
||||
printf("\n");
|
||||
printf("usage: %s [-debugger] ROM.bin\n", progname);
|
||||
printf("usage: %s [-debugger] [-fast] ROM.bin\n", progname);
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
}
|
||||
@ -1596,6 +1596,10 @@ int main(int argc, char **argv)
|
||||
debugging = true;
|
||||
argv++;
|
||||
argc--;
|
||||
} else if(strcmp(argv[0], "-fast") == 0) {
|
||||
run_fast = true;
|
||||
argv += 1;
|
||||
argc -= 1;
|
||||
} else if(strcmp(argv[0], "-d") == 0) {
|
||||
debug = atoi(argv[1]);
|
||||
argv += 2;
|
||||
@ -1667,6 +1671,7 @@ int main(int argc, char **argv)
|
||||
if(have_key) {
|
||||
if(key == '') {
|
||||
debugging = true;
|
||||
printf("enter debugger\n");
|
||||
clear_strobe();
|
||||
stop_keyboard();
|
||||
continue;
|
||||
@ -1677,11 +1682,16 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
chrono::time_point<chrono::system_clock> then;
|
||||
int inst_per_slice = 255750 * millis_per_slice / 1000 * 2;
|
||||
int inst_per_slice;
|
||||
if(run_fast)
|
||||
inst_per_slice = 2557500;
|
||||
else
|
||||
inst_per_slice = 255750 * millis_per_slice / 1000 * 2;
|
||||
for(int i = 0; i < inst_per_slice; i++) {
|
||||
if(debug & DEBUG_DECODE) {
|
||||
string dis = read_bus_and_disassemble(bus, cpu.pc);
|
||||
if(debug & DEBUG_DECODE)
|
||||
printf("%s\n", dis.c_str());
|
||||
}
|
||||
if(use_fake6502)
|
||||
step6502();
|
||||
else
|
||||
@ -1737,9 +1747,10 @@ int main(int argc, char **argv)
|
||||
cpu.nmi(bus);
|
||||
continue;
|
||||
}
|
||||
if(debug & DEBUG_DECODE) {
|
||||
string dis = read_bus_and_disassemble(bus, cpu.pc);
|
||||
if(debug & DEBUG_DECODE)
|
||||
printf("%s\n", dis.c_str());
|
||||
}
|
||||
|
||||
if(use_fake6502)
|
||||
step6502();
|
||||
|
Loading…
Reference in New Issue
Block a user