Fixes, mostly dma.c argument type changes.

This commit is contained in:
waltje
2017-12-15 21:16:25 -05:00
parent 193905e431
commit 69186cfb54
14 changed files with 257 additions and 240 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the NEC uPD-765 and compatible floppy disk
* controller.
*
* Version: @(#)fdc.c 1.0.11 2017/12/09
* Version: @(#)fdc.c 1.0.10 2017/12/08
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -22,7 +22,6 @@
#include <string.h>
#include <stdarg.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include "../86box.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
@@ -182,7 +181,7 @@ fdc_log(const char *fmt, ...)
if (fdc_do_log)
{
va_start(ap, fmt);
pclog_ex(fmt, ap);
pclog(fmt, ap);
va_end(ap);
}
#endif
@@ -714,7 +713,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
}
if ((val&4) && !(fdc.dor&4))
{
timer_clock();
timer_process();
floppytime = 128LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
floppyint=-1;
@@ -727,6 +726,8 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
fdc_reset();
}
timer_process();
timer_update_outstanding();
/* We can now simplify this since each motor now spins separately. */
for (i = 0; i < FDD_NUM; i++)
{
@@ -755,7 +756,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
case 4:
if (val & 0x80)
{
timer_clock();
timer_process();
floppytime = 128LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
floppyint=-1;
@@ -936,7 +937,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
bad_command:
fdc.stat |= 0x10;
floppyint=0xfc;
timer_clock();
timer_process();
floppytime = 200LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
break;
@@ -962,7 +963,7 @@ bad_command:
{
fdc_log("Got all params %02X\n", fdc.command);
floppyint=fdc.command&0x1F;
timer_clock();
timer_process();
floppytime = 1024LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
fdc_reset_stat = 0;
@@ -1140,7 +1141,7 @@ bad_command:
fdc.pcn[fdc.params[0] & 3] = 0;
floppytime = 0LL;
floppyint=-3;
timer_clock();
timer_process();
floppytime = 2048LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
break;
@@ -1197,7 +1198,7 @@ bad_command:
}
floppytime = 0LL;
floppyint=-3;
timer_clock();
timer_process();
floppytime = 2048LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
break;
@@ -1228,7 +1229,7 @@ bad_command:
fdc.st0 = 0x20 | (fdc.params[0] & 7);
floppytime = 0LL;
floppyint=-3;
timer_clock();
timer_process();
floppytime = 2048LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
break;
@@ -1244,7 +1245,7 @@ bad_command:
fdc.st0 = 0x20 | (fdc.params[0] & 7);
floppytime = 0LL;
floppyint=-3;
timer_clock();
timer_process();
floppytime = 2048LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
break;
@@ -1402,7 +1403,7 @@ uint8_t fdc_read(uint16_t addr, void *priv)
/* What the heck is this even doing?! */
/* if (floppyint==0xA)
{
timer_clock();
timer_process();
floppytime = 1024LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
} */
@@ -1740,7 +1741,7 @@ void fdc_callback(void *priv)
fdc.st0 |= 0x50;
}
floppyint=-3;
timer_clock();
timer_process();
floppytime = 2048LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
fdc.stat = 0x80 | (1 << fdc.drive);
@@ -1786,7 +1787,7 @@ void fdc_callback(void *priv)
if (fdc.format_state == 1)
{
fdc.format_state = 2;
timer_clock();
timer_process();
floppytime = 128LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
}
@@ -1817,7 +1818,7 @@ void fdc_callback(void *priv)
drive_num = real_drive(fdc.rw_drive);
fdc.st0 = 0x20 | (fdc.params[0] & 7);
floppyint=-3;
timer_clock();
timer_process();
floppytime = 2048LL * (1LL << TIMER_SHIFT);
timer_update_outstanding();
fdc.stat = 0x80 | (1 << fdc.drive);

View File

@@ -9,7 +9,7 @@
* Generic floppy disk interface that communicates with the
* other handlers.
*
* Version: @(#)floppy.c 1.0.12 2017/11/04
* Version: @(#)floppy.c 1.0.13 2017/12/14
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -323,7 +323,6 @@ void floppy_set_rate(int drive, int drvden, int rate)
floppy_period = 4;
break;
}
break;
case 2: /*Double density*/
floppy_period = 32;
break;

View File

@@ -10,7 +10,7 @@
* data in the form of FM/MFM-encoded transitions) which also
* forms the core of the emulator's floppy disk emulation.
*
* Version: @(#)floppy_86f.c 1.0.13 2017/12/09
* Version: @(#)floppy_86f.c 1.0.12 2017/11/24
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -23,7 +23,6 @@
#include <assert.h>
#include <wchar.h>
#include "../lzf/lzf.h"
#define HAVE_STDARG_H
#include "../86box.h"
#include "../config.h"
#include "../dma.h"
@@ -247,15 +246,15 @@ int d86f_do_log = ENABLE_D86F_LOG;
static void
d86f_log(const char *fmt, ...)
d86f_log(const char *format, ...)
{
#ifdef ENABLE_D86F_LOG
va_list ap;
if (d86f_do_log)
{
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_start(ap, format);
pclog(format, ap);
va_end(ap);
}
#endif

View File

@@ -9,7 +9,7 @@
* Implementation of the FDI floppy stream image format
* interface to the FDI2RAW module.
*
* Version: @(#)floppy_fdi.c 1.0.6 2017/12/15
* Version: @(#)floppy_fdi.c 1.0.6 2017/12/14
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>

View File

@@ -9,10 +9,11 @@
* Implementation of the FDI floppy stream image format
* interface to the FDI2RAW module.
*
* Version: @(#)floppy_fdi.h 1.0.3 2017/12/15
* Version: @(#)floppy_fdi.h 1.0.3 2017/12/14
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -20,7 +21,6 @@
# define EMU_FLOPPY_FDI_H
extern void fdi_init(void);
extern void fdi_load(int drive, wchar_t *fn);
extern void fdi_close(int drive);
extern void fdi_seek(int drive, int track);