mirror of
https://github.com/pevans/erc-c.git
synced 2025-02-25 14:29:13 +00:00
Lock disk drives during disassembly
This commit is contained in:
parent
33b44d1a70
commit
418688cd15
@ -332,7 +332,12 @@ apple2_run_loop(apple2 *mach)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (vm_screen_active(mach->screen)) {
|
while (vm_screen_active(mach->screen)) {
|
||||||
//mos6502_dis_opcode(mach->cpu, stdout, mach->cpu->PC);
|
mach->drive1->locked = true;
|
||||||
|
mach->drive2->locked = true;
|
||||||
|
mos6502_dis_opcode(mach->cpu, stdout, mach->cpu->PC);
|
||||||
|
mach->drive1->locked = false;
|
||||||
|
mach->drive2->locked = false;
|
||||||
|
|
||||||
mos6502_execute(mach->cpu);
|
mos6502_execute(mach->cpu);
|
||||||
|
|
||||||
if (vm_screen_dirty(mach->screen)) {
|
if (vm_screen_dirty(mach->screen)) {
|
||||||
|
@ -26,6 +26,7 @@ apple2_dd_create()
|
|||||||
// ProDOS disk will have 140k, but a NIB file would have more.
|
// ProDOS disk will have 140k, but a NIB file would have more.
|
||||||
drive->data = NULL;
|
drive->data = NULL;
|
||||||
|
|
||||||
|
drive->locked = false;
|
||||||
drive->track_pos = 0;
|
drive->track_pos = 0;
|
||||||
drive->sector_pos = 0;
|
drive->sector_pos = 0;
|
||||||
drive->online = false;
|
drive->online = false;
|
||||||
@ -216,6 +217,12 @@ apple2_dd_set_mode(apple2dd *drive, int mode)
|
|||||||
void
|
void
|
||||||
apple2_dd_shift(apple2dd *drive, int pos)
|
apple2_dd_shift(apple2dd *drive, int pos)
|
||||||
{
|
{
|
||||||
|
// When locked is true, we shouldn't shift our position by any
|
||||||
|
// number.
|
||||||
|
if (drive->locked) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
drive->sector_pos += pos;
|
drive->sector_pos += pos;
|
||||||
|
|
||||||
while (drive->sector_pos > MAX_SECTOR_POS) {
|
while (drive->sector_pos > MAX_SECTOR_POS) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user