mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 17:45:31 -07:00
Another massive cleanup run. Ibm.h no longer includes system header files. ROM loading simplified, and moved from mem.c to rom.c. Fixes in Makefile. Corrected mamy wrong includes. Removed old junk from days long gone. First phase of new SCAT chipset driver - no longer gives errors in BIOS, but NOT DONE YET.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#
|
||||
# Modified Makefile for Win32 (MinGW32) environment.
|
||||
#
|
||||
# Version: @(#)Makefile.mingw 1.0.46 2017/09/19
|
||||
# Version: @(#)Makefile.mingw 1.0.47 2017/09/24
|
||||
#
|
||||
# Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
# Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -101,14 +101,14 @@ CC = gcc.exe -m32
|
||||
endif
|
||||
WINDRES = windres.exe
|
||||
|
||||
OPTS = -DWIN32 -I$(PLAT) $(EXTRAS) $(STUFF)
|
||||
# Set up the correct toolchain flags.
|
||||
OPTS = -DWIN32 -I$(PLAT) $(EXTRAS) $(STUFF)
|
||||
ifdef EXFLAGS
|
||||
OPTS += $(EXFLAGS)
|
||||
OPTS += $(EXFLAGS)
|
||||
endif
|
||||
ifdef EXINC
|
||||
OPTS += -I$(EXINC)
|
||||
OPTS += -I$(EXINC)
|
||||
endif
|
||||
|
||||
ifeq ($(X64), y)
|
||||
ifeq ($(OPTIM), y)
|
||||
DFLAGS = -march=native
|
||||
@@ -152,17 +152,6 @@ ifeq ($(VRAMDUMP), y)
|
||||
CFLAGS += -DENABLE_VRAM_DUMP
|
||||
RFLAGS += -DENABLE_VRAM_DUMP
|
||||
endif
|
||||
ifeq ($(FLUIDSYNTH), y)
|
||||
CFLAGS += -DUSE_FLUIDSYNTH
|
||||
FSYNTHOBJ = midi_fluidsynth.o
|
||||
endif
|
||||
ifeq ($(MUNT), y)
|
||||
CFLAGS += -DUSE_MUNT
|
||||
endif
|
||||
ifeq ($(NETWORK), y)
|
||||
CFLAGS += -DUSE_NETWORK
|
||||
RFLAGS += -DUSE_NETWORK
|
||||
endif
|
||||
ifeq ($(X64), y)
|
||||
PLATCG = codegen_x86-64.o
|
||||
CGOPS = codegen_ops_x86-64.h
|
||||
@@ -174,20 +163,57 @@ VCG = vid_voodoo_codegen_x86.h
|
||||
endif
|
||||
|
||||
|
||||
# Optional modules.
|
||||
ifeq ($(FLUIDSYNTH), y)
|
||||
CFLAGS += -DUSE_FLUIDSYNTH
|
||||
FSYNTHOBJ = midi_fluidsynth.o
|
||||
endif
|
||||
|
||||
ifeq ($(MUNT), y)
|
||||
CFLAGS += -DUSE_MUNT
|
||||
MUNTOBJ = midi_mt32.o \
|
||||
Analog.o BReverbModel.o File.o FileStream.o LA32Ramp.o \
|
||||
LA32FloatWaveGenerator.o LA32WaveGenerator.o \
|
||||
MidiStreamParser.o Part.o Partial.o PartialManager.o \
|
||||
Poly.o ROMInfo.o SampleRateConverter_dummy.o Synth.o \
|
||||
Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o
|
||||
endif
|
||||
|
||||
ifeq ($(NETWORK), y)
|
||||
CFLAGS += -DUSE_NETWORK
|
||||
RFLAGS += -DUSE_NETWORK
|
||||
NETOBJ = network.o \
|
||||
net_pcap.o \
|
||||
net_slirp.o \
|
||||
bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o \
|
||||
ip_input.o queue.o tcp_input.o debug.o ip_output.o \
|
||||
sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o \
|
||||
net_ne2000.o
|
||||
endif
|
||||
|
||||
|
||||
# Options for the DEV branch.
|
||||
ifeq ($(DEV_BRANCH), y)
|
||||
CFLAGS += -DDEV_BRANCH
|
||||
DEVBROBJ =
|
||||
|
||||
ifeq ($(CIRRUS), y)
|
||||
CFLAGS += -DUSE_CIRRUS
|
||||
DEVBROBJ += vid_cl_gd.o vid_cl_gd_blit.o vid_cl_ramdac.o
|
||||
endif
|
||||
|
||||
ifeq ($(NV_RIVA), y)
|
||||
CFLAGS += -DUSE_RIVA
|
||||
DEVBROBJ += vid_nv_riva128.o
|
||||
endif
|
||||
|
||||
ifeq ($(PAS16), y)
|
||||
CFLAGS += -DUSE_PAS16
|
||||
DEVBROBJ += snd_pas16.o
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# Options for works-in-progress.
|
||||
ifndef SERIAL
|
||||
SERIAL = serial.o
|
||||
@@ -210,24 +236,24 @@ CPUOBJ = cpu.o 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o \
|
||||
codegen_timing_winchip.o $(PLATCG) \
|
||||
x86seg.o x87.o
|
||||
|
||||
MACHINEOBJ = machine.o \
|
||||
machine_common.o \
|
||||
machine_amstrad.o $(EUROPC) \
|
||||
machine_olivetti_m24.o \
|
||||
machine_pcjr.o \
|
||||
machine_tandy.o \
|
||||
machine_xt.o machine_xt_laserxt.o \
|
||||
machine_at.o \
|
||||
machine_at_ali1429.o machine_at_commodore.o \
|
||||
machine_at_neat.o machine_at_headland.o \
|
||||
machine_at_opti495.o machine_at_scat.o \
|
||||
machine_at_wd76c10.o \
|
||||
machine_at_sis_85c471.o machine_at_sis_85c496.o \
|
||||
machine_at_430lx_nx.o machine_at_430fx.o \
|
||||
machine_at_430hx.o machine_at_430vx.o \
|
||||
machine_at_440fx.o \
|
||||
machine_ps1.o \
|
||||
machine_ps2_isa.o machine_ps2_mca.o
|
||||
MCHOBJ = machine.o \
|
||||
machine_common.o \
|
||||
machine_amstrad.o $(EUROPC) \
|
||||
machine_olivetti_m24.o \
|
||||
machine_pcjr.o \
|
||||
machine_tandy.o \
|
||||
machine_xt.o machine_xt_laserxt.o \
|
||||
machine_at.o \
|
||||
machine_at_ali1429.o machine_at_commodore.o \
|
||||
machine_at_neat.o machine_at_headland.o \
|
||||
machine_at_opti495.o machine_at_scat.o \
|
||||
machine_at_wd76c10.o \
|
||||
machine_at_sis_85c471.o machine_at_sis_85c496.o \
|
||||
machine_at_430lx_nx.o machine_at_430fx.o \
|
||||
machine_at_430hx.o machine_at_430vx.o \
|
||||
machine_at_440fx.o \
|
||||
machine_ps1.o \
|
||||
machine_ps2_isa.o machine_ps2_mca.o
|
||||
|
||||
DEVOBJ = bugger.o lpt.o $(SERIAL) \
|
||||
tandy_eeprom.o tandy_rom.o \
|
||||
@@ -240,64 +266,49 @@ DEVOBJ = bugger.o lpt.o $(SERIAL) \
|
||||
gameport.o \
|
||||
joystick_standard.o joystick_ch_flightstick_pro.o \
|
||||
joystick_sw_pad.o joystick_tm_fcs.o \
|
||||
mouse.o mouse_serial.o mouse_ps2.o mouse_bus.o
|
||||
mouse.o \
|
||||
mouse_serial.o mouse_ps2.o mouse_bus.o
|
||||
|
||||
FDDOBJ = fdd.o fdc.o fdi2raw.o \
|
||||
floppy.o floppy_common.o floppy_86f.o \
|
||||
floppy_fdi.o floppy_imd.o floppy_img.o floppy_json.o floppy_td0.o
|
||||
floppy.o floppy_common.o floppy_86f.o \
|
||||
floppy_fdi.o floppy_imd.o floppy_img.o floppy_json.o floppy_td0.o
|
||||
|
||||
CDROMOBJ= cdrom.o \
|
||||
cdrom_dosbox.o cdrom_image.o cdrom_ioctl.o cdrom_null.o
|
||||
cdrom_dosbox.o cdrom_image.o cdrom_ioctl.o cdrom_null.o
|
||||
|
||||
HDDOBJ = hdd.o hdd_image.o \
|
||||
hdd_mfm_at.o hdd_mfm_xebec.o hdd_esdi_at.o hdd_esdi_mca.o \
|
||||
hdd_ide_at.o hdd_ide_xt.o piix.o
|
||||
hdd_mfm_at.o hdd_mfm_xebec.o hdd_esdi_at.o hdd_esdi_mca.o \
|
||||
hdd_ide_at.o hdd_ide_xt.o piix.o
|
||||
|
||||
ifeq ($(USB), y)
|
||||
USBOBJ = usb.o
|
||||
endif
|
||||
ifeq ($(MUNT), y)
|
||||
MUNTOBJ = midi_mt32.o \
|
||||
Analog.o BReverbModel.o File.o FileStream.o LA32Ramp.o \
|
||||
LA32FloatWaveGenerator.o LA32WaveGenerator.o \
|
||||
MidiStreamParser.o Part.o Partial.o PartialManager.o \
|
||||
Poly.o ROMInfo.o SampleRateConverter_dummy.o Synth.o \
|
||||
Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o
|
||||
endif
|
||||
ifeq ($(NETWORK), y)
|
||||
NETOBJ = network.o \
|
||||
net_pcap.o \
|
||||
net_slirp.o \
|
||||
bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o \
|
||||
ip_input.o queue.o tcp_input.o debug.o ip_output.o \
|
||||
sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o \
|
||||
net_ne2000.o
|
||||
endif
|
||||
SCSIOBJ = scsi.o scsi_bios_command.o scsi_device.o scsi_disk.o \
|
||||
scsi_buslogic.o scsi_aha154x.o
|
||||
ifeq ($(DEV_BRANCH), y)
|
||||
ifeq ($(PAS16), y)
|
||||
PAS16OBJ = snd_pas16.o
|
||||
endif
|
||||
endif
|
||||
|
||||
SCSIOBJ = scsi.o \
|
||||
scsi_bios_command.o scsi_device.o scsi_disk.o \
|
||||
scsi_buslogic.o scsi_aha154x.o
|
||||
|
||||
SNDOBJ = sound.o \
|
||||
openal.o \
|
||||
dbopl.o nukedopl.o \
|
||||
convolve.o convolve-sse.o envelope.o extfilt.o \
|
||||
filter.o pot.o sid.o voice.o wave6581__ST.o \
|
||||
wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \
|
||||
wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \
|
||||
wave8580_PST.o wave.o \
|
||||
snd_resid.o \
|
||||
convolve.o convolve-sse.o envelope.o extfilt.o \
|
||||
filter.o pot.o sid.o voice.o wave6581__ST.o \
|
||||
wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \
|
||||
wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \
|
||||
wave8580_PST.o wave.o \
|
||||
midi.o $(FSYNTHOBJ) $(MUNTOBJ) \
|
||||
midi_system.o \
|
||||
midi_system.o \
|
||||
snd_speaker.o \
|
||||
snd_ps1.o snd_pssj.o \
|
||||
snd_lpt_dac.o snd_lpt_dss.o \
|
||||
snd_adlib.o snd_adlibgold.o snd_ad1848.o \
|
||||
snd_sb.o snd_sb_dsp.o snd_cms.o snd_dbopl.o \
|
||||
snd_emu8k.o snd_gus.o snd_opl.o \
|
||||
snd_mpu401.o $(PAS16OBJ) snd_resid.o \
|
||||
snd_mpu401.o \
|
||||
snd_sn76489.o snd_ssi2001.o snd_wss.o \
|
||||
snd_ym7128.o
|
||||
|
||||
VIDOBJ = video.o \
|
||||
vid_cga.o vid_cga_comp.o vid_mda.o \
|
||||
vid_ega.o vid_ega_render.o \
|
||||
@@ -311,17 +322,20 @@ VIDOBJ = video.o \
|
||||
vid_paradise.o \
|
||||
vid_tvga.o vid_tgui9440.o vid_tkd8001_ramdac.o \
|
||||
vid_ati_eeprom.o vid_ati18800.o vid_ati28800.o \
|
||||
vid_ati68860_ramdac.o vid_ati_mach64.o \
|
||||
vid_ics2595.o \
|
||||
vid_ati68860_ramdac.o vid_ati_mach64.o \
|
||||
vid_ics2595.o \
|
||||
vid_sc1502x_ramdac.o \
|
||||
vid_sdac_ramdac.o \
|
||||
vid_stg_ramdac.o \
|
||||
vid_wy700.o \
|
||||
vid_voodoo.o \
|
||||
vid_pcjr.o vid_ps1_svga.o \
|
||||
vid_pcjr.o \
|
||||
vid_ps1_svga.o \
|
||||
vid_olivetti_m24.o \
|
||||
vid_pc1512.o vid_pc1640.o vid_pc200.o \
|
||||
vid_pc1512.o vid_pc1640.o \
|
||||
vid_pc200.o \
|
||||
vid_tandy.o vid_tandysl.o
|
||||
|
||||
WINOBJ = win.o \
|
||||
win_ddraw.o win_ddraw_fs.o win_ddraw_screenshot.o \
|
||||
win_d3d.o win_d3d_fs.o \
|
||||
@@ -330,19 +344,11 @@ WINOBJ = win.o \
|
||||
win_iodev.o win_joystick.o win_midi.o \
|
||||
win_settings.o win_deviceconfig.o win_joystickconfig.o \
|
||||
86Box.res
|
||||
ifeq ($(DEV_BRANCH), y)
|
||||
ifeq ($(CIRRUS), y)
|
||||
CIRRUSOBJ = vid_cl_gd.o vid_cl_gd_blit.o vid_cl_ramdac.o
|
||||
endif
|
||||
ifeq ($(NV_RIVA), y)
|
||||
RIVAOBJ = vid_nv_riva128.o
|
||||
endif
|
||||
DEVBRANCHOBJ = $(CIRRUSOBJ) $(RIVAOBJ)
|
||||
endif
|
||||
OBJ = $(MAINOBJ) $(CPUOBJ) $(MACHINEOBJ) $(DEVOBJ) \
|
||||
|
||||
OBJ = $(MAINOBJ) $(CPUOBJ) $(MCHOBJ) $(DEVOBJ) \
|
||||
$(FDDOBJ) $(CDROMOBJ) $(HDDOBJ) \
|
||||
$(USBOBJ) $(NETOBJ) $(SCSIOBJ) $(SNDOBJ) $(VIDOBJ) \
|
||||
$(WINOBJ) $(DEVBRANCHOBJ)
|
||||
$(WINOBJ) $(DEVBROBJ)
|
||||
ifdef EXOBJ
|
||||
OBJ += $(EXOBJ)
|
||||
endif
|
||||
@@ -690,7 +696,7 @@ nvr.o: ibm.h cpu/cpu.h device.h io.h mem.h nvr.h machine/machine.h \
|
||||
|
||||
nvr_ps2.o: ibm.h device.h io.h mem.h nvr.h nvr_ps2.h
|
||||
|
||||
pc.o: 86box.h config.h random.h ibm.h mem.h \
|
||||
pc.o: 86box.h config.h random.h ibm.h mem.h rom.h \
|
||||
cpu/cpu.h cpu/x86_ops.h cpu/codegen.h \
|
||||
dma.h nvr.h pic.h pit.h timer.h device.h machine/machine.h \
|
||||
floppy.h floppy_86f.h floppy_fdi.h floppy_imd.h floppy_img.h floppy_td0.h \
|
||||
@@ -976,7 +982,7 @@ win_opendir.o: ibm.h win/plat_dir.h win/resource.h
|
||||
|
||||
win_serial.o: win/plat_thread.h win/plat_serial.h win/resource.h
|
||||
|
||||
win_settings.o: ibm.h mem.h cpu/cpu.h nvr.h device.h machine/machine.h cdrom.h floppy.h fdd.h hdd/hdd.h hdd/hdd_ide_at.h scsi/scsi.h network/network.h sound/midi.h \
|
||||
win_settings.o: ibm.h mem.h rom.h cpu/cpu.h nvr.h device.h machine/machine.h cdrom.h floppy.h fdd.h hdd/hdd.h hdd/hdd_ide_at.h scsi/scsi.h network/network.h sound/midi.h \
|
||||
sound/sound.h sound/snd_dbopl.h sound/snd_mpu401.h video/video.h video/vid_voodoo.h gameport.h mouse.h win/plat_midi.h \
|
||||
win/resource.h win/win.h win/win_language.h
|
||||
|
||||
|
||||
@@ -44,11 +44,15 @@
|
||||
* configuration register (CTRL_SPCFG bit set) but have to
|
||||
* remember that stuff first...
|
||||
*
|
||||
* Version: @(#)bugger.c 1.0.4 2017/05/09
|
||||
* Version: @(#)bugger.c 1.0.5 2017/09/24
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 1989-2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "bugger.h"
|
||||
|
||||
@@ -9,16 +9,17 @@
|
||||
* Implementation of the CD-ROM drive with SCSI(-like)
|
||||
* commands, for both ATAPI and SCSI usage.
|
||||
*
|
||||
* Version: @(#)cdrom.c 1.0.5 2017/09/19
|
||||
* Version: @(#)cdrom.c 1.0.6 2017/09/24
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
#include "../ibm.h"
|
||||
#include "../piix.h"
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
#define __USE_LARGEFILE64
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../config.h"
|
||||
#include "cdrom_dosbox.h"
|
||||
#include "cdrom.h"
|
||||
|
||||
@@ -9,18 +9,22 @@
|
||||
* Implementation of the CD-ROM host drive IOCTL interface for
|
||||
* Windows using SCSI Passthrough Direct.
|
||||
*
|
||||
* Version: @(#)cdrom_ioctl.c 1.0.3 2017/09/03
|
||||
* Version: @(#)cdrom_ioctl.c 1.0.4 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2016 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#define WINVER 0x0600
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include "ntddcdrm.h"
|
||||
#include "ntddscsi.h"
|
||||
#include <ntddcdrm.h>
|
||||
#include <ntddscsi.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../scsi/scsi.h"
|
||||
#include "cdrom.h"
|
||||
|
||||
@@ -9,13 +9,17 @@
|
||||
* Implementation of the CD-ROM null interface for unmounted
|
||||
* guest CD-ROM drives.
|
||||
*
|
||||
* Version: @(#)cdrom_null.c 1.0.2 2017/09/03
|
||||
* Version: @(#)cdrom_null.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2016 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "cdrom.h"
|
||||
#include "cdrom_ioctl.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Configuration file handler.
|
||||
*
|
||||
* Version: @(#)config.c 1.0.5 2017/09/22
|
||||
* Version: @(#)config.c 1.0.6 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -22,11 +22,12 @@
|
||||
* it on Windows XP, and possibly also Vista. Use the
|
||||
* -DANSI_CFG for use on these systems.
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <inttypes.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "config.h"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <math.h>
|
||||
#ifndef INFINITY
|
||||
# define INFINITY (__builtin_inff())
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../ibm.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <math.h>
|
||||
#ifndef INFINITY
|
||||
# define INFINITY (__builtin_inff())
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include "../ibm.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <math.h>
|
||||
#ifndef INFINITY
|
||||
# define INFINITY (__builtin_inff())
|
||||
|
||||
@@ -8,30 +8,34 @@
|
||||
*
|
||||
* 808x CPU emulation.
|
||||
*
|
||||
* Version: @(#)808x.c 1.0.1 2017/09/19
|
||||
* SHR AX,1
|
||||
*
|
||||
* 4 clocks - fetch opcode
|
||||
* 4 clocks - fetch mod/rm
|
||||
* 2 clocks - execute 2 clocks - fetch opcode 1
|
||||
* 2 clocks - fetch opcode 2
|
||||
* 4 clocks - fetch mod/rm
|
||||
* 2 clocks - fetch opcode 1 2 clocks - execute
|
||||
* 2 clocks - fetch opcode 2 etc
|
||||
*
|
||||
* Version: @(#)808x.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
|
||||
/*SHR AX,1
|
||||
|
||||
4 clocks - fetch opcode
|
||||
4 clocks - fetch mod/rm
|
||||
2 clocks - execute 2 clocks - fetch opcode 1
|
||||
2 clocks - fetch opcode 2
|
||||
4 clocks - fetch mod/rm
|
||||
2 clocks - fetch opcode 1 2 clocks - execute
|
||||
2 clocks - fetch opcode 2 etc*/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
//#include <unistd.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
#include "../keyboard.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../nmi.h"
|
||||
#include "../pic.h"
|
||||
#include "../timer.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "x86_ops.h"
|
||||
#include "../mem.h"
|
||||
#include "x86_ops.h"
|
||||
#include "codegen.h"
|
||||
|
||||
void (*codegen_timing_start)();
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "x86.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
#include "x86_ops.h"
|
||||
#include "x87.h"
|
||||
#include "../mem.h"
|
||||
#include "codegen.h"
|
||||
#include "codegen_ops.h"
|
||||
#include "codegen_timing_common.h"
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
- FPU queue
|
||||
- Out of order execution (beyond most simplistic approximation)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
#include "x86_ops.h"
|
||||
#include "x87.h"
|
||||
#include "../mem.h"
|
||||
#include "codegen.h"
|
||||
#include "codegen_timing_common.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "codegen_timing_common.h"
|
||||
|
||||
|
||||
uint64_t opcode_deps[256] =
|
||||
{
|
||||
/* ADD ADD ADD ADD*/
|
||||
|
||||
@@ -9,19 +9,21 @@
|
||||
- PMMX decode queue
|
||||
- MMX latencies
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
#include "x86_ops.h"
|
||||
#include "x87.h"
|
||||
#include "../mem.h"
|
||||
#include "codegen.h"
|
||||
#include "codegen_ops.h"
|
||||
#include "codegen_timing_common.h"
|
||||
|
||||
|
||||
|
||||
/*Instruction has different execution time for 16 and 32 bit data. Does not pair */
|
||||
#define CYCLES_HAS_MULTI (1 << 28)
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifdef __amd64__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "cpu.h"
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
#if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined WIN32 || defined _WIN32 || defined _WIN32
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
#include "x86_flags.h"
|
||||
#include "x86_ops.h"
|
||||
#include "x87.h"
|
||||
#include "../mem.h"
|
||||
|
||||
#include "386_common.h"
|
||||
|
||||
|
||||
@@ -8,15 +8,19 @@
|
||||
*
|
||||
* CPU type handler.
|
||||
*
|
||||
* Version: @(#)cpu.c 1.0.1 2017/06/03
|
||||
* Version: @(#)cpu.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* leilei,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 leilei.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "cpu.h"
|
||||
#include "../device.h"
|
||||
|
||||
@@ -8,17 +8,19 @@
|
||||
*
|
||||
* x86 CPU segment emulation.
|
||||
*
|
||||
* Version: @(#)x86seg.c 1.0.0 2017/05/30
|
||||
* Version: @(#)x86seg.c 1.0.1 2017/09/24
|
||||
*
|
||||
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "../nvr.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#define fplog 0
|
||||
#include <math.h>
|
||||
#include "../ibm.h"
|
||||
|
||||
@@ -9,13 +9,17 @@
|
||||
* Implementation of the generic device interface to handle
|
||||
* all devices attached to the emulator.
|
||||
*
|
||||
* Version: @(#)device.c 1.0.3 2017/09/02
|
||||
* Version: @(#)device.c 1.0.4 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2016 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "config.h"
|
||||
|
||||
@@ -8,13 +8,17 @@
|
||||
*
|
||||
* Implementation of the Intel DMA controllers.
|
||||
*
|
||||
* Version: @(#)dma.c 1.0.2 2017/08/23
|
||||
* Version: @(#)dma.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/x86.h"
|
||||
#include "mem.h"
|
||||
|
||||
@@ -9,18 +9,22 @@
|
||||
* Implementation of the NEC uPD-765 and compatible floppy disk
|
||||
* controller.
|
||||
*
|
||||
* Version: @(#)fdc.c 1.0.2 2017/09/03
|
||||
* Version: @(#)fdc.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../dma.h"
|
||||
#include "../pic.h"
|
||||
#include "../timer.h"
|
||||
|
||||
@@ -8,13 +8,17 @@
|
||||
*
|
||||
* Implementation of the floppy drive emulation.
|
||||
*
|
||||
* Version: @(#)fdd.c 1.0.2 2017/09/03
|
||||
* Version: @(#)fdd.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "floppy.h"
|
||||
#include "fdc.h"
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
|
||||
#define STATIC_INLINE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
|
||||
/* IF UAE */
|
||||
/*#include "sysconfig.h"
|
||||
@@ -37,7 +38,6 @@
|
||||
#define VERBOSE
|
||||
#undef VERBOSE
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
static char *datalog(uae_u8 *src, int len)
|
||||
|
||||
@@ -9,16 +9,20 @@
|
||||
* Generic floppy disk interface that communicates with the
|
||||
* other handlers.
|
||||
*
|
||||
* Version: @(#)floppy.c 1.0.3 2017/09/12
|
||||
* Version: @(#)floppy.c 1.0.4 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#define UNICODE
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../config.h"
|
||||
#include "../timer.h"
|
||||
#include "floppy.h"
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
* 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.3 2017/09/19
|
||||
* Version: @(#)floppy_86f.c 1.0.4 2017/09/24
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <wchar.h>
|
||||
#include "../lzf/lzf.h"
|
||||
|
||||
@@ -8,12 +8,16 @@
|
||||
*
|
||||
* Shared code for all the floppy modules.
|
||||
*
|
||||
* Version: @(#)floppy_common.c 1.0.1 2017/09/10
|
||||
* Version: @(#)floppy_common.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../floppy/floppy.h"
|
||||
#include "floppy_common.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Implementation of the FDI floppy stream image format
|
||||
* interface to the FDI2RAW module.
|
||||
*
|
||||
* Version: @(#)floppy_fdi.c 1.0.1 2017/09/03
|
||||
* Version: @(#)floppy_fdi.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "floppy.h"
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
*
|
||||
* Implementation of the IMD floppy image format.
|
||||
*
|
||||
* Version: @(#)floppy_imd.c 1.0.1 2017/09/03
|
||||
* Version: @(#)floppy_imd.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "floppy.h"
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
* Implementation of the raw sector-based floppy image format,
|
||||
* as well as the Japanese FDI, CopyQM, and FDF formats.
|
||||
*
|
||||
* Version: @(#)floppy_img.c 1.0.1 2017/09/03
|
||||
* Version: @(#)floppy_img.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
*
|
||||
* Implementation of the PCjs JSON floppy image format.
|
||||
*
|
||||
* Version: @(#)floppy_json.c 1.0.2 2017/09/16
|
||||
* Version: @(#)floppy_json.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "floppy.h"
|
||||
#include "fdc.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Teledisk floppy image format.
|
||||
*
|
||||
* Version: @(#)floppy_td0.c 1.0.2 2017/09/-3
|
||||
* Version: @(#)floppy_td0.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Milodrag Milanovic,
|
||||
* Haruhiko OKUMURA,
|
||||
@@ -37,8 +37,11 @@
|
||||
* Adaptive Huffman Coding coded by Haruyasu YOSHIZAKI
|
||||
* Edited and translated to English by Kenji RIKITAKE
|
||||
*/
|
||||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "floppy.h"
|
||||
#include "floppy_td0.h"
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "device.h"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../device.h"
|
||||
#include "../machine/machine.h"
|
||||
|
||||
#include "hdd.h"
|
||||
|
||||
#include "hdd_esdi_at.h"
|
||||
#include "hdd_esdi_mca.h"
|
||||
#include "hdd_mfm_at.h"
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../device.h"
|
||||
#include "hdd_image.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
#include "../pic.h"
|
||||
#include "../rom.h"
|
||||
#include "../timer.h"
|
||||
|
||||
#include "hdd_image.h"
|
||||
#include "hdd_esdi_at.h"
|
||||
|
||||
|
||||
|
||||
@@ -52,24 +52,28 @@
|
||||
* however, are auto-configured by the system software as
|
||||
* shown above.
|
||||
*
|
||||
* Version: @(#)hdd_esdi_mca.c 1.0.2 2017/08/27
|
||||
* Version: @(#)hdd_esdi_mca.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../device.h"
|
||||
#include "../dma.h"
|
||||
#include "hdd_image.h"
|
||||
#include "../io.h"
|
||||
#include "../mca.h"
|
||||
#include "../mem.h"
|
||||
#include "../pic.h"
|
||||
#include "../rom.h"
|
||||
#include "../timer.h"
|
||||
#include "hdd_image.h"
|
||||
#include "hdd_esdi_mca.h"
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Implementation of the IDE emulation for hard disks and ATAPI
|
||||
* CD-ROM devices.
|
||||
*
|
||||
* Version: @(#)hdd_ide_at.c 1.0.6 2017/09/03
|
||||
* Version: @(#)hdd_ide_at.c 1.0.7 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -17,8 +17,9 @@
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
|
||||
@@ -8,14 +8,18 @@
|
||||
*
|
||||
* XT IDE controller emulation.
|
||||
*
|
||||
* Version: @(#)xtide.c 1.0.3 2017/08/24
|
||||
* Version: @(#)xtide.c 1.0.4 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <errno.h>
|
||||
#include "../ibm.h"
|
||||
#include "hdd_ide_at.h"
|
||||
#include "hdd_image.h"
|
||||
#include "hdd_ide_at.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -12,15 +12,20 @@
|
||||
* based design. Most cards were WD1003-WA2 or -WAH, where the
|
||||
* -WA2 cards had a floppy controller as well (to save space.)
|
||||
*
|
||||
* Version: @(#)hdd_mfm_at.c 1.0.2 2017/09/23
|
||||
* Version: @(#)hdd_mfm_at.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../device.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#include <malloc.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
|
||||
#include "../device.h"
|
||||
#include "../dma.h"
|
||||
#include "hdd_image.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
#include "../pic.h"
|
||||
#include "../rom.h"
|
||||
#include "../timer.h"
|
||||
#include "hdd_image.h"
|
||||
#include "hdd_mfm_xebec.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/* Intel 82335 SX emulation, used by the Phoenix 386 clone. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
|
||||
126
src/ibm.h
126
src/ibm.h
@@ -8,18 +8,18 @@
|
||||
*
|
||||
* General include file.
|
||||
*
|
||||
* Version: @(#)ibm.h 1.0.4 2017/09/19
|
||||
* Version: @(#)ibm.h 1.0.5 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#define printf pclog
|
||||
#ifndef EMU_IBM_H
|
||||
# define EMU_IBM_H
|
||||
|
||||
|
||||
#define printf pclog
|
||||
|
||||
|
||||
/*Memory*/
|
||||
@@ -379,120 +379,11 @@ extern int driveempty[4];
|
||||
|
||||
#define MDA ((gfxcard==GFX_MDA || gfxcard==GFX_HERCULES || gfxcard==GFX_HERCULESPLUS || gfxcard==GFX_INCOLOR || gfxcard==GFX_GENIUS) && (romset<ROM_TANDY || romset>=ROM_IBMAT))
|
||||
#define VGA ((gfxcard>=GFX_TVGA || romset==ROM_ACER386) && gfxcard!=GFX_COLORPLUS && gfxcard!=GFX_INCOLOR && gfxcard!=GFX_WY700 && gfxcard!=GFX_GENIUS && gfxcard!=GFX_COMPAQ_EGA && gfxcard!=GFX_SUPER_EGA && gfxcard!=GFX_HERCULESPLUS && romset!=ROM_PC1640 && romset!=ROM_PC1512 && romset!=ROM_TANDY && romset!=ROM_PC200)
|
||||
#define PCJR (romset == ROM_IBMPCJR)
|
||||
#define AMIBIOS (romset==ROM_AMI386SX || romset==ROM_AMI486 || romset == ROM_WIN486)
|
||||
|
||||
int GAMEBLASTER, GUS, SSI2001, voodoo_enabled, buslogic_enabled;
|
||||
extern int AMSTRAD, AT, is286, is386, PCI, TANDY;
|
||||
|
||||
enum
|
||||
{
|
||||
ROM_IBMPC = 0, /*301 keyboard error, 131 cassette (!!!) error*/
|
||||
ROM_IBMXT, /*301 keyboard error*/
|
||||
ROM_IBMPCJR,
|
||||
ROM_GENXT, /*'Generic XT BIOS'*/
|
||||
ROM_DTKXT,
|
||||
ROM_EUROPC,
|
||||
ROM_OLIM24,
|
||||
ROM_TANDY,
|
||||
ROM_PC1512,
|
||||
ROM_PC200,
|
||||
ROM_PC1640,
|
||||
ROM_PC2086,
|
||||
ROM_PC3086,
|
||||
ROM_AMIXT, /*XT Clone with AMI BIOS*/
|
||||
ROM_LTXT,
|
||||
ROM_LXT3,
|
||||
ROM_PX386,
|
||||
ROM_DTK386,
|
||||
ROM_PXXT,
|
||||
ROM_JUKOPC,
|
||||
ROM_TANDY1000HX,
|
||||
ROM_TANDY1000SL2,
|
||||
ROM_IBMAT,
|
||||
ROM_CMDPC30,
|
||||
ROM_AMI286,
|
||||
ROM_AWARD286,
|
||||
ROM_DELL200,
|
||||
ROM_MISC286,
|
||||
ROM_IBMAT386,
|
||||
ROM_ACER386,
|
||||
ROM_MEGAPC,
|
||||
ROM_AMI386SX,
|
||||
ROM_AMI486,
|
||||
ROM_WIN486,
|
||||
ROM_PCI486,
|
||||
ROM_SIS496,
|
||||
ROM_430VX,
|
||||
ROM_ENDEAVOR,
|
||||
ROM_REVENGE,
|
||||
ROM_IBMPS1_2011,
|
||||
ROM_DESKPRO_386,
|
||||
ROM_PORTABLE,
|
||||
#if 0
|
||||
ROM_PORTABLEII,
|
||||
ROM_PORTABLEIII,
|
||||
ROM_PORTABLEIII386, /* The original Compaq Portable III shipped with an Intel 80286 CPU, but later switched to a 386DX. */
|
||||
#endif
|
||||
ROM_IBMPS1_2121,
|
||||
|
||||
ROM_AMI386DX_OPTI495,
|
||||
ROM_MR386DX_OPTI495,
|
||||
|
||||
ROM_IBMPS2_M30_286,
|
||||
ROM_IBMPS2_M50,
|
||||
ROM_IBMPS2_M55SX,
|
||||
ROM_IBMPS2_M80,
|
||||
|
||||
ROM_DTK486, /*DTK PKM-0038S E-2 / SiS 471 / Award BIOS / SiS 85C471*/
|
||||
ROM_VLI486SV2G, /*ASUS VL/I-486SV2G / SiS 471 / Award BIOS / SiS 85C471*/
|
||||
ROM_R418, /*Rise Computer R418 / SiS 496/497 / Award BIOS / SMC FDC37C665*/
|
||||
ROM_586MC1, /*Micro Star 586MC1 MS-5103 / 430LX / Award BIOS*/
|
||||
ROM_PLATO, /*Intel Premiere/PCI II / 430NX / AMI BIOS / SMC FDC37C665*/
|
||||
ROM_MB500N, /*PC Partner MB500N / 430FX / Award BIOS / SMC FDC37C665*/
|
||||
ROM_P54TP4XE, /*ASUS P/I-P55TP4XE / 430FX / Award BIOS / SMC FDC37C665*/
|
||||
ROM_AP53, /*AOpen AP53 / 430HX / AMI BIOS / SMC FDC37C665/669*/
|
||||
ROM_P55T2S, /*ASUS P/I-P55T2S / 430HX / AMI BIOS / National Semiconductors PC87306*/
|
||||
ROM_ACERM3A, /*Acer M3A / 430HX / Acer BIOS / SMC FDC37C932FR*/
|
||||
ROM_ACERV35N, /*Acer V35N / 430HX / Acer BIOS / SMC FDC37C932FR*/
|
||||
ROM_P55T2P4, /*ASUS P/I-P55T2P4 / 430HX / Award BIOS / Winbond W8387F*/
|
||||
ROM_P55TVP4, /*ASUS P/I-P55TVP4 / 430HX / Award BIOS / Winbond W8387F*/
|
||||
ROM_P55VA, /*Epox P55-VA / 430VX / Award BIOS / SMC FDC37C932FR*/
|
||||
|
||||
ROM_440FX, /*Tyan Titan-Pro AT / 440FX / Award BIOS / SMC FDC37C665*/
|
||||
|
||||
ROM_MARL, /*Intel Advanced/ML / 430HX / AMI BIOS / National Semiconductors PC87306*/
|
||||
ROM_THOR, /*Intel Advanced/ATX / 430FX / AMI BIOS / National Semiconductors PC87306*/
|
||||
ROM_MRTHOR, /*Intel Advanced/ATX / 430FX / MR.BIOS / National Semiconductors PC87306*/
|
||||
ROM_POWERMATE_V,/*NEC PowerMate V / 430FX / Phoenix BIOS / SMC FDC37C665*/
|
||||
|
||||
ROM_IBMPS1_2121_ISA,/*IBM PS/1 Model 2121 with ISA expansion bus*/
|
||||
|
||||
ROM_SPC4200P, /*Samsung SPC-4200P / SCAT / Phoenix BIOS*/
|
||||
ROM_SUPER286TR, /*Hyundai Super-286TR / SCAT / Award BIOS*/
|
||||
|
||||
ROM_AWARD386SX_OPTI495,
|
||||
ROM_AWARD386DX_OPTI495,
|
||||
ROM_AWARD486_OPTI495,
|
||||
|
||||
ROM_MEGAPCDX, /*386DX mdoel of the Mega PC - Note by Tohka: The documentation (that I have in German) clearly says such a model exists.*/
|
||||
ROM_ZAPPA, /*Intel Advanced/ZP / 430FX / AMI BIOS / National Semiconductors PC87306*/
|
||||
|
||||
ROM_CMDPC60,
|
||||
|
||||
ROM_S1668, /*Tyan Titan-Pro ATX / 440FX / AMI BIOS / SMC FDC37C669*/
|
||||
ROM_IBMPS1_2133,
|
||||
|
||||
ROM_PRESIDENT, /*President Award 430FX PCI / 430FX / Award BIOS / Unknown Super I/O chip*/
|
||||
ROM_IBMPS2_M80_486,
|
||||
|
||||
ROM_MAX
|
||||
};
|
||||
|
||||
extern int romspresent[ROM_MAX];
|
||||
|
||||
extern int hasfpu;
|
||||
extern int romset;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -733,11 +624,11 @@ extern PCI_RESET pci_reset_handler;
|
||||
|
||||
extern void trc_init(void);
|
||||
|
||||
extern int enable_xtide;
|
||||
extern int enable_external_fpu;
|
||||
|
||||
extern int serial_enabled[2];
|
||||
extern int lpt_enabled, bugger_enabled;
|
||||
extern int romset;
|
||||
|
||||
extern int invert_display;
|
||||
|
||||
@@ -812,3 +703,6 @@ extern void status_settext(char *str);
|
||||
/* Configuration values. */
|
||||
#define SERIAL_MAX 2
|
||||
#define PARALLEL_MAX 1
|
||||
|
||||
|
||||
#endif /*EMU_IBM_H*/
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "io.h"
|
||||
|
||||
@@ -8,15 +8,18 @@
|
||||
*
|
||||
* Implementation of the Intel 2 Mbit 8-bit flash devices.
|
||||
*
|
||||
* Version: @(#)intel_flash.c 1.0.2 2017/09/19
|
||||
* Version: @(#)intel_flash.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "device.h"
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
*
|
||||
* Emulation of Intel System I/O PCI chip.
|
||||
*
|
||||
* Version: @(#)intel_sio.c 1.0.5 2017/09/03
|
||||
* Version: @(#)intel_sio.c 1.0.6 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "dma.h"
|
||||
|
||||
4
src/io.c
4
src/io.c
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "timer.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "timer.h"
|
||||
|
||||
@@ -19,8 +19,11 @@
|
||||
- Some DOS stuff will write to 0x201 while a packet is being transferred.
|
||||
This seems to be ignored.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "timer.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "timer.h"
|
||||
|
||||
@@ -8,21 +8,26 @@
|
||||
*
|
||||
* Host to guest keyboard interface and keyboard scan code sets.
|
||||
*
|
||||
* Version: @(#)keyboard.c 1.0.1 2017/08/23
|
||||
* Version: @(#)keyboard.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "plat_keyboard.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
|
||||
int keybsendcallback = 0;
|
||||
int keybsenddelay;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int scancodes_make[9];
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
|
||||
@@ -8,19 +8,23 @@
|
||||
*
|
||||
* Intel 8042 (AT keyboard controller) emulation.
|
||||
*
|
||||
* Version: @(#)keyboard_at.c 1.0.2 2017/09/03
|
||||
* Version: @(#)keyboard_at.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "pic.h"
|
||||
#include "pit.h"
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
#include "timer.h"
|
||||
#include "floppy/floppy.h"
|
||||
#include "floppy/fdc.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
#include "pic.h"
|
||||
#include "pit.h"
|
||||
#include "timer.h"
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
|
||||
#include "lpt.h"
|
||||
#include "sound/snd_lpt_dac.h"
|
||||
#include "sound/snd_lpt_dss.h"
|
||||
|
||||
|
||||
char lpt1_device_name[16];
|
||||
|
||||
|
||||
static struct
|
||||
{
|
||||
char name[64];
|
||||
|
||||
@@ -8,18 +8,22 @@
|
||||
*
|
||||
* Handling of the emulated machines.
|
||||
*
|
||||
* Version: @(#)machine.c 1.0.14 2017/09/21
|
||||
* Version: @(#)machine.c 1.0.15 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../device.h"
|
||||
#include "../floppy/floppy.h"
|
||||
#include "../floppy/fdc.h"
|
||||
@@ -161,103 +165,108 @@ machine_t machines[] =
|
||||
};
|
||||
|
||||
|
||||
int machine_count(void)
|
||||
void
|
||||
machine_init(void)
|
||||
{
|
||||
return (sizeof(machines) / sizeof(machine)) - 1;
|
||||
pclog("Initializing as \"%s\"\n", machine_getname());
|
||||
|
||||
AMSTRAD = AT = PCI = TANDY = 0;
|
||||
|
||||
io_init();
|
||||
|
||||
fdc_update_is_nsc(0);
|
||||
|
||||
machines[machine].init();
|
||||
|
||||
if (machines[machine].get_device)
|
||||
device_add(machines[machine].get_device());
|
||||
}
|
||||
|
||||
|
||||
int machine_getromset(void)
|
||||
int
|
||||
machine_count(void)
|
||||
{
|
||||
return machines[machine].id;
|
||||
return((sizeof(machines) / sizeof(machine)) - 1);
|
||||
}
|
||||
|
||||
|
||||
int machine_getromset_ex(int m)
|
||||
int
|
||||
machine_getromset(void)
|
||||
{
|
||||
return machines[m].id;
|
||||
return(machines[machine].id);
|
||||
}
|
||||
|
||||
|
||||
int machine_getmachine(int romset)
|
||||
int
|
||||
machine_getromset_ex(int m)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (machines[c].id != -1)
|
||||
{
|
||||
if (machines[c].id == romset)
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return(machines[m].id);
|
||||
}
|
||||
|
||||
|
||||
char *machine_getname(void)
|
||||
int
|
||||
machine_getmachine(int romset)
|
||||
{
|
||||
return machines[machine].name;
|
||||
int c = 0;
|
||||
|
||||
while (machines[c].id != -1) {
|
||||
if (machines[c].id == romset)
|
||||
return(c);
|
||||
c++;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
device_t *machine_getdevice(int machine)
|
||||
char *
|
||||
machine_getname(void)
|
||||
{
|
||||
if (machines[machine].get_device)
|
||||
{
|
||||
return machines[machine].get_device();
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return(machines[machine].name);
|
||||
}
|
||||
|
||||
|
||||
char *machine_get_internal_name(void)
|
||||
device_t *
|
||||
machine_getdevice(int machine)
|
||||
{
|
||||
return machines[machine].internal_name;
|
||||
if (machines[machine].get_device)
|
||||
return(machines[machine].get_device());
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
|
||||
char *machine_get_internal_name_ex(int m)
|
||||
char *
|
||||
machine_get_internal_name(void)
|
||||
{
|
||||
return machines[m].internal_name;
|
||||
return(machines[machine].internal_name);
|
||||
}
|
||||
|
||||
|
||||
int machine_get_nvrmask(int m)
|
||||
char *
|
||||
machine_get_internal_name_ex(int m)
|
||||
{
|
||||
return machines[m].nvrmask;
|
||||
return(machines[m].internal_name);
|
||||
}
|
||||
|
||||
|
||||
int machine_get_machine_from_internal_name(char *s)
|
||||
int
|
||||
machine_get_nvrmask(int m)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (machines[c].id != -1)
|
||||
{
|
||||
if (!strcmp(machines[c].internal_name, s))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return(machines[m].nvrmask);
|
||||
}
|
||||
|
||||
|
||||
void machine_init(void)
|
||||
int
|
||||
machine_get_machine_from_internal_name(char *s)
|
||||
{
|
||||
pclog("Initializing as %s\n", machine_getname());
|
||||
int c = 0;
|
||||
|
||||
AMSTRAD = AT = PCI = TANDY = 0;
|
||||
while (machines[c].id != -1) {
|
||||
if (!strcmp(machines[c].internal_name, s))
|
||||
return(c);
|
||||
c++;
|
||||
}
|
||||
|
||||
io_init();
|
||||
|
||||
fdc_update_is_nsc(0);
|
||||
|
||||
machines[machine].init();
|
||||
|
||||
if (machines[machine].get_device)
|
||||
device_add(machines[machine].get_device());
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
#include "../nmi.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../device.h"
|
||||
#include "../nvr.h"
|
||||
#include "../gameport.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../pic.h"
|
||||
#include "../pit.h"
|
||||
|
||||
@@ -8,18 +8,22 @@
|
||||
*
|
||||
* Implementation of the Intel 430FX PCISet chip.
|
||||
*
|
||||
* Version: @(#)machine_at_430fx.c 1.0.4 2017/09/03
|
||||
* Version: @(#)machine_at_430fx.c 1.0.5 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../mem.h"
|
||||
#include "../memregs.h"
|
||||
#include "../rom.h"
|
||||
#include "../pci.h"
|
||||
#include "../device.h"
|
||||
#include "../piix.h"
|
||||
|
||||
@@ -8,14 +8,17 @@
|
||||
*
|
||||
* Implementation of the Intel 430HX PCISet chip.
|
||||
*
|
||||
* Version: @(#)machine_at_430hx.c 1.0.4 2017/09/03
|
||||
* Version: @(#)machine_at_430hx.c 1.0.5 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -8,18 +8,22 @@
|
||||
*
|
||||
* Implementation of the Intel 430LX and 430NX PCISet chips.
|
||||
*
|
||||
* Version: @(#)machine_at_430lx_nx.c 1.0.4 2017/09/03
|
||||
* Version: @(#)machine_at_430lx_nx.c 1.0.5 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../mem.h"
|
||||
#include "../memregs.h"
|
||||
#include "../rom.h"
|
||||
#include "../pci.h"
|
||||
#include "../device.h"
|
||||
#include "../intel.h"
|
||||
|
||||
@@ -8,14 +8,17 @@
|
||||
*
|
||||
* Implementation of the Intel 430VX PCISet chip.
|
||||
*
|
||||
* Version: @(#)machine_at_430vx.c 1.0.5 2017/09/03
|
||||
* Version: @(#)machine_at_430vx.c 1.0.6 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -8,14 +8,17 @@
|
||||
*
|
||||
* Implementation of the Intel 440FX PCISet chip.
|
||||
*
|
||||
* Version: @(#)machine_at_440fx.c 1.0.4 2017/09/03
|
||||
* Version: @(#)machine_at_440fx.c 1.0.5 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../io.h"
|
||||
#include "../lpt.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../mem.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
see COPYING for more details
|
||||
*/
|
||||
/*This is the chipset used in the AMI 286 clone model*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -251,6 +251,10 @@ Note: the block address is forced to be a multiple of the block size by
|
||||
ignoring the appropriate number of the least-significant bits
|
||||
SeeAlso: #P0178,#P0187
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,11 +9,15 @@
|
||||
* SiS sis85c471 Super I/O Chip
|
||||
* Used by DTK PKM-0038S E-2
|
||||
*
|
||||
* Version: @(#)sis85c471.c 1.0.4 2017/09/03
|
||||
* Version: @(#)sis85c471.c 1.0.5 2017/09/24
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../io.h"
|
||||
#include "../memregs.h"
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -6,12 +6,16 @@
|
||||
*
|
||||
* Emulation of the SiS 50x PCI chips.
|
||||
*
|
||||
* Version: @(#)machine_at_sis_85c50x.c 1.0.2 2017/09/02
|
||||
* Version: @(#)machine_at_sis_85c50x.c 1.0.3 2017/09/24
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../io.h"
|
||||
#include "../pci.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../dma.h"
|
||||
#include "../pic.h"
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
@@ -10,6 +12,7 @@
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../device.h"
|
||||
#include "../nvr.h"
|
||||
#include "../gameport.h"
|
||||
#include "../keyboard_xt.h"
|
||||
#include "../lpt.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../nmi.h"
|
||||
#include "../pic.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* Copyright holders: Sarah Walker
|
||||
see COPYING for more details
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
@@ -149,7 +153,8 @@ void ps1mb_init(void)
|
||||
io_sethandler(0x0320, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0322, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0324, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
|
||||
|
||||
|
||||
#if 0
|
||||
if (!enable_xtide)
|
||||
{
|
||||
rom_init(&ps1_high_rom,
|
||||
@@ -160,14 +165,7 @@ void ps1mb_init(void)
|
||||
0,
|
||||
MEM_MAPPING_EXTERNAL);
|
||||
}
|
||||
/* rom_init_interleaved(&ps1_high_rom,
|
||||
L"roms/machines/ibmps1es/ibm_1057757_24-05-90.bin",
|
||||
L"roms/machines/ibmps1es/ibm_1057757_29-15-90.bin",
|
||||
0xfc0000,
|
||||
0x40000,
|
||||
0x3ffff,
|
||||
0,
|
||||
MEM_MAPPING_EXTERNAL);*/
|
||||
#endif
|
||||
ps1_190 = 0;
|
||||
|
||||
lpt1_remove();
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../cpu/x86.h"
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../nmi.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../device.h"
|
||||
#include "../gameport.h"
|
||||
#include "../keyboard_xt.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../nmi.h"
|
||||
#include "../pit.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
/*This is the chipset used in the LaserXT series model*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../ibm.h"
|
||||
#include "../cpu/cpu.h"
|
||||
#include "../io.h"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/*INTEL 82355 MCR emulation
|
||||
This chip was used as part of many 386 chipsets
|
||||
It controls memory addressing and shadowing*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
|
||||
|
||||
|
||||
842
src/mem.c
842
src/mem.c
@@ -1,14 +1,11 @@
|
||||
/* Copyright holders: Sarah Walker, Tenshi
|
||||
see COPYING for more details
|
||||
*/
|
||||
/*MESS ROM notes :
|
||||
|
||||
- pc2386 BIOS is corrupt (JMP at F000:FFF0 points to RAM)
|
||||
- pc2386 video BIOS is underdumped (16k instead of 24k)
|
||||
- c386sx16 BIOS fails checksum
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "cpu/x86_ops.h"
|
||||
@@ -18,12 +15,8 @@
|
||||
#include "mem.h"
|
||||
#include "rom.h"
|
||||
#include "cpu/codegen.h"
|
||||
#include "video/video.h"
|
||||
|
||||
|
||||
page_t *pages;
|
||||
page_t **page_lookup;
|
||||
|
||||
static uint8_t (*_mem_read_b[0x40000])(uint32_t addr, void *priv);
|
||||
static uint16_t (*_mem_read_w[0x40000])(uint32_t addr, void *priv);
|
||||
static uint32_t (*_mem_read_l[0x40000])(uint32_t addr, void *priv);
|
||||
@@ -38,14 +31,17 @@ static mem_mapping_t *_mem_mapping_w[0x40000];
|
||||
static int _mem_state[0x40000];
|
||||
|
||||
static mem_mapping_t base_mapping;
|
||||
static mem_mapping_t ram_remapped_mapping;
|
||||
mem_mapping_t ram_low_mapping;
|
||||
mem_mapping_t ram_high_mapping;
|
||||
mem_mapping_t ram_mid_mapping;
|
||||
static mem_mapping_t ram_remapped_mapping;
|
||||
mem_mapping_t bios_mapping[8];
|
||||
mem_mapping_t bios_high_mapping[8];
|
||||
mem_mapping_t romext_mapping;
|
||||
|
||||
page_t *pages;
|
||||
page_t **page_lookup;
|
||||
|
||||
uint8_t *ram;
|
||||
uint32_t rammask;
|
||||
|
||||
@@ -67,8 +63,6 @@ unsigned char isram[0x10000];
|
||||
|
||||
static uint8_t ff_array[0x1000];
|
||||
|
||||
int enable_xtide = 0;
|
||||
|
||||
int mem_size;
|
||||
uint32_t biosmask;
|
||||
int readlnum=0,writelnum=0;
|
||||
@@ -79,802 +73,8 @@ uint8_t romext[32768];
|
||||
|
||||
uint32_t ram_mapped_addr[64];
|
||||
|
||||
static void mem_load_atide115_bios()
|
||||
{
|
||||
FILE *f;
|
||||
f=romfopen(L"roms/hdd/xtide/ide_at_1_1_5.bin",L"rb");
|
||||
|
||||
if (f)
|
||||
{
|
||||
fread(romext,16384,1,f);
|
||||
mem_mapping_enable(&romext_mapping);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
int loadbios()
|
||||
{
|
||||
FILE *f=NULL,*ff=NULL;
|
||||
int c;
|
||||
|
||||
loadfont(L"roms/video/mda/mda.rom", 0);
|
||||
loadfont(L"roms/video/wyse700/wy700.rom", 3);
|
||||
|
||||
biosmask = 0xffff;
|
||||
|
||||
if (!rom)
|
||||
rom = malloc(0x20000);
|
||||
memset(romext,0xff,0x8000);
|
||||
memset(rom, 0xff, 0x20000);
|
||||
|
||||
pclog("Starting with romset %i\n", romset);
|
||||
|
||||
mem_mapping_disable(&romext_mapping);
|
||||
|
||||
switch (romset)
|
||||
{
|
||||
case ROM_PC1512:
|
||||
f=romfopen(L"roms/machines/pc1512/40043.v1",L"rb");
|
||||
ff=romfopen(L"roms/machines/pc1512/40044.v1",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0xC000;c<0x10000;c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
loadfont(L"roms/machines/pc1512/40078.ic127", 2);
|
||||
return 1;
|
||||
case ROM_PC1640:
|
||||
f=romfopen(L"roms/machines/pc1640/40044.v3",L"rb");
|
||||
ff=romfopen(L"roms/machines/pc1640/40043.v3",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0xC000;c<0x10000;c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/pc1640/40100",L"rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_PC200:
|
||||
f=romfopen(L"roms/machines/pc200/pc20v2.1",L"rb");
|
||||
ff=romfopen(L"roms/machines/pc200/pc20v2.0",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0xC000;c<0x10000;c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
loadfont(L"roms/machines/pc200/40109.bin", 1);
|
||||
return 1;
|
||||
case ROM_TANDY:
|
||||
f=romfopen(L"roms/machines/tandy/tandy1t1.020",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_TANDY1000HX:
|
||||
f = romfopen(L"roms/machines/tandy1000hx/v020000.u12", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
case ROM_TANDY1000SL2:
|
||||
f = romfopen(L"roms/machines/tandy1000sl2/8079047.hu1" ,L"rb");
|
||||
ff = romfopen(L"roms/machines/tandy1000sl2/8079048.hu2",L"rb");
|
||||
if (!f || !ff) break;
|
||||
fseek(f, 0x30000/2, SEEK_SET);
|
||||
fseek(ff, 0x30000/2, SEEK_SET);
|
||||
for (c = 0x0000; c < 0x10000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c + 1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_IBMXT:
|
||||
f=romfopen(L"roms/machines/ibmxt/xt.rom",L"rb");
|
||||
if (!f)
|
||||
{
|
||||
f = romfopen(L"roms/machines/ibmxt/5000027.u19", L"rb");
|
||||
ff = romfopen(L"roms/machines/ibmxt/1501512.u18", L"rb");
|
||||
if (!f || !ff) break;
|
||||
fread(rom, 0x8000, 1, f);
|
||||
fread(rom + 0x8000, 0x8000, 1, ff);
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case ROM_IBMPCJR:
|
||||
f = romfopen(L"roms/machines/ibmpcjr/bios.rom", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_PORTABLE:
|
||||
f=romfopen(L"roms/machines/portable/Compaq Portable Plus 100666-001 Rev C u47.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
#if 0
|
||||
case ROM_PORTABLEII:
|
||||
f = romfopen(L"roms/machines/portableii/106438-001.BIN", L"rb");
|
||||
ff =romfopen(L"roms/machines/portableii/106437-001.BIN", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x8000;c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x7fff;
|
||||
return 1;
|
||||
|
||||
case ROM_PORTABLEIII:
|
||||
case ROM_PORTABLEIII386:
|
||||
f = romfopen(L"roms/machines/portableiii/109738-002.BIN", L"rb");
|
||||
ff =romfopen(L"roms/machines/portableiii/109737-002.BIN", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x10000;c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
case ROM_GENXT:
|
||||
f=romfopen(L"roms/machines/genxt/pcxt.rom",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_DTKXT:
|
||||
f=romfopen(L"roms/machines/dtk/DTK_ERSO_2.42_2764.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_OLIM24:
|
||||
f = romfopen(L"roms/machines/olivetti_m24/olivetti_m24_version_1.43_low.bin" ,L"rb");
|
||||
ff = romfopen(L"roms/machines/olivetti_m24/olivetti_m24_version_1.43_high.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x4000; c += 2)
|
||||
{
|
||||
rom[c + 0xc000] = getc(f);
|
||||
rom[c + 0xc001] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_PC2086:
|
||||
f = romfopen(L"roms/machines/pc2086/40179.ic129" ,L"rb");
|
||||
ff = romfopen(L"roms/machines/pc2086/40180.ic132",L"rb");
|
||||
if (!f || !ff) break;
|
||||
pclog("Loading BIOS\n");
|
||||
for (c = 0x0000; c < 0x4000; c += 2)
|
||||
{
|
||||
rom[c + 0x0000] = getc(f);
|
||||
rom[c + 0x0001] = getc(ff);
|
||||
}
|
||||
pclog("%02X %02X %02X\n", rom[0xfff0], rom[0xfff1], rom[0xfff2]);
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/pc2086/40186.ic171", L"rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
biosmask = 0x3fff;
|
||||
return 1;
|
||||
|
||||
case ROM_PC3086:
|
||||
f = romfopen(L"roms/machines/pc3086/fc00.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x4000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/pc3086/c000.bin", L"rb");
|
||||
if (!f) break;
|
||||
fclose(f);
|
||||
biosmask = 0x3fff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMAT:
|
||||
f = romfopen(L"roms/machines/ibmat/62x0820.u27", L"rb");
|
||||
ff =romfopen(L"roms/machines/ibmat/62x0821.u47", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c=0x0000;c<0x10000;c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_CMDPC30:
|
||||
f = romfopen(L"roms/machines/cmdpc30/commodore pc 30 iii even.bin", L"rb");
|
||||
ff = romfopen(L"roms/machines/cmdpc30/commodore pc 30 iii odd.bin", L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x8000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c + 1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x7fff;
|
||||
return 1;
|
||||
|
||||
case ROM_AMI386SX:
|
||||
f=romfopen(L"roms/machines/ami386/ami386.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AMI386DX_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
f=romfopen(L"roms/machines/ami386dx/OPT495SX.AMI",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
case ROM_MR386DX_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
f=romfopen(L"roms/machines/mr386dx/OPT495SX.MR",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AWARD386SX_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
case ROM_AWARD386DX_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
case ROM_AWARD486_OPTI495: /*This uses the OPTi 82C495 chipset*/
|
||||
f=romfopen(L"roms/machines/award495/OPT495S.AWA",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AMI286:
|
||||
f=romfopen(L"roms/machines/ami286/amic206.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AWARD286:
|
||||
f=romfopen(L"roms/machines/award286/award.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_EUROPC:
|
||||
f=romfopen(L"roms/machines/europc/50145",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0x8000,32768,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPC:
|
||||
f=romfopen(L"roms/machines/ibmpc/pc102782.bin",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xE000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/ibmpc/ibm-basic-1.10.rom",L"rb");
|
||||
if (!f)
|
||||
{
|
||||
f=romfopen(L"roms/machines/ibmpc/basicc11.f6",L"rb");
|
||||
if (!f) return 1; /*I don't really care if BASIC is there or not*/
|
||||
fread(rom+0x6000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ibmpc/basicc11.f8",L"rb");
|
||||
if (!f) break; /*But if some of it is there, then all of it must be*/
|
||||
fread(rom+0x8000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ibmpc/basicc11.fa",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xA000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ibmpc/basicc11.fc",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xC000,8192,1,f);
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
{
|
||||
fread(rom+0x6000,32768,1,f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
case ROM_MEGAPC:
|
||||
case ROM_MEGAPCDX:
|
||||
f = romfopen(L"roms/machines/megapc/41651-bios lo.u18", L"rb");
|
||||
ff = romfopen(L"roms/machines/megapc/211253-bios hi.u19", L"rb");
|
||||
if (!f || !ff) break;
|
||||
fseek(f, 0x8000, SEEK_SET);
|
||||
fseek(ff, 0x8000, SEEK_SET);
|
||||
for (c = 0x0000; c < 0x10000; c+=2)
|
||||
{
|
||||
rom[c]=getc(f);
|
||||
rom[c+1]=getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_AMI486:
|
||||
f=romfopen(L"roms/machines/ami486/ami486.BIN",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_WIN486:
|
||||
f=romfopen(L"roms/machines/win486/ALI1429G.AMW",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom,65536,1,f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_430VX:
|
||||
f = romfopen(L"roms/machines/430vx/55XWUQ0E.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_REVENGE:
|
||||
f = romfopen(L"roms/machines/revenge/1009AF2_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/revenge/1009AF2_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0xc000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
case ROM_ENDEAVOR:
|
||||
f = romfopen(L"roms/machines/endeavor/1006CB0_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/endeavor/1006CB0_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0xd000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS1_2011:
|
||||
f = romfopen(L"roms/machines/ibmps1es/f80000.bin", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x60000, SEEK_SET);
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS1_2121:
|
||||
case ROM_IBMPS1_2121_ISA:
|
||||
f = romfopen(L"roms/machines/ibmps1_2121/fc0000.bin", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x20000, SEEK_SET);
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
if (enable_xtide)
|
||||
{
|
||||
mem_load_atide115_bios();
|
||||
}
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS1_2133:
|
||||
f = romfopen(L"roms/machines/ibmps1_2133/PS1_2133_52G2974_ROM.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_DESKPRO_386:
|
||||
f=romfopen(L"roms/machines/deskpro386/109592-005.U11.bin",L"rb");
|
||||
ff=romfopen(L"roms/machines/deskpro386/109591-005.U13.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x8000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c+1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x7fff;
|
||||
return 1;
|
||||
|
||||
case ROM_AMIXT:
|
||||
f = romfopen(L"roms/machines/amixt/AMI_8088_BIOS_31JAN89.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_LTXT:
|
||||
f = romfopen(L"roms/machines/ltxt/27C64.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/ltxt/ibm-basic-1.10.rom",L"rb");
|
||||
if (!f)
|
||||
{
|
||||
f=romfopen(L"roms/machines/ltxt/basicc11.f6",L"rb");
|
||||
if (!f) return 1; /*I don't really care if BASIC is there or not*/
|
||||
fread(rom+0x6000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ltxt/basicc11.f8",L"rb");
|
||||
if (!f) break; /*But if some of it is there, then all of it must be*/
|
||||
fread(rom+0x8000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ltxt/basicc11.fa",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xA000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ltxt/basicc11.fc",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xC000,8192,1,f);
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
{
|
||||
fread(rom+0x6000,32768,1,f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
case ROM_LXT3:
|
||||
f = romfopen(L"roms/machines/lxt3/27C64D.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/lxt3/ibm-basic-1.10.rom",L"rb");
|
||||
if (!f)
|
||||
{
|
||||
f=romfopen(L"roms/machines/lxt3/basicc11.f6",L"rb");
|
||||
if (!f) return 1; /*I don't really care if BASIC is there or not*/
|
||||
fread(rom+0x6000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/lxt3/basicc11.f8",L"rb");
|
||||
if (!f) break; /*But if some of it is there, then all of it must be*/
|
||||
fread(rom+0x8000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/lxt3/basicc11.fa",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xA000,8192,1,f);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/lxt3/basicc11.fc",L"rb");
|
||||
if (!f) break;
|
||||
fread(rom+0xC000,8192,1,f);
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
{
|
||||
fread(rom+0x6000,32768,1,f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
case ROM_SPC4200P: /*Samsung SPC-4200P*/
|
||||
f = romfopen(L"roms/machines/spc4200p/U8.01", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 65536, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_SUPER286TR: /*Hyundai Super-286TR*/
|
||||
f = romfopen(L"roms/machines/super286tr/hyundai_award286.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 65536, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_DTK386: /*Uses NEAT chipset*/
|
||||
f = romfopen(L"roms/machines/dtk386/3cto001.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 65536, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_PXXT:
|
||||
f = romfopen(L"roms/machines/pxxt/000p001.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_JUKOPC:
|
||||
f = romfopen(L"roms/machines/jukopc/000o001.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom + 0xE000, 8192, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M30_286:
|
||||
f = romfopen(L"roms/machines/ibmps2_m30_286/33f5381a.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
if (enable_xtide)
|
||||
{
|
||||
mem_load_atide115_bios();
|
||||
}
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_DTK486:
|
||||
f = romfopen(L"roms/machines/dtk486/4siw005.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
return 1;
|
||||
|
||||
case ROM_R418:
|
||||
f = romfopen(L"roms/machines/r418/r418i.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
pclog("Load R418 %x %x\n", rom[0x1fff0], rom[0xfff0]);
|
||||
return 1;
|
||||
|
||||
#if 0
|
||||
case ROM_586MC1:
|
||||
f = romfopen(L"roms/machines/586mc1/IS.34", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
case ROM_PLATO:
|
||||
f = romfopen(L"roms/machines/plato/1016AX1_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/plato/1016AX1_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0xd000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_MB500N:
|
||||
f = romfopen(L"roms/machines/mb500n/031396S.BIN", L"rb"); /* Works */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_AP53:
|
||||
f = romfopen(L"roms/machines/ap53/AP53R2C0.ROM", L"rb"); /* Works */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_P55T2S:
|
||||
f = romfopen(L"roms/machines/p55t2s/S6Y08T.ROM", L"rb"); /* Works */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_PRESIDENT:
|
||||
f = romfopen(L"roms/machines/president/BIOS.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_P54TP4XE:
|
||||
f = romfopen(L"roms/machines/p54tp4xe/T15I0302.AWD", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_ACERM3A:
|
||||
f = romfopen(L"roms/machines/acerm3a/r01-b3.bin", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_ACERV35N:
|
||||
f = romfopen(L"roms/machines/acerv35n/V35ND1S1.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_P55VA:
|
||||
f = romfopen(L"roms/machines/p55va/VA021297.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_P55T2P4:
|
||||
f = romfopen(L"roms/machines/p55t2p4/0207_J2.BIN", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_P55TVP4:
|
||||
f = romfopen(L"roms/machines/p55tvp4/TV5I0204.AWD", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_440FX:
|
||||
f = romfopen(L"roms/machines/440fx/NTMAW501.BIN", L"rb"); /* Working Tyan BIOS. */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_S1668:
|
||||
f = romfopen(L"roms/machines/tpatx/S1668P.ROM", L"rb"); /* Working Tyan BIOS. */
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_THOR:
|
||||
f = romfopen(L"roms/machines/thor/1006CN0_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/thor/1006CN0_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_MRTHOR:
|
||||
f = romfopen(L"roms/machines/mrthor/MR_ATX.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fread(rom, 0x20000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_ZAPPA:
|
||||
f = romfopen(L"roms/machines/zappa/1006BS0_.BIO", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom + 0x10000, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
f = romfopen(L"roms/machines/zappa/1006BS0_.BI1", L"rb");
|
||||
if (!f) break;
|
||||
fseek(f, 0x80, SEEK_SET);
|
||||
fread(rom, 0x10000, 1, f);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M50:
|
||||
f=romfopen(L"roms/machines/ibmps2_m50/90x7423.zm14",L"rb");
|
||||
ff=romfopen(L"roms/machines/ibmps2_m50/90x7426.zm16",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x10000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c+1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
f=romfopen(L"roms/machines/ibmps2_m50/90x7420.zm13",L"rb");
|
||||
ff=romfopen(L"roms/machines/ibmps2_m50/90x7429.zm18",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x10000; c < 0x20000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c+1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M55SX:
|
||||
f=romfopen(L"roms/machines/ibmps2_m55sx/33f8146.zm41",L"rb");
|
||||
ff=romfopen(L"roms/machines/ibmps2_m55sx/33f8145.zm40",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x20000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c+1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
|
||||
case ROM_IBMPS2_M80:
|
||||
case ROM_IBMPS2_M80_486:
|
||||
f=romfopen(L"roms/machines/ibmps2_m80/15f6637.bin",L"rb");
|
||||
ff=romfopen(L"roms/machines/ibmps2_m80/15f6639.bin",L"rb");
|
||||
if (!f || !ff) break;
|
||||
for (c = 0x0000; c < 0x20000; c += 2)
|
||||
{
|
||||
rom[c] = getc(f);
|
||||
rom[c+1] = getc(ff);
|
||||
}
|
||||
fclose(ff);
|
||||
fclose(f);
|
||||
biosmask = 0x1ffff;
|
||||
return 1;
|
||||
}
|
||||
printf("Failed to load ROM!\n");
|
||||
if (f) fclose(f);
|
||||
if (ff) fclose(ff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void resetreadlookup()
|
||||
void resetreadlookup(void)
|
||||
{
|
||||
int c;
|
||||
memset(readlookup2,0xFF,1024*1024*sizeof(uintptr_t));
|
||||
@@ -890,7 +90,7 @@ void resetreadlookup()
|
||||
int mmuflush=0;
|
||||
int mmu_perm=4;
|
||||
|
||||
void flushmmucache()
|
||||
void flushmmucache(void)
|
||||
{
|
||||
int c;
|
||||
for (c=0;c<256;c++)
|
||||
@@ -914,7 +114,7 @@ void flushmmucache()
|
||||
codegen_flush();
|
||||
}
|
||||
|
||||
void flushmmucache_nopc()
|
||||
void flushmmucache_nopc(void)
|
||||
{
|
||||
int c;
|
||||
for (c=0;c<256;c++)
|
||||
@@ -933,7 +133,7 @@ void flushmmucache_nopc()
|
||||
}
|
||||
}
|
||||
|
||||
void flushmmucache_cr3()
|
||||
void flushmmucache_cr3(void)
|
||||
{
|
||||
int c;
|
||||
for (c=0;c<256;c++)
|
||||
@@ -982,7 +182,7 @@ int pctrans=0;
|
||||
|
||||
extern uint32_t testr[9];
|
||||
|
||||
int mem_cpl3_check()
|
||||
int mem_cpl3_check(void)
|
||||
{
|
||||
if ((CPL == 3) && !cpl_override)
|
||||
{
|
||||
@@ -2120,7 +1320,7 @@ void mem_add_bios()
|
||||
int mem_a20_key = 0, mem_a20_alt = 0;
|
||||
int mem_a20_state = 1;
|
||||
|
||||
void mem_init()
|
||||
void mem_init(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -2299,9 +1499,10 @@ void mem_reset_page_blocks()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int port_92_reg = 0;
|
||||
|
||||
void mem_a20_recalc()
|
||||
void mem_a20_recalc(void)
|
||||
{
|
||||
int state = mem_a20_key | mem_a20_alt;
|
||||
if (state && !mem_a20_state)
|
||||
@@ -2317,11 +1518,13 @@ void mem_a20_recalc()
|
||||
mem_a20_state = state;
|
||||
}
|
||||
|
||||
|
||||
static uint8_t port_92_read(uint16_t port, void *priv)
|
||||
{
|
||||
return port_92_reg;
|
||||
}
|
||||
|
||||
|
||||
static void port_92_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
if ((mem_a20_alt ^ val) & 2)
|
||||
@@ -2339,22 +1542,23 @@ static void port_92_write(uint16_t port, uint8_t val, void *priv)
|
||||
port_92_reg = val;
|
||||
}
|
||||
|
||||
void port_92_clear_reset()
|
||||
|
||||
void port_92_clear_reset(void)
|
||||
{
|
||||
port_92_reg &= 2;
|
||||
}
|
||||
|
||||
void port_92_add()
|
||||
void port_92_add(void)
|
||||
{
|
||||
io_sethandler(0x0092, 0x0001, port_92_read, NULL, NULL, port_92_write, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
void port_92_remove()
|
||||
void port_92_remove(void)
|
||||
{
|
||||
io_removehandler(0x0092, 0x0001, port_92_read, NULL, NULL, port_92_write, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
void port_92_reset()
|
||||
void port_92_reset(void)
|
||||
{
|
||||
port_92_reg = 0;
|
||||
mem_a20_alt = 0;
|
||||
|
||||
23
src/mem.h
23
src/mem.h
@@ -173,26 +173,23 @@ void mem_write_ramw_page(uint32_t addr, uint16_t val, page_t *p);
|
||||
void mem_write_raml_page(uint32_t addr, uint32_t val, page_t *p);
|
||||
void mem_flush_write_page(uint32_t addr, uint32_t virt);
|
||||
|
||||
void mem_reset_page_blocks();
|
||||
extern void mem_reset_page_blocks(void);
|
||||
|
||||
extern mem_mapping_t ram_low_mapping;
|
||||
extern mem_mapping_t ram_mid_mapping;
|
||||
|
||||
void mem_remap_top_256k();
|
||||
void mem_remap_top_384k();
|
||||
extern void mem_remap_top_256k(void);
|
||||
extern void mem_remap_top_384k(void);
|
||||
|
||||
void flushmmucache_nopc();
|
||||
extern void flushmmucache_nopc(void);
|
||||
|
||||
int loadbios();
|
||||
extern void mem_add_bios(void);
|
||||
|
||||
void mem_add_bios();
|
||||
extern void mem_init(void);
|
||||
extern void mem_resize(void);
|
||||
|
||||
void mem_init();
|
||||
void mem_resize();
|
||||
|
||||
void port_92_reset();
|
||||
|
||||
void port_92_add();
|
||||
void port_92_remove();
|
||||
extern void port_92_reset(void);
|
||||
extern void port_92_add(void);
|
||||
extern void port_92_remove(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,12 +9,15 @@
|
||||
* Emulation of the memory I/O scratch registers on ports 0xE1
|
||||
* and 0xE2, used by just about any emulated machine.
|
||||
*
|
||||
* Version: @(#)memregs.c 1.0.1 2017/08/23
|
||||
* Version: @(#)memregs.c 1.0.2 2017/09/24
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "memregs.h"
|
||||
@@ -24,6 +27,7 @@ static uint8_t mem_regs[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0
|
||||
|
||||
static uint8_t mem_reg_ffff = 0;
|
||||
|
||||
|
||||
void memregs_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
if (port == 0xffff)
|
||||
|
||||
@@ -8,15 +8,19 @@
|
||||
*
|
||||
* Common driver module for MOUSE devices.
|
||||
*
|
||||
* Version: @(#)mouse.c 1.0.7 2017/09/02
|
||||
* Version: @(#)mouse.c 1.0.8 2017/09/24
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* TheCollector1995,
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "cpu/cpu.h"
|
||||
#include "device.h"
|
||||
|
||||
@@ -32,14 +32,17 @@
|
||||
* Based on an early driver for MINIX 1.5.
|
||||
* Based on the 86Box PS/2 mouse driver as a framework.
|
||||
*
|
||||
* Version: @(#)mouse_bus.c 1.0.8 2017/08/03
|
||||
* Version: @(#)mouse_bus.c 1.0.9 2017/09/24
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* TheCollector1995
|
||||
* Copyright 1989-2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "io.h"
|
||||
#include "pic.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "keyboard_at.h"
|
||||
#include "mouse.h"
|
||||
|
||||
@@ -10,11 +10,15 @@
|
||||
*
|
||||
* Based on the 86Box Serial Mouse driver as a framework.
|
||||
*
|
||||
* Version: @(#)mouse_serial.c 1.0.8 2017/08/03
|
||||
* Version: @(#)mouse_serial.c 1.0.9 2017/09/24
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include "ibm.h"
|
||||
#include "timer.h"
|
||||
#include "serial.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user