Applied a whole slew of patches, getting RAM usage down by a further 10 MB.

This commit is contained in:
OBattler
2018-03-19 01:02:04 +01:00
parent b6c393cc91
commit b1efb99ed6
222 changed files with 9538 additions and 9980 deletions

View File

@@ -1,21 +1,39 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
* VARCem Virtual ARchaeological Computer EMulator.
* An emulator of (mostly) x86-based PC systems and devices,
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
* spanning the era between 1981 and 1995.
*
* This file is part of the 86Box distribution.
* This file is part of the VARCem Project.
*
* Implementation of the NEC uPD-765 and compatible floppy disk
* controller.
*
* Version: @(#)fdc->c 1.0.18 2018/03/08
* Version: @(#)fdc.c 1.0.5 2018/03/16
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
*
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#include <stdio.h>
#include <stdint.h>
@@ -42,7 +60,7 @@
extern int64_t motoron[FDD_NUM];
int command_has_drivesel[256] = {
const int command_has_drivesel[256] = {
0, 0,
1, /* READ TRACK */
0,
@@ -1147,7 +1165,6 @@ fdc_read(uint16_t addr, void *priv)
{
fdc_t *fdc = (fdc_t *) priv;
uint8_t ret;
int drive;
cycles -= ISA_CYCLES(8);
@@ -2020,7 +2037,7 @@ fdc_close(void *priv)
static void *
fdc_init(device_t *info)
fdc_init(const device_t *info)
{
fdc_t *fdc = (fdc_t *) malloc(sizeof(fdc_t));
memset(fdc, 0, sizeof(fdc_t));
@@ -2058,7 +2075,7 @@ fdc_3f1_enable(fdc_t *fdc, int enable)
}
device_t fdc_xt_device = {
const device_t fdc_xt_device = {
"PC/XT Floppy Drive Controller",
0,
0,
@@ -2068,7 +2085,7 @@ device_t fdc_xt_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_pcjr_device = {
const device_t fdc_pcjr_device = {
"PCjr Floppy Drive Controller",
0,
FDC_FLAG_PCJR,
@@ -2078,7 +2095,7 @@ device_t fdc_pcjr_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_at_device = {
const device_t fdc_at_device = {
"PC/AT Floppy Drive Controller",
0,
FDC_FLAG_AT,
@@ -2088,7 +2105,7 @@ device_t fdc_at_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_at_actlow_device = {
const device_t fdc_at_actlow_device = {
"PC/AT Floppy Drive Controller (Active low)",
0,
FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT,
@@ -2098,7 +2115,7 @@ device_t fdc_at_actlow_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_at_ps1_device = {
const device_t fdc_at_ps1_device = {
"PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)",
0,
FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1,
@@ -2108,7 +2125,7 @@ device_t fdc_at_ps1_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_at_smc_device = {
const device_t fdc_at_smc_device = {
"PC/AT Floppy Drive Controller (SM(s)C FDC37Cxxx)",
0,
FDC_FLAG_AT | FDC_FLAG_SUPERIO,
@@ -2118,7 +2135,7 @@ device_t fdc_at_smc_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_at_winbond_device = {
const device_t fdc_at_winbond_device = {
"PC/AT Floppy Drive Controller (Winbond W83x77F)",
0,
FDC_FLAG_AT | FDC_FLAG_SUPERIO | FDC_FLAG_START_RWC_1 | FDC_FLAG_MORE_TRACKS,
@@ -2128,7 +2145,7 @@ device_t fdc_at_winbond_device = {
NULL, NULL, NULL, NULL
};
device_t fdc_at_nsc_device = {
const device_t fdc_at_nsc_device = {
"PC/AT Floppy Drive Controller (NSC PC8730x)",
0,
FDC_FLAG_AT | FDC_FLAG_MORE_TRACKS | FDC_FLAG_NSC,