From 644d17fc7f1e6ecf0bc40d987e74ea4041854c1b Mon Sep 17 00:00:00 2001 From: TomW Date: Thu, 2 Apr 2015 19:54:47 +0100 Subject: [PATCH] Fixed bug which ejected discs on hard reset. --- src/disc.c | 11 ++++++++--- src/disc.h | 1 + src/pc.c | 17 +++++------------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/disc.c b/src/disc.c index 7ba7038..df5461b 100644 --- a/src/disc.c +++ b/src/disc.c @@ -141,15 +141,20 @@ void disc_set_rate(int rate) } } +void disc_reset() +{ + curdrive = 0; + disc_period = 32; + timer_add(disc_poll, &disc_poll_time, &motoron, NULL); +} + void disc_init() { // pclog("disc_init %p\n", drives); drives[0].poll = drives[1].poll = 0; drives[0].seek = drives[1].seek = 0; drives[0].readsector = drives[1].readsector = 0; - curdrive = 0; - disc_period = 32; - timer_add(disc_poll, &disc_poll_time, &motoron, NULL); + disc_reset(); } int oldtrack[2] = {0, 0}; diff --git a/src/disc.h b/src/disc.h index 3a2efa0..d6bae79 100644 --- a/src/disc.h +++ b/src/disc.h @@ -17,6 +17,7 @@ void disc_load(int drive, char *fn); void disc_new(int drive, char *fn); void disc_close(int drive); void disc_init(); +void disc_reset(); void disc_poll(); void disc_seek(int drive, int track); void disc_readsector(int drive, int sector, int track, int side, int density); diff --git a/src/pc.c b/src/pc.c index a172712..74e04c4 100644 --- a/src/pc.c +++ b/src/pc.c @@ -220,16 +220,16 @@ void initpc() mem_init(); loadbios(); mem_add_bios(); - - disc_load(0, discfns[0]); - disc_load(1, discfns[1]); - + timer_reset(); sound_reset(); fdc_init(); disc_init(); fdi_init(); img_init(); + + disc_load(0, discfns[0]); + disc_load(1, discfns[1]); //loadfont(); loadnvr(); @@ -286,15 +286,8 @@ void resetpchard() sound_reset(); mem_resize(); fdc_init(); - disc_init(); - fdi_init(); - img_init(); + disc_reset(); - disc_close(0); - disc_close(1); - disc_load(0, discfns[0]); - disc_load(1, discfns[1]); - model_init(); video_init(); speaker_init();