Cleanup, moving stuff out of ibm.h and such. Moved more configuration variables into main. Minor changes for multiplatform.

This commit is contained in:
waltje
2017-11-02 02:28:00 -05:00
parent 0565bf76af
commit b40ea14027
92 changed files with 565 additions and 467 deletions

View File

@@ -8,7 +8,7 @@
*
* Main include file for the application.
*
* Version: @(#)86box.h 1.0.10 2017/10/30
* Version: @(#)86box.h 1.0.11 2017/11/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -79,6 +79,19 @@ extern int vid_cga_contrast, /* (C) video */
enable_overscan, /* (C) video */
force_43, /* (C) video */
video_speed; /* (C) video */
extern int serial_enabled[], /* (C) enable serial ports */
lpt_enabled, /* (C) enable LPT ports */
bugger_enabled; /* (C) enable ISAbugger */
extern int gfxcard; /* (C) graphics/video card */
extern int GAMEBLASTER, /* (C) sound option */
GUS, /* (C) sound option */
SSI2001, /* (C) sound option */
voodoo_enabled; /* (C) video option */
extern int mem_size; /* (C) memory size */
extern int cpu_manufacturer, /* (C) cpu manufacturer */
cpu, /* (C) cpu type */
cpu_use_dynarec, /* (C) cpu uses/needs Dyna */
enable_external_fpu; /* (C) enable external FPU */
#ifdef ENABLE_LOG_TOGGLES
@@ -95,7 +108,7 @@ extern wchar_t exe_path[1024]; /* path (dir) of executable */
extern wchar_t cfg_path[1024]; /* path (dir) of user data */
extern int scrnsz_x, /* current screen size, X */
scrnsz_y; /* current screen size, Y */
extern int config_changed; /* configuration has changed */
extern int config_changed; /* config has changed */
/* Function prototypes. */

View File

@@ -86,7 +86,7 @@ static uint8_t bug_buff[FIFO_LEN], /* serial port data buffer */
static char bug_str[UISTR_LEN]; /* UI output string */
extern void set_bugui(char *__str);
extern void ui_sb_bugui(char *__str);
/* Update the system's UI with the actual Bugger status. */
@@ -106,7 +106,7 @@ bug_setui(void)
(bug_ledr&0x02)?'R':'r', (bug_ledr&0x01)?'R':'r');
/* Send formatted string to the UI. */
ui_sb_set_text(bug_str);
ui_sb_bugui(bug_str);
}

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)cdrom.h 1.0.3 2017/10/15
* Version: @(#)cdrom.h 1.0.4 2017/11/01
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -21,6 +21,12 @@
#define CDROM_NUM 4
#define CD_STATUS_EMPTY 0
#define CD_STATUS_DATA_ONLY 1
#define CD_STATUS_PLAYING 2
#define CD_STATUS_PAUSED 3
#define CD_STATUS_STOPPED 4
#define CDROM_PHASE_IDLE 0
#define CDROM_PHASE_COMMAND 1
#define CDROM_PHASE_COMPLETE 2
@@ -38,6 +44,15 @@
#define CDROM_TIME (5LL * 100LL * (1LL << TIMER_SHIFT))
enum {
CDROM_BUS_DISABLED = 0,
CDROM_BUS_ATAPI_PIO_ONLY = 4,
CDROM_BUS_ATAPI_PIO_AND_DMA,
CDROM_BUS_SCSI,
CDROM_BUS_USB = 8
};
typedef struct {
int (*ready)(uint8_t id);
int (*medium_changed)(uint8_t id);

View File

@@ -8,7 +8,7 @@
*
* Configuration file handler.
*
* Version: @(#)config.c 1.0.29 2017/10/28
* Version: @(#)config.c 1.0.30 2017/11/01
*
* Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com>
@@ -975,7 +975,7 @@ load_removable_devices(void)
wcsncpy(floppyfns[c], wp, sizeof_w(floppyfns[c]));
if (*wp != L'\0')
printf("Floppy%d: %ls\n", c, floppyfns[c]);
pclog("Floppy%d: %ls\n", c, floppyfns[c]);
sprintf(temp, "fdd_%02i_writeprot", c+1);
ui_writeprot[c] = !!config_get_int(cat, temp, 0);
sprintf(temp, "fdd_%02i_turbo", c + 1);

View File

@@ -14,6 +14,7 @@
#include "x87.h"
#include "../mem.h"
#include "../pic.h"
#include "../pit.h"
#include "../timer.h"
#include "../floppy/floppy.h"
#include "../floppy/fdc.h"

View File

@@ -13,6 +13,7 @@
#include "x86.h"
#include "x86_ops.h"
#include "x87.h"
#include "../io.h"
#include "../mem.h"
#include "../nmi.h"
#include "../pic.h"

View File

@@ -18,7 +18,7 @@
* 2 clocks - fetch opcode 1 2 clocks - execute
* 2 clocks - fetch opcode 2 etc
*
* Version: @(#)808x.c 1.0.5 2017/10/16
* Version: @(#)808x.c 1.0.6 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -34,6 +34,8 @@
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../mem.h"
#include "../rom.h"
#include "../nmi.h"
@@ -537,41 +539,41 @@ void dumpregs(int force)
pclog("Dumping done\n");
#endif
if (is386)
printf("EAX=%08X EBX=%08X ECX=%08X EDX=%08X\nEDI=%08X ESI=%08X EBP=%08X ESP=%08X\n",EAX,EBX,ECX,EDX,EDI,ESI,EBP,ESP);
pclog("EAX=%08X EBX=%08X ECX=%08X EDX=%08X\nEDI=%08X ESI=%08X EBP=%08X ESP=%08X\n",EAX,EBX,ECX,EDX,EDI,ESI,EBP,ESP);
else
printf("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",AX,BX,CX,DX,DI,SI,BP,SP);
printf("PC=%04X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",cpu_state.pc,CS,DS,ES,SS,flags);
printf("%04X:%04X %04X:%04X\n",oldcs,cpu_state.oldpc, oldcs2, oldpc2);
printf("%i ins\n",ins);
pclog("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",AX,BX,CX,DX,DI,SI,BP,SP);
pclog("PC=%04X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",cpu_state.pc,CS,DS,ES,SS,flags);
pclog("%04X:%04X %04X:%04X\n",oldcs,cpu_state.oldpc, oldcs2, oldpc2);
pclog("%i ins\n",ins);
if (is386)
printf("In %s mode\n",(msw&1)?((eflags&VM_FLAG)?"V86":"protected"):"real");
pclog("In %s mode\n",(msw&1)?((eflags&VM_FLAG)?"V86":"protected"):"real");
else
printf("In %s mode\n",(msw&1)?"protected":"real");
printf("CS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",cs,_cs.limit,_cs.access, _cs.limit_low, _cs.limit_high);
printf("DS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",ds,_ds.limit,_ds.access, _ds.limit_low, _ds.limit_high);
printf("ES : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",es,_es.limit,_es.access, _es.limit_low, _es.limit_high);
pclog("In %s mode\n",(msw&1)?"protected":"real");
pclog("CS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",cs,_cs.limit,_cs.access, _cs.limit_low, _cs.limit_high);
pclog("DS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",ds,_ds.limit,_ds.access, _ds.limit_low, _ds.limit_high);
pclog("ES : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",es,_es.limit,_es.access, _es.limit_low, _es.limit_high);
if (is386)
{
printf("FS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",seg_fs,_fs.limit,_fs.access, _fs.limit_low, _fs.limit_high);
printf("GS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",gs,_gs.limit,_gs.access, _gs.limit_low, _gs.limit_high);
pclog("FS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",seg_fs,_fs.limit,_fs.access, _fs.limit_low, _fs.limit_high);
pclog("GS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",gs,_gs.limit,_gs.access, _gs.limit_low, _gs.limit_high);
}
printf("SS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",ss,_ss.limit,_ss.access, _ss.limit_low, _ss.limit_high);
printf("GDT : base=%06X limit=%04X\n",gdt.base,gdt.limit);
printf("LDT : base=%06X limit=%04X\n",ldt.base,ldt.limit);
printf("IDT : base=%06X limit=%04X\n",idt.base,idt.limit);
printf("TR : base=%06X limit=%04X\n", tr.base, tr.limit);
pclog("SS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",ss,_ss.limit,_ss.access, _ss.limit_low, _ss.limit_high);
pclog("GDT : base=%06X limit=%04X\n",gdt.base,gdt.limit);
pclog("LDT : base=%06X limit=%04X\n",ldt.base,ldt.limit);
pclog("IDT : base=%06X limit=%04X\n",idt.base,idt.limit);
pclog("TR : base=%06X limit=%04X\n", tr.base, tr.limit);
if (is386)
{
printf("386 in %s mode stack in %s mode\n",(use32)?"32-bit":"16-bit",(stack32)?"32-bit":"16-bit");
printf("CR0=%08X CR2=%08X CR3=%08X CR4=%08x\n",cr0,cr2,cr3, cr4);
pclog("386 in %s mode stack in %s mode\n",(use32)?"32-bit":"16-bit",(stack32)?"32-bit":"16-bit");
pclog("CR0=%08X CR2=%08X CR3=%08X CR4=%08x\n",cr0,cr2,cr3, cr4);
}
printf("Entries in readlookup : %i writelookup : %i\n",readlnum,writelnum);
pclog("Entries in readlookup : %i writelookup : %i\n",readlnum,writelnum);
for (c=0;c<1024*1024;c++)
{
if (readlookup2[c]!=0xFFFFFFFF) d++;
if (writelookup2[c]!=0xFFFFFFFF) e++;
}
printf("Entries in readlookup : %i writelookup : %i\n",d,e);
pclog("Entries in readlookup : %i writelookup : %i\n",d,e);
x87_dumpregs();
indump = 0;
}
@@ -1025,7 +1027,7 @@ void execx86(int cycs)
cpu_state.pc--;
if (output)
{
if (!skipnextprint) printf("%04X:%04X : %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %02X %04X %i %p %02X\n",cs,cpu_state.pc,AX,BX,CX,DX,CS,DS,ES,SS,DI,SI,BP,SP,opcode,flags, ins, ram, ram[0x1a925]);
if (!skipnextprint) pclog("%04X:%04X : %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %04X %02X %04X %i %p %02X\n",cs,cpu_state.pc,AX,BX,CX,DX,CS,DS,ES,SS,DI,SI,BP,SP,opcode,flags, ins, ram, ram[0x1a925]);
skipnextprint=0;
}
cpu_state.pc++;
@@ -2910,7 +2912,7 @@ void execx86(int cycs)
}
else
{
printf("DIVb BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
pclog("DIVb BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
writememw(ss,(SP-2)&0xFFFF,flags|0xF000);
writememw(ss,(SP-4)&0xFFFF,CS);
writememw(ss,(SP-6)&0xFFFF,cpu_state.pc);
@@ -2934,7 +2936,7 @@ void execx86(int cycs)
}
else
{
printf("IDIVb BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
pclog("IDIVb BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
writememw(ss,(SP-2)&0xFFFF,flags|0xF000);
writememw(ss,(SP-4)&0xFFFF,CS);
writememw(ss,(SP-6)&0xFFFF,cpu_state.pc);
@@ -3006,7 +3008,7 @@ void execx86(int cycs)
}
else
{
printf("DIVw BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
pclog("DIVw BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
writememw(ss,(SP-2)&0xFFFF,flags|0xF000);
writememw(ss,(SP-4)&0xFFFF,CS);
writememw(ss,(SP-6)&0xFFFF,cpu_state.pc);
@@ -3030,7 +3032,7 @@ void execx86(int cycs)
}
else
{
printf("IDIVw BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
pclog("IDIVw BY 0 %04X:%04X\n",cs>>4,cpu_state.pc);
writememw(ss,(SP-2)&0xFFFF,flags|0xF000);
writememw(ss,(SP-4)&0xFFFF,CS);
writememw(ss,(SP-6)&0xFFFF,cpu_state.pc);

View File

@@ -8,7 +8,7 @@
*
* CPU type handler.
*
* Version: @(#)cpu.c 1.0.5 2017/10/16
* Version: @(#)cpu.c 1.0.6 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* leilei,
@@ -97,7 +97,6 @@ enum
CPUID_FXSR = (1 << 24)
};
int cpu = 3, cpu_manufacturer = 0;
CPU *cpu_s;
int cpu_multi;
int cpu_iscyrix;
@@ -107,10 +106,9 @@ int cpu_hasrdtsc;
int cpu_hasMMX, cpu_hasMSR;
int cpu_hasCR4;
int cpu_hasVME;
int cpu_use_dynarec;
int cpu_cyrix_alignment;
int hasfpu;
int cpuspeed;
uint64_t cpu_CR4_mask;
@@ -621,12 +619,12 @@ CPU cpus_PentiumPro[] =
{"", -1, 0, 0, 0}
};
void cpu_set_edx()
{
EDX = machines[machine].cpu[cpu_manufacturer].cpus[cpu].edx_reset;
}
int enable_external_fpu = 0;
void cpu_set()
{

View File

@@ -6,6 +6,7 @@
#include <math.h>
#include "../86box.h"
#include "../ibm.h"
#include "../mem.h"
#include "../pic.h"
#include "x86.h"
#include "x86_flags.h"

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of disk controllers.
*
* Version: @(#)hdc.c 1.0.4 2017/10/16
* Version: @(#)hdc.c 1.0.5 2017/11/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -21,10 +21,8 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../device.h"
#include "../machine/machine.h"
#include "../device.h"
#include "hdc.h"

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdc_ide.c 1.0.17 2017/10/27
* Version: @(#)hdc_ide.c 1.0.18 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -28,6 +28,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../pic.h"
#include "../pci.h"

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of hard disk images.
*
* Version: @(#)hdd.c 1.0.5 2017/10/16
* Version: @(#)hdd.c 1.0.6 2017/11/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -21,7 +21,6 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../ui.h"
#include "hdd.h"

View File

@@ -8,7 +8,7 @@
*
* Handling of hard disk image files.
*
* Version: @(#)hdd_image.c 1.0.6 2017/10/19
* Version: @(#)hdd_image.c 1.0.7 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -29,7 +29,6 @@
#include <wchar.h>
#include <errno.h>
#include "../86box.h"
#include "../ibm.h"
#include "../plat.h"
#include "hdd.h"

View File

@@ -9,10 +9,11 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdd_table.c 1.0.4 2017/10/16
* Version: @(#)hdd_table.c 1.0.5 2017/11/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
@@ -22,11 +23,6 @@
#include <stdarg.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pic.h"
#include "../pci.h"
#include "../timer.h"
#include "hdd.h"

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Intel DMA controllers.
*
* Version: @(#)dma.c 1.0.4 2017/10/16
* Version: @(#)dma.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -23,6 +23,7 @@
#include "86box.h"
#include "ibm.h"
#include "cpu/x86.h"
#include "machine/machine.h"
#include "mem.h"
#include "io.h"
#include "dma.h"

View File

@@ -8,10 +8,11 @@
*
* Implementation of the Intel DMA controllers.
*
* Version: @(#)dma.h 1.0.2 2017/08/23
* Version: @(#)dma.h 1.0.3 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -19,9 +20,35 @@
# define EMU_DMA_H
#define DMA_NODATA -1
#define DMA_OVER 0x10000
#define DMA_VERIFY 0x20000
#define DMA_NODATA -1
#define DMA_OVER 0x10000
#define DMA_VERIFY 0x20000
typedef struct DMA {
uint32_t ab[4],
ac[4];
uint16_t cb[4];
int cc[4];
int wp;
uint8_t m,
mode[4];
uint8_t page[4];
uint8_t stat;
uint8_t command;
uint8_t request;
int xfr_command,
xfr_channel;
int byte_ptr;
int is_ps2;
uint8_t arb_level[4];
uint8_t ps2_mode[4];
} DMA;
extern DMA dma, dma16;
extern void dma_init(void);

View File

@@ -9,7 +9,7 @@
* Implementation of the NEC uPD-765 and compatible floppy disk
* controller.
*
* Version: @(#)fdc.c 1.0.6 2017/10/16
* Version: @(#)fdc.c 1.0.7 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../mem.h"
#include "../rom.h"

View File

@@ -21,7 +21,7 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
//#include "../ibm.h"
#include "floppy.h"
#include "fdc.h"
#include "fdd.h"

View File

@@ -8,10 +8,11 @@
*
* Implementation of the floppy drive emulation.
*
* Version: @(#)fdd.h 1.0.2 2017/09/03
* Version: @(#)fdd.h 1.0.3 2017/10/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -22,6 +23,10 @@
#define SEEK_RECALIBRATE -999
#ifdef __cplusplus
extern "C" {
#endif
extern int fdd_swap;
@@ -60,5 +65,9 @@ extern int fdd_get_from_internal_name(char *s);
extern int fdd_track(int drive);
#ifdef __cplusplus
}
#endif
#endif /*EMU_FDD_H*/

View File

@@ -31,7 +31,7 @@
/* ELSE */
#define xmalloc malloc
#include "../86box.h"
#include "../ibm.h"
//#include "../ibm.h"
#include "fdi2raw.h"

View File

@@ -9,7 +9,7 @@
* Generic floppy disk interface that communicates with the
* other handlers.
*
* Version: @(#)floppy.c 1.0.10 2017/10/16
* Version: @(#)floppy.c 1.0.11 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -23,6 +23,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../mem.h"
#include "../rom.h"
#include "../config.h"

View File

@@ -9,7 +9,7 @@
* Generic floppy disk interface that communicates with the
* other handlers.
*
* Version: @(#)floppy.h 1.0.4 2017/10/15
* Version: @(#)floppy.h 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,26 +24,29 @@
#define FDD_NUM 4
typedef struct
{
void (*seek)(int drive, int track);
void (*readsector)(int drive, int sector, int track, int side, int density, int sector_size);
void (*writesector)(int drive, int sector, int track, int side, int density, int sector_size);
void (*comparesector)(int drive, int sector, int track, int side, int density, int sector_size);
void (*readaddress)(int drive, int side, int density);
void (*format)(int drive, int side, int density, uint8_t fill);
int (*hole)(int drive);
double (*byteperiod)(int drive);
void (*stop)(int drive);
void (*poll)(int drive);
typedef struct {
void (*seek)(int drive, int track);
void (*readsector)(int drive, int sector, int track, int side, int density, int sector_size);
void (*writesector)(int drive, int sector, int track, int side, int density, int sector_size);
void (*comparesector)(int drive, int sector, int track, int side, int density, int sector_size);
void (*readaddress)(int drive, int side, int density);
void (*format)(int drive, int side, int density, uint8_t fill);
int (*hole)(int drive);
double (*byteperiod)(int drive);
void (*stop)(int drive);
void (*poll)(int drive);
} DRIVE;
extern DRIVE drives[FDD_NUM];
extern wchar_t floppyfns[FDD_NUM][512];
extern int driveempty[FDD_NUM];
extern int64_t floppy_poll_time[FDD_NUM];
extern int curdrive;
extern int floppy_time;
extern int64_t floppy_poll_time[FDD_NUM];
extern int64_t floppytime;
extern void floppy_load(int drive, wchar_t *fn);
@@ -84,9 +87,11 @@ extern void fdc_sectorid(uint8_t track, uint8_t side, uint8_t sector,
uint8_t size, uint8_t crc1, uint8_t crc2);
extern void fdc_indexpulse(void);
/*extern int fdc_time;
#if 0
extern int fdc_time;
extern int fdc_ready;
extern int fdc_indexcount;*/
extern int fdc_indexcount;
#endif
extern int motorspin;
extern int64_t motoron[FDD_NUM];

View File

@@ -10,7 +10,7 @@
* data in the form of FM/MFM-encoded transitions) which also
* forms the core of the emulator's floppy disk emulation.
*
* Version: @(#)floppy_86f.c 1.0.9 2017/10/19
* Version: @(#)floppy_86f.c 1.0.10 2017/11/01
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -1303,7 +1303,7 @@ void d86f_read_sector_id(int drive, int side, int match)
if (d86f[drive].calc_crc.word != d86f[drive].track_crc.word)
{
d86f[drive].id_find.sync_marks = d86f[drive].id_find.bits_obtained = d86f[drive].id_find.bytes_obtained = 0;
printf("ID CRC error: %04X != %04X (%08X)\n", d86f[drive].track_crc.word, d86f[drive].calc_crc.word, d86f[drive].last_sector.dword);
pclog("86F: ID CRC error: %04X != %04X (%08X)\n", d86f[drive].track_crc.word, d86f[drive].calc_crc.word, d86f[drive].last_sector.dword);
if ((d86f[drive].state != STATE_02_READ_ID) && (d86f[drive].state != STATE_0A_READ_ID))
{
d86f[drive].error_condition = 0;
@@ -1495,7 +1495,7 @@ void d86f_read_sector_data(int drive, int side)
if ((d86f[drive].calc_crc.word != d86f[drive].track_crc.word) && (d86f[drive].state != STATE_02_READ_DATA))
{
printf("Data CRC error: %04X != %04X (%08X)\n", d86f[drive].track_crc.word, d86f[drive].calc_crc.word, d86f[drive].last_sector.dword);
pclog("86F: Data CRC error: %04X != %04X (%08X)\n", d86f[drive].track_crc.word, d86f[drive].calc_crc.word, d86f[drive].last_sector.dword);
d86f[drive].data_find.sync_marks = d86f[drive].data_find.bits_obtained = d86f[drive].data_find.bytes_obtained = 0;
d86f[drive].error_condition = 0;
d86f[drive].state = STATE_IDLE;

View File

@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
//#include "../ibm.h"
#include "../floppy/floppy.h"
#include "floppy_common.h"

View File

@@ -22,7 +22,7 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
//#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"
#include "floppy_86f.h"

View File

@@ -9,7 +9,7 @@
* 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.5 2017/10/16
* Version: @(#)floppy_img.c 1.0.6 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -674,7 +674,7 @@ void img_load(int drive, wchar_t *fn)
}
}
}
printf("Finished reading CopyQM image data\n");
pclog("Finished reading CopyQM image data\n");
cqm = 1;
img[drive].disk_at_once = 1;

View File

@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
//#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"
#include "fdc.h"

View File

@@ -43,7 +43,7 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
//#include "../ibm.h"
#include "../plat.h"
#include "floppy.h"
#include "floppy_td0.h"

View File

@@ -8,6 +8,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../cpu/cpu.h"
#include "../device.h"
#include "../io.h"

386
src/ibm.h
View File

@@ -10,10 +10,11 @@
*
* !!!NOTE!!! The goal is to GET RID of this file. Do NOT add stuff !!
*
* Version: @(#)ibm.h 1.0.11 2017/10/17
* Version: @(#)ibm.h 1.0.12 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -21,162 +22,115 @@
# define EMU_IBM_H
#define printf pclog
/*Memory*/
extern uint8_t *ram;
extern uint32_t rammask;
extern int readlookup[256],readlookupp[256];
extern uintptr_t *readlookup2;
extern int readlnext;
extern int writelookup[256],writelookupp[256];
extern uintptr_t *writelookup2;
extern int writelnext;
extern int mmu_perm;
#define readmemb(a) ((readlookup2[(a)>>12]==-1)?readmembl(a):*(uint8_t *)(readlookup2[(a) >> 12] + (a)))
#define readmemw(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 1))?readmemwl(s,a):*(uint16_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a))))
#define readmeml(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 3))?readmemll(s,a):*(uint32_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a))))
extern uint8_t readmembl(uint32_t addr);
extern void writemembl(uint32_t addr, uint8_t val);
extern uint8_t readmemb386l(uint32_t seg, uint32_t addr);
extern void writememb386l(uint32_t seg, uint32_t addr, uint8_t val);
extern uint16_t readmemwl(uint32_t seg, uint32_t addr);
extern void writememwl(uint32_t seg, uint32_t addr, uint16_t val);
extern uint32_t readmemll(uint32_t seg, uint32_t addr);
extern void writememll(uint32_t seg, uint32_t addr, uint32_t val);
extern uint64_t readmemql(uint32_t seg, uint32_t addr);
extern void writememql(uint32_t seg, uint32_t addr, uint64_t val);
extern uint8_t *getpccache(uint32_t a);
extern uint32_t mmutranslatereal(uint32_t addr, int rw);
extern void addreadlookup(uint32_t virt, uint32_t phys);
extern void addwritelookup(uint32_t virt, uint32_t phys);
/*IO*/
extern uint8_t inb(uint16_t port);
extern void outb(uint16_t port, uint8_t val);
extern uint16_t inw(uint16_t port);
extern void outw(uint16_t port, uint16_t val);
extern uint32_t inl(uint16_t port);
extern void outl(uint16_t port, uint32_t val);
extern int shadowbios,shadowbios_write;
extern int mem_size;
extern int readlnum,writelnum;
/*Processor*/
#define EAX cpu_state.regs[0].l
#define ECX cpu_state.regs[1].l
#define EDX cpu_state.regs[2].l
#define EBX cpu_state.regs[3].l
#define ESP cpu_state.regs[4].l
#define EBP cpu_state.regs[5].l
#define ESI cpu_state.regs[6].l
#define EDI cpu_state.regs[7].l
#define AX cpu_state.regs[0].w
#define CX cpu_state.regs[1].w
#define DX cpu_state.regs[2].w
#define BX cpu_state.regs[3].w
#define SP cpu_state.regs[4].w
#define BP cpu_state.regs[5].w
#define SI cpu_state.regs[6].w
#define DI cpu_state.regs[7].w
#define AL cpu_state.regs[0].b.l
#define AH cpu_state.regs[0].b.h
#define CL cpu_state.regs[1].b.l
#define CH cpu_state.regs[1].b.h
#define DL cpu_state.regs[2].b.l
#define DH cpu_state.regs[2].b.h
#define BL cpu_state.regs[3].b.l
#define BH cpu_state.regs[3].b.h
typedef union
{
uint32_t l;
uint16_t w;
struct
{
uint8_t l,h;
} b;
typedef union {
uint32_t l;
uint16_t w;
struct {
uint8_t l,
h;
} b;
} x86reg;
typedef struct
{
uint32_t base;
uint32_t limit;
uint8_t access;
uint16_t seg;
uint32_t limit_low, limit_high;
int checked; /*Non-zero if selector is known to be valid*/
typedef struct {
uint32_t base;
uint32_t limit;
uint8_t access;
uint16_t seg;
uint32_t limit_low,
limit_high;
int checked; /*Non-zero if selector is known to be valid*/
} x86seg;
typedef union MMX_REG
{
uint64_t q;
int64_t sq;
uint32_t l[2];
int32_t sl[2];
uint16_t w[4];
int16_t sw[4];
uint8_t b[8];
int8_t sb[8];
typedef union MMX_REG {
uint64_t q;
int64_t sq;
uint32_t l[2];
int32_t sl[2];
uint16_t w[4];
int16_t sw[4];
uint8_t b[8];
int8_t sb[8];
} MMX_REG;
struct _cpustate_
{
x86reg regs[8];
struct _cpustate_ {
x86reg regs[8];
uint8_t tag[8];
uint8_t tag[8];
x86seg *ea_seg;
uint32_t eaaddr;
x86seg *ea_seg;
uint32_t eaaddr;
int flags_op;
uint32_t flags_res;
uint32_t flags_op1, flags_op2;
uint32_t pc;
uint32_t oldpc;
uint32_t op32;
int flags_op;
uint32_t flags_res;
uint32_t flags_op1,
flags_op2;
int TOP;
union
{
struct
{
int8_t rm, mod, reg;
} rm_mod_reg;
uint32_t rm_mod_reg_data;
} rm_data;
int8_t ssegs;
int8_t ismmx;
int8_t abrt;
uint32_t pc;
uint32_t oldpc;
uint32_t op32;
int _cycles;
int cpu_recomp_ins;
uint16_t npxs, npxc;
int TOP;
double ST[8];
uint16_t MM_w4[8];
MMX_REG MM[8];
uint16_t old_npxc, new_npxc;
uint32_t last_ea;
union {
struct {
int8_t rm,
mod,
reg;
} rm_mod_reg;
int32_t rm_mod_reg_data;
} rm_data;
int8_t ssegs;
int8_t ismmx;
int8_t abrt;
int _cycles;
int cpu_recomp_ins;
uint16_t npxs,
npxc;
double ST[8];
uint16_t MM_w4[8];
MMX_REG MM[8];
uint16_t old_npxc,
new_npxc;
uint32_t last_ea;
} cpu_state;
#define EAX cpu_state.regs[0].l
#define AX cpu_state.regs[0].w
#define AL cpu_state.regs[0].b.l
#define AH cpu_state.regs[0].b.h
#define ECX cpu_state.regs[1].l
#define CX cpu_state.regs[1].w
#define CL cpu_state.regs[1].b.l
#define CH cpu_state.regs[1].b.h
#define EDX cpu_state.regs[2].l
#define DX cpu_state.regs[2].w
#define DL cpu_state.regs[2].b.l
#define DH cpu_state.regs[2].b.h
#define EBX cpu_state.regs[3].l
#define BX cpu_state.regs[3].w
#define BL cpu_state.regs[3].b.l
#define BH cpu_state.regs[3].b.h
#define ESP cpu_state.regs[4].l
#define EBP cpu_state.regs[5].l
#define ESI cpu_state.regs[6].l
#define EDI cpu_state.regs[7].l
#define SP cpu_state.regs[4].w
#define BP cpu_state.regs[5].w
#define SI cpu_state.regs[6].w
#define DI cpu_state.regs[7].w
#define cycles cpu_state._cycles
#define cycles cpu_state._cycles
#define cpu_rm cpu_state.rm_data.rm_mod_reg.rm
#define cpu_mod cpu_state.rm_data.rm_mod_reg.mod
#define cpu_reg cpu_state.rm_data.rm_mod_reg.reg
extern uint32_t cpu_cur_status;
@@ -185,10 +139,6 @@ extern uint32_t cpu_cur_status;
#define CPU_STATUS_FLATDS (1 << 2)
#define CPU_STATUS_FLATSS (1 << 3)
#define cpu_rm cpu_state.rm_data.rm_mod_reg.rm
#define cpu_mod cpu_state.rm_data.rm_mod_reg.mod
#define cpu_reg cpu_state.rm_data.rm_mod_reg.reg
#ifdef __MSC__
# define COMPILE_TIME_ASSERT(expr) /*nada*/
#else
@@ -272,9 +222,6 @@ extern uint32_t dr[8];
#define IOPLp ((!(msw&1)) || (CPL<=IOPL))
extern int cycles_lost;
extern int israpidcad;
extern int is486;
extern int is_pentium;
extern uint8_t opcode;
extern int insc;
extern int fpucount;
@@ -285,108 +232,15 @@ extern int CPUID;
extern int cpl_override;
extern int is286, is386, is486;
extern int is_rapidcad, is_pentium;
extern int hasfpu;
extern int cpuspeed;
/*Timer*/
typedef struct PIT_nr
{
int64_t nr;
struct PIT *pit;
} PIT_nr;
typedef struct PIT
{
uint32_t l[3];
int64_t c[3];
uint8_t m[3];
uint8_t ctrl,ctrls[3];
int64_t wp,rm[3],wm[3];
uint16_t rl[3];
int64_t thit[3];
int64_t delay[3];
int64_t rereadlatch[3];
int64_t gate[3];
int64_t out[3];
int64_t running[3];
int64_t enabled[3];
int64_t newcount[3];
int64_t count[3];
int64_t using_timer[3];
int64_t initial[3];
int64_t latched[3];
int64_t disabled[3];
uint8_t read_status[3];
int64_t do_read_status[3];
PIT_nr pit_nr[3];
void (*set_out_funcs[3])(int64_t new_out, int64_t old_out);
} PIT;
PIT pit, pit2;
extern void setpitclock(float clock);
extern float pit_timer0_freq(void);
/*DMA*/
typedef struct DMA
{
uint32_t ab[4],ac[4];
uint16_t cb[4];
int cc[4];
int wp;
uint8_t m,mode[4];
uint8_t page[4];
uint8_t stat;
uint8_t command;
uint8_t request;
int xfr_command, xfr_channel;
int byte_ptr;
int is_ps2;
uint8_t arb_level[4];
uint8_t ps2_mode[4];
} DMA;
extern DMA dma, dma16;
/*PPI*/
typedef struct PPI
{
int s2;
uint8_t pa,pb;
} PPI;
extern PPI ppi;
/*PIC*/
typedef struct PIC
{
uint8_t icw1,icw3,icw4,mask,ins,pend,mask2;
int icw;
uint8_t vector;
int read;
} PIC;
extern PIC pic, pic2;
extern int pic_intpending;
extern int64_t floppytime;
extern wchar_t floppyfns[4][512];
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) && 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)
int GAMEBLASTER, GUS, SSI2001, voodoo_enabled;
extern int AMSTRAD, AT, is286, is386, PCI, TANDY;
extern int hasfpu;
enum
{
GFX_CGA = 0,
@@ -460,10 +314,6 @@ enum
extern int gfx_present[GFX_MAX];
int gfxcard;
int cpuspeed;
/*Video*/
extern int egareads,egawrites;
@@ -471,14 +321,9 @@ extern int changeframecount;
/*Sound*/
extern int ppispeakon;
extern float CGACONST;
extern float MDACONST;
extern float VGACONST1,VGACONST2;
extern float RTCCONST;
extern int gated,speakval,speakon;
#define SOUNDBUFLEN (48000/50)
extern int ppispeakon;
extern int gated,speakval,speakon;
/*Sound Blaster*/
@@ -494,32 +339,13 @@ extern int gated,speakval,speakon;
#define SND_PAS16 10 /*Pro Audio Spectrum 16*/
/*Keyboard*/
extern int64_t keybsenddelay;
/*CD-ROM*/
enum
{
CDROM_BUS_DISABLED = 0,
CDROM_BUS_ATAPI_PIO_ONLY = 4,
CDROM_BUS_ATAPI_PIO_AND_DMA,
CDROM_BUS_SCSI,
CDROM_BUS_USB = 8
};
extern int64_t idecallback[5];
#define CD_STATUS_EMPTY 0
#define CD_STATUS_DATA_ONLY 1
#define CD_STATUS_PLAYING 2
#define CD_STATUS_PAUSED 3
#define CD_STATUS_STOPPED 4
extern uint32_t SCSIGetCDVolume(int channel);
extern uint32_t SCSIGetCDChannel(int channel);
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ELEMENTS(Array) (sizeof(Array) / sizeof((Array)[0]))
extern int ui_writeprot[4];
@@ -558,12 +384,6 @@ extern PCI_RESET pci_reset_handler;
extern void trc_init(void);
extern int enable_external_fpu;
extern int serial_enabled[2];
extern int lpt_enabled, bugger_enabled;
extern int romset;
uint32_t svga_color_transform(uint32_t color);

View File

@@ -7,6 +7,7 @@
#include <wchar.h>
#include "ibm.h"
#include "cpu/cpu.h"
#include "machine/machine.h"
#include "io.h"
#include "mem.h"
#include "pit.h"

View File

@@ -6,7 +6,6 @@
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"

View File

@@ -38,3 +38,10 @@ extern void io_removehandler_interleaved(uint16_t base, int size,
void (*outw)(uint16_t addr, uint16_t val, void *priv),
void (*outl)(uint16_t addr, uint32_t val, void *priv),
void *priv);
extern uint8_t inb(uint16_t port);
extern void outb(uint16_t port, uint8_t val);
extern uint16_t inw(uint16_t port);
extern void outw(uint16_t port, uint16_t val);
extern uint32_t inl(uint16_t port);
extern void outl(uint16_t port, uint32_t val);

View File

@@ -8,7 +8,7 @@
*
* Host to guest keyboard interface and keyboard scan code sets.
*
* Version: @(#)keyboard.c 1.0.7 2017/10/28
* Version: @(#)keyboard.c 1.0.8 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,7 +21,7 @@
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "machine/machine.h"
#include "keyboard.h"

View File

@@ -8,7 +8,7 @@
*
* Host to guest keyboard interface and keyboard scan code sets.
*
* Version: @(#)keyboard.h 1.0.3 2017/10/24
* Version: @(#)keyboard.h 1.0.4 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@ extern "C" {
extern uint8_t keyboard_mode;
extern int keyboard_scan;
extern int64_t keybsenddelay;
extern uint8_t keyboard_set3_flags[272];
extern uint8_t keyboard_set3_all_repeat;
extern uint8_t keyboard_set3_all_break;

View File

@@ -8,9 +8,9 @@
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"
#include "pic.h"
#include "pit.h"
#include "ppi.h"
#include "timer.h"
#include "sound/sound.h"
#include "sound/snd_speaker.h"

View File

@@ -8,7 +8,7 @@
*
* Intel 8042 (AT keyboard controller) emulation.
*
* Version: @(#)keyboard_at.c 1.0.6 2017/10/24
* Version: @(#)keyboard_at.c 1.0.7 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -27,6 +27,7 @@
#include "io.h"
#include "pic.h"
#include "pit.h"
#include "ppi.h"
#include "mem.h"
#include "rom.h"
#include "timer.h"

View File

@@ -4,11 +4,10 @@
#include <stdlib.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"
#include "pic.h"
#include "pit.h"
#include "ppi.h"
#include "timer.h"
#include "mouse.h"
#include "sound/sound.h"

View File

@@ -7,11 +7,13 @@
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "machine/machine.h"
#include "io.h"
#include "mem.h"
#include "rom.h"
#include "pic.h"
#include "pit.h"
#include "ppi.h"
#include "timer.h"
#include "device.h"
#include "tandy_eeprom.h"

View File

@@ -5,7 +5,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "ibm.h"
#include "86box.h"
#include "io.h"
#include "lpt.h"
#include "sound/snd_lpt_dac.h"

View File

@@ -8,7 +8,7 @@
*
* Handling of the emulated machines.
*
* Version: @(#)machine.c 1.0.22 2017/10/30
* Version: @(#)machine.c 1.0.23 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -40,8 +40,6 @@
int machine;
int AMSTRAD, AT, PCI, TANDY;
int serial_enabled[SERIAL_MAX] = { 0, 0 };
int lpt_enabled = 0, bugger_enabled = 0;
int romset;

View File

@@ -8,7 +8,7 @@
*
* Handling of the emulated machines.
*
* Version: @(#)machine.h 1.0.7 2017/10/12
* Version: @(#)machine.h 1.0.8 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -73,6 +73,8 @@ typedef struct _machine_ {
/* Global variables. */
extern machine_t machines[];
extern int machine;
extern int romset;
extern int AMSTRAD, TANDY, AT, PCI;
/* Core functions. */

View File

@@ -275,7 +275,7 @@ static void opti495_write(uint16_t addr, uint8_t val, void *p)
optireg=val;
break;
case 0x24:
printf("Writing OPTI reg %02X %02X\n",optireg,val);
pclog("OPTI: writing reg %02X %02X\n",optireg,val);
if (optireg>=0x20 && optireg<=0x2C)
{
optiregs[optireg-0x20]=val;

View File

@@ -2,9 +2,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "ibm.h"
#include "io.h"
#include "mem.h"
#include "mca.h"

View File

@@ -7,6 +7,7 @@
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "mem.h"
int nextreg6;
@@ -23,7 +24,7 @@ void resetmcr(void)
void writemcr(uint16_t addr, uint8_t val)
{
printf("Write MCR %04X %02X %04X:%04X\n",addr,val,CS,cpu_state.pc);
pclog("MCR: write %04X %02X %04X:%04X\n",addr,val,CS,cpu_state.pc);
switch (addr)
{
case 0x22:

View File

@@ -11,6 +11,7 @@
#include "cpu/cpu.h"
#include "cpu/x86_ops.h"
#include "cpu/x86.h"
#include "machine/machine.h"
#include "config.h"
#include "io.h"
#include "mem.h"

View File

@@ -4,6 +4,43 @@
#ifndef _MEM_H_
#define _MEM_H_
extern uint8_t *ram;
extern uint32_t rammask;
extern int readlookup[256],readlookupp[256];
extern uintptr_t *readlookup2;
extern int readlnext;
extern int writelookup[256],writelookupp[256];
extern uintptr_t *writelookup2;
extern int writelnext;
extern int mmu_perm;
#define readmemb(a) ((readlookup2[(a)>>12]==-1)?readmembl(a):*(uint8_t *)(readlookup2[(a) >> 12] + (a)))
#define readmemw(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 1))?readmemwl(s,a):*(uint16_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a))))
#define readmeml(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 3))?readmemll(s,a):*(uint32_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a))))
extern uint8_t readmembl(uint32_t addr);
extern void writemembl(uint32_t addr, uint8_t val);
extern uint8_t readmemb386l(uint32_t seg, uint32_t addr);
extern void writememb386l(uint32_t seg, uint32_t addr, uint8_t val);
extern uint16_t readmemwl(uint32_t seg, uint32_t addr);
extern void writememwl(uint32_t seg, uint32_t addr, uint16_t val);
extern uint32_t readmemll(uint32_t seg, uint32_t addr);
extern void writememll(uint32_t seg, uint32_t addr, uint32_t val);
extern uint64_t readmemql(uint32_t seg, uint32_t addr);
extern void writememql(uint32_t seg, uint32_t addr, uint64_t val);
extern uint8_t *getpccache(uint32_t a);
extern uint32_t mmutranslatereal(uint32_t addr, int rw);
extern void addreadlookup(uint32_t virt, uint32_t phys);
extern void addwritelookup(uint32_t virt, uint32_t phys);
extern int shadowbios,shadowbios_write;
extern int readlnum,writelnum;
typedef struct mem_mapping_t
{
struct mem_mapping_t *prev, *next;

View File

@@ -8,7 +8,7 @@
*
* Common driver module for MOUSE devices.
*
* Version: @(#)mouse.c 1.0.13 2017/10/25
* Version: @(#)mouse.c 1.0.14 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -22,7 +22,7 @@
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "ibm.h"
#include "86box.h"
#include "device.h"
#include "mouse.h"
#include "machine/machine.h"

View File

@@ -32,7 +32,7 @@
* 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.20 2017/10/25
* Version: @(#)mouse_bus.c 1.0.21 2017/11/01
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -44,7 +44,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "io.h"
#include "pic.h"
#include "timer.h"
@@ -407,6 +406,7 @@ bm_init(mouse_t *info)
break;
}
ms->flags |= MOUSE_ENABLED;
ms->flags |= MOUSE_SCALED;
/* Request an I/O range. */
io_sethandler(ms->port, ms->portlen,

View File

@@ -10,7 +10,7 @@
*
* NOTE: The file will also implement an NE1000 for 8-bit ISA systems.
*
* Version: @(#)net_ne2000.c 1.0.21 2017/10/28
* Version: @(#)net_ne2000.c 1.0.22 2017/11/01
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Peter Grehan, grehan@iprg.nokia.com>
@@ -30,6 +30,7 @@
#include "../86box.h"
#include "../config.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../mem.h"
#include "../rom.h"

View File

@@ -8,7 +8,7 @@
*
* Definitions for the network module.
*
* Version: @(#)network.h 1.0.9 2017/10/28
* Version: @(#)network.h 1.0.10 2017/11/01
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*/
@@ -47,6 +47,10 @@ typedef struct {
} netdev_t;
#ifdef __cplusplus
extern "C" {
#endif
/* Global variables. */
extern int nic_do_log; /* config */
extern int network_card; /* config */
@@ -88,5 +92,9 @@ extern char *network_card_get_internal_name(int);
extern int network_card_get_from_internal_name(char *);
extern device_t *network_card_getdevice(int);
#ifdef __cplusplus
}
#endif
#endif /*EMU_NETWORK_H*/

View File

@@ -186,7 +186,7 @@
* (DS12887A) which implemented a "century" register to be
* compatible with Y2K.
*
* Version: @(#)nvr.c 1.0.11 2017/10/28
* Version: @(#)nvr.c 1.0.12 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -204,11 +204,9 @@
#include <time.h>
#include <wchar.h>
#include "86Box.h"
#include "ibm.h"
#include "cpu/cpu.h"
#include "pic.h"
#include "pit.h"
#include "timer.h"
#include "device.h"
#include "machine/machine.h"
#include "plat.h"
#include "nvr.h"

View File

@@ -3,6 +3,8 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include "86box.h"
#include "machine/machine.h"
#include "ibm.h"
#include "device.h"
#include "io.h"

View File

@@ -8,7 +8,7 @@
*
* Main emulator module where most things are controlled.
*
* Version: @(#)pc.c 1.0.38 2017/10/30
* Version: @(#)pc.c 1.0.39 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -102,6 +102,19 @@ int vid_cga_contrast = 0, /* (C) video */
enable_overscan = 0, /* (C) video */
force_43 = 0, /* (C) video */
video_speed = 0; /* (C) video */
int serial_enabled[SERIAL_MAX] = {0,0}, /* (C) enable serial ports */
lpt_enabled = 0, /* (C) enable LPT ports */
bugger_enabled = 0; /* (C) enable ISAbugger */
int gfxcard = 0; /* (C) graphics/video card */
int GAMEBLASTER = 0, /* (C) sound option */
GUS = 0, /* (C) sound option */
SSI2001 = 0, /* (C) sound option */
voodoo_enabled = 0; /* (C) video option */
int mem_size = 0; /* (C) memory size */
int cpu_manufacturer = 0, /* (C) cpu manufacturer */
cpu_use_dynarec = 0, /* (C) cpu uses/needs Dyna */
cpu = 3, /* (C) cpu type */
enable_external_fpu = 0; /* (C) enable external FPU */
/* Statistics. */
@@ -134,7 +147,8 @@ wchar_t exe_path[1024]; /* path (dir) of executable */
wchar_t cfg_path[1024]; /* path (dir) of user data */
int scrnsz_x = SCREEN_RES_X, /* current screen size, X */
scrnsz_y = SCREEN_RES_Y; /* current screen size, Y */
int config_changed; /* configuration has changed */
int config_changed; /* config has changed */
int romset; /* current machine ID */
int title_update;
int64_t main_time;
@@ -168,7 +182,7 @@ fatal(const char *format, ...)
va_start(ap, format);
vsprintf(msg, format, ap);
printf(msg);
fprintf(stdout, msg);
va_end(ap);
fflush(stdout);

View File

@@ -3,6 +3,8 @@
#include <string.h>
#include <stdarg.h>
#include <wchar.h>
#include "86box.h"
#include "machine/machine.h"
#include "ibm.h"
#include "io.h"
#include "pic.h"

View File

@@ -3,7 +3,7 @@
#include <string.h>
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "machine/machine.h"
#include "io.h"
#include "pci.h"
#include "pic.h"

View File

@@ -1,10 +1,29 @@
extern void pic_init(void);
extern void pic2_init(void);
extern void pic_reset(void);
#ifndef EMU_PIC_H
# define EMU_PIC_H
extern void picint(uint16_t num);
extern void picintlevel(uint16_t num);
extern void picintc(uint16_t num);
extern uint8_t picinterrupt(void);
extern void picclear(int num);
extern void dumppic(void);
typedef struct PIC {
uint8_t icw1,icw3,icw4,mask,ins,pend,mask2;
int icw;
uint8_t vector;
int read;
} PIC;
extern PIC pic, pic2;
extern int pic_intpending;
extern void pic_init(void);
extern void pic2_init(void);
extern void pic_reset(void);
extern void picint(uint16_t num);
extern void picintlevel(uint16_t num);
extern void picintc(uint16_t num);
extern uint8_t picinterrupt(void);
extern void picclear(int num);
extern void dumppic(void);
#endif /*EMU_PIC_H*/

View File

@@ -12,6 +12,7 @@
#include "io.h"
#include "pic.h"
#include "pit.h"
#include "ppi.h"
#include "device.h"
#include "timer.h"
#include "machine/machine.h"
@@ -23,14 +24,17 @@
/*B4 to 40, two writes to 43, then two reads - value _does_ change!*/
int64_t displine;
double PITCONST;
PIT pit,
pit2;
float cpuclock;
float isa_timing, bus_timing;
float CGACONST;
float MDACONST;
float VGACONST1,VGACONST2;
float RTCCONST;
double PITCONST;
float CGACONST;
float MDACONST;
float VGACONST1,
VGACONST2;
float RTCCONST;
int64_t firsttime=1;
void setpitclock(float clock)

View File

@@ -1,17 +1,72 @@
extern double PITCONST;
extern void pit_init(void);
extern void pit_ps2_init(void);
extern void pit_reset(PIT *pit);
extern void pit_set_gate(PIT *pit, int64_t channel, int64_t gate);
extern void pit_set_using_timer(PIT *pit, int64_t t, int64_t using_timer);
extern void pit_set_out_func(PIT *pit, int64_t t, void (*func)(int64_t new_out, int64_t old_out));
extern void pit_clock(PIT *pit, int64_t t);
#ifndef EMU_PIT_H
# define EMU_PIT_H
extern void pit_null_timer(int64_t new_out, int64_t old_out);
extern void pit_irq0_timer(int64_t new_out, int64_t old_out);
extern void pit_irq0_timer_pcjr(int64_t new_out, int64_t old_out);
extern void pit_refresh_timer_xt(int64_t new_out, int64_t old_out);
extern void pit_refresh_timer_at(int64_t new_out, int64_t old_out);
extern void pit_speaker_timer(int64_t new_out, int64_t old_out);
typedef struct {
int64_t nr;
struct PIT *pit;
} PIT_nr;
typedef struct PIT {
uint32_t l[3];
int64_t c[3];
uint8_t m[3];
uint8_t ctrl,
ctrls[3];
int64_t wp,
rm[3],
wm[3];
uint16_t rl[3];
int64_t thit[3];
int64_t delay[3];
int64_t rereadlatch[3];
int64_t gate[3];
int64_t out[3];
int64_t running[3];
int64_t enabled[3];
int64_t newcount[3];
int64_t count[3];
int64_t using_timer[3];
int64_t initial[3];
int64_t latched[3];
int64_t disabled[3];
uint8_t read_status[3];
int64_t do_read_status[3];
PIT_nr pit_nr[3];
void (*set_out_funcs[3])(int64_t new_out, int64_t old_out);
} PIT;
extern PIT pit,
pit2;
extern double PITCONST;
extern float CGACONST,
MDACONST,
VGACONST1,
VGACONST2,
RTCCONST;
extern void pit_init(void);
extern void pit_ps2_init(void);
extern void pit_reset(PIT *pit);
extern void pit_set_gate(PIT *pit, int64_t channel, int64_t gate);
extern void pit_set_using_timer(PIT *pit, int64_t t, int64_t using_timer);
extern void pit_set_out_func(PIT *pit, int64_t t, void (*func)(int64_t new_out, int64_t old_out));
extern void pit_clock(PIT *pit, int64_t t);
extern void setpitclock(float clock);
extern float pit_timer0_freq(void);
extern void pit_null_timer(int64_t new_out, int64_t old_out);
extern void pit_irq0_timer(int64_t new_out, int64_t old_out);
extern void pit_irq0_timer_pcjr(int64_t new_out, int64_t old_out);
extern void pit_refresh_timer_xt(int64_t new_out, int64_t old_out);
extern void pit_refresh_timer_at(int64_t new_out, int64_t old_out);
extern void pit_speaker_timer(int64_t new_out, int64_t old_out);
#endif /*EMU_PIT_H*/

View File

@@ -13,6 +13,7 @@
#include <wchar.h>
#include "ibm.h"
#include "pit.h"
#include "ppi.h"
PPI ppi;

18
src/ppi.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef EMU_PPI_H
# define EMU_PPI_H
typedef struct PPI {
int s2;
uint8_t pa,pb;
} PPI;
extern int ppispeakon;
extern PPI ppi;
extern void ppi_reset(void);
#endif /*EMU_PPI_H*/

View File

@@ -11,7 +11,7 @@
* Winbond W83877F Super I/O Chip
* Used by the Award 430HX
*
* Version: @(#)sio_w83877f.c 1.0.4 2017/10/16
* Version: @(#)sio_w83877f.c 1.0.5 2017/11/01
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -22,6 +22,7 @@
#include <wchar.h>
#include "86box.h"
#include "ibm.h"
#include "machine/machine.h"
#include "io.h"
#include "mem.h"
#include "rom.h"

View File

@@ -1020,7 +1020,7 @@ void *gus_init(device_t *info)
out/=1.002709201; /* 0.0235 dB Steps */
}
printf("Top volume %f %f %f %f\n",vol16bit[4095],vol16bit[3800],vol16bit[3000],vol16bit[2048]);
pclog("GUS: top volume %f %f %f %f\n",vol16bit[4095],vol16bit[3800],vol16bit[3000],vol16bit[2048]);
gus->voices=14;
gus->samp_timer = gus->samp_latch = (int64_t)(TIMER_USEC * (1000000.0 / 44100.0));

View File

@@ -6,6 +6,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
#include "../lpt.h"
#include "../timer.h"
#include "sound.h"

View File

@@ -6,6 +6,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
#include "../timer.h"
#include "../lpt.h"
#include "sound.h"

View File

@@ -416,7 +416,7 @@ static void pas16_pit_out(uint16_t port, uint8_t val, void *p)
pas16->pit.ctrls[t] = pas16->pit.ctrl = val;
if (t == 3)
{
printf("Bad PIT reg select\n");
pclog("PAS16: bad PIT reg select\n");
return;
}
if (!(pas16->pit.ctrl & 0x30))

View File

@@ -4,6 +4,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../pit.h"
#include "sound.h"
#include "snd_speaker.h"

View File

@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <wchar.h>
#include "ibm.h"
#include "machine/machine.h"
#include "device.h"
#include "mem.h"
#include "rom.h"

View File

@@ -8,7 +8,7 @@
*
* Define the various UI functions.
*
* Version: @(#)ui.h 1.0.8 2017/10/28
* Version: @(#)ui.h 1.0.9 2017/11/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -64,6 +64,7 @@ extern void ui_sb_update_icon(int tag, int val);
extern void ui_sb_update_icon_state(int tag, int active);
extern void ui_sb_set_text_w(wchar_t *wstr);
extern void ui_sb_set_text(char *str);
extern void ui_sb_bugui(char *str);
#ifdef __cplusplus
}

View File

@@ -8,7 +8,7 @@
*
* ATI 28800 emulation (VGA Charger)
*
* Version: @(#)vid_ati28800.c 1.0.2 2017/10/31
* Version: @(#)vid_ati28800.c 1.0.3 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../device.h"

View File

@@ -8,7 +8,7 @@
*
* ATi Mach64 graphics card emulation.
*
* Version: @(#)vid_ati_mach64.c 1.0.6 2017/10/31
* Version: @(#)vid_ati_mach64.c 1.0.7 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -23,6 +23,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../device.h"
#include "../io.h"
#include "../mem.h"

View File

@@ -8,7 +8,7 @@
*
* Emulation of the old and new IBM CGA graphics cards.
*
* Version: @(#)vid_cga.c 1.0.8 2017/10/22
* Version: @(#)vid_cga.c 1.0.9 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -25,6 +25,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* Plantronics ColorPlus emulation.
*
* Version: @(#)vid_colorplus.c 1.0.4 2017/10/22
* Version: @(#)vid_colorplus.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -25,6 +25,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../timer.h"
#include "../device.h"

View File

@@ -9,7 +9,7 @@
* Emulation of the EGA, Chips & Technologies SuperEGA, and
* AX JEGA graphics cards.
*
* Version: @(#)vid_ega.c 1.0.9 2017/10/31
* Version: @(#)vid_ega.c 1.0.10 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* MDSI Genius VHR emulation.
*
* Version: @(#)vid_genius.c 1.0.5 2017/10/31
* Version: @(#)vid_genius.c 1.0.6 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* Hercules emulation.
*
* Version: @(#)vid_hercules.c 1.0.5 2017/10/22
* Version: @(#)vid_hercules.c 1.0.6 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@
#include "../mem.h"
#include "../rom.h"
#include "../io.h"
#include "../pit.h"
#include "../timer.h"
#include "../device.h"
#include "video.h"

View File

@@ -8,7 +8,7 @@
*
* Hercules InColor emulation.
*
* Version: @(#)vid_herculesplus.c 1.0.3 2017/10/18
* Version: @(#)vid_herculesplus.c 1.0.4 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* Hercules InColor emulation.
*
* Version: @(#)vid_incolor.c 1.0.4 2017/10/31
* Version: @(#)vid_incolor.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* MDA emulation.
*
* Version: @(#)vid_mda.c 1.0.6 2017/10/31
* Version: @(#)vid_mda.c 1.0.7 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* nVidia RIVA 128 emulation.
*
* Version: @(#)vid_nv_riva128.c 1.0.1 2017/10/16
* Version: @(#)vid_nv_riva128.c 1.0.2 2017/11/01
*
* Author: Melissa Goad
* Miran Grca, <mgrca8@gmail.com>
@@ -23,6 +23,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../mem.h"
#include "../pci.h"

View File

@@ -8,7 +8,7 @@
*
* Olivetti M24 video emulation- essentially double-res CGA.
*
* Version: @(#)vid_olivetti_m24.c 1.0.4 2017/10/22
* Version: @(#)vid_olivetti_m24.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../timer.h"
#include "../device.h"

View File

@@ -15,7 +15,7 @@
* time as between 12 and 46 cycles. We currently always use
* the lower number.
*
* Version: @(#)vid_pc1512.c 1.0.4 2017/10/22
* Version: @(#)vid_pc1512.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -31,6 +31,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../timer.h"
#include "../device.h"

View File

@@ -8,7 +8,7 @@
*
* Video emulation for IBM PCjr.
*
* Version: @(#)vid_pcjr.c 1.0.4 2017/10/22
* Version: @(#)vid_pcjr.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -25,6 +25,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../pic.h"
#include "../timer.h"

View File

@@ -11,7 +11,7 @@
* This is intended to be used by another SVGA driver,
* and not as a card in it's own right.
*
* Version: @(#)vid_svga.c 1.0.7 2017/10/18
* Version: @(#)vid_svga.c 1.0.9 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,7 +26,9 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../rom.h"
#include "../timer.h"
@@ -92,19 +94,19 @@ void svga_out(uint16_t addr, uint8_t val, void *p)
{
#ifdef DEV_BRANCH
case 0x32CB:
printf("Write 32CB: %04X\n", val);
pclog("SVGA: write 32CB: %04X\n", val);
charedit_on = (val & 0x10) ? 1 : 0;
charsettings = val;
return;
case 0x22CB:
printf("Write 22CB: %04X\n", val);
pclog("SVGA: write 22CB: %04X\n", val);
charmode = val;
charptr = 0;
return;
case 0x22CF:
printf("Write 22CF: %04X\n", val);
pclog("SVGA: write 22CF: %04X\n", val);
switch(charmode)
{
case 1: case 2:
@@ -121,7 +123,7 @@ void svga_out(uint16_t addr, uint8_t val, void *p)
return;
case 0x22CA: case 0x22CE: case 0x32CA:
printf("OUT SVGA %03X %02X %04X:%04X\n",addr,val,CS,cpu_state.pc);
pclog("SVGA: OUT SVGA %03X %02X %04X:%04X\n",addr,val,CS,cpu_state.pc);
return;
#endif
@@ -689,9 +691,9 @@ void svga_recalctimings(svga_t *svga)
svga->dispontime = (int64_t)(_dispontime * (1 << TIMER_SHIFT));
svga->dispofftime = (int64_t)(_dispofftime * (1 << TIMER_SHIFT));
/* printf("SVGA horiz total %i display end %i vidclock %f\n",svga->crtc[0],svga->crtc[1],svga->clock);
printf("SVGA vert total %i display end %i max row %i vsync %i\n",svga->vtotal,svga->dispend,(svga->crtc[9]&31)+1,svga->vsyncstart);
printf("total %f on %i cycles off %i cycles frame %i sec %i %02X\n",disptime*crtcconst,svga->dispontime,svga->dispofftime,(svga->dispontime+svga->dispofftime)*svga->vtotal,(svga->dispontime+svga->dispofftime)*svga->vtotal*70,svga->seqregs[1]);
/* pclog("SVGA horiz total %i display end %i vidclock %f\n",svga->crtc[0],svga->crtc[1],svga->clock);
pclog("SVGA vert total %i display end %i max row %i vsync %i\n",svga->vtotal,svga->dispend,(svga->crtc[9]&31)+1,svga->vsyncstart);
pclog("total %f on %i cycles off %i cycles frame %i sec %i %02X\n",disptime*crtcconst,svga->dispontime,svga->dispofftime,(svga->dispontime+svga->dispofftime)*svga->vtotal,(svga->dispontime+svga->dispofftime)*svga->vtotal*70,svga->seqregs[1]);
pclog("svga->render %08X\n", svga->render);*/
}

View File

@@ -8,7 +8,7 @@
*
* Emulation of the Tandy Model 1000 video.
*
* Version: @(#)vid_tandy.c 1.0.3 2017/10/22
* Version: @(#)vid_tandy.c 1.0.4 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -25,6 +25,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../timer.h"
#include "../device.h"

View File

@@ -8,7 +8,7 @@
*
* Emulation of the Tandy Model 1000/SL video.
*
* Version: @(#)vid_tandysl.c 1.0.4 2017/10/22
* Version: @(#)vid_tandysl.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -25,6 +25,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../timer.h"
#include "../device.h"

View File

@@ -8,7 +8,7 @@
*
* Emulation of the 3DFX Voodoo Graphics controller.
*
* Version: @(#)vid_voodoo.c 1.0.4 2017/10/28
* Version: @(#)vid_voodoo.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* leilei
@@ -25,6 +25,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
#include "../device.h"
#include "../mem.h"
#include "../pci.h"

View File

@@ -8,7 +8,7 @@
*
* Wyse-700 emulation.
*
* Version: @(#)vid_wy700.c 1.0.4 2017/10/22
* Version: @(#)vid_wy700.c 1.0.5 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pit.h"
#include "../mem.h"
#include "../timer.h"
#include "../device.h"

View File

@@ -40,7 +40,7 @@
* W = 3 bus clocks
* L = 4 bus clocks
*
* Version: @(#)video.c 1.0.6 2017/10/27
* Version: @(#)video.c 1.0.7 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -57,6 +57,7 @@
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
#include "../io.h"
#include "../mem.h"
#include "../rom.h"

View File

@@ -8,7 +8,7 @@
*
* Platform main support module for Windows.
*
* Version: @(#)win.c 1.0.30 2017/10/28
* Version: @(#)win.c 1.0.31 2017/11/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -38,6 +38,7 @@
#include "../86box.h"
#include "../config.h"
#include "../ibm.h"
#include "../machine/machine.h"
#include "../mem.h" // because of load_config
#include "../rom.h" // because of load_config
#include "../device.h"

View File

@@ -11,6 +11,7 @@
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../pit.h"
#include "../mem.h"
#include "../cpu/x86_ops.h"
#ifdef USE_DYNAREC

View File

@@ -8,7 +8,7 @@
*
* Implement the application's Status Bar.
*
* Version: @(#)win_stbar.c 1.0.4 2017/10/28
* Version: @(#)win_stbar.c 1.0.5 2017/11/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -1140,14 +1140,25 @@ ui_sb_set_text_w(wchar_t *wstr)
}
/* API */
void
ui_sb_set_text(char *str)
{
static wchar_t wstr[512];
memset(wstr, 0x00, 1024);
memset(wstr, 0x00, sizeof(wstr));
mbstowcs(wstr, str, strlen(str) + 1);
ui_sb_set_text_w(wstr);
}
/* API */
void
ui_sb_bugui(char *str)
{
static wchar_t wstr[512];
memset(wstr, 0x00, sizeof(wstr));
mbstowcs(wstr, str, strlen(str) + 1);
ui_sb_set_text_w(wstr);
}