Skip to content

Commit

Permalink
fix crash when (re-)booting a floppy with speed >1x
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Nov 11, 2018
1 parent 448f3ec commit a100fce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
set(CMAKE_VERBOSE_MAKEFILE OFF)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 74)
set(VERSION_MINOR 75)

if(BUILD_PSP2)
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
Expand Down
12 changes: 6 additions & 6 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
Changes in this Version
======
1.74 (Switch only)
1.75 (WIP)

- Allow remapping of ZR/ZL on Switch
- Map ZR/ZL to "slow-down mouse" on Switch if custom controls are off
- Add option to misc menu to choose either A or B as OK button on Switch
- Add sharp-bilinear-simple scaling routine, and make it the new default
- Add point filtering scaling routine
- fix crash when booting a floppy with floppy speed >1x

Description
=====
Expand Down Expand Up @@ -203,6 +199,10 @@ Mouse + keyboard tested working with the "Jelly Comb Mini Bluetooth Keyboard Wit

CHANGELOG
=====
1.75 (WIP)

- fix crash when booting a floppy with floppy speed >1x

1.74 (Switch only)

- Allow remapping of ZR/ZL on Switch
Expand Down
11 changes: 10 additions & 1 deletion src/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ static uae_u8 selected = 15, disabled=0;

static uae_u8 writebuffer[544 * 22 * DDHDMULT];

// delay increasing floppy speed for a little bit to prevent problems during boot
static int newly_inserted_countdown = 100;

typedef enum { TRACK_AMIGADOS, TRACK_RAW, TRACK_RAW1, TRACK_PCDOS } image_tracktype;
typedef struct {
uae_u32 offs;
Expand Down Expand Up @@ -380,6 +383,7 @@ static int drive_insert (drive *drv, int dnum, const char *fname)
}
drive_settype_id (drv); /* Set DD or HD drive */
drv->buffered_side = 2; /* will force read */
newly_inserted_countdown = 100; // fix problems when booting with speed >1x
drive_fill_bigbuf (drv);
return 1;
}
Expand Down Expand Up @@ -653,7 +657,12 @@ static void drive_fill_bigbuf (drive * drv)
}
drv->buffered_side = side;
drv->buffered_cyl = drv->cyl;
drv->trackspeed = get_floppy_speed() * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN);
if (newly_inserted_countdown) {
drv->trackspeed = NORMAL_FLOPPY_SPEED * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN);
newly_inserted_countdown--;
} else {
drv->trackspeed = get_floppy_speed() * drv->tracklen / (2 * 8 * FLOPPY_WRITE_LEN);
}
}

/* Update ADF_EXT2 track header */
Expand Down

0 comments on commit a100fce

Please sign in to comment.