More cleanups to separate main code from platform support and UI support, plus a few bugfixes.

This commit is contained in:
waltje
2017-10-12 14:25:17 -04:00
parent aa7e85d0d7
commit 724e5c44df
46 changed files with 217 additions and 259 deletions

View File

@@ -41,20 +41,20 @@ x86seg _oldds;
extern int cpl_override;
int has_fpu;
extern int fpucount;
uint16_t rds;
uint16_t ea_rseg;
int is486;
int cgate32;
uint32_t cr2, cr3, cr4;
uint32_t dr[8];
#if FIXME
/* in mem.c and rom.c */
uint8_t romext[32768];
uint8_t *ram,*rom;
#endif
uint32_t rmdat32;
#define rmdat rmdat32

View File

@@ -45,17 +45,16 @@ int trap;
int cpl_override=0;
int has_fpu;
int fpucount=0;
uint16_t rds;
uint16_t ea_rseg;
int is486;
int cgate32;
#if FIXME
uint8_t romext[32768];
uint8_t *ram,*rom;
#endif
uint32_t rmdat32;
uint32_t backupregs[16];

View File

@@ -18,10 +18,11 @@
* 2 clocks - fetch opcode 1 2 clocks - execute
* 2 clocks - fetch opcode 2 etc
*
* Version: @(#)808x.c 1.0.3 2017/10/04
* Version: @(#)808x.c 1.0.4 2017/10/12
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -32,14 +33,16 @@
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"
#include "../keyboard.h" /* its WRONG to have this in here!! --FvK */
#include "../mem.h"
#include "../rom.h"
#include "../nmi.h"
#include "../pic.h"
#include "../timer.h"
#include "../device.h" /* for scsi.h */
#include "../keyboard.h" /* its WRONG to have this in here!! --FvK */
#include "../scsi/scsi.h" /* its WRONG to have this in here!! --FvK */
#include "../plat.h"
int xt_cpu_multi;
int nmi = 0;
@@ -131,7 +134,10 @@ int noint=0;
int output=0;
#if 0
/* Also in mem.c */
int shadowbios=0;
#endif
int ins=0;
@@ -487,7 +493,10 @@ void makeznptable()
if (c&0x8000) znptable16[c]|=N_FLAG;
}
}
#if 1
/* Also in mem.c */
int timetolive=0;
#endif
extern uint32_t oldcs2;
extern uint32_t oldpc2;
@@ -507,7 +516,7 @@ void dumpregs(int force)
#ifndef RELEASE_BUILD
indump = 1;
output=0;
_wchdir(cfg_path);
(void)plat_chdir(cfg_path);
nopageerrors=1;
f=fopen("ram.dmp","wb");
fwrite(ram,mem_size*1024,1,f);

View File

@@ -8,11 +8,12 @@
*
* CPU type handler.
*
* Version: @(#)cpu.c 1.0.2 2017/09/24
* Version: @(#)cpu.c 1.0.3 2017/10/12
*
* 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.
@@ -114,7 +115,7 @@ int cpu_waitstates;
int cpu_cache_int_enabled, cpu_cache_ext_enabled;
int cpu_pci_speed;
int is286, is386;
int is286, is386, is486;
int israpidcad, is_pentium;
uint64_t tsc = 0;

View File

@@ -17,7 +17,7 @@ uint8_t opcode;
int noint;
uint16_t lastcs,lastpc;
int timetolive,keyboardtimer;
extern int timetolive,keyboardtimer;
#define setznp168 setznp16

View File

@@ -8,10 +8,11 @@
*
* x86 CPU segment emulation.
*
* Version: @(#)x86seg.c 1.0.2 2017/10/02
* Version: @(#)x86seg.c 1.0.3 2017/10/12
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -39,7 +40,6 @@
int stimes = 0;
int dtimes = 0;
int btimes = 0;
int is486=1;
uint32_t abrt_error;
int cgate16,cgate32;

View File

@@ -8,10 +8,11 @@
*
* x86 CPU segment emulation.
*
* Version: @(#)x86seg.h 1.0.0 2017/05/30
* Version: @(#)x86seg.h 1.0.1 2017/10/12
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2016-2017 Miran Grca.
*/
void do_seg_load(x86seg *s, uint16_t *segdat);
extern void do_seg_load(x86seg *s, uint16_t *segdat);