on reset turn floppy off; MAINboard resets all boards; fix #47

This commit is contained in:
Brad Grantham 2020-12-14 19:48:17 -08:00
parent 13ece22f09
commit 65d8f90cf7
2 changed files with 32 additions and 21 deletions

View File

@ -1,20 +1,20 @@
400 GR : REM SET COLOR GRAPHICS AREA
420 HOME : REM CLEAR TEXT AREA
440 X = 0: REM SET STARTING POSITION OF BACK-AND-FORTH VARIABLE
460 Y = 5: REM SET STARTING POSITION OF UP-AND-DOWN VARIABLE
480 XV = 2: REM SET X VELOCITY
500 YV = 1: REM SET Y VELOCITY
520 REM CALCULATE NEW POSITION
540 NX = X + XV:NY = Y + YV
560 REM IF BALL EXCEEDS SCREEN EDGE, THEN BOUNCE
580 IF NX > 39 THEN NX = 39:XV = - XV
600 IF NX < 0 THEN NX = 0:XV = - XV
620 IF NY > 39 THEN NY = 39:YV = - YV
640 IF NY < 0 THEN NY = 0:YV = - YV
660 REM PLOT NEW POSITION
680 COLOR= 7: PLOT NX,NY
700 REM ERASE OLD POSITION
720 COLOR= 0: PLOT X,Y
740 REM SAVE CURRENT POSITION
760 X = NX:Y = NY
780 GOTO 540
400 GR : REM SET COLOR GRAPHICS AREA
420 HOME : REM CLEAR TEXT AREA
440 X = 0: REM SET STARTING POSITION OF BACK-AND-FORTH VARIABLE
460 Y = 5: REM SET STARTING POSITION OF UP-AND-DOWN VARIABLE
480 XV = 2: REM SET X VELOCITY
500 YV = 1: REM SET Y VELOCITY
520 REM CALCULATE NEW POSITION
540 NX = X + XV:NY = Y + YV
560 REM IF BALL EXCEEDS SCREEN EDGE, THEN BOUNCE
580 IF NX > 39 THEN NX = 39:XV = - XV
600 IF NX < 0 THEN NX = 0:XV = - XV
620 IF NY > 39 THEN NY = 39:YV = - YV
640 IF NY < 0 THEN NY = 0:YV = - YV
660 REM PLOT NEW POSITION
680 COLOR= 7: PLOT NX,NY
700 REM ERASE OLD POSITION
720 COLOR= 0: PLOT X,Y
740 REM SAVE CURRENT POSITION
760 X = NX:Y = NY
780 GOTO 540

View File

@ -660,7 +660,15 @@ struct DISKIIboard : board_base
data = 0;
return true;
}
virtual void reset(void) {}
virtual void reset(void)
{
driveMotorEnabled[0] = false; // Is this safe?
driveMotorEnabled[1] = false; // Is this safe?
driveSelected = 0;
trackBytesOutOfDate = true;
floppy_activity(0, false);
floppy_activity(1, false);
}
};
struct Mockingboard : board_base
@ -1074,6 +1082,9 @@ struct MAINboard : board_base
C08X_write_RAM = true;
internal_C800_ROM_selected = true;
repage_regions("reset");
for(auto b : boards) {
b->reset();
}
}
bool read(int addr, unsigned char &data)