Fix run on linux
This commit is contained in:
+4
-5
@@ -49,13 +49,15 @@ int main(void) {
|
||||
/* DEBUG */
|
||||
|
||||
//FILE *fp = fopen("/Users/Kili2/Documents/Projekte/6502pc/6502_65C02_functional_tests/6502_functional_test.bin", "rb");
|
||||
FILE *fp = fopen("/Users/Kili2/Documents/Projekte/6502pc/6502_65C02_functional_tests/6502_decimal_test.bin", "rb");
|
||||
//FILE *fp = fopen("/Users/Kili2/Documents/Projekte/6502pc/6502_65C02_functional_tests/6502_decimal_test.bin", "rb");
|
||||
FILE *fp = fopen("/mnt/c/Users/llego/source/repos/6502PC/6502_65C02_functional_tests/6502_functional_test.bin", "rb");
|
||||
//FILE *fp = fopen("/mnt/c/Users/llego/source/repos/6502PC/6502_65C02_functional_tests/6502_decimal_test.bin", "rb");
|
||||
if (!fp) {
|
||||
perror("fopen");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fread(ram, 1, 64 * 1024, fp);
|
||||
fread(ram, 1, RAM_SIZE, fp);
|
||||
if (ferror(fp)) {
|
||||
perror("fread");
|
||||
fclose(fp);
|
||||
@@ -70,7 +72,6 @@ int main(void) {
|
||||
resetCPU(&cpu, rom);
|
||||
|
||||
while (1) {
|
||||
// printf("\tPC: 0x%x\tOP: 0x%x\n", cpu.ProgrammeCounter, ram[cpu.ProgrammeCounter]);
|
||||
uint8_t sleep = runCycle(&cpu, ram, rom);
|
||||
if (sleep == 1) {
|
||||
printf("opcode missing: 0x%X\n", ram[cpu.ProgrammeCounter - 1]);
|
||||
@@ -81,8 +82,6 @@ int main(void) {
|
||||
nanosleep(&sleepTime, NULL);
|
||||
}
|
||||
|
||||
/* CPU WORK */
|
||||
|
||||
destroyRAM(ram);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user