mirror of
https://github.com/bradgrantham/apple2e.git
synced 2024-06-18 06:29:28 +00:00
take bin file name as an argument
This commit is contained in:
parent
ae2748dc0b
commit
c798a2d886
13
test6502.cpp
13
test6502.cpp
|
@ -61,10 +61,18 @@ std::string read_bus_and_disassemble(const BUS &bus, int pc)
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
if(argc < 2) {
|
||||||
|
fprintf(stderr, "usage: %s testfile.bin\n", argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
bus machine;
|
bus machine;
|
||||||
|
|
||||||
FILE *testbin = fopen("6502_functional_test.bin", "rb");
|
FILE *testbin = fopen(argv[1], "rb");
|
||||||
assert(testbin);
|
if(!testbin) {
|
||||||
|
printf("couldn't open \"%s\" for reading\n", argv[1]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
fseek(testbin, 0, SEEK_END);
|
fseek(testbin, 0, SEEK_END);
|
||||||
long length = ftell(testbin);
|
long length = ftell(testbin);
|
||||||
fseek(testbin, 0, SEEK_SET);
|
fseek(testbin, 0, SEEK_SET);
|
||||||
|
@ -87,4 +95,5 @@ int main(int argc, const char **argv)
|
||||||
cpu.cycle();
|
cpu.cycle();
|
||||||
} while(cpu.pc != oldpc);
|
} while(cpu.pc != oldpc);
|
||||||
print_cpu_state(cpu);
|
print_cpu_state(cpu);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user