comparison blastem.c @ 872:7022ba865cfd

Initial work for allowing loading a ROM from menu
author Michael Pavone <pavone@retrodev.com>
date Sun, 08 Nov 2015 15:51:57 -0800
parents 4e394d9a7548
children b6842dfb8edf
comparison
equal deleted inserted replaced
871:f364f4f22f8f 872:7022ba865cfd
169 printf("int cycle changed to: %d, level: %d @ %d(%d), frame: %d, vcounter: %d, hslot: %d, mask: %d, hint_counter: %d\n", context->int_cycle, context->int_num, v_context->cycles, context->current_cycle, v_context->frame, v_context->vcounter, v_context->hslot, context->status & 0x7, v_context->hint_counter); 169 printf("int cycle changed to: %d, level: %d @ %d(%d), frame: %d, vcounter: %d, hslot: %d, mask: %d, hint_counter: %d\n", context->int_cycle, context->int_num, v_context->cycles, context->current_cycle, v_context->frame, v_context->vcounter, v_context->hslot, context->status & 0x7, v_context->hint_counter);
170 old_int_cycle = context->int_cycle; 170 old_int_cycle = context->int_cycle;
171 }*/ 171 }*/
172 172
173 context->target_cycle = context->int_cycle < context->sync_cycle ? context->int_cycle : context->sync_cycle; 173 context->target_cycle = context->int_cycle < context->sync_cycle ? context->int_cycle : context->sync_cycle;
174 if (context->should_return) {
175 context->target_cycle = context->current_cycle;
176 }
174 /*printf("Cyc: %d, Trgt: %d, Int Cyc: %d, Int: %d, Mask: %X, V: %d, H: %d, HICount: %d, HReg: %d, Line: %d\n", 177 /*printf("Cyc: %d, Trgt: %d, Int Cyc: %d, Int: %d, Mask: %X, V: %d, H: %d, HICount: %d, HReg: %d, Line: %d\n",
175 context->current_cycle, context->target_cycle, context->int_cycle, context->int_num, (context->status & 0x7), 178 context->current_cycle, context->target_cycle, context->int_cycle, context->int_num, (context->status & 0x7),
176 v_context->regs[REG_MODE_2] & 0x20, v_context->regs[REG_MODE_1] & 0x10, v_context->hint_counter, v_context->regs[REG_HINT], v_context->cycles / MCLKS_LINE);*/ 179 v_context->regs[REG_MODE_2] & 0x20, v_context->regs[REG_MODE_1] & 0x10, v_context->hint_counter, v_context->regs[REG_HINT], v_context->cycles / MCLKS_LINE);*/
177 } 180 }
178 181
1014 if (!loaded) { 1017 if (!loaded) {
1015 #ifdef __ANDROID__ 1018 #ifdef __ANDROID__
1016 //Temporary hack until UI is in place 1019 //Temporary hack until UI is in place
1017 if (!(rom_size = load_rom("/mnt/sdcard/rom.bin"))) { 1020 if (!(rom_size = load_rom("/mnt/sdcard/rom.bin"))) {
1018 fatal_error("Failed to open /mnt/sdcard/rom.bin for reading"); 1021 fatal_error("Failed to open /mnt/sdcard/rom.bin for reading");
1019 1022
1020 } 1023 }
1021 romfname = "/mnt/sdcard/rom.bin"; 1024 romfname = "/mnt/sdcard/rom.bin";
1022 loaded = 1; 1025 loaded = 1;
1023 #else 1026 #else
1024 fatal_error("Usage: blastem [OPTIONS] ROMFILE [WIDTH] [HEIGHT]\n"); 1027 fatal_error("Usage: blastem [OPTIONS] ROMFILE [WIDTH] [HEIGHT]\n");