Vastly overhauled the UI, there's now a completely new Settings dialog as well as a status bar with disk activity icons and removable drive menus;

Thoroughly clean up the code to vastly reduce the number of compiler warnings and found and fixed several bugs in the process;
Applied all mainline PCem commits;
Added SCSI hard disk emulation;
Commented out all unfinished machines and graphics cards;
Added the AOpen AP53 and ASUS P/I-P55T2 machines as well as another Tyan 440FX machine, all three with AMI WinBIOS (patch from TheCollector1995);
Added the Diamond Stealth 3D 3000 (S3 ViRGE/VX) graphics card (patch from TheCollector1995);
Added the PS/2 XT IDE (AccuLogic) HDD Controller (patch from TheCollector1995);
Added Microsoft/Logitech Bus Mouse emulation (patch from waltje);
Overhauled the makefiles (patch from waltje);
Added the Adaptec AHA-1542CF SCSI controller (patch from waltje);
Added preliminary (but still unfinished) Adaptec AHA-154x SCSI controller BIOS support (patch from waltje);
Added an ISABugger debugging device (patch from waltje);
Added sanity checks to the Direct3D code.
This commit is contained in:
OBattler
2017-05-05 01:49:42 +02:00
parent d07d53962c
commit f6ef1f833c
346 changed files with 24292 additions and 18058 deletions

View File

@@ -1,3 +1,7 @@
#include <math.h>
#ifndef INFINITY
# define INFINITY (__builtin_inff())
#endif
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -8,6 +12,7 @@
#include "cpu.h"
#include "disc.h"
#include "fdc.h"
#include "pic.h"
#include "timer.h"
#include "386_common.h"
@@ -56,7 +61,7 @@ uint32_t *eal_r, *eal_w;
uint16_t *mod1add[2][8];
uint32_t *mod1seg[8];
static inline void fetch_ea_32_long(uint32_t rmdat)
static __inline void fetch_ea_32_long(uint32_t rmdat)
{
eal_r = eal_w = NULL;
easeg = cpu_state.ea_seg->base;
@@ -74,7 +79,7 @@ static inline void fetch_ea_32_long(uint32_t rmdat)
case 1:
cpu_state.pc++;
cpu_state.eaaddr = ((uint32_t)(int8_t)getbyte()) + cpu_state.regs[sib & 7].l;
// pc++;
/* pc++; */
break;
case 2:
cpu_state.eaaddr = (fastreadl(cs + cpu_state.pc + 1)) + cpu_state.regs[sib & 7].l;
@@ -129,7 +134,7 @@ static inline void fetch_ea_32_long(uint32_t rmdat)
}
}
static inline void fetch_ea_16_long(uint32_t rmdat)
static __inline void fetch_ea_16_long(uint32_t rmdat)
{
eal_r = eal_w = NULL;
easeg = cpu_state.ea_seg->base;
@@ -215,22 +220,23 @@ void exec386(int cycs)
int tempi;
int cycdiff;
int oldcyc;
int cycle_period = cycs / 2000; /*Use a 5us timing granularity*/
cycles+=cycs;
// output=3;
/* output=3; */
while (cycles>0)
{
cycdiff=0;
oldcyc=cycles;
timer_start_period(cycles << TIMER_SHIFT);
// pclog("%i %02X\n", ins, ram[8]);
while (cycdiff<100)
/* pclog("%i %02X\n", ins, ram[8]); */
while (cycdiff < cycle_period)
{
/* testr[0]=EAX; testr[1]=EBX; testr[2]=ECX; testr[3]=EDX;
testr[4]=ESI; testr[5]=EDI; testr[6]=EBP; testr[7]=ESP;*/
/* testr[8]=flags;*/
// oldcs2=oldcs;
// oldpc2=oldpc;
/* oldcs2=oldcs; */
/* oldpc2=oldpc; */
oldcs=CS;
cpu_state.oldpc = cpu_state.pc;
oldcpl=CPL;
@@ -262,8 +268,8 @@ dontprint=0;
if (cpu_state.abrt)
{
flags_rebuild();
// pclog("Abort\n");
// if (CS == 0x228) pclog("Abort at %04X:%04X - %i %i %i\n",CS,pc,notpresent,nullseg,cpu_state.abrt);
/* pclog("Abort\n"); */
/* if (CS == 0x228) pclog("Abort at %04X:%04X - %i %i %i\n",CS,pc,notpresent,nullseg,cpu_state.abrt); */
/* if (testr[0]!=EAX) pclog("EAX corrupted %08X\n",pc);
if (testr[1]!=EBX) pclog("EBX corrupted %08X\n",pc);
if (testr[2]!=ECX) pclog("ECX corrupted %08X\n",pc);
@@ -297,8 +303,8 @@ dontprint=0;
if (trap)
{
flags_rebuild();
// oldpc=pc;
// oldcs=CS;
/* oldpc=pc; */
/* oldcs=CS; */
if (msw&1)
{
pmodeint(1,0);
@@ -320,19 +326,24 @@ dontprint=0;
{
cpu_state.oldpc = cpu_state.pc;
oldcs = CS;
// pclog("NMI\n");
/* pclog("NMI\n"); */
x86_int(2);
nmi_enable = 0;
if (nmi_auto_clear)
{
nmi_auto_clear = 0;
nmi = 0;
}
}
else if ((flags&I_FLAG) && pic_intpending)
{
temp=picinterrupt();
if (temp!=0xFF)
{
// if (temp == 0x54) pclog("Take int 54\n");
// if (output) output=3;
// if (temp == 0xd) pclog("Hardware int %02X %i %04X(%08X):%08X\n",temp,ins, CS,cs,pc);
// if (temp==0x54) output=3;
/* if (temp == 0x54) pclog("Take int 54\n"); */
/* if (output) output=3; */
/* if (temp == 0xd) pclog("Hardware int %02X %i %04X(%08X):%08X\n",temp,ins, CS,cs,pc); */
/* if (temp==0x54) output=3; */
flags_rebuild();
if (msw&1)
{
@@ -350,9 +361,9 @@ dontprint=0;
oxpc=cpu_state.pc;
cpu_state.pc=readmemw(0,addr);
loadcs(readmemw(0,addr+2));
// if (temp==0x76) pclog("INT to %04X:%04X\n",CS,pc);
/* if (temp==0x76) pclog("INT to %04X:%04X\n",CS,pc); */
}
// pclog("Now at %04X(%08X):%08X\n", CS, cs, pc);
/* pclog("Now at %04X(%08X):%08X\n", CS, cs, pc); */
}
}

View File

@@ -64,7 +64,7 @@ extern uint16_t ea_rseg;
}
#define CHECK_READ(chseg, low, high) \
if ((low < (chseg)->limit_low) || (high > (chseg)->limit_high)) \
if ((low < (chseg)->limit_low) || (high > (chseg)->limit_high) || ((msw & 1) && !(eflags & VM_FLAG) && (((chseg)->access & 10) == 8))) \
{ \
x86gpf("Limit check", 0); \
return 1; \
@@ -79,7 +79,7 @@ extern uint16_t ea_rseg;
}
#define CHECK_WRITE(chseg, low, high) \
if ((low < (chseg)->limit_low) || (high > (chseg)->limit_high) || !((chseg)->access & 2)) \
if ((low < (chseg)->limit_low) || (high > (chseg)->limit_high) || !((chseg)->access & 2) || ((msw & 1) && !(eflags & VM_FLAG) && ((chseg)->access & 8))) \
{ \
x86gpf("Limit check", 0); \
return 1; \
@@ -118,7 +118,7 @@ extern uint16_t ea_rseg;
static inline uint8_t fastreadb(uint32_t a)
static __inline uint8_t fastreadb(uint32_t a)
{
uint8_t *t;
@@ -126,13 +126,13 @@ static inline uint8_t fastreadb(uint32_t a)
return *((uint8_t *)&pccache2[a]);
t = getpccache(a);
if (cpu_state.abrt)
return;
return 0xFF;
pccache = a >> 12;
pccache2 = t;
return *((uint8_t *)&pccache2[a]);
}
static inline uint16_t fastreadw(uint32_t a)
static __inline uint16_t fastreadw(uint32_t a)
{
uint8_t *t;
uint16_t val;
@@ -145,14 +145,14 @@ static inline uint16_t fastreadw(uint32_t a)
if ((a>>12)==pccache) return *((uint16_t *)&pccache2[a]);
t = getpccache(a);
if (cpu_state.abrt)
return;
return 0xff;
pccache = a >> 12;
pccache2 = t;
return *((uint16_t *)&pccache2[a]);
}
static inline uint32_t fastreadl(uint32_t a)
static __inline uint32_t fastreadl(uint32_t a)
{
uint8_t *t;
uint32_t val;
@@ -165,7 +165,7 @@ static inline uint32_t fastreadl(uint32_t a)
return 0;
pccache2 = t;
pccache=a>>12;
//return *((uint32_t *)&pccache2[a]);
/* return *((uint32_t *)&pccache2[a]); */
}
return *((uint32_t *)&pccache2[a]);
}
@@ -176,25 +176,25 @@ static inline uint32_t fastreadl(uint32_t a)
return val;
}
static inline uint8_t getbyte()
static __inline uint8_t getbyte()
{
cpu_state.pc++;
return fastreadb(cs + (cpu_state.pc - 1));
}
static inline uint16_t getword()
static __inline uint16_t getword()
{
cpu_state.pc+=2;
return fastreadw(cs+(cpu_state.pc-2));
}
static inline uint32_t getlong()
static __inline uint32_t getlong()
{
cpu_state.pc+=4;
return fastreadl(cs+(cpu_state.pc-4));
}
static inline uint64_t getquad()
static __inline uint64_t getquad()
{
cpu_state.pc+=8;
return fastreadl(cs+(cpu_state.pc-8)) | ((uint64_t)fastreadl(cs+(cpu_state.pc-4)) << 32);
@@ -202,7 +202,7 @@ static inline uint64_t getquad()
static inline uint8_t geteab()
static __inline uint8_t geteab()
{
if (cpu_mod == 3)
return (cpu_rm & 4) ? cpu_state.regs[cpu_rm & 3].b.h : cpu_state.regs[cpu_rm&3].b.l;
@@ -211,48 +211,48 @@ static inline uint8_t geteab()
return readmemb(easeg, cpu_state.eaaddr);
}
static inline uint16_t geteaw()
static __inline uint16_t geteaw()
{
if (cpu_mod == 3)
return cpu_state.regs[cpu_rm].w;
// cycles-=3;
/* cycles-=3; */
if (eal_r)
return *(uint16_t *)eal_r;
return readmemw(easeg, cpu_state.eaaddr);
}
static inline uint32_t geteal()
static __inline uint32_t geteal()
{
if (cpu_mod == 3)
return cpu_state.regs[cpu_rm].l;
// cycles-=3;
/* cycles-=3; */
if (eal_r)
return *eal_r;
return readmeml(easeg, cpu_state.eaaddr);
}
static inline uint64_t geteaq()
static __inline uint64_t geteaq()
{
return readmemq(easeg, cpu_state.eaaddr);
}
static inline uint8_t geteab_mem()
static __inline uint8_t geteab_mem()
{
if (eal_r) return *(uint8_t *)eal_r;
return readmemb(easeg,cpu_state.eaaddr);
}
static inline uint16_t geteaw_mem()
static __inline uint16_t geteaw_mem()
{
if (eal_r) return *(uint16_t *)eal_r;
return readmemw(easeg,cpu_state.eaaddr);
}
static inline uint32_t geteal_mem()
static __inline uint32_t geteal_mem()
{
if (eal_r) return *eal_r;
return readmeml(easeg,cpu_state.eaaddr);
}
static inline void seteaq(uint64_t v)
static __inline void seteaq(uint64_t v)
{
writememql(easeg, cpu_state.eaaddr, v);
}

View File

@@ -1,3 +1,7 @@
#include <math.h>
#ifndef INFINITY
# define INFINITY (__builtin_inff())
#endif
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -10,6 +14,7 @@
#include "cpu.h"
#include "disc.h"
#include "fdc.h"
#include "pic.h"
#include "timer.h"
#include "386_common.h"
@@ -62,7 +67,7 @@ uint32_t *eal_r, *eal_w;
uint16_t *mod1add[2][8];
uint32_t *mod1seg[8];
static inline void fetch_ea_32_long(uint32_t rmdat)
static __inline void fetch_ea_32_long(uint32_t rmdat)
{
eal_r = eal_w = NULL;
easeg = cpu_state.ea_seg->base;
@@ -80,7 +85,6 @@ static inline void fetch_ea_32_long(uint32_t rmdat)
case 1:
cpu_state.pc++;
cpu_state.eaaddr = ((uint32_t)(int8_t)getbyte()) + cpu_state.regs[sib & 7].l;
// cpu_state.pc++;
break;
case 2:
cpu_state.eaaddr = (fastreadl(cs + cpu_state.pc + 1)) + cpu_state.regs[sib & 7].l;
@@ -136,7 +140,7 @@ static inline void fetch_ea_32_long(uint32_t rmdat)
cpu_state.last_ea = cpu_state.eaaddr;
}
static inline void fetch_ea_16_long(uint32_t rmdat)
static __inline void fetch_ea_16_long(uint32_t rmdat)
{
eal_r = eal_w = NULL;
easeg = cpu_state.ea_seg->base;
@@ -187,7 +191,6 @@ static inline void fetch_ea_16_long(uint32_t rmdat)
void x86_int(int num)
{
uint32_t addr;
// pclog("x86_int %02x %04x:%04x\n", num, CS,pc);
flags_rebuild();
cpu_state.pc=cpu_state.oldpc;
if (msw&1)
@@ -225,8 +228,6 @@ void x86_int(int num)
void x86_int_sw(int num)
{
uint32_t addr;
// pclog("x86_int_sw %02x %04x:%04x\n", num, CS,pc);
// pclog("x86_int\n");
flags_rebuild();
cycles -= timing_int;
if (msw&1)
@@ -264,14 +265,6 @@ void x86_int_sw(int num)
void x86illegal()
{
uint16_t addr;
// pclog("x86 illegal %04X %08X %04X:%08X %02X\n",msw,cr0,CS,pc,opcode);
// if (output)
// {
// dumpregs();
// exit(-1);
// }
x86_int(6);
}
@@ -359,14 +352,28 @@ static void prefetch_flush()
#define PREFETCH_FLUSH() prefetch_flush()
int checkio(int port)
{
uint16_t t;
uint8_t d;
cpl_override = 1;
t = readmemw(tr.base, 0x66);
cpl_override = 0;
if (cpu_state.abrt) return 0;
if ((t+(port>>3))>tr.limit) return 1;
cpl_override = 1;
d = readmemb386l(0, tr.base + t + (port >> 3));
cpl_override = 0;
return d&(1<<(port&7));
}
int rep386(int fv)
{
uint8_t temp;
uint32_t c;//=CX;
uint32_t c;
uint8_t temp2;
uint16_t tempw,tempw2,of;
uint32_t ipc = cpu_state.oldpc;//pc-1;
uint32_t oldds;
uint32_t ipc = cpu_state.oldpc;
uint32_t rep32 = cpu_state.op32;
uint32_t templ,templ2;
int tempz;
@@ -384,16 +391,9 @@ int rep386(int fv)
flags_rebuild();
of = flags;
// if (inrecomp) pclog("REP32 %04X %04X ",use32,rep32);
startrep:
temp=opcode2=readmemb(cs,cpu_state.pc); cpu_state.pc++;
// if (firstrepcycle && temp==0xA5) pclog("REP MOVSW %06X:%04X %06X:%04X\n",ds,SI,es,DI);
// if (inrecomp) pclog("REP %02X %04X\n",temp,ipc);
c=(rep32&0x200)?ECX:CX;
/* if (rep32 && (msw&1))
{
if (temp!=0x67 && temp!=0x66 && (rep32|temp)!=0x1AB && (rep32|temp)!=0x3AB) pclog("32-bit REP %03X %08X %04X:%06X\n",temp|rep32,c,CS,pc);
}*/
switch (temp|rep32)
{
case 0xC3: case 0x1C3: case 0x2C3: case 0x3C3:
@@ -436,7 +436,6 @@ int rep386(int fv)
PREFETCH_PREFIX();
goto startrep;
case 0x6C: case 0x16C: /*REP INSB*/
// cpu_notreps++;
if (c>0)
{
checkio_perm(DX);
@@ -453,7 +452,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x26C: case 0x36C: /*REP INSB*/
// cpu_notreps++;
if (c>0)
{
checkio_perm(DX);
@@ -470,10 +468,8 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x6D: /*REP INSW*/
// cpu_notreps++;
if (c>0)
{
// pclog("REP INSW %04x %04x:%04x %04x\n", DX, ES, DI, CX);
tempw=inw(DX);
writememw(es,DI,tempw);
if (cpu_state.abrt) break;
@@ -487,7 +483,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x16D: /*REP INSL*/
// cpu_notreps++;
if (c>0)
{
templ=inl(DX);
@@ -503,7 +498,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x26D: /*REP INSW*/
// cpu_notreps++;
if (c>0)
{
tempw=inw(DX);
@@ -519,7 +513,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x36D: /*REP INSL*/
// cpu_notreps++;
if (c>0)
{
templ=inl(DX);
@@ -535,7 +528,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x6E: case 0x16E: /*REP OUTSB*/
// cpu_notreps++;
if (c>0)
{
temp2 = readmemb(cpu_state.ea_seg->base, SI);
@@ -552,7 +544,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x26E: case 0x36E: /*REP OUTSB*/
// cpu_notreps++;
if (c>0)
{
temp2 = readmemb(cpu_state.ea_seg->base, ESI);
@@ -569,12 +560,10 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x6F: /*REP OUTSW*/
// cpu_notreps++;
if (c>0)
{
tempw = readmemw(cpu_state.ea_seg->base, SI);
if (cpu_state.abrt) break;
// pclog("OUTSW %04X -> %04X\n",SI,tempw);
outw(DX,tempw);
if (flags&D_FLAG) SI-=2;
else SI+=2;
@@ -586,7 +575,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x16F: /*REP OUTSL*/
// cpu_notreps++;
if (c > 0)
{
templ = readmeml(cpu_state.ea_seg->base, SI);
@@ -602,7 +590,6 @@ int rep386(int fv)
else firstrepcycle = 1;
break;
case 0x26F: /*REP OUTSW*/
// cpu_notreps++;
if (c>0)
{
tempw = readmemw(cpu_state.ea_seg->base, ESI);
@@ -618,7 +605,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x36F: /*REP OUTSL*/
// cpu_notreps++;
if (c > 0)
{
templ = readmeml(cpu_state.ea_seg->base, ESI);
@@ -635,7 +621,6 @@ int rep386(int fv)
break;
case 0x90: case 0x190: /*REP NOP*/
case 0x290: case 0x390:
// cpu_notreps++;
break;
case 0xA4: case 0x1A4: /*REP MOVSB*/
while (c > 0)
@@ -643,7 +628,6 @@ int rep386(int fv)
CHECK_WRITE_REP(&_es, DI, DI);
temp2 = readmemb(cpu_state.ea_seg->base, SI); if (cpu_state.abrt) break;
writememb(es,DI,temp2); if (cpu_state.abrt) break;
// if (output==3) pclog("MOVSB %08X:%04X -> %08X:%04X %02X\n",ds,SI,es,DI,temp2);
if (flags&D_FLAG) { DI--; SI--; }
else { DI++; SI++; }
c--;
@@ -700,7 +684,6 @@ int rep386(int fv)
{
CHECK_WRITE_REP(&_es, DI, DI+3);
templ = readmeml(cpu_state.ea_seg->base, SI); if (cpu_state.abrt) break;
// pclog("MOVSD %08X from %08X to %08X (%04X:%08X)\n", templ, ds+SI, es+DI, CS, pc);
writememl(es,DI,templ); if (cpu_state.abrt) break;
if (flags&D_FLAG) { DI-=4; SI-=4; }
else { DI+=4; SI+=4; }
@@ -721,7 +704,6 @@ int rep386(int fv)
CHECK_WRITE_REP(&_es, EDI, EDI+1);
tempw = readmemw(cpu_state.ea_seg->base, ESI); if (cpu_state.abrt) break;
writememw(es,EDI,tempw); if (cpu_state.abrt) break;
// if (output) pclog("Written %04X from %08X to %08X %i %08X %04X %08X %04X\n",tempw,ds+ESI,es+EDI,c,ds,ES,es,ES);
if (flags&D_FLAG) { EDI-=2; ESI-=2; }
else { EDI+=2; ESI+=2; }
c--;
@@ -740,9 +722,7 @@ int rep386(int fv)
{
CHECK_WRITE_REP(&_es, EDI, EDI+3);
templ = readmeml(cpu_state.ea_seg->base, ESI); if (cpu_state.abrt) break;
// if ((EDI&0xFFFF0000)==0xA0000) cycles-=12;
writememl(es,EDI,templ); if (cpu_state.abrt) break;
// if (output) pclog("Load %08X from %08X to %08X %04X %08X %04X %08X\n",templ,ESI,EDI,DS,ds,ES,es);
if (flags&D_FLAG) { EDI-=4; ESI-=4; }
else { EDI+=4; ESI+=4; }
c--;
@@ -757,7 +737,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0xA6: case 0x1A6: /*REP CMPSB*/
// cpu_notreps++;
tempz = (fv) ? 1 : 0;
if ((c>0) && (fv==tempz))
{
@@ -776,7 +755,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x2A6: case 0x3A6: /*REP CMPSB*/
// cpu_notreps++;
tempz = (fv) ? 1 : 0;
if ((c>0) && (fv==tempz))
{
@@ -795,14 +773,11 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0xA7: /*REP CMPSW*/
// cpu_notreps++;
tempz = (fv) ? 1 : 0;
if ((c>0) && (fv==tempz))
{
// pclog("CMPSW (%04x:%04x)%05X (%04x:%04x)%05X ", DS,SI, ds+SI, ES,DI, es+DI);
tempw = readmemw(cpu_state.ea_seg->base, SI);
tempw2=readmemw(es,DI);
// pclog("%04X %04X %c%c %c%c\n", tempw, tempw2, tempw & 0xff, tempw >> 8, tempw2 & 0xff, tempw2 >> 8);
if (cpu_state.abrt) { flags=of; break; }
if (flags&D_FLAG) { DI-=2; SI-=2; }
@@ -817,7 +792,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x1A7: /*REP CMPSL*/
// cpu_notreps++;
tempz = (fv) ? 1 : 0;
if ((c>0) && (fv==tempz))
{
@@ -836,7 +810,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x2A7: /*REP CMPSW*/
// cpu_notreps++;
tempz = (fv) ? 1 : 0;
if ((c>0) && (fv==tempz))
{
@@ -855,7 +828,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x3A7: /*REP CMPSL*/
// cpu_notreps++;
tempz = (fv) ? 1 : 0;
if ((c>0) && (fv==tempz))
{
@@ -989,8 +961,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0xAC: case 0x1AC: /*REP LODSB*/
// cpu_notreps++;
// if (ds==0xFFFFFFFF) pclog("Null selector REP LODSB %04X(%06X):%06X\n",CS,cs,pc);
if (c>0)
{
AL = readmemb(cpu_state.ea_seg->base, SI);
@@ -1005,8 +975,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x2AC: case 0x3AC: /*REP LODSB*/
// cpu_notreps++;
// if (ds==0xFFFFFFFF) pclog("Null selector REP LODSB %04X(%06X):%06X\n",CS,cs,pc);
if (c>0)
{
AL = readmemb(cpu_state.ea_seg->base, ESI);
@@ -1021,8 +989,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0xAD: /*REP LODSW*/
// cpu_notreps++;
// if (ds==0xFFFFFFFF) pclog("Null selector REP LODSW %04X(%06X):%06X\n",CS,cs,pc);
if (c>0)
{
AX = readmemw(cpu_state.ea_seg->base, SI);
@@ -1037,8 +1003,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x1AD: /*REP LODSL*/
// cpu_notreps++;
// if (ds==0xFFFFFFFF) pclog("Null selector REP LODSL %04X(%06X):%06X\n",CS,cs,pc);
if (c>0)
{
EAX = readmeml(cpu_state.ea_seg->base, SI);
@@ -1053,8 +1017,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x2AD: /*REP LODSW*/
// cpu_notreps++;
// if (ds==0xFFFFFFFF) pclog("Null selector REP LODSW %04X(%06X):%06X\n",CS,cs,pc);
if (c>0)
{
AX = readmemw(cpu_state.ea_seg->base, ESI);
@@ -1069,8 +1031,6 @@ int rep386(int fv)
else firstrepcycle=1;
break;
case 0x3AD: /*REP LODSL*/
// cpu_notreps++;
// if (ds==0xFFFFFFFF) pclog("Null selector REP LODSL %04X(%06X):%06X\n",CS,cs,pc);
if (c>0)
{
EAX = readmeml(cpu_state.ea_seg->base, ESI);
@@ -1086,8 +1046,6 @@ int rep386(int fv)
break;
case 0xAE: case 0x1AE: /*REP SCASB*/
cpu_notreps++;
// if (es==0xFFFFFFFF) pclog("Null selector REP SCASB %04X(%06X):%06X\n",CS,cs,pc);
// tempz=(fv)?1:0;
tempz = (fv) ? 1 : 0;
while ((c > 0) && (fv == tempz))
{
@@ -1110,14 +1068,11 @@ int rep386(int fv)
break;
case 0x2AE: case 0x3AE: /*REP SCASB*/
cpu_notreps++;
// if (es==0xFFFFFFFF) pclog("Null selector REP SCASB %04X(%06X):%06X\n",CS,cs,pc);
// tempz=(fv)?1:0;
tempz = (fv) ? 1 : 0;
while ((c > 0) && (fv == tempz))
{
temp2=readmemb(es,EDI);
if (cpu_state.abrt) { flags=of; break; }
// if (output) pclog("Compare %02X,%02X\n",temp2,AL);
setsub8(AL,temp2);
tempz = (ZF_SET()) ? 1 : 0;
if (flags&D_FLAG) EDI--;
@@ -1135,7 +1090,6 @@ int rep386(int fv)
break;
case 0xAF: /*REP SCASW*/
cpu_notreps++;
// if (es==0xFFFFFFFF) pclog("Null selector REP SCASW %04X(%06X):%06X\n",CS,cs,pc);
tempz = (fv) ? 1 : 0;
while ((c > 0) && (fv == tempz))
{
@@ -1158,7 +1112,6 @@ int rep386(int fv)
break;
case 0x1AF: /*REP SCASL*/
cpu_notreps++;
// if (es==0xFFFFFFFF) pclog("Null selector REP SCASL %04X(%06X):%06X\n",CS,cs,pc);
tempz = (fv) ? 1 : 0;
while ((c > 0) && (fv == tempz))
{
@@ -1181,7 +1134,6 @@ int rep386(int fv)
break;
case 0x2AF: /*REP SCASW*/
cpu_notreps++;
// if (es==0xFFFFFFFF) pclog("Null selector REP SCASW %04X(%06X):%06X\n",CS,cs,pc);
tempz = (fv) ? 1 : 0;
while ((c > 0) && (fv == tempz))
{
@@ -1204,7 +1156,6 @@ int rep386(int fv)
break;
case 0x3AF: /*REP SCASL*/
cpu_notreps++;
// if (es==0xFFFFFFFF) pclog("Null selector REP SCASL %04X(%06X):%06X\n",CS,cs,pc);
tempz = (fv) ? 1 : 0;
while ((c > 0) && (fv == tempz))
{
@@ -1229,7 +1180,6 @@ int rep386(int fv)
default:
cpu_state.pc = ipc+1;
//pclog("Bad REP %02X %i\n", temp, rep32 >> 8);
break;
}
if (rep32&0x200) ECX=c;
@@ -1237,27 +1187,6 @@ int rep386(int fv)
CPU_BLOCK_END();
PREFETCH_RUN(total_cycles, 1, -1, reads, reads_l, writes, writes_l, 0);
return cpu_state.abrt;
//pclog("rep cpu_block_end=%d %p\n", cpu_block_end, (void *)&cpu_block_end);
// if (output) pclog("%03X %03X\n",rep32,use32);
}
int checkio(int port)
{
uint16_t t;
uint8_t d;
cpl_override = 1;
t = readmemw(tr.base, 0x66);
cpl_override = 0;
// pclog("CheckIO 1 %08X %04x %02x\n",tr.base, eflags, _cs.access);
if (cpu_state.abrt) return 0;
// pclog("CheckIO %04X %01X %01X %02X %04X %04X %08X ",CS,CPL,IOPL,port,t,t+(port>>3),tr.base+t+(port>>3));
if ((t+(port>>3))>tr.limit) return 1;
cpl_override = 1;
d = readmemb386l(0, tr.base + t + (port >> 3));
// d=readmemb(tr.base,t+(port>>3));
cpl_override = 0;
// pclog("%02X %02X\n",d,d&(1<<(port&7)));
return d&(1<<(port&7));
}
int xout=0;
@@ -1276,15 +1205,20 @@ int xout=0;
int divl(uint32_t val)
{
uint64_t num, quo;
uint32_t rem, quo32;
if (val==0)
{
divexcp();
return 1;
}
uint64_t num=(((uint64_t)EDX)<<32)|EAX;
uint64_t quo=num/val;
uint32_t rem=num%val;
uint32_t quo32=(uint32_t)(quo&0xFFFFFFFF);
num=(((uint64_t)EDX)<<32)|EAX;
quo=num/val;
rem=num%val;
quo32=(uint32_t)(quo&0xFFFFFFFF);
if (quo!=(uint64_t)quo32)
{
divexcp();
@@ -1296,15 +1230,20 @@ int divl(uint32_t val)
}
int idivl(int32_t val)
{
int64_t num, quo;
int32_t rem, quo32;
if (val==0)
{
divexcp();
return 1;
}
int64_t num=(((uint64_t)EDX)<<32)|EAX;
int64_t quo=num/val;
int32_t rem=num%val;
int32_t quo32=(int32_t)(quo&0xFFFFFFFF);
num=(((uint64_t)EDX)<<32)|EAX;
quo=num/val;
rem=num%val;
quo32=(int32_t)(quo&0xFFFFFFFF);
if (quo!=(int64_t)quo32)
{
divexcp();
@@ -1338,7 +1277,6 @@ int dontprint=0;
#define CACHE_ON() (!(cr0 & (1 << 30)) /*&& (cr0 & 1)*/ && !(flags & T_FLAG))
//#define CACHE_ON() 0
static int cycles_main = 0;
void exec386_dynarec(int cycs)
@@ -1348,8 +1286,8 @@ void exec386_dynarec(int cycs)
int tempi;
int cycdiff;
int oldcyc;
uint32_t start_pc = 0;
//output = 3;
cycles_main += cycs;
while (cycles_main > 0)
{
@@ -1359,7 +1297,6 @@ void exec386_dynarec(int cycs)
cycles_start = cycles;
timer_start_period(cycles << TIMER_SHIFT);
// output=3;
while (cycles>0)
{
oldcs = CS;
@@ -1370,11 +1307,9 @@ void exec386_dynarec(int cycs)
cycdiff=0;
oldcyc=cycles;
// if (output && CACHE_ON()) pclog("Block %04x:%04x %04x:%08x\n", CS, pc, SS,ESP);
if (!CACHE_ON()) /*Interpret block*/
{
cpu_block_end = 0;
// if (output) pclog("Interpret block at %04x:%04x %04x %04x %04x %04x %04x %04x %04x\n", CS, pc, AX, BX, CX, DX, SI, DI, SP);
while (!cpu_block_end)
{
oldcs=CS;
@@ -1385,19 +1320,13 @@ void exec386_dynarec(int cycs)
cpu_state.ea_seg = &_ds;
cpu_state.ssegs = 0;
opcodestart:
fetchdat = fastreadl(cs + cpu_state.pc);
// if (!fetchdat)
// fatal("Dead with cache off\n");
if (!cpu_state.abrt)
{
trap = flags & T_FLAG;
opcode = fetchdat & 0xFF;
fetchdat >>= 8;
// if (output == 3)
// pclog("int %04X(%06X):%04X : %08X %08X %08X %08X %04X %04X %04X(%08X) %04X %04X %04X(%08X) %08X %08X %08X SP=%04X:%08X %02X %04X %i %08X %08X %i %i %02X %02X %02X %02X %02X %f %02X%02X %02X%02X\n",CS,cs,pc,EAX,EBX,ECX,EDX,CS,DS,ES,es,FS,GS,SS,ss,EDI,ESI,EBP,SS,ESP,opcode,flags,ins,0, ldt.base, CPL, stack32, pic.pend, pic.mask, pic.mask2, pic2.pend, pic2.mask, pit.c[0], ram[0x8f13f], ram[0x8f13e], ram[0x8f141], ram[0x8f140]);
cpu_state.pc++;
x86_opcodes[(opcode | cpu_state.op32) & 0x3ff](fetchdat);
}
@@ -1504,13 +1433,11 @@ void exec386_dynarec(int cycs)
void (*code)() = (void *)&block->data[BLOCK_START];
codeblock_hash[hash] = block;
// if (output) pclog("Run block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%08x %04x %08x %08x %016llx %08x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, get_phys(cs+pc), block->phys, block->page_mask, block->endpc);
inrecomp=1;
code();
inrecomp=0;
if (!use32) cpu_state.pc &= 0xffff;
// cpu_recomp_ins += block->ins;
cpu_recomp_blocks++;
/* ins += codeblock_ins[index];
insc += codeblock_ins[index];*/
@@ -1518,10 +1445,8 @@ inrecomp=0;
}
else if (valid_block && !cpu_state.abrt)
{
uint32_t start_page = cpu_state.pc >> 12;
uint32_t start_pc = cpu_state.pc;
start_pc = cpu_state.pc;
// pclog("Hash %08x %i\n", codeblock_hash_pc[HASH(cs + pc)], codeblock_page_dirty[(cs + pc) >> 12]);
cpu_block_end = 0;
x86_was_reset = 0;
@@ -1530,7 +1455,6 @@ inrecomp=0;
codegen_block_start_recompile(block);
codegen_in_recompile = 1;
// if (output) pclog("Recompile block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%04x %04x %02x%02x:%02x%02x %02x%02x:%02x%02x %02x%02x:%02x%02x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, ram[0x116330+0x6df4+0xa+3], ram[0x116330+0x6df4+0xa+2], ram[0x116330+0x6df4+0xa+1], ram[0x116330+0x6df4+0xa+0], ram[0x11d136+3],ram[0x11d136+2],ram[0x11d136+1],ram[0x11d136+0], ram[(0x119abe)+0x3],ram[(0x119abe)+0x2],ram[(0x119abe)+0x1],ram[(0x119abe)+0x0]);
while (!cpu_block_end)
{
oldcs=CS;
@@ -1541,21 +1465,13 @@ inrecomp=0;
cpu_state.ea_seg = &_ds;
cpu_state.ssegs = 0;
opcodestart_compile:
fetchdat = fastreadl(cs + cpu_state.pc);
// if (fetchdat == 0xffffffff)
// fatal("Dead ffffffff\n");
// if (!fetchdat)
// fatal("Dead\n");
if (!cpu_state.abrt)
{
trap = flags & T_FLAG;
opcode = fetchdat & 0xFF;
fetchdat >>= 8;
// if (output == 3)
// pclog("%04X(%06X):%04X : %08X %08X %08X %08X %04X %04X %04X(%08X) %04X %04X %04X(%08X) %08X %08X %08X SP=%04X:%08X %02X %04X %i %08X %08X %i %i %02X %02X %02X %02X %02X %08x %08x\n",CS,cs,pc,EAX,EBX,ECX,EDX,CS,DS,ES,es,FS,GS,SS,ss,EDI,ESI,EBP,SS,ESP,opcode,flags,ins,0, ldt.base, CPL, stack32, pic.pend, pic.mask, pic.mask2, pic2.pend, pic2.mask, cs+pc, pccache);
cpu_state.pc++;
codegen_generate_call(opcode, x86_opcodes[(opcode | cpu_state.op32) & 0x3ff], fetchdat, cpu_state.pc, cpu_state.pc-1);
@@ -1596,23 +1512,17 @@ inrecomp=0;
codegen_reset();
codegen_in_recompile = 0;
// output &= ~2;
}
else if (!cpu_state.abrt)
{
/*Mark block but do not recompile*/
uint32_t start_page = cpu_state.pc >> 12;
uint32_t start_pc = cpu_state.pc;
start_pc = cpu_state.pc;
// pclog("Hash %08x %i\n", codeblock_hash_pc[HASH(cs + pc)], codeblock_page_dirty[(cs + pc) >> 12]);
cpu_block_end = 0;
x86_was_reset = 0;
// cpu_new_blocks++;
codegen_block_init(phys_addr);
// if (output) pclog("Recompile block at %04x:%04x %04x %04x %04x %04x %04x %04x ESP=%04x %04x %02x%02x:%02x%02x %02x%02x:%02x%02x %02x%02x:%02x%02x\n", CS, pc, AX, BX, CX, DX, SI, DI, ESP, BP, ram[0x116330+0x6df4+0xa+3], ram[0x116330+0x6df4+0xa+2], ram[0x116330+0x6df4+0xa+1], ram[0x116330+0x6df4+0xa+0], ram[0x11d136+3],ram[0x11d136+2],ram[0x11d136+1],ram[0x11d136+0], ram[(0x119abe)+0x3],ram[(0x119abe)+0x2],ram[(0x119abe)+0x1],ram[(0x119abe)+0x0]);
while (!cpu_block_end)
{
oldcs=CS;
@@ -1632,9 +1542,6 @@ inrecomp=0;
opcode = fetchdat & 0xFF;
fetchdat >>= 8;
// if (output == 3)
// pclog("%04X(%06X):%04X : %08X %08X %08X %08X %04X %04X %04X(%08X) %04X %04X %04X(%08X) %08X %08X %08X SP=%04X:%08X %02X %04X %i %08X %08X %i %i %02X %02X %02X %02X %02X %08x %08x\n",CS,cs,pc,EAX,EBX,ECX,EDX,CS,DS,ES,es,FS,GS,SS,ss,EDI,ESI,EBP,SS,ESP,opcode,flags,ins,0, ldt.base, CPL, stack32, pic.pend, pic.mask, pic.mask2, pic2.pend, pic2.mask, cs+pc, pccache);
cpu_state.pc++;
x86_opcodes[(opcode | cpu_state.op32) & 0x3ff](fetchdat);
@@ -1671,18 +1578,12 @@ inrecomp=0;
if (x86_was_reset)
codegen_reset();
// output &= ~2;
}
// if (output && (SP & 1))
// fatal("odd SP\n");
}
cycdiff=oldcyc-cycles;
tsc += cycdiff;
// timer_end_period(cycles);
if (cpu_state.abrt)
{
flags_rebuild();
@@ -1710,8 +1611,6 @@ inrecomp=0;
{
flags_rebuild();
// oldpc=pc;
// oldcs=CS;
if (msw&1)
{
pmodeint(1,0);
@@ -1734,7 +1633,6 @@ inrecomp=0;
temp=picinterrupt();
if (temp!=0xFF)
{
// pclog("IRQ %02X %04X:%04X %04X:%04X\n", temp, SS, SP, CS, pc);
CPU_BLOCK_END();
flags_rebuild();
if (msw&1)

View File

@@ -1,3 +1,7 @@
#include <math.h>
#ifndef INFINITY
# define INFINITY (__builtin_inff())
#endif
#include "ibm.h"
#include "cpu.h"
#include "x86.h"
@@ -6,6 +10,7 @@
#include "x86_flags.h"
#include "mem.h"
#include "codegen.h"
#include "pic.h"
#define CPU_BLOCK_END() cpu_block_end = 1
@@ -15,7 +20,7 @@
extern uint16_t *mod1add[2][8];
extern uint32_t *mod1seg[8];
static inline void fetch_ea_32_long(uint32_t rmdat)
static __inline void fetch_ea_32_long(uint32_t rmdat)
{
eal_r = eal_w = NULL;
easeg = cpu_state.ea_seg->base;
@@ -31,7 +36,7 @@ static inline void fetch_ea_32_long(uint32_t rmdat)
cpu_state.last_ea = cpu_state.eaaddr;
}
static inline void fetch_ea_16_long(uint32_t rmdat)
static __inline void fetch_ea_16_long(uint32_t rmdat)
{
eal_r = eal_w = NULL;
easeg = cpu_state.ea_seg->base;

View File

@@ -15,7 +15,7 @@
} \
} while (0)
static inline void PUSH_W(uint16_t val)
static __inline void PUSH_W(uint16_t val)
{
if (stack32)
{
@@ -31,7 +31,7 @@ static inline void PUSH_W(uint16_t val)
}
}
static inline void PUSH_L(uint32_t val)
static __inline void PUSH_L(uint32_t val)
{
if (stack32)
{
@@ -47,7 +47,7 @@ static inline void PUSH_L(uint32_t val)
}
}
static inline uint16_t POP_W()
static __inline uint16_t POP_W()
{
uint16_t ret;
if (stack32)
@@ -65,7 +65,7 @@ static inline uint16_t POP_W()
return ret;
}
static inline uint32_t POP_L()
static __inline uint32_t POP_L()
{
uint32_t ret;
if (stack32)
@@ -83,7 +83,7 @@ static inline uint32_t POP_L()
return ret;
}
static inline uint16_t POP_W_seg(uint32_t seg)
static __inline uint16_t POP_W_seg(uint32_t seg)
{
uint16_t ret;
if (stack32)
@@ -101,7 +101,7 @@ static inline uint16_t POP_W_seg(uint32_t seg)
return ret;
}
static inline uint32_t POP_L_seg(uint32_t seg)
static __inline uint32_t POP_L_seg(uint32_t seg)
{
uint32_t ret;
if (stack32)
@@ -119,6 +119,17 @@ static inline uint32_t POP_L_seg(uint32_t seg)
return ret;
}
static int fopcode;
static int ILLEGAL(uint32_t fetchdat)
{
cpu_state.pc = cpu_state.oldpc;
pclog("Illegal instruction %08X (%02X)\n", fetchdat, fopcode);
x86illegal();
return 0;
}
#include "x86seg.h"
#include "x86_ops_arith.h"
#include "x86_ops_atomic.h"
@@ -133,6 +144,8 @@ static inline uint32_t POP_L_seg(uint32_t seg)
#include "x86_ops_io.h"
#include "x86_ops_jump.h"
#include "x86_ops_misc.h"
#include "x87_ops.h"
#include "x86_ops_i686.h"
#include "x86_ops_mmx.h"
#include "x86_ops_mmx_arith.h"
#include "x86_ops_mmx_cmp.h"
@@ -156,25 +169,12 @@ static inline uint32_t POP_L_seg(uint32_t seg)
#include "x86_ops_string.h"
#include "x86_ops_xchg.h"
static int fopcode;
static int ILLEGAL(uint32_t fetchdat)
{
cpu_state.pc = cpu_state.oldpc;
// fatal("Illegal instruction %08X\n", fetchdat);
pclog("Illegal instruction %08X (%02X)\n", fetchdat, fopcode);
x86illegal();
return 0;
}
static int op0F_w_a16(uint32_t fetchdat)
{
int opcode = fetchdat & 0xff;
fopcode = opcode;
cpu_state.pc++;
// pclog("A16W: 0F %02X\n", opcode);
PREFETCH_PREFIX();
return x86_opcodes_0f[opcode](fetchdat >> 8);
@@ -185,7 +185,6 @@ static int op0F_l_a16(uint32_t fetchdat)
fopcode = opcode;
cpu_state.pc++;
// pclog("A16L: 0F %02X\n", opcode);
PREFETCH_PREFIX();
return x86_opcodes_0f[opcode | 0x100](fetchdat >> 8);
@@ -196,7 +195,6 @@ static int op0F_w_a32(uint32_t fetchdat)
fopcode = opcode;
cpu_state.pc++;
// pclog("A32W: 0F %02X\n", opcode);
PREFETCH_PREFIX();
return x86_opcodes_0f[opcode | 0x200](fetchdat >> 8);
@@ -207,15 +205,11 @@ static int op0F_l_a32(uint32_t fetchdat)
fopcode = opcode;
cpu_state.pc++;
// pclog("A32L: 0F %02X\n", opcode);
PREFETCH_PREFIX();
return x86_opcodes_0f[opcode | 0x300](fetchdat >> 8);
}
#include "x87_ops.h"
#include "x86_ops_i686.h"
OpFn OP_TABLE(286_0f)[1024] =
{
/*16-bit data, 16-bit addr*/
@@ -1241,7 +1235,7 @@ OpFn OP_TABLE(286)[1024] =
/*c0*/ opC0_a16, opC1_w_a16, opRET_w_imm, opRET_w, opLES_w_a16, opLDS_w_a16, opMOV_b_imm_a16,opMOV_w_imm_a16,opENTER_w, opLEAVE_w, opRETF_a16_imm, opRETF_a16, opINT3, opINT, opINTO, opIRET_286,
/*d0*/ opD0_a16, opD1_w_a16, opD2_a16, opD3_w_a16, opAAM, opAAD, opSETALC, opXLAT_a16, opESCAPE_d8_a16,opESCAPE_d9_a16,opESCAPE_da_a16,opESCAPE_db_a16,opESCAPE_dc_a16,opESCAPE_dd_a16,opESCAPE_de_a16,opESCAPE_df_a16,
/*e0*/ opLOOPNE_w, opLOOPE_w, opLOOP_w, opJCXZ, opIN_AL_imm, opIN_AX_imm, opOUT_AL_imm, opOUT_AX_imm, opCALL_r16, opJMP_r16, opJMP_far_a16, opJMP_r8, opIN_AL_DX, opIN_AX_DX, opOUT_AL_DX, opOUT_AX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*f0*/ opLOCK, opLOCK, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*32-bit data, 16-bit addr*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
@@ -1263,7 +1257,7 @@ OpFn OP_TABLE(286)[1024] =
/*c0*/ opC0_a16, opC1_w_a16, opRET_w_imm, opRET_w, opLES_w_a16, opLDS_w_a16, opMOV_b_imm_a16,opMOV_w_imm_a16,opENTER_w, opLEAVE_w, opRETF_a16_imm, opRETF_a16, opINT3, opINT, opINTO, opIRET_286,
/*d0*/ opD0_a16, opD1_w_a16, opD2_a16, opD3_w_a16, opAAM, opAAD, opSETALC, opXLAT_a16, opESCAPE_d8_a16,opESCAPE_d9_a16,opESCAPE_da_a16,opESCAPE_db_a16,opESCAPE_dc_a16,opESCAPE_dd_a16,opESCAPE_de_a16,opESCAPE_df_a16,
/*e0*/ opLOOPNE_w, opLOOPE_w, opLOOP_w, opJCXZ, opIN_AL_imm, opIN_AX_imm, opOUT_AL_imm, opOUT_AX_imm, opCALL_r16, opJMP_r16, opJMP_far_a16, opJMP_r8, opIN_AL_DX, opIN_AX_DX, opOUT_AL_DX, opOUT_AX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*f0*/ opLOCK, opLOCK, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*16-bit data, 32-bit addr*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
@@ -1285,7 +1279,7 @@ OpFn OP_TABLE(286)[1024] =
/*c0*/ opC0_a16, opC1_w_a16, opRET_w_imm, opRET_w, opLES_w_a16, opLDS_w_a16, opMOV_b_imm_a16,opMOV_w_imm_a16,opENTER_w, opLEAVE_w, opRETF_a16_imm, opRETF_a16, opINT3, opINT, opINTO, opIRET_286,
/*d0*/ opD0_a16, opD1_w_a16, opD2_a16, opD3_w_a16, opAAM, opAAD, opSETALC, opXLAT_a16, opESCAPE_d8_a16,opESCAPE_d9_a16,opESCAPE_da_a16,opESCAPE_db_a16,opESCAPE_dc_a16,opESCAPE_dd_a16,opESCAPE_de_a16,opESCAPE_df_a16,
/*e0*/ opLOOPNE_w, opLOOPE_w, opLOOP_w, opJCXZ, opIN_AL_imm, opIN_AX_imm, opOUT_AL_imm, opOUT_AX_imm, opCALL_r16, opJMP_r16, opJMP_far_a16, opJMP_r8, opIN_AL_DX, opIN_AX_DX, opOUT_AL_DX, opOUT_AX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*f0*/ opLOCK, opLOCK, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*32-bit data, 32-bit addr*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
@@ -1307,7 +1301,7 @@ OpFn OP_TABLE(286)[1024] =
/*c0*/ opC0_a16, opC1_w_a16, opRET_w_imm, opRET_w, opLES_w_a16, opLDS_w_a16, opMOV_b_imm_a16,opMOV_w_imm_a16,opENTER_w, opLEAVE_w, opRETF_a16_imm, opRETF_a16, opINT3, opINT, opINTO, opIRET_286,
/*d0*/ opD0_a16, opD1_w_a16, opD2_a16, opD3_w_a16, opAAM, opAAD, opSETALC, opXLAT_a16, opESCAPE_d8_a16,opESCAPE_d9_a16,opESCAPE_da_a16,opESCAPE_db_a16,opESCAPE_dc_a16,opESCAPE_dd_a16,opESCAPE_de_a16,opESCAPE_df_a16,
/*e0*/ opLOOPNE_w, opLOOPE_w, opLOOP_w, opJCXZ, opIN_AL_imm, opIN_AX_imm, opOUT_AL_imm, opOUT_AX_imm, opCALL_r16, opJMP_r16, opJMP_far_a16, opJMP_r8, opIN_AL_DX, opIN_AX_DX, opOUT_AL_DX, opOUT_AX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*f0*/ opLOCK, opLOCK, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
};
OpFn OP_TABLE(386)[1024] =
@@ -1332,7 +1326,7 @@ OpFn OP_TABLE(386)[1024] =
/*c0*/ opC0_a16, opC1_w_a16, opRET_w_imm, opRET_w, opLES_w_a16, opLDS_w_a16, opMOV_b_imm_a16,opMOV_w_imm_a16,opENTER_w, opLEAVE_w, opRETF_a16_imm, opRETF_a16, opINT3, opINT, opINTO, opIRET,
/*d0*/ opD0_a16, opD1_w_a16, opD2_a16, opD3_w_a16, opAAM, opAAD, opSETALC, opXLAT_a16, opESCAPE_d8_a16,opESCAPE_d9_a16,opESCAPE_da_a16,opESCAPE_db_a16,opESCAPE_dc_a16,opESCAPE_dd_a16,opESCAPE_de_a16,opESCAPE_df_a16,
/*e0*/ opLOOPNE_w, opLOOPE_w, opLOOP_w, opJCXZ, opIN_AL_imm, opIN_AX_imm, opOUT_AL_imm, opOUT_AX_imm, opCALL_r16, opJMP_r16, opJMP_far_a16, opJMP_r8, opIN_AL_DX, opIN_AX_DX, opOUT_AL_DX, opOUT_AX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*f0*/ opLOCK, opINT1, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_w_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_w_a16,
/*32-bit data, 16-bit addr*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
@@ -1354,7 +1348,7 @@ OpFn OP_TABLE(386)[1024] =
/*c0*/ opC0_a16, opC1_l_a16, opRET_l_imm, opRET_l, opLES_l_a16, opLDS_l_a16, opMOV_b_imm_a16,opMOV_l_imm_a16,opENTER_l, opLEAVE_l, opRETF_a32_imm, opRETF_a32, opINT3, opINT, opINTO, opIRETD,
/*d0*/ opD0_a16, opD1_l_a16, opD2_a16, opD3_l_a16, opAAM, opAAD, opSETALC, opXLAT_a16, opESCAPE_d8_a16,opESCAPE_d9_a16,opESCAPE_da_a16,opESCAPE_db_a16,opESCAPE_dc_a16,opESCAPE_dd_a16,opESCAPE_de_a16,opESCAPE_df_a16,
/*e0*/ opLOOPNE_w, opLOOPE_w, opLOOP_w, opJCXZ, opIN_AL_imm, opIN_EAX_imm, opOUT_AL_imm, opOUT_EAX_imm, opCALL_r32, opJMP_r32, opJMP_far_a32, opJMP_r8, opIN_AL_DX, opIN_EAX_DX, opOUT_AL_DX, opOUT_EAX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_l_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_l_a16,
/*f0*/ opLOCK, opINT1, opREPNE, opREPE, opHLT, opCMC, opF6_a16, opF7_l_a16, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a16, opFF_l_a16,
/*16-bit data, 32-bit addr*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
@@ -1376,7 +1370,7 @@ OpFn OP_TABLE(386)[1024] =
/*c0*/ opC0_a32, opC1_w_a32, opRET_w_imm, opRET_w, opLES_w_a32, opLDS_w_a32, opMOV_b_imm_a32,opMOV_w_imm_a32,opENTER_w, opLEAVE_w, opRETF_a16_imm, opRETF_a16, opINT3, opINT, opINTO, opIRET,
/*d0*/ opD0_a32, opD1_w_a32, opD2_a32, opD3_w_a32, opAAM, opAAD, opSETALC, opXLAT_a32, opESCAPE_d8_a32,opESCAPE_d9_a32,opESCAPE_da_a32,opESCAPE_db_a32,opESCAPE_dc_a32,opESCAPE_dd_a32,opESCAPE_de_a32,opESCAPE_df_a32,
/*e0*/ opLOOPNE_l, opLOOPE_l, opLOOP_l, opJECXZ, opIN_AL_imm, opIN_AX_imm, opOUT_AL_imm, opOUT_AX_imm, opCALL_r16, opJMP_r16, opJMP_far_a16, opJMP_r8, opIN_AL_DX, opIN_AX_DX, opOUT_AL_DX, opOUT_AX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a32, opF7_w_a32, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a32, opFF_w_a32,
/*f0*/ opLOCK, opINT1, opREPNE, opREPE, opHLT, opCMC, opF6_a32, opF7_w_a32, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a32, opFF_w_a32,
/*32-bit data, 32-bit addr*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
@@ -1398,5 +1392,5 @@ OpFn OP_TABLE(386)[1024] =
/*c0*/ opC0_a32, opC1_l_a32, opRET_l_imm, opRET_l, opLES_l_a32, opLDS_l_a32, opMOV_b_imm_a32,opMOV_l_imm_a32,opENTER_l, opLEAVE_l, opRETF_a32_imm, opRETF_a32, opINT3, opINT, opINTO, opIRETD,
/*d0*/ opD0_a32, opD1_l_a32, opD2_a32, opD3_l_a32, opAAM, opAAD, opSETALC, opXLAT_a32, opESCAPE_d8_a32,opESCAPE_d9_a32,opESCAPE_da_a32,opESCAPE_db_a32,opESCAPE_dc_a32,opESCAPE_dd_a32,opESCAPE_de_a32,opESCAPE_df_a32,
/*e0*/ opLOOPNE_l, opLOOPE_l, opLOOP_l, opJECXZ, opIN_AL_imm, opIN_EAX_imm, opOUT_AL_imm, opOUT_EAX_imm, opCALL_r32, opJMP_r32, opJMP_far_a32, opJMP_r8, opIN_AL_DX, opIN_EAX_DX, opOUT_AL_DX, opOUT_EAX_DX,
/*f0*/ opLOCK, ILLEGAL, opREPNE, opREPE, opHLT, opCMC, opF6_a32, opF7_l_a32, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a32, opFF_l_a32,
/*f0*/ opLOCK, opINT1, opREPNE, opREPE, opHLT, opCMC, opF6_a32, opF7_l_a32, opCLC, opSTC, opCLI, opSTI, opCLD, opSTD, opINCDEC_b_a32, opFF_l_a32,
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
version="1.20.0.0"
processorArchitecture="*"
name="86Box.exe"
type="win32"
/>
<description>Your application description here.</description>
<description>Emulator for X86-based systems.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity

833
src/86Box.rc Normal file
View File

@@ -0,0 +1,833 @@
#include <inttypes.h>
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
STATUSBARMENU MENU DISCARDABLE
BEGIN
POPUP "FDD 1"
BEGIN
MENUITEM "&Change...", IDM_DISC_1
MENUITEM "Change FDD 1 (&Write-protected)...", IDM_DISC_1_WP
MENUITEM "&Eject FDD 1", IDM_EJECT_1
END
POPUP "FDD 2"
BEGIN
MENUITEM "&Change...", IDM_DISC_2
MENUITEM "Change FDD 2 (&Write-protected)...", IDM_DISC_2_WP
MENUITEM "&Eject FDD 2", IDM_EJECT_2
END
POPUP "FDD 3"
BEGIN
MENUITEM "&Change...", IDM_DISC_3
MENUITEM "Change FDD 3 (&Write-protected)...", IDM_DISC_3_WP
MENUITEM "&Eject FDD 3", IDM_EJECT_3
END
POPUP "FDD 4"
BEGIN
MENUITEM "&Change...", IDM_DISC_4
MENUITEM "Change FDD 4 (&Write-protected)...", IDM_DISC_4_WP
MENUITEM "&Eject FDD 4", IDM_EJECT_4
END
POPUP "CD-ROM 1"
BEGIN
MENUITEM "&Mute", IDM_CDROM_1_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_1_EMPTY
MENUITEM "&Reload previous disc", IDM_CDROM_1_RELOAD
MENUITEM SEPARATOR
MENUITEM "&ISO...", IDM_CDROM_1_ISO
END
POPUP "CD-ROM 2"
BEGIN
MENUITEM "&Mute", IDM_CDROM_2_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_2_EMPTY
MENUITEM "&Reload previous disc", IDM_CDROM_2_RELOAD
MENUITEM SEPARATOR
MENUITEM "&ISO...", IDM_CDROM_2_ISO
END
POPUP "CD-ROM 3"
BEGIN
MENUITEM "&Mute", IDM_CDROM_3_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_3_EMPTY
MENUITEM "&Reload previous disc", IDM_CDROM_3_RELOAD
MENUITEM SEPARATOR
MENUITEM "&ISO...", IDM_CDROM_3_ISO
END
POPUP "CD-ROM 4"
BEGIN
MENUITEM "&Mute", IDM_CDROM_4_MUTE
MENUITEM SEPARATOR
MENUITEM "E&mpty", IDM_CDROM_4_EMPTY
MENUITEM "&Reload previous disc", IDM_CDROM_4_RELOAD
MENUITEM SEPARATOR
MENUITEM "&ISO...", IDM_CDROM_4_ISO
END
END
MAINMENU MENU DISCARDABLE
BEGIN
POPUP "&Action"
BEGIN
MENUITEM "&Hard Reset", IDM_FILE_HRESET
MENUITEM "&Ctrl+Alt+Del\tCtrl+F12", IDM_FILE_RESET_CAD
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_FILE_EXIT
END
POPUP "&Tools"
BEGIN
MENUITEM "&Settings...", IDM_CONFIG
MENUITEM SEPARATOR
MENUITEM "&Load configuration...", IDM_CONFIG_LOAD
MENUITEM "&Save configuration...", IDM_CONFIG_SAVE
MENUITEM SEPARATOR
POPUP "&Video"
BEGIN
MENUITEM "&Resizeable window", IDM_VID_RESIZE
MENUITEM "R&emember size && position", IDM_VID_REMEMBER
MENUITEM SEPARATOR
MENUITEM "&DirectDraw", IDM_VID_DDRAW
MENUITEM "Direct&3D 9", IDM_VID_D3D
MENUITEM SEPARATOR
POPUP "&Window scale factor"
BEGIN
MENUITEM "&0.5x", IDM_VID_SCALE_1X
MENUITEM "&1x", IDM_VID_SCALE_2X
MENUITEM "1.&5x", IDM_VID_SCALE_3X
MENUITEM "&2x", IDM_VID_SCALE_4X
END
MENUITEM SEPARATOR
MENUITEM "&Fullscreen", IDM_VID_FULLSCREEN
POPUP "Fullscreen &stretch mode"
BEGIN
MENUITEM "&Full screen stretch", IDM_VID_FS_FULL
MENUITEM "&4:3", IDM_VID_FS_43
MENUITEM "&Square pixels", IDM_VID_FS_SQ
MENUITEM "&Integer scale", IDM_VID_FS_INT
END
MENUITEM "&Inverted VGA monitor", IDM_VID_INVERT
MENUITEM SEPARATOR
MENUITEM "F&orce 4:3 display ratio", IDM_VID_FORCE43
MENUITEM "E&GA/(S)VGA overscan", IDM_VID_OVERSCAN
MENUITEM SEPARATOR
MENUITEM "Take s&creenshot\tCtrl+F11", IDM_VID_SCREENSHOT
END
MENUITEM "S&tatus", IDM_STATUS
END
POPUP "&Help"
BEGIN
MENUITEM "&About 86Box...", IDM_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
MAINACCEL ACCELERATORS MOVEABLE PURE
BEGIN
VK_F11, IDM_VID_SCREENSHOT, VIRTKEY, CONTROL
VK_F12, IDM_FILE_RESET_CAD, VIRTKEY, CONTROL
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
CONFIGUREDLG_MAIN DIALOG DISCARDABLE 0, 0, 366, 241
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "86Box Settings"
FONT 9, "Segoe UI"
BEGIN
DEFPUSHBUTTON "OK",IDOK,246,220,50,14
PUSHBUTTON "Cancel",IDCANCEL,307,220,50,14
CONTROL "List2",IDC_SETTINGSCATLIST,"SysListView32",LVS_LIST |
LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,90,197
CONTROL "",-1,"Static",SS_BLACKFRAME | SS_SUNKEN,1,211,363,1
LTEXT "Language:",2047,7,222,41,10
COMBOBOX IDC_COMBO_LANG,48,221,108,120,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
END
CONFIGUREDLG_HARD_DISKS_ADD DIALOG DISCARDABLE 0, 0, 219, 111
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Add Hard Disk"
FONT 9, "Segoe UI"
BEGIN
DEFPUSHBUTTON "OK",IDOK,55,89,50,14
PUSHBUTTON "Cancel",IDCANCEL,112,89,50,14
EDITTEXT IDC_EDIT_HD_FILE_NAME,7,16,188,12
PUSHBUTTON "...",IDC_CFILE,195,16,16,12
EDITTEXT IDC_EDIT_HD_SPT,183,34,28,12
EDITTEXT IDC_EDIT_HD_HPC,112,34,28,12
EDITTEXT IDC_EDIT_HD_CYL,42,34,28,12
EDITTEXT IDC_EDIT_HD_SIZE,42,52,28,12
COMBOBOX IDC_COMBO_HD_TYPE,113,52,98,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Sectors:",IDC_STATIC,154,35,27,10
LTEXT "Heads:",1793,81,35,29,8
LTEXT "Cylinders:",1794,7,35,32,12
LTEXT "Size (MB):",1795,7,54,33,8
LTEXT "Type:",1797,86,54,24,8
LTEXT "File name:",-1,7,7,204,9
COMBOBOX IDC_COMBO_HD_BUS,33,71,58,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",1798,7,72,24,8
COMBOBOX IDC_COMBO_HD_CHANNEL,134,71,77,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",1799,99,72,34,8
COMBOBOX IDC_COMBO_HD_ID,133,71,26,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",1800,117,72,15,8
COMBOBOX IDC_COMBO_HD_LUN,185,71,26,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",1801,168,72,15,8
COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,134,71,77,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",1802,99,72,34,8
END
STATUSDLG DIALOG DISCARDABLE 0, 0, 186, 386
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Status"
FONT 9, "Segoe UI"
BEGIN
LTEXT "1",IDC_STEXT_DEVICE,16,16,180,1000
LTEXT "1",IDC_STEXT1,16,186,180,1000
END
ABOUTDLG DIALOG DISCARDABLE 0, 0, 209, 114
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About 86Box"
FONT 9, "Segoe UI"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,94,71,12
ICON 100,IDC_ABOUT_ICON,7,7,20,20
LTEXT "86Box v1.20 - A fork of PCem\n\nAuthors: Sarah Walker, Tohka, waltje, SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information.",
IDC_ABOUT_ICON,54,7,146,73
CONTROL "",IDC_ABOUT_ICON,"Static",SS_BLACKFRAME | SS_SUNKEN,0,
86,208,1
END
CONFIGUREDLG_MACHINE DIALOG DISCARDABLE 97, 0, 267, 112
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
COMBOBOX IDC_COMBO_MACHINE,71,7,138,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Machine:",1794,7,8,60,10
PUSHBUTTON "Configure",IDC_CONFIGURE_MACHINE,214,7,46,12
COMBOBOX IDC_COMBO_CPU_TYPE,71,25,45,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "CPU type:",1796,7,26,59,10
COMBOBOX IDC_COMBO_WS,71,44,189,120,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
LTEXT "Wait states:",1798,7,45,60,10
COMBOBOX IDC_COMBO_CPU,145,25,115,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "CPU:",1797,124,26,18,10
CONTROL "Dynamic Recompiler",IDC_CHECK_DYNAREC,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,80,94,10
CONTROL "Enable FPU",IDC_CHECK_FPU,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,147,81,113,10
EDITTEXT IDC_MEMTEXT,70,63,45,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_MEMSPIN,"msctls_updown32",UDS_SETBUDDYINT |
UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,113,63,
12,12
LTEXT "MB",IDC_TEXT_MB,123,64,10,10
LTEXT "Memory:",1802,7,64,30,10
CONTROL "Enable time sync",IDC_CHECK_SYNC,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,95,102,10
END
CONFIGUREDLG_VIDEO DIALOG DISCARDABLE 97, 0, 267, 63
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
COMBOBOX IDC_COMBO_VIDEO,71,7,140,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Video:",1795,7,8,55,10
COMBOBOX IDC_COMBO_VIDEO_SPEED,71,25,189,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Video speed:",1800,7,26,58,10
CONTROL "Voodoo Graphics",IDC_CHECK_VOODOO,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,45,199,10
PUSHBUTTON "Configure",IDC_CONFIGURE_VOODOO,215,44,45,12
PUSHBUTTON "Configure",IDC_CONFIGUREVID,214,7,46,12
END
CONFIGUREDLG_INPUT DIALOG DISCARDABLE 97, 0, 267, 65
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
LTEXT "Mouse :",IDC_STATIC,7,8,57,10
COMBOBOX IDC_COMBO_MOUSE,71,7,189,120,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP
LTEXT "Joystick :",1793,7,26,58,10
COMBOBOX IDC_COMBO_JOYSTICK,71,25,189,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "Joystick 1...",IDC_JOY1,7,44,50,14
PUSHBUTTON "Joystick 2...",IDC_JOY2,74,44,50,14
DEFPUSHBUTTON "Joystick 3...",IDC_JOY3,141,44,50,14
PUSHBUTTON "Joystick 4...",IDC_JOY4,209,44,50,14
END
CONFIGUREDLG_SOUND DIALOG DISCARDABLE 97, 0, 267, 60
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
COMBOBOX IDC_COMBOSND,71,7,141,120,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
LTEXT "Sound card:",1800,7,8,59,10
PUSHBUTTON "Configure",IDC_CONFIGURESND,215,7,45,14
CONTROL "CMS / Game Blaster",IDC_CHECKCMS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,87,25,80,10
CONTROL "Innovation SSI-2001",IDC_CHECKSSI,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,25,80,10
CONTROL "Gravis Ultrasound",IDC_CHECKGUS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,174,25,80,10
CONTROL "Use Nuked OPL",IDC_CHECKNUKEDOPL,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,43,80,10
END
CONFIGUREDLG_PERIPHERALS DIALOG DISCARDABLE 97, 0, 267, 132
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
PUSHBUTTON "Configure",IDC_CONFIGURE_SCSI,215,24,45,14
LTEXT "HD Controller:",1799,7,44,61,10
COMBOBOX IDC_COMBO_HDC,71,43,189,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Network adapter:",1801,7,8,59,10
COMBOBOX IDC_COMBONET,71,7,141,120,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
PUSHBUTTON "Configure",IDC_CONFIGURENET,215,6,45,14
LTEXT "Tertiary IDE:",1802,7,62,61,10
COMBOBOX IDC_COMBO_IDE_TER,71,61,189,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Quaternary IDE:",1803,7,81,61,10
COMBOBOX IDC_COMBO_IDE_QUA,71,79,189,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "SCSI Controller:",1804,7,26,59,10
COMBOBOX IDC_COMBO_SCSI,71,25,141,120,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
CONTROL "Serial port 1",IDC_CHECKSERIAL1,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,97,80,10
CONTROL "Parallel port",IDC_CHECKPARALLEL,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,174,97,80,10
CONTROL "Serial port 2",IDC_CHECKSERIAL2,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,87,97,80,10
CONTROL "ISABugger device",IDC_CHECKBUGGER,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,115,80,10
END
CONFIGUREDLG_HARD_DISKS DIALOG DISCARDABLE 97, 0, 267, 154
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
CONTROL "List1",IDC_LIST_HARD_DISKS,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,18,253,92
LTEXT "Hard disks:",-1,7,7,34,8
PUSHBUTTON "&New...",IDC_BUTTON_HDD_ADD_NEW,60,137,62,10
PUSHBUTTON "&Existing...",IDC_BUTTON_HDD_ADD,129,137,62,10
PUSHBUTTON "&Remove",IDC_BUTTON_HDD_REMOVE,198,137,62,10
COMBOBOX IDC_COMBO_HD_BUS,33,117,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",1798,7,118,24,8
COMBOBOX IDC_COMBO_HD_CHANNEL,170,117,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",1799,131,118,38,8
COMBOBOX IDC_COMBO_HD_ID,170,117,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",1800,131,118,38,8
COMBOBOX IDC_COMBO_HD_LUN,239,117,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",1801,200,118,38,8
COMBOBOX IDC_COMBO_HD_CHANNEL_IDE,170,117,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",1802,131,118,38,8
END
CONFIGUREDLG_REMOVABLE_DEVICES DIALOG DISCARDABLE 97, 0, 267, 202
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
BEGIN
CONTROL "List1",IDC_LIST_FLOPPY_DRIVES,"SysListView32",
LVS_REPORT | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,
7,18,253,60
LTEXT "Floppy drives:",-1,7,7,43,8
CONTROL "List1",IDC_LIST_CDROM_DRIVES,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,116,253,60
LTEXT "CD-ROM drives:",-1,7,106,50,8
COMBOBOX IDC_COMBO_FD_TYPE,33,85,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Type:",1803,7,86,24,8
COMBOBOX IDC_COMBO_CD_BUS,33,183,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Bus:",1798,7,184,24,8
COMBOBOX IDC_COMBO_CD_ID,170,183,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "ID:",1800,131,184,38,8
COMBOBOX IDC_COMBO_CD_LUN,239,183,22,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "LUN:",1801,200,184,38,8
COMBOBOX IDC_COMBO_CD_CHANNEL_IDE,170,183,90,12,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Channel:",1802,131,184,38,8
END
/////////////////////////////////////////////////////////////////////////////
//
// 24
//
1 24 MOVEABLE PURE "86Box.manifest"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
#ifdef RELEASE_BUILD
/* Icon by Devcore - https://commons.wikimedia.org/wiki/File:Icon_PC_256x256.png */
100 ICON DISCARDABLE "ICONS/86Box-RB.ico"
#else
/* Icon by Devcore - https://commons.wikimedia.org/wiki/File:Icon_PC2_256x256.png */
100 ICON DISCARDABLE "ICONS/86Box.ico"
#endif
128 ICON DISCARDABLE "ICONS/floppy_525_1dd.ico"
129 ICON DISCARDABLE "ICONS/floppy_525_1dd_active.ico"
130 ICON DISCARDABLE "ICONS/floppy_525_2dd.ico"
131 ICON DISCARDABLE "ICONS/floppy_525_2dd_active.ico"
132 ICON DISCARDABLE "ICONS/floppy_525_2qd.ico"
133 ICON DISCARDABLE "ICONS/floppy_525_2qd_active.ico"
134 ICON DISCARDABLE "ICONS/floppy_525_2hd.ico"
135 ICON DISCARDABLE "ICONS/floppy_525_2hd_active.ico"
144 ICON DISCARDABLE "ICONS/floppy_35_1dd.ico"
145 ICON DISCARDABLE "ICONS/floppy_35_1dd_active.ico"
146 ICON DISCARDABLE "ICONS/floppy_35_2dd.ico"
147 ICON DISCARDABLE "ICONS/floppy_35_2dd_active.ico"
150 ICON DISCARDABLE "ICONS/floppy_35_2hd.ico"
151 ICON DISCARDABLE "ICONS/floppy_35_2hd_active.ico"
152 ICON DISCARDABLE "ICONS/floppy_35_2ed.ico"
153 ICON DISCARDABLE "ICONS/floppy_35_2ed_active.ico"
160 ICON DISCARDABLE "ICONS/cdrom_atapi.ico"
161 ICON DISCARDABLE "ICONS/cdrom_atapi_active.ico"
162 ICON DISCARDABLE "ICONS/cdrom_atapi_dma.ico"
163 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_active.ico"
164 ICON DISCARDABLE "ICONS/cdrom_scsi.ico"
165 ICON DISCARDABLE "ICONS/cdrom_scsi_active.ico"
176 ICON DISCARDABLE "ICONS/hard_disk.ico"
177 ICON DISCARDABLE "ICONS/hard_disk_active.ico"
178 ICON DISCARDABLE "ICONS/hard_disk_ide.ico"
179 ICON DISCARDABLE "ICONS/hard_disk_ide_active.ico"
180 ICON DISCARDABLE "ICONS/hard_disk_scsi.ico"
181 ICON DISCARDABLE "ICONS/hard_disk_scsi_active.ico"
256 ICON DISCARDABLE "ICONS/machine.ico"
257 ICON DISCARDABLE "ICONS/video.ico"
258 ICON DISCARDABLE "ICONS/input_devices.ico"
259 ICON DISCARDABLE "ICONS/sound.ico"
260 ICON DISCARDABLE "ICONS/other_peripherals.ico"
261 ICON DISCARDABLE "ICONS/hard_disk.ico"
262 ICON DISCARDABLE "ICONS/removable_devices.ico"
384 ICON DISCARDABLE "ICONS/floppy_525_1dd_empty.ico"
385 ICON DISCARDABLE "ICONS/floppy_525_1dd_empty_active.ico"
386 ICON DISCARDABLE "ICONS/floppy_525_2dd_empty.ico"
387 ICON DISCARDABLE "ICONS/floppy_525_2dd_empty_active.ico"
388 ICON DISCARDABLE "ICONS/floppy_525_2qd_empty.ico"
389 ICON DISCARDABLE "ICONS/floppy_525_2qd_empty_active.ico"
390 ICON DISCARDABLE "ICONS/floppy_525_2hd_empty.ico"
391 ICON DISCARDABLE "ICONS/floppy_525_2hd_empty_active.ico"
400 ICON DISCARDABLE "ICONS/floppy_35_1dd_empty.ico"
401 ICON DISCARDABLE "ICONS/floppy_35_1dd_empty_active.ico"
402 ICON DISCARDABLE "ICONS/floppy_35_2dd_empty.ico"
403 ICON DISCARDABLE "ICONS/floppy_35_2dd_empty_active.ico"
406 ICON DISCARDABLE "ICONS/floppy_35_2hd_empty.ico"
407 ICON DISCARDABLE "ICONS/floppy_35_2hd_empty_active.ico"
408 ICON DISCARDABLE "ICONS/floppy_35_2ed_empty.ico"
409 ICON DISCARDABLE "ICONS/floppy_35_2ed_empty_active.ico"
416 ICON DISCARDABLE "ICONS/cdrom_atapi_empty.ico"
417 ICON DISCARDABLE "ICONS/cdrom_atapi_empty_active.ico"
418 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_empty.ico"
419 ICON DISCARDABLE "ICONS/cdrom_atapi_dma_empty_active.ico"
420 ICON DISCARDABLE "ICONS/cdrom_scsi_empty.ico"
421 ICON DISCARDABLE "ICONS/cdrom_scsi_empty_active.ico"
512 ICON DISCARDABLE "ICONS/floppy_disabled.ico"
514 ICON DISCARDABLE "ICONS/cdrom_disabled.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""resources.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
CONFIGUREDLG_MAIN, DIALOG
BEGIN
RIGHTMARGIN, 365
END
ABOUTDLG, DIALOG
BEGIN
RIGHTMARGIN, 208
END
CONFIGUREDLG_MACHINE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 260
TOPMARGIN, 7
BOTTOMMARGIN, 105
END
CONFIGUREDLG_VIDEO, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 260
TOPMARGIN, 7
BOTTOMMARGIN, 56
END
CONFIGUREDLG_INPUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 260
TOPMARGIN, 7
BOTTOMMARGIN, 58
END
CONFIGUREDLG_PERIPHERALS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 260
TOPMARGIN, 7
BOTTOMMARGIN, 125
END
CONFIGUREDLG_HARD_DISKS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 260
TOPMARGIN, 7
BOTTOMMARGIN, 137
END
CONFIGUREDLG_REMOVABLE_DEVICES, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 260
TOPMARGIN, 7
BOTTOMMARGIN, 195
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
2048 "86Box"
IDS_STRING2049 "86Box Error"
IDS_STRING2050 "86Box Fatal Error"
IDS_STRING2051 "This will reset 86Box.\nDo you want to save the settings?"
IDS_STRING2052 "DirectDraw Screenshot Error"
IDS_STRING2053 "Invalid number of sectors (valid values are between 1 and 63)"
IDS_STRING2054 "Invalid number of heads (valid values are between 1 and 16)"
IDS_STRING2055 "Invalid number of cylinders (valid values are between 1 and 266305)"
IDS_STRING2056 "Please enter a valid file name"
IDS_STRING2057 "Unable to open the file for write"
IDS_STRING2058 "Attempting to create a HDI image larger than 4 GB"
IDS_STRING2059 "Remember to partition and format the new drive"
IDS_STRING2060 "Unable to open the file for read"
IDS_STRING2061 "HDI or HDX image with a sector size that is not 512 are not supported"
IDS_STRING2062 "86Box was unable to find any ROMs.\nAt least one ROM set is required to use 86Box."
IDS_STRING2063 "Configured ROM set not available.\nDefaulting to an available ROM set."
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_STRING2064 "Configured video BIOS not available.\nDefaulting to an available video BIOS."
IDS_STRING2065 "Machine"
IDS_STRING2066 "Video"
IDS_STRING2067 "Input devices"
IDS_STRING2068 "Sound"
IDS_STRING2069 "Other peripherals"
IDS_STRING2070 "Hard disks"
IDS_STRING2071 "Removable devices"
IDS_STRING2072 "Disabled floppy drive"
IDS_STRING2073 "%i"" floppy drive: %s"
IDS_STRING2074 "Disabled CD-ROM drive"
IDS_STRING2075 "%s CD-ROM drive: %s"
IDS_STRING2076 "Host CD/DVD Drive (%c:)"
IDS_STRING2077 "Click to capture mouse"
IDS_STRING2078 "Press F12-F8 to release mouse"
IDS_STRING2079 "Press F12-F8 or middle button to release mouse"
END
STRINGTABLE DISCARDABLE
BEGIN
2080 "Drive"
2081 "Location"
2082 "Bus"
2083 "File"
2084 "C"
2085 "H"
2086 "S"
2087 "MB"
2088 "%i"
2089 "Enabled"
2090 "Mute"
2091 "Type"
2092 "Bus"
2093 "DMA"
2094 "KB"
2095 "Master"
END
STRINGTABLE DISCARDABLE
BEGIN
2096 "Slave"
2097 "SCSI (ID %s, LUN %s)"
2098 "Adapter Type"
2099 "Base Address"
2100 "IRQ"
2101 "8-bit DMA"
2102 "16-bit DMA"
2103 "BIOS"
2104 "Network Type"
2105 "Surround Module"
2106 "MPU-401 Base Address"
2107 "MIDI Out Device"
2108 "On-board RAM"
2109 "Memory Size"
2110 "Display Type"
2111 "RGB"
END
STRINGTABLE DISCARDABLE
BEGIN
2112 "Composite"
2113 "Composite Type"
2114 "Old"
2115 "New"
2116 "RGB Type"
2117 "Color"
2118 "Monochrome (Green)"
2119 "Monochrome (Amber)"
2120 "Monochrome (Gray)"
2121 "Color (no brown)"
2122 "Monochrome (Default)"
2123 "Snow Emulation"
2124 "Bilinear Filtering"
2125 "Dithering"
2126 "Framebuffer Memory Size"
2127 "Texture Memory Size"
END
STRINGTABLE DISCARDABLE
BEGIN
2128 "Screen Filter"
2129 "Render Threads"
2130 "Recompiler"
2131 "System Default"
2132 "%i Wait state(s)"
2133 "8-bit"
2134 "Slow 16-bit"
2135 "Fast 16-bit"
2136 "Slow VLB/PCI"
2137 "Mid VLB/PCI"
2138 "Fast VLB/PCI"
2139 "Microsoft 2-button mouse (serial)"
2140 "2-button mouse (PS/2)"
2141 "Microsoft Intellimouse (PS/2)"
2142 "Amstrad mouse"
2143 "Olivetti M24 mouse"
END
STRINGTABLE DISCARDABLE
BEGIN
2144 "Standard 2-button joystick(s)"
2145 "Standard 4-button joystick"
2146 "Standard 6-button joystick"
2147 "Standard 8-button joystick"
2148 "CH Flightstick Pro"
2149 "Microsoft SideWinder Pad"
2150 "Thrustmaster Flight Control System"
2151 "Disabled"
2152 "None"
2153 "AT Fixed Disk Adapter"
2154 "Internal IDE"
2155 "IRQ %i"
2156 "MFM (%01i:%01i)"
2157 "IDE (%01i:%01i)"
2158 "SCSI (%02i:%02i)"
2159 "IDE (PIO-only)"
2160 "%" PRIu64
2161 "Microsoft Bus mouse"
2162 "Mouse Systems mouse"
2163 "Attempting to create a spuriously large hard disk image"
2164 "Invalid number of sectors (valid values are between 1 and 99)"
2165 "Invalid number of cylinders (valid values are between 1 and 1023)"
2166 "MFM"
2167 "IDE"
2168 "SCSI"
2169 "%01i:%01i"
2170 "Custom..."
2171 "%" PRIu64 " MB (CHS: %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")"
2172 "Hard disk images (*.HDI;*.HDX;*.IMA;*.IMG)\0*.HDI;*.HDX;*.IMA;*.IMG\0All files (*.*)\0*.*\0"
2173 "All floppy images (*.0??;*.12;*.144;*.360;*.720;*.86F;*.BIN;*.CQ;*.CQM;*.DSK;*.FDI;*.FDF;*.FLP;*.HDM;*.IMA;*.IMD;*.IMG;*.TD0;*.VFD;*.XDF)\0*.0??;*.12;*.144;*.360;*.720;*.86F;*.BIN;*.CQ;*.CQM;*.DSK;*.FDI;*.FDF;*.FLP;*.HDM;*.IMA;*.IMD;*.IMG;*.TD0;*.VFD;*.XDF\0Advanced sector-based images (*.IMD;*.TD0)\0*.IMD;*.TD0\0Basic sector-based images (*.0??;*.12;*.144;*.360;*.720;*.BIN;*.CQ;*.CQM;*.DSK;*.FDI;*.FDF;*.FLP;*.HDM;*.IMA;*.IMG;*.VFD;*.XDF)\0*.0??;*.12;*.144;*.360;*.720;*.BIN;*.CQ;*.CQM;*.DSK;*.FDI;*.FDF;*.FLP;*.HDM;*.IMA;*.IMG;*.VFD;*.XDF\0Flux images (*.FDI)\0*.FDI\0Surface-based images (*.86F)\0*.86F\0All files (*.*)\0*.*\0"
2174 "Configuration files (*.CFG)\0*.CFG\0All files (*.*)\0*.*\0"
2175 "CD-ROM image (*.ISO)\0*.ISO\0All files (*.*)\0*.*\0"
2176 "Use CTRL + ALT + PAGE DOWN to return to windowed mode"
2177 "Microsoft InPort mouse"
2178 "Genius Bus mouse"
2179 "Floppy %i (%s): %s"
2180 "CD-ROM %i: %s"
2181 "Removable disk %i: %s"
2182 "MFM hard disk"
2183 "IDE hard disk"
2184 "SCSI hard disk"
2185 "(empty)"
2186 "(host drive %c:)"
2187 "Custom (large)..."
2188 "Type"
2189 "ATAPI (PIO-only)"
2190 "ATAPI (PIO and DMA)"
2191 "ATAPI (PIO-only) (%01i:%01i)"
2192 "ATAPI (PIO and DMA) (%01i:%01i)"
2193 "Use CTRL + ALT + PAGE DOWN to return to windowed mode"
2194 "<placeholder string>"
2195 "English (United States)"
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,20,0,0
PRODUCTVERSION 1,20,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "IRC #SoftHistory\0"
VALUE "FileDescription", "86Box - an emulator for X86-based systems\0"
VALUE "FileVersion", "1.20\0"
VALUE "InternalName", "pc_new\0"
VALUE "LegalCopyright", "Copyright © SoftHistory, Sarah Walker, 2007-2017, Released under the GNU GPL v2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "86Box.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "86Box Emulator\0"
VALUE "ProductVersion", "1.20\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -1,4 +1,4 @@
/* Copyright holders: Tenshi
see COPYING for more details
*/
#define emulator_version "1.10"
#define emulator_version "1.20"

View File

@@ -1,59 +0,0 @@
cmake_minimum_required(VERSION 2.8.8)
project(86box)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
ENABLE_LANGUAGE(RC)
set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} <SOURCE> <OBJECT>")
set(SRCS
386.c 386_dynarec.c 386_dynarec_ops.c 808x.c acer386sx.c acerm3a.c ali1429.c amstrad.c buslogic.c cdrom.c cdrom-ioctl.c cdrom-iso.c
cdrom-null.c codegen.c codegen_ops.c codegen_timing_486.c codegen_timing_686.c codegen_timing_pentium.c codegen_timing_winchip.c compaq.c config.c cpu.c dac.c
device.c disc.c disc_86f.c disc_fdi.c disc_imd.c disc_img.c disc_random.c disc_td0.c dma.c fdc.c fdc37c665.c fdc37c932fr.c fdd.c fdi2raw.c gameport.c hdd.c headland.c i430hx.c i430lx.c i430fx.c
i430nx.c i430vx.c i440fx.c ide.c intel.c intel_flash.c io.c jim.c joystick_ch_flightstick_pro.c joystick_standard.c joystick_sw_pad.c joystick_tm_fcs.c keyboard.c keyboard_amstrad.c keyboard_at.c
keyboard_olim24.c keyboard_pcjr.c keyboard_xt.c lpt.c mcr.c mem.c memregs.c mfm_at.c model.c mouse.c mouse_ps2.c
mouse_serial.c ne2000.c neat.c nethandler.c nmi.c nvr.c olivetti_m24.c opti495.c pc.c pc87306.c pci.c pic.c piix.c pit.c ppi.c ps1.c ps2.c rom.c rtc.c
scat.c scsi.c serial.c sis496.c sis85c471.c sio.c sound.c sound_ad1848.c sound_adlib.c sound_adlibgold.c sound_cms.c
sound_dbopl.cc sound_emu8k.c sound_gus.c sound_mpu401_uart.c sound_opl.c sound_pas16.c sound_ps1.c sound_pssj.c sound_resid.cc
sound_sb.c sound_sb_dsp.c sound_sn76489.c sound_speaker.c sound_ssi2001.c sound_wss.c sound_ym7128.c
soundopenal.c tandy_eeprom.c tandy_rom.c timer.c um8669f.c usb.c vid_ati_eeprom.c vid_ati_mach64.c vid_ati18800.c
vid_ati28800.c vid_ati68860_ramdac.c vid_bt485_ramdac.c vid_cga.c vid_cl_gd.c vid_cl_gd_blit.c vid_cl_ramdac.c vid_colorplus.c vid_ega.c vid_et4000.c
vid_et4000w32.c vid_hercules.c vid_herculesplus.c vid_icd2061.c vid_ics2595.c vid_incolor.c vid_mda.c vid_nv_riva128.c
vid_olivetti_m24.c vid_oti067.c vid_paradise.c vid_pc1512.c vid_pc1640.c vid_pc200.c
vid_pcjr.c vid_ps1_svga.c vid_s3.c vid_s3_virge.c vid_sdac_ramdac.c vid_stg_ramdac.c vid_svga.c
vid_svga_render.c vid_tandy.c vid_tandysl.c vid_tgui9440.c vid_tkd8001_ramdac.c vid_tvga.c vid_unk_ramdac.c
vid_vga.c vid_wy700.c vid_voodoo.c video.c w83877f.c wd76c10.c win.c win-config.c win-d3d.cc win-d3d-fs.cc win-ddraw.cc
win-ddraw-fs.cc win-ddraw-screenshot.cc win-deviceconfig.c win-hdconf.c win-joystick.cc win-joystickconfig.c win-keyboard.cc win-midi.c win-mouse.cc
win-status.c win-video.c x86seg.c x87.c xtide.c pc.rc
dosbox/dbopl.cpp dosbox/nukedopl.cpp dosbox/vid_cga_comp.c
lzf/lzf_c.c lzf/lzf_d.c
resid-fp/convolve.cc resid-fp/convolve-sse.cc resid-fp/envelope.cc resid-fp/extfilt.cc resid-fp/filter.cc resid-fp/pot.cc resid-fp/sid.cc resid-fp/voice.cc resid-fp/wave6581__ST.cc resid-fp/wave6581_P_T.cc resid-fp/wave6581_PS_.cc resid-fp/wave6581_PST.cc resid-fp/wave8580__ST.cc resid-fp/wave8580_P_T.cc resid-fp/wave8580_PS_.cc resid-fp/wave8580_PST.cc resid-fp/wave.cc
slirp/bootp.c slirp/ip_icmp.c slirp/misc.c slirp/socket.c slirp/tcp_timer.c slirp/cksum.c slirp/ip_input.c slirp/queue.c slirp/tcp_input.c slirp/tftp.c slirp/debug.c slirp/ip_output.c slirp/sbuf.c slirp/tcp_output.c slirp/udp.c slirp/if.c slirp/mbuf.c slirp/slirp.c slirp/tcp_subr.c
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_ARCH_64 1)
else()
set(_ARCH_32 1)
endif()
include(FindOpenAL REQUIRED)
include(FindDirectInput REQUIRED)
include(FindDirectDraw REQUIRED)
if(_ARCH_32)
set(SRCS ${SRCS}
codegen_x86.c
)
else()
set(SRCS ${SRCS}
codegen_x86-64.c
)
endif()
add_definitions(-msse2 -mstackrealign -mwindows -g)
add_executable(86box ${SRCS})
target_link_libraries(86box winmm openal.dll openal ddraw dinput8 dxguid d3d9 d3dx9 wsock32 iphlpapi stdc++ psapi wpcapdelay comdlg32 gdi32)

View File

Before

Width:  |  Height:  |  Size: 385 KiB

After

Width:  |  Height:  |  Size: 385 KiB

View File

Before

Width:  |  Height:  |  Size: 385 KiB

After

Width:  |  Height:  |  Size: 385 KiB

BIN
src/ICONS/cdrom_atapi.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/cdrom_scsi.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/floppy_35_1dd.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/floppy_35_2dd.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/floppy_35_2ed.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/floppy_35_2hd.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/hard_disk.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/hard_disk_ide.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/input_devices.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/machine.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/sound.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/ICONS/video.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,51 +0,0 @@
# Makefile.am for PCem
bin_PROGRAMS = pcem
noinst_SCRIPTS = ../pcem
CLEANFILES = $(noinst_SCRIPTS)
../pcem: pcem
cp pcem ..
amrefresh:
pcem_CFLAGS = $(allegro_CFLAGS)
pcem_LDADD = $(allegro_LIBS) -lopenal -lalut
pcem_SOURCES = 386.c 386_dynarec.c 386_dynarec_ops.c 808x.c acer386sx.c ali1429.c allegro-gui.c \
allegro-gui-configure.c allegro-gui-deviceconfig.c allegro-gui-hdconf.c allegro-joystick.c allegro-keyboard.c allegro-main.c \
allegro-midi.c allegro-mouse.c allegro-video.c amstrad.c cdrom-ioctl-linux.c cdrom-iso.c cdrom-null.c \
codegen.c codegen_ops.c codegen_timing_486.c codegen_timing_686.c codegen_timing_pentium.c codegen_timing_winchip.c compaq.c config.c cpu.c \
dac.c device.c disc.c disc_fdi.c disc_img.c disc_sector.c dma.c fdc.c fdc37c665.c fdd.c fdi2raw.c gameport.c \
headland.c i430lx.c i430fx.c i430vx.c ide.c intel.c intel_flash.c io.c jim.c \
keyboard.c keyboard_amstrad.c keyboard_at.c keyboard_olim24.c keyboard_pcjr.c keyboard_xt.c \
linux-time.c lpt.c mcr.c mem.c model.c mouse.c mouse_ps2.c mouse_serial.c neat.c nmi.c nvr.c \
olivetti_m24.c opti.c pc.c pci.c pic.c piix.c pit.c ppi.c ps1.c rom.c scat.c serial.c sis496.c sound.c \
sound_ad1848.c sound_adlib.c sound_adlibgold.c sound_cms.c sound_emu8k.c sound_gus.c \
sound_mpu401_uart.c sound_opl.c sound_pas16.c sound_ps1.c sound_pssj.c sound_sb.c sound_sb_dsp.c sound_sn76489.c \
sound_speaker.c sound_ssi2001.c sound_wss.c sound_ym7128.c soundopenal.c tandy_eeprom.c tandy_rom.c thread-pthread.c \
timer.c um8669f.c um8881f.c usb.c vid_ati_eeprom.c vid_ati_mach64.c vid_ati18800.c vid_ati28800.c \
vid_ati68860_ramdac.c vid_cga.c vid_cl_gd.c vid_cl_gd_blit.c vid_cl_ramdac.c vid_ega.c vid_et4000.c vid_et4000w32.c vid_hercules.c vid_herculesplus.c\
vid_icd2061.c vid_ics2595.c vid_incolor.c vid_mda.c vid_nv_riva128.c vid_olivetti_m24.c vid_oti067.c vid_paradise.c vid_pc200.c \
vid_pc1512.c vid_pc1640.c vid_pcjr.c vid_ps1_svga.c vid_s3.c vid_s3_virge.c vid_sdac_ramdac.c \
vid_stg_ramdac.c vid_svga.c vid_svga_render.c vid_tandy.c vid_tandysl.c vid_tgui9440.c \
vid_tkd8001_ramdac.c vid_tvga.c vid_unk_ramdac.c vid_vga.c vid_voodoo.c video.c wd76c10.c \
x86seg.c x87.c xtide.c sound_dbopl.cc sound_resid.cc dosbox/dbopl.cpp \
resid-fp/convolve.cc resid-fp/convolve-sse.cc resid-fp/envelope.cc \
resid-fp/extfilt.cc resid-fp/filter.cc resid-fp/pot.cc resid-fp/sid.cc \
resid-fp/voice.cc resid-fp/wave6581_PS_.cc resid-fp/wave6581_PST.cc \
resid-fp/wave6581_P_T.cc resid-fp/wave6581__ST.cc resid-fp/wave8580_PS_.cc \
resid-fp/wave8580_PST.cc resid-fp/wave8580_P_T.cc resid-fp/wave8580__ST.cc \
resid-fp/wave.cc
if CPU_I386
pcem_SOURCES += codegen_x86.c
pcem_CFLAGS += -msse2
endif
if CPU_X86_64
pcem_SOURCES += codegen_x86-64.c
endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,56 +1,189 @@
VPATH = . dosbox lzf resid-fp slirp
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
CFLAGS = -O3 -march=native -mtune=native -fbranch-probabilities -fvpt -fpeel-loops -ftracer -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -mssse3 -mfpmath=sse -mstackrealign
DFLAGS = -O3 -march=i686 -fomit-frame-pointer -msse2 -mstackrealign
OBJ = 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o acer386sx.o acerm3a.o ali1429.o amstrad.o buslogic.o cdrom.o cdrom-ioctl.o cdrom-iso.o \
cdrom-null.o codegen.o codegen_ops.o codegen_timing_486.o codegen_timing_686.o codegen_timing_pentium.o codegen_timing_winchip.o codegen_x86.o compaq.o config.o cpu.o dac.o \
device.o disc.o disc_86f.o disc_fdi.o disc_imd.o disc_img.o disc_random.o disc_td0.o dma.o fdc.o fdc37c665.o fdc37c932fr.o fdd.o fdi2raw.o gameport.o hdd.o headland.o i430hx.o i430lx.o i430fx.o \
i430nx.o i430vx.o i440fx.o ide.o intel.o intel_flash.o io.o jim.o joystick_ch_flightstick_pro.o joystick_standard.o joystick_sw_pad.o joystick_tm_fcs.o keyboard.o keyboard_amstrad.o keyboard_at.o \
keyboard_olim24.o keyboard_pcjr.o keyboard_xt.o lpt.o mcr.o mem.o memregs.o mfm_at.o model.o mouse.o mouse_ps2.o \
mouse_serial.o ne2000.o neat.o nethandler.o nmi.o nvr.o olivetti_m24.o opti495.o pc.o pc87306.o pci.o pic.o piix.o pit.o ppi.o ps1.o ps2.o rom.o rtc.o \
scat.o scsi.o serial.o sis496.o sis85c471.o sio.o sound.o sound_ad1848.o sound_adlib.o sound_adlibgold.o sound_cms.o \
sound_dbopl.o sound_emu8k.o sound_gus.o sound_mpu401_uart.o sound_opl.o sound_pas16.o sound_ps1.o sound_pssj.o sound_resid.o \
sound_sb.o sound_sb_dsp.o sound_sn76489.o sound_speaker.o sound_ssi2001.o sound_wss.o sound_ym7128.o \
soundopenal.o tandy_eeprom.o tandy_rom.o timer.o um8669f.o usb.o vid_ati_eeprom.o vid_ati_mach64.o vid_ati18800.o \
vid_ati28800.o vid_ati68860_ramdac.o vid_bt485_ramdac.o vid_cga.o vid_cl_gd.o vid_cl_gd_blit.o vid_cl_ramdac.o vid_colorplus.o vid_ega.o vid_et4000.o \
vid_et4000w32.o vid_hercules.o vid_herculesplus.o vid_icd2061.o vid_ics2595.o vid_incolor.o vid_mda.o vid_nv_riva128.o \
vid_olivetti_m24.o vid_oti067.o vid_paradise.o vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_pcjr.o vid_ps1_svga.o vid_s3.o vid_s3_virge.o vid_sdac_ramdac.o vid_stg_ramdac.o vid_svga.o \
vid_svga_render.o vid_tandy.o vid_tandysl.o vid_tgui9440.o vid_tkd8001_ramdac.o vid_tvga.o vid_unk_ramdac.o \
vid_vga.o vid_wy700.o vid_voodoo.o video.o w83877f.o wd76c10.o win.o win-config.o win-d3d.o win-d3d-fs.o win-ddraw.o \
win-ddraw-fs.o win-ddraw-screenshot.o win-deviceconfig.o win-hdconf.o win-joystick.o win-joystickconfig.o win-keyboard.o win-midi.o win-mouse.o \
win-status.o win-video.o x86seg.o x87.o xtide.o pc.res
DBOBJ = dbopl.o nukedopl.o vid_cga_comp.o
LZFOBJ = lzf_c.o lzf_d.o
SIDOBJ = 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
SLIRPOBJ = bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o ip_input.o queue.o tcp_input.o tftp.o debug.o ip_output.o sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for IBM
# PC systems and compatibles from 1981 through fairly recent
# system designs based on the PCI bus.
#
# This file is part of the 86Box distribution.
#
# Modified Makefile for Win32 MinGW 32-bit environment.
#
# Version: @(#)Makefile.mingw 1.0.5 2017/05/05
#
# Authors: Kotori, <oubattler@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
# Sarah Walker,
# Richard G.,
#
# Name of the executable.
PROG = 86Box
# Various compile-time options.
# -DROM_TRACE=0xcd800 traces ROM access from segment C800
# -DIO_TACE=0x66 traces I/O on port 0x66
STUFF =
# Add feature selections here.
# -DBUGGER adds the ISA BusBugger emulation.
EXTRAS =
# Do we want a debugging build?
DEBUG = n
LIBS = -mwindows -lwinmm -lopenal.dll -lopenal -lddraw -ldinput8 -ldxguid -ld3d9 -ld3dx9 -lwsock32 -liphlpapi -lstdc++ -lpsapi -static-libstdc++ -static-libgcc -static -lwpcapdelay
#########################################################################
# Nothing should need changing from here on.. #
#########################################################################
VPATH = . dosbox lzf resid-fp slirp
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
86Box.exe: $(OBJ) $(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ)
$(CC) $(OBJ) $(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ) -o "86Box.exe" $(LIBS)
sleep 10
strip "86Box.exe"
sleep 10
OPTS = -DWIN32 $(EXTRAS) $(STUFF)
ifeq ($(DEBUG), y)
DFLAGS = -march=i686 -Og -ggdb -DDEBUG
else
DFLAGS = -march=native -mtune=native -O6
UFLAGS = -march=i686 -O3
endif
AFLAGS = -msse -msse2 -mfpmath=sse
CFLAGS = $(OPTS) $(DFLAGS) $(AFLAGS) \
-fomit-frame-pointer -mstackrealign
RFLAGS = --input-format=rc -O coff
all : 86Box.exe
clean :
rm *.o
rm *.exe
rm *.res
MAINOBJ = pc.o config.o device.o timer.o dma.o io.o nmi.o pic.o \
mca.o mcr.o pit.o ppi.o pci.o sio.o intel.o rom.o mem.o \
memregs.o intel_flash.o rtc.o nvr.o ps2_nvr.o
CPUOBJ = cpu.o 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o \
codegen.o \
codegen_ops.o codegen_timing_486.o \
codegen_timing_686.o codegen_timing_pentium.o \
codegen_timing_winchip.o codegen_x86.o \
x86seg.o x87.o
SYSOBJ = model.o \
headland.o \
i430hx.o i430lx.o i430fx.o i430nx.o i430vx.o i440fx.o \
neat.o \
ali1429.o \
opti495.o \
scat.o \
sis496.o \
wd76c10.o \
acer386sx.o acerm3a.o amstrad.o \
compaq.o olivetti_m24.o jim.o ps1.o ps2.o ps2_mca.o \
tandy_eeprom.o tandy_rom.o
DEVOBJ = bugger.o lpt.o serial.o \
um8669f.o pc87306.o sis85c471.o w83877f.o \
keyboard.o \
keyboard_xt.o keyboard_at.o keyboard_pcjr.o \
keyboard_amstrad.o keyboard_olim24.o \
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 \
fdd.o fdc.o \
fdc37c665.o fdc37c669.o fdc37c932fr.o fdi2raw.o \
hdd.o hdd_esdi.o mfm_at.o mfm_xebec.o ide.o xtide.o piix.o scsi_hd.o \
disc.o \
disc_86f.o disc_fdi.o disc_imd.o disc_img.o \
disc_random.o disc_td0.o \
cdrom.o cdrom-ioctl.o cdrom-iso.o cdrom-null.o
USBOBJ = usb.o
NETOBJ = ne2000.o nethandler.o
SCSIOBJ = scsi.o scsi_buslogic.o scsi_aha154x.o
SNDOBJ = sound.o sound_speaker.o dac.o sound_ps1.o sound_pssj.o \
sound_adlib.o sound_adlibgold.o sound_ad1848.o sound_sb.o \
sound_sb_dsp.o sound_cms.o sound_dbopl.o sound_emu8k.o \
sound_gus.o sound_opl.o sound_mpu401_uart.o sound_pas16.o \
sound_resid.o sound_sn76489.o sound_ssi2001.o sound_wss.o \
sound_ym7128.o soundopenal.o
VIDOBJ = video.o \
vid_mda.o vid_cga.o vid_ega.o \
vid_vga.o vid_svga.o vid_svga_render.o \
vid_hercules.o vid_herculesplus.o vid_incolor.o \
vid_colorplus.o \
vid_genius.o \
vid_s3.o vid_s3_virge.o \
vid_et4000.o vid_et4000w32.o vid_icd2061.o \
vid_oti067.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_cl_gd.o vid_cl_gd_blit.o vid_cl_ramdac.o \
vid_bt485_ramdac.o \
vid_sdac_ramdac.o \
vid_stg_ramdac.o \
vid_unk_ramdac.o \
vid_wy700.o \
vid_nv_riva128.o \
vid_voodoo.o \
vid_pcjr.o vid_ps1_svga.o \
vid_olivetti_m24.o \
vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_tandy.o vid_tandysl.o
WINOBJ = win.o \
win-d3d.o win-d3d-fs.o \
win-ddraw.o win-ddraw-fs.o win-ddraw-screenshot.o \
win-language.o win-status.o win-video.o \
win-keyboard.o win-mouse.o win-joystick.o win-midi.o \
win-settings.o win-deviceconfig.o win-joystickconfig.o \
86Box.res
OBJ = $(MAINOBJ) $(CPUOBJ) $(SYSOBJ) $(DEVOBJ) $(USBOBJ) \
$(NETOBJ) $(SCSIOBJ) $(SNDOBJ) $(VIDOBJ) $(WINOBJ)
%.o : %.c
$(CC) $(CFLAGS) -c $<
DBOBJ = dbopl.o nukedopl.o vid_cga_comp.o
LZFOBJ = lzf_c.o lzf_d.o
SIDOBJ = 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
SLIRPOBJ= bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o ip_input.o \
queue.o tcp_input.o tftp.o debug.o ip_output.o sbuf.o tcp_output.o \
udp.o if.o mbuf.o slirp.o tcp_subr.o
%.o : %.cc
$(CPP) $(CFLAGS) -c $<
LIBS = -mwindows -lcomctl32 -lwinmm -lopenal.dll -lopenal -lddraw \
-ldinput8 -ldxguid -ld3d9 -ld3dx9 -lwsock32 -liphlpapi \
-lstdc++ -lpsapi -static-libstdc++ -static-libgcc \
-static -L. -lwpcapdelay
%.o : %.cpp
$(CPP) $(CFLAGS) -c $<
pc.res: pc.rc
$(WINDRES) $(RFLAGS) -i pc.rc --input-format=rc -o pc.res -O coff
# Build rules.
%.o: %.c
@echo $<
$(CC) $(CFLAGS) -c $<
%.o: %.cc
@echo $<
@$(CPP) $(CFLAGS) -c $<
%.o: %.cpp
@echo $<
@$(CPP) $(CFLAGS) -c $<
$(PROG).exe: $(OBJ) $(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ)
@echo Linking $(PROG).exe ..
@$(CC) -o $(PROG).exe \
$(OBJ) \
$(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ) \
$(LIBS)
all: $(PROG).exe
ifeq ($(DEBUG), y)
strip $(PROG).exe
endif
clean:
rm *.o
rm *.exe
rm *.res
86Box.res: 86Box.rc
@echo Processing $<
@$(WINDRES) $(RFLAGS) -i 86Box.rc -o 86Box.res
# End of Makefile.mingw.

View File

@@ -1,56 +1,189 @@
VPATH = . dosbox lzf resid-fp slirp
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
CFLAGS = -O3 -march=native -mtune=native -fbranch-probabilities -fvpt -fpeel-loops -ftracer -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -mssse3 -mfpmath=sse -mstackrealign
DFLAGS = -O3 -fomit-frame-pointer -msse2 -mstackrealign
OBJ = 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o acer386sx.o acerm3a.o ali1429.o amstrad.o buslogic.o cdrom.o cdrom-ioctl.o cdrom-iso.o \
cdrom-null.o codegen.o codegen_ops.o codegen_timing_486.o codegen_timing_686.o codegen_timing_pentium.o codegen_timing_winchip.o codegen_x86-64.o compaq.o config.o cpu.o dac.o \
device.o disc.o disc_86f.o disc_fdi.o disc_imd.o disc_img.o disc_random.o disc_td0.o dma.o fdc.o fdc37c665.o fdc37c932fr.o fdd.o fdi2raw.o gameport.o hdd.o headland.o i430hx.o i430lx.o i430fx.o \
i430nx.o i430vx.o i440fx.o ide.o intel.o intel_flash.o io.o jim.o joystick_ch_flightstick_pro.o joystick_standard.o joystick_sw_pad.o joystick_tm_fcs.o keyboard.o keyboard_amstrad.o keyboard_at.o \
keyboard_olim24.o keyboard_pcjr.o keyboard_xt.o lpt.o mcr.o mem.o memregs.o mfm_at.o model.o mouse.o mouse_ps2.o \
mouse_serial.o ne2000.o neat.o nethandler.o nmi.o nvr.o olivetti_m24.o opti495.o pc.o pc87306.o pci.o pic.o piix.o pit.o ppi.o ps1.o ps2.o rom.o rtc.o \
scat.o scsi.o serial.o sis496.o sis85c471.o sio.o sound.o sound_ad1848.o sound_adlib.o sound_adlibgold.o sound_cms.o \
sound_dbopl.o sound_emu8k.o sound_gus.o sound_mpu401_uart.o sound_opl.o sound_pas16.o sound_ps1.o sound_pssj.o sound_resid.o \
sound_sb.o sound_sb_dsp.o sound_sn76489.o sound_speaker.o sound_ssi2001.o sound_wss.o sound_ym7128.o \
soundopenal.o tandy_eeprom.o tandy_rom.o timer.o um8669f.o usb.o vid_ati_eeprom.o vid_ati_mach64.o vid_ati18800.o \
vid_ati28800.o vid_ati68860_ramdac.o vid_bt485_ramdac.o vid_cga.o vid_cl_gd.o vid_cl_gd_blit.o vid_cl_ramdac.o vid_colorplus.o vid_ega.o vid_et4000.o \
vid_et4000w32.o vid_hercules.o vid_herculesplus.o vid_icd2061.o vid_ics2595.o vid_incolor.o vid_mda.o vid_nv_riva128.o \
vid_olivetti_m24.o vid_oti067.o vid_paradise.o vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_pcjr.o vid_ps1_svga.o vid_s3.o vid_s3_virge.o vid_sdac_ramdac.o vid_stg_ramdac.o vid_svga.o \
vid_svga_render.o vid_tandy.o vid_tandysl.o vid_tgui9440.o vid_tkd8001_ramdac.o vid_tvga.o vid_unk_ramdac.o \
vid_vga.o vid_wy700.o vid_voodoo.o video.o w83877f.o wd76c10.o win.o win-config.o win-d3d.o win-d3d-fs.o win-ddraw.o \
win-ddraw-fs.o win-ddraw-screenshot.o win-deviceconfig.o win-hdconf.o win-joystick.o win-joystickconfig.o win-keyboard.o win-midi.o win-mouse.o \
win-status.o win-video.o x86seg.o x87.o xtide.o pc.res
DBOBJ = dbopl.o nukedopl.o vid_cga_comp.o
LZFOBJ = lzf_c.o lzf_d.o
SIDOBJ = 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
SLIRPOBJ = bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o ip_input.o queue.o tcp_input.o tftp.o debug.o ip_output.o sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o
#
# 86Box A hypervisor and IBM PC system emulator that specializes in
# running old operating systems and software designed for IBM
# PC systems and compatibles from 1981 through fairly recent
# system designs based on the PCI bus.
#
# This file is part of the 86Box distribution.
#
# Modified Makefile for Win32 MinGW 32-bit environment.
#
# Version: @(#)Makefile.mingw64 1.0.0 2017/05/05
#
# Authors: Kotori, <oubattler@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
# Sarah Walker,
# Richard G.,
#
# Name of the executable.
PROG = 86Box64
# Various compile-time options.
# -DROM_TRACE=0xcd800 traces ROM access from segment C800
# -DIO_TACE=0x66 traces I/O on port 0x66
STUFF =
# Add feature selections here.
# -DBUGGER adds the ISA BusBugger emulation.
EXTRAS =
# Do we want a debugging build?
DEBUG = n
LIBS = -mwindows -lwinmm -lopenal -lddraw -ldinput8 -ldxguid -ld3d9 -ld3dx9 -lwsock32 -liphlpapi -lstdc++ -lpsapi -static-libstdc++ -static-libgcc -static -lopenal.dll -lgcov -lPacket -lwpcapdelay
#########################################################################
# Nothing should need changing from here on.. #
#########################################################################
VPATH = . dosbox lzf resid-fp slirp
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
86Box64.exe: $(OBJ) $(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ)
$(CC) $(OBJ) $(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ) -o "86Box64.exe" $(LIBS)
sleep 10
strip "86Box64.exe"
sleep 10
OPTS = -DWIN32 $(EXTRAS) $(STUFF)
ifeq ($(DEBUG), y)
DFLAGS = -march=i686 -Og -ggdb -DDEBUG
else
DFLAGS = -march=native -mtune=native -O6
UFLAGS = -O3
endif
AFLAGS = -msse -msse2 -mfpmath=sse
CFLAGS = $(OPTS) $(DFLAGS) $(AFLAGS) \
-fomit-frame-pointer -mstackrealign
RFLAGS = --input-format=rc -O coff
all : 86Box64.exe
clean :
rm *.o
rm *.exe
rm *.res
MAINOBJ = pc.o config.o device.o timer.o dma.o io.o nmi.o pic.o \
mca.o mcr.o pit.o ppi.o pci.o sio.o intel.o rom.o mem.o \
memregs.o intel_flash.o rtc.o nvr.o ps2_nvr.o
CPUOBJ = cpu.o 386.o 386_dynarec.o 386_dynarec_ops.o 808x.o \
codegen.o \
codegen_ops.o codegen_timing_486.o \
codegen_timing_686.o codegen_timing_pentium.o \
codegen_timing_winchip.o codegen_x86-64.o \
x86seg.o x87.o
SYSOBJ = model.o \
headland.o \
i430hx.o i430lx.o i430fx.o i430nx.o i430vx.o i440fx.o \
neat.o \
ali1429.o \
opti495.o \
scat.o \
sis496.o \
wd76c10.o \
acer386sx.o acerm3a.o amstrad.o \
compaq.o olivetti_m24.o jim.o ps1.o ps2.o ps2_mca.o \
tandy_eeprom.o tandy_rom.o
DEVOBJ = bugger.o lpt.o serial.o \
um8669f.o pc87306.o sis85c471.o w83877f.o \
keyboard.o \
keyboard_xt.o keyboard_at.o keyboard_pcjr.o \
keyboard_amstrad.o keyboard_olim24.o \
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 \
fdd.o fdc.o \
fdc37c665.o fdc37c669.o fdc37c932fr.o fdi2raw.o \
hdd.o hdd_esdi.o mfm_at.o mfm_xebec.o ide.o xtide.o piix.o scsi_hd.o \
disc.o \
disc_86f.o disc_fdi.o disc_imd.o disc_img.o \
disc_random.o disc_td0.o \
cdrom.o cdrom-ioctl.o cdrom-iso.o cdrom-null.o
USBOBJ = usb.o
NETOBJ = ne2000.o nethandler.o
SCSIOBJ = scsi.o scsi_buslogic.o scsi_aha154x.o
SNDOBJ = sound.o sound_speaker.o dac.o sound_ps1.o sound_pssj.o \
sound_adlib.o sound_adlibgold.o sound_ad1848.o sound_sb.o \
sound_sb_dsp.o sound_cms.o sound_dbopl.o sound_emu8k.o \
sound_gus.o sound_opl.o sound_mpu401_uart.o sound_pas16.o \
sound_resid.o sound_sn76489.o sound_ssi2001.o sound_wss.o \
sound_ym7128.o soundopenal.o
VIDOBJ = video.o \
vid_mda.o vid_cga.o vid_ega.o \
vid_vga.o vid_svga.o vid_svga_render.o \
vid_hercules.o vid_herculesplus.o vid_incolor.o \
vid_colorplus.o \
vid_genius.o \
vid_s3.o vid_s3_virge.o \
vid_et4000.o vid_et4000w32.o vid_icd2061.o \
vid_oti067.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_cl_gd.o vid_cl_gd_blit.o vid_cl_ramdac.o \
vid_bt485_ramdac.o \
vid_sdac_ramdac.o \
vid_stg_ramdac.o \
vid_unk_ramdac.o \
vid_wy700.o \
vid_nv_riva128.o \
vid_voodoo.o \
vid_pcjr.o vid_ps1_svga.o \
vid_olivetti_m24.o \
vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_tandy.o vid_tandysl.o
WINOBJ = win.o \
win-d3d.o win-d3d-fs.o \
win-ddraw.o win-ddraw-fs.o win-ddraw-screenshot.o \
win-language.o win-status.o win-video.o \
win-keyboard.o win-mouse.o win-joystick.o win-midi.o \
win-settings.o win-deviceconfig.o win-joystickconfig.o \
86Box.res
OBJ = $(MAINOBJ) $(CPUOBJ) $(SYSOBJ) $(DEVOBJ) $(USBOBJ) \
$(NETOBJ) $(SCSIOBJ) $(SNDOBJ) $(VIDOBJ) $(WINOBJ)
%.o : %.c
$(CC) $(CFLAGS) -c $<
DBOBJ = dbopl.o nukedopl.o vid_cga_comp.o
LZFOBJ = lzf_c.o lzf_d.o
SIDOBJ = 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
SLIRPOBJ= bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o ip_input.o \
queue.o tcp_input.o tftp.o debug.o ip_output.o sbuf.o tcp_output.o \
udp.o if.o mbuf.o slirp.o tcp_subr.o
%.o : %.cc
$(CPP) $(CFLAGS) -c $<
LIBS = -mwindows -lcomctl32 -lwinmm -lopenal.dll -lopenal -lddraw \
-ldinput8 -ldxguid -ld3d9 -ld3dx9 -lwsock32 -liphlpapi \
-lstdc++ -lpsapi -static-libstdc++ -static-libgcc \
-static -L. -lwpcapdelay
%.o : %.cpp
$(CPP) $(CFLAGS) -c $<
pc.res: pc.rc
$(WINDRES) $(RFLAGS) -i pc.rc --input-format=rc -o pc.res -O coff
# Build rules.
%.o: %.c
@echo $<
$(CC) $(CFLAGS) -c $<
%.o: %.cc
@echo $<
@$(CPP) $(CFLAGS) -c $<
%.o: %.cpp
@echo $<
@$(CPP) $(CFLAGS) -c $<
$(PROG).exe: $(OBJ) $(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ)
@echo Linking $(PROG).exe ..
@$(CC) -o $(PROG).exe \
$(OBJ) \
$(DBOBJ) $(LZFOBJ) $(SIDOBJ) $(SLIRPOBJ) \
$(LIBS)
all: $(PROG).exe
ifeq ($(DEBUG), y)
strip $(PROG).exe
endif
clean:
rm *.o
rm *.exe
rm *.res
86Box.res: 86Box.rc
@echo Processing $<
@$(WINDRES) $(RFLAGS) -i 86Box.rc -o 86Box.res
# End of Makefile.mingw.

View File

@@ -46,14 +46,11 @@ static void ali1429_recalc()
void ali1429_write(uint16_t port, uint8_t val, void *priv)
{
int c;
if (!(port & 1))
ali1429_index = val;
else
{
ali1429_regs[ali1429_index] = val;
// pclog("ALI1429 write %02X %02X %04X:%04X %i\n",ali1429_index,val,CS,pc,ins);
switch (ali1429_index)
{
case 0x13:

View File

@@ -2,3 +2,4 @@
see COPYING for more details
*/
void ali1429_init();
void ali1429_reset();

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include "ibm.h"
#include "io.h"
#include "keyboard.h"
@@ -58,7 +59,7 @@ typedef struct mouse_amstrad_t
int oldb;
} mouse_amstrad_t;
static void mouse_amstrad_poll(int x, int y, int z, int b, void *p)
static uint8_t mouse_amstrad_poll(int x, int y, int z, int b, void *p)
{
mouse_amstrad_t *mouse = (mouse_amstrad_t *)p;
@@ -75,6 +76,8 @@ static void mouse_amstrad_poll(int x, int y, int z, int b, void *p)
keyboard_send(0xfd);
mouse->oldb = b;
return(0);
}
static void *mouse_amstrad_init()
@@ -95,10 +98,11 @@ static void mouse_amstrad_close(void *p)
mouse_t mouse_amstrad =
{
"Amstrad mouse",
"amstrad",
MOUSE_TYPE_AMSTRAD,
mouse_amstrad_init,
mouse_amstrad_close,
mouse_amstrad_poll,
MOUSE_TYPE_AMSTRAD
mouse_amstrad_poll
};
void amstrad_init()

View File

@@ -4,117 +4,110 @@
#ifndef BSWAP_H
#define BSWAP_H
//#include "config-host.h"
#include <inttypes.h>
#include <stdint.h>
#ifdef HAVE_BYTESWAP_H
#include <byteswap.h>
#else
# define bswap_16(x) \
( \
((uint16_t)( \
(((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
(((uint16_t)(x) & (uint16_t)0xff00U) >> 8) )) \
)
#define bswap_16(x) \
({ \
uint16_t __x = (x); \
((uint16_t)( \
(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
})
# define bswap_32(x) \
( \
((uint32_t)( \
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) )) \
)
#define bswap_32(x) \
({ \
uint32_t __x = (x); \
((uint32_t)( \
(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) << 8) | \
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
})
# define bswap_64(x) \
( \
((uint64_t)( \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) \
)
#endif /*HAVE_BYTESWAP_H*/
#define bswap_64(x) \
({ \
uint64_t __x = (x); \
((uint64_t)( \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
})
#endif /* !HAVE_BYTESWAP_H */
static inline uint16_t bswap16(uint16_t x)
static __inline uint16_t bswap16(uint16_t x)
{
return bswap_16(x);
}
static inline uint32_t bswap32(uint32_t x)
static __inline uint32_t bswap32(uint32_t x)
{
return bswap_32(x);
}
static inline uint64_t bswap64(uint64_t x)
static __inline uint64_t bswap64(uint64_t x)
{
return bswap_64(x);
}
static inline void bswap16s(uint16_t *s)
static __inline void bswap16s(uint16_t *s)
{
*s = bswap16(*s);
}
static inline void bswap32s(uint32_t *s)
static __inline void bswap32s(uint32_t *s)
{
*s = bswap32(*s);
}
static inline void bswap64s(uint64_t *s)
static __inline void bswap64s(uint64_t *s)
{
*s = bswap64(*s);
}
#if defined(WORDS_BIGENDIAN)
#define be_bswap(v, size) (v)
#define le_bswap(v, size) bswap ## size(v)
#define be_bswaps(v, size)
#define le_bswaps(p, size) *p = bswap ## size(*p);
# define be_bswap(v, size) (v)
# define le_bswap(v, size) bswap ## size(v)
# define be_bswaps(v, size)
# define le_bswaps(p, size) *p = bswap ## size(*p);
#else
#define le_bswap(v, size) (v)
#define be_bswap(v, size) bswap ## size(v)
#define le_bswaps(v, size)
#define be_bswaps(p, size) *p = bswap ## size(*p);
# define le_bswap(v, size) (v)
# define be_bswap(v, size) bswap ## size(v)
# define le_bswaps(v, size)
# define be_bswaps(p, size) *p = bswap ## size(*p);
#endif
#define CPU_CONVERT(endian, size, type)\
static inline type endian ## size ## _to_cpu(type v)\
static __inline type endian ## size ## _to_cpu(type v)\
{\
return endian ## _bswap(v, size);\
}\
\
static inline type cpu_to_ ## endian ## size(type v)\
static __inline type cpu_to_ ## endian ## size(type v)\
{\
return endian ## _bswap(v, size);\
}\
\
static inline void endian ## size ## _to_cpus(type *p)\
static __inline void endian ## size ## _to_cpus(type *p)\
{\
endian ## _bswaps(p, size)\
}\
\
static inline void cpu_to_ ## endian ## size ## s(type *p)\
static __inline void cpu_to_ ## endian ## size ## s(type *p)\
{\
endian ## _bswaps(p, size)\
}\
\
static inline type endian ## size ## _to_cpup(const type *p)\
static __inline type endian ## size ## _to_cpup(const type *p)\
{\
return endian ## size ## _to_cpu(*p);\
}\
\
static inline void cpu_to_ ## endian ## size ## w(type *p, type v)\
static __inline void cpu_to_ ## endian ## size ## w(type *p, type v)\
{\
*p = cpu_to_ ## endian ## size(v);\
}
@@ -141,7 +134,7 @@ CPU_CONVERT(le, 64, uint64_t)
#else
static inline void cpu_to_le16wu(uint16_t *p, uint16_t v)
static __inline void cpu_to_le16wu(uint16_t *p, uint16_t v)
{
uint8_t *p1 = (uint8_t *)p;
@@ -149,7 +142,7 @@ static inline void cpu_to_le16wu(uint16_t *p, uint16_t v)
p1[1] = v >> 8;
}
static inline void cpu_to_le32wu(uint32_t *p, uint32_t v)
static __inline void cpu_to_le32wu(uint32_t *p, uint32_t v)
{
uint8_t *p1 = (uint8_t *)p;
@@ -159,19 +152,19 @@ static inline void cpu_to_le32wu(uint32_t *p, uint32_t v)
p1[3] = v >> 24;
}
static inline uint16_t le16_to_cpupu(const uint16_t *p)
static __inline uint16_t le16_to_cpupu(const uint16_t *p)
{
const uint8_t *p1 = (const uint8_t *)p;
return p1[0] | (p1[1] << 8);
}
static inline uint32_t le32_to_cpupu(const uint32_t *p)
static __inline uint32_t le32_to_cpupu(const uint32_t *p)
{
const uint8_t *p1 = (const uint8_t *)p;
return p1[0] | (p1[1] << 8) | (p1[2] << 16) | (p1[3] << 24);
}
static inline void cpu_to_be16wu(uint16_t *p, uint16_t v)
static __inline void cpu_to_be16wu(uint16_t *p, uint16_t v)
{
uint8_t *p1 = (uint8_t *)p;
@@ -179,7 +172,7 @@ static inline void cpu_to_be16wu(uint16_t *p, uint16_t v)
p1[1] = v;
}
static inline void cpu_to_be32wu(uint32_t *p, uint32_t v)
static __inline void cpu_to_be32wu(uint32_t *p, uint32_t v)
{
uint8_t *p1 = (uint8_t *)p;

325
src/bugger.c Normal file
View File

@@ -0,0 +1,325 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the ISA Bus (de)Bugger expansion card
* sold as a DIY kit in the late 1980's in The Netherlands.
* This card was a assemble-yourself 8bit ISA addon card for
* PC and AT systems that had several tools to aid in low-
* level debugging (mostly for faulty BIOSes, bootloaders
* and system kernels...)
*
* The standard version had a total of 16 LEDs (8 RED, plus
* 8 GREEN), two 7-segment displays and one 8-position DIP
* switch block on board for use as debugging tools.
*
* The "Plus" version, added an extra 2 7-segment displays,
* as well as a very simple RS-232 serial interface that
* could be used as a mini-console terminal.
*
* Two I/O ports were used; one for control, at offset 0 in
* I/O space, and one for data, at offset 1 in I/O space.
* Both registers could be read from and written to. Although
* the author has a vague memory of a DIP switch to set the
* board's I/O address, comments in old software seems to
* indicate that it was actually fixed to 0x7A (and 0x7B.)
*
* A READ on the data register always returned the actual
* state of the DIP switch. Writing data to the LEDs was done
* in two steps.. first, the block number (RED or GREEN) was
* written to the CTRL register, and then the actual LED data
* was written to the DATA register. Likewise, data for the
* 7-segment displays was written.
*
* The serial port was a bit different, and its operation is
* not verified, but two extra bits in the control register
* were used to set up parameters, and also the actual data
* input and output.
*
* TODO: Still have to implement the RS232 Serial Port Parameters
* configuration register (CTRL_SPCFG bit set) but have to
* remember that stuff first...
*
* Version: @(#)bugger.c 1.0.3 2017/04/07
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 1989-2017 Fred N. van Kempen.
*/
#include "ibm.h"
#include "io.h"
#include "bugger.h"
/* BugBugger registers. */
#define BUG_CTRL 0
# define CTRL_RLED 0x00 /* write to the RED LED block */
# define CTRL_GLED 0x01 /* write to the GREEN LED block */
# define CTRL_SEG1 0x02 /* write to the RIGHT 7SEG displays */
# define CTRL_SEG2 0x04 /* write to the LEFT 7SEG displays */
# define CTRL_SPORT 0x20 /* enable the serial port */
# define CTRL_SPCFG 0x40 /* set up the serial port */
# define CTRL_INIT 0x80 /* enable and reset the card */
# define CTRL_RESET 0xff /* this resets the board */
#define BUG_DATA 1
static uint8_t bug_ctrl, /* control register */
bug_data, /* data register */
bug_ledr, bug_ledg, /* RED and GREEN LEDs */
bug_seg1, bug_seg2, /* LEFT and RIGHT 7SEG displays */
bug_spcfg; /* serial port configuration */
# define FIFO_LEN 256
static uint8_t bug_buff[FIFO_LEN], /* serial port data buffer */
*bug_bptr;
# define UISTR_LEN 24
static char bug_str[UISTR_LEN]; /* UI output string */
extern void set_bugui(char *__str);
/* Update the system's UI with the actual Bugger status. */
static void
bug_setui(void)
{
/* Format all current info in a string. */
sprintf(bug_str, "%02X:%02X %c%c%c%c%c%c%c%c-%c%c%c%c%c%c%c%c",
bug_seg2, bug_seg1,
(bug_ledg&0x80)?'G':'g', (bug_ledg&0x40)?'G':'g',
(bug_ledg&0x20)?'G':'g', (bug_ledg&0x10)?'G':'g',
(bug_ledg&0x08)?'G':'g', (bug_ledg&0x04)?'G':'g',
(bug_ledg&0x02)?'G':'g', (bug_ledg&0x01)?'G':'g',
(bug_ledr&0x80)?'R':'r', (bug_ledr&0x40)?'R':'r',
(bug_ledr&0x20)?'R':'r', (bug_ledr&0x10)?'R':'r',
(bug_ledr&0x08)?'R':'r', (bug_ledr&0x04)?'R':'r',
(bug_ledr&0x02)?'R':'r', (bug_ledr&0x01)?'R':'r');
#if 0
/* Send formatted string to the UI. */
set_bugui(bug_str);
#endif
}
/* Flush the serial port. */
static void
bug_spflsh(void)
{
*bug_bptr = '\0';
pclog("BUGGER- serial port [%s]\n", bug_buff);
bug_bptr = bug_buff;
}
/* Handle a write to the Serial Port Data register. */
static void
bug_wsport(uint8_t val)
{
uint8_t old = bug_ctrl;
/* Clear the SPORT bit to indicate we are busy. */
bug_ctrl &= ~CTRL_SPORT;
/* Delay while processing byte.. */
if (bug_bptr == &bug_buff[FIFO_LEN-1]) {
/* Buffer full, gotta flush. */
bug_spflsh();
}
/* Write (store) the byte. */
*bug_bptr++ = val;
/* Restore the SPORT bit. */
bug_ctrl |= (old & CTRL_SPORT);
pclog("BUGGER- sport %02x\n", val);
}
/* Handle a write to the Serial Port Configuration register. */
static void
bug_wspcfg(uint8_t val)
{
bug_spcfg = val;
pclog("BUGGER- spcfg %02x\n", bug_spcfg);
}
/* Handle a write to the control register. */
static void
bug_wctrl(uint8_t val)
{
if (val == CTRL_RESET) {
/* User wants us to reset. */
bug_ctrl = CTRL_INIT;
bug_spcfg = 0x00;
bug_bptr = NULL;
} else {
/* If turning off the serial port, flush it. */
if ((bug_ctrl & CTRL_SPORT) && !(val & CTRL_SPORT))
bug_spflsh();
/* FIXME: did they do this using an XOR of operation bits? --FvK */
if (val & CTRL_SPCFG) {
/* User wants to configure the serial port. */
bug_ctrl &= ~(CTRL_SPORT|CTRL_SEG2|CTRL_SEG1|CTRL_GLED);
bug_ctrl |= CTRL_SPCFG;
} else if (val & CTRL_SPORT) {
/* User wants to talk to the serial port. */
bug_ctrl &= ~(CTRL_SPCFG|CTRL_SEG2|CTRL_SEG1|CTRL_GLED);
bug_ctrl |= CTRL_SPORT;
if (bug_bptr == NULL)
bug_bptr = bug_buff;
} else if (val & CTRL_SEG2) {
/* User selected SEG2 (LEFT, Plus only) for output. */
bug_ctrl &= ~(CTRL_SPCFG|CTRL_SPORT|CTRL_SEG1|CTRL_GLED);
bug_ctrl |= CTRL_SEG2;
} else if (val & CTRL_SEG1) {
/* User selected SEG1 (RIGHT) for output. */
bug_ctrl &= ~(CTRL_SPCFG|CTRL_SPORT|CTRL_SEG2|CTRL_GLED);
bug_ctrl |= CTRL_SEG1;
} else if (val & CTRL_GLED) {
/* User selected the GREEN LEDs for output. */
bug_ctrl &= ~(CTRL_SPCFG|CTRL_SPORT|CTRL_SEG2|CTRL_SEG1);
bug_ctrl |= CTRL_GLED;
} else {
/* User selected the RED LEDs for output. */
bug_ctrl &=
~(CTRL_SPCFG|CTRL_SPORT|CTRL_SEG2|CTRL_SEG1|CTRL_GLED);
}
}
/* Update the UI with active settings. */
pclog("BUGGER- ctrl %02x\n", bug_ctrl);
bug_setui();
}
/* Handle a write to the data register. */
static void
bug_wdata(uint8_t val)
{
bug_data = val;
if (bug_ctrl & CTRL_SPCFG)
bug_wspcfg(val);
else if (bug_ctrl & CTRL_SPORT)
bug_wsport(val);
else {
if (bug_ctrl & CTRL_SEG2)
bug_seg2 = val;
else if (bug_ctrl & CTRL_SEG1)
bug_seg1 = val;
else if (bug_ctrl & CTRL_GLED)
bug_ledg = val;
else
bug_ledr = val;
pclog("BUGGER- data %02x\n", bug_data);
}
/* Update the UI with active settings. */
bug_setui();
}
/* Reset the ISA BusBugger controller. */
static void
bug_reset(void)
{
/* Clear the data register. */
bug_data = 0x00;
/* Clear the RED and GREEN LEDs. */
bug_ledr = 0x00; bug_ledg = 0x00;
/* Clear both 7SEG displays. */
bug_seg1 = 0x00; bug_seg2 = 0x00;
/* Reset the control register (updates UI.) */
bug_wctrl(CTRL_RESET);
}
/* Handle a WRITE operation to one of our registers. */
static void
bug_write(uint16_t port, uint8_t val, void *priv)
{
switch (port-BUGGER_ADDR) {
case BUG_CTRL: /* control register */
if (val == CTRL_RESET) {
/* Perform a full reset. */
bug_reset();
} else if (bug_ctrl & CTRL_INIT) {
/* Only allow writes if initialized. */
bug_wctrl(val);
}
break;
case BUG_DATA: /* data register */
if (bug_ctrl & CTRL_INIT) {
bug_wdata(val);
}
break;
}
}
/* Handle a READ operation from one of our registers. */
static uint8_t
bug_read(uint16_t port, void *priv)
{
uint8_t ret = 0xff;
if (bug_ctrl & CTRL_INIT) switch (port-BUGGER_ADDR) {
case BUG_CTRL: /* control register */
ret = bug_ctrl;
break;
case BUG_DATA: /* data register */
if (bug_ctrl & CTRL_SPCFG) {
ret = bug_spcfg;
} else if (bug_ctrl & CTRL_SPORT) {
ret = 0x00; /* input not supported */
} else {
/* Just read the DIP switch. */
ret = bug_data;
}
break;
default:
break;
}
return(ret);
}
/* Initialize the ISA BusBugger emulator. */
void
bugger_init(void)
{
pclog("ISA Bus (de)Bugger, I/O=%04x\n", BUGGER_ADDR);
/* Initialize local registers. */
bug_reset();
io_sethandler(BUGGER_ADDR, BUGGER_ADDRLEN,
bug_read, NULL, NULL, bug_write, NULL, NULL, NULL);
}
/* Remove the ISA BusBugger emulator from the system. */
void
bugger_remove(void)
{
io_removehandler(BUGGER_ADDR, BUGGER_ADDRLEN,
bug_read, NULL, NULL, bug_write, NULL, NULL, NULL);
}

37
src/bugger.h Normal file
View File

@@ -0,0 +1,37 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the ISA Bus (de)Bugger expansion card
* sold as a DIY kit in the late 1980's in The Netherlands.
* This card was a assemble-yourself 8bit ISA addon card for
* PC and AT systems that had several tools to aid in low-
* level debugging (mostly for faulty BIOSes, bootloaders
* and system kernels...)
*
* Definitions for the BUGGER card.
*
* Version: @(#)bugger.h 1.0.3 2017/04/07
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 1989-2017 Fred N. van Kempen.
*/
#ifndef BUGGER_H
# define BUGGER_H
/* I/O port range used. */
#define BUGGER_ADDR 0x007a
#define BUGGER_ADDRLEN 4
/* Functions. */
extern void bugger_init(void);
extern void bugger_remove(void);
#endif /*BUGGER_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,27 @@
extern device_t BuslogicDevice;
#ifndef BUSLOGIC_H
# define BUSLOGIC_H
typedef struct {
uint8_t flags; /* local flags */
uint8_t bid; /* board ID */
char fwl, fwh; /* firmware info */
} aha_info;
#define AHA_GLAG_MEMEN 0x01 /* BIOS Shadow RAM enabled */
extern device_t aha1540b_device;
extern device_t aha1542cf_device;
extern device_t buslogic_device;
extern device_t buslogic_pci_device;
extern int buslogic_dev_present(uint8_t id, uint8_t lun);
extern void aha154x_init(uint16_t, uint32_t, aha_info *);
extern uint8_t aha154x_shram(uint8_t);
extern uint8_t aha154x_eeprom(uint8_t,uint8_t,uint8_t,uint8_t,uint8_t *);
extern uint8_t aha154x_memory(uint8_t);
#endif /*BUSLOGIC_H*/

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,11 @@
#include "ibm.h"
#include "cdrom.h"
#include "cdrom-iso.h"
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <sys/stat.h>
static CDROM iso_cdrom;
@@ -38,7 +43,7 @@ void iso_audio_callback(uint8_t id, int16_t *output, int len)
void iso_audio_stop(uint8_t id)
{
// cdrom_iso_log("iso_audio_stop stub\n");
return;
}
static int iso_ready(uint8_t id)
@@ -93,8 +98,8 @@ static void lba_to_msf(uint8_t *buf, int lba)
static uint8_t iso_getcurrentsubchannel(uint8_t id, uint8_t *b, int msf)
{
long size;
int pos=0;
int32_t temp;
if (strlen(cdrom_iso[id].iso_path) == 0)
{
return 0;
@@ -104,7 +109,7 @@ static uint8_t iso_getcurrentsubchannel(uint8_t id, uint8_t *b, int msf)
b[pos++]=0;
b[pos++]=0;
int32_t temp = cdrom[id].seek_pos;
temp = cdrom[id].seek_pos;
if (msf)
{
memset(&(b[pos]), 0, 8);
@@ -130,12 +135,12 @@ static uint8_t iso_getcurrentsubchannel(uint8_t id, uint8_t *b, int msf)
static void iso_eject(uint8_t id)
{
// cdrom_iso_log("iso_eject stub\n");
return;
}
static void iso_load(uint8_t id)
{
// cdrom_iso_log("iso_load stub\n");
return;
}
static int iso_sector_data_type(uint8_t id, int sector, int ismsf)
@@ -145,50 +150,52 @@ static int iso_sector_data_type(uint8_t id, int sector, int ismsf)
static void iso_readsector(uint8_t id, uint8_t *b, int sector)
{
uint32_t temp;
uint64_t file_pos = sector;
if (!cdrom_drives[id].host_drive) return;
if (!cdrom_drives[id].host_drive)
{
return;
}
file_pos <<= 11;
memset(b, 0, 2856);
cdrom_iso[id].iso_image = fopen(cdrom_iso[id].iso_path, "rb");
fseeko64(cdrom_iso[id].iso_image, file_pos, SEEK_SET);
fread(b + 16, 2048, 1, cdrom_iso[id].iso_image);
fclose(cdrom_iso[id].iso_image);
cdrom_iso[id].iso_image = fopen(cdrom_iso[id].iso_path, "rb");
fseeko64(cdrom_iso[id].iso_image, file_pos, SEEK_SET);
fread(b + 16, 2048, 1, cdrom_iso[id].iso_image);
fclose(cdrom_iso[id].iso_image);
/* sync bytes */
b[0] = 0;
memset(b + 1, 0xff, 10);
b[11] = 0;
b += 12;
lba_to_msf(b, sector);
b[3] = 1; /* mode 1 data */
b += 4;
b += 2048;
memset(b, 0, 288);
/* sync bytes */
b[0] = 0;
memset(b + 1, 0xff, 10);
b[11] = 0;
b += 12;
lba_to_msf(b, sector);
b[3] = 1; /* mode 1 data */
b += 4;
b += 2048;
memset(b, 0, 288);
b += 288;
memset(b, 0, 392);
memset(b, 0, 392);
}
typedef struct __attribute__((packed))
typedef struct __attribute__((__packed__))
{
uint8_t user_data[2048];
uint8_t ecc[288];
} m1_data_t;
typedef struct __attribute__((packed))
typedef struct __attribute__((__packed__))
{
uint8_t sub_header[8];
uint8_t user_data[2328];
} m2_data_t;
typedef union __attribute__((packed))
typedef union __attribute__((__packed__))
{
m1_data_t m1_data;
m2_data_t m2_data;
uint8_t raw_data[2352];
} sector_data_t;
typedef struct __attribute__((packed))
typedef struct __attribute__((__packed__))
{
uint8_t sync[12];
uint8_t header[4];
@@ -199,7 +206,7 @@ typedef struct __attribute__((packed))
uint8_t subchannel_rw[96];
} cdrom_sector_t;
typedef union __attribute__((packed))
typedef union __attribute__((__packed__))
{
cdrom_sector_t cdrom_sector;
uint8_t buffer[2856];
@@ -211,10 +218,8 @@ int cdrom_sector_size;
static int iso_readsector_raw(uint8_t id, uint8_t *buffer, int sector, int ismsf, int cdrom_sector_type, int cdrom_sector_flags, int *len)
{
int real_sector_type;
uint8_t *b;
uint8_t *temp_b;
int is_audio;
int real_pos;
b = temp_b = buffer;
@@ -314,8 +319,6 @@ static int iso_readsector_raw(uint8_t id, uint8_t *buffer, int sector, int ismsf
temp_b += 288;
}
cdrom_iso_log("CD-ROM sector size: %i (%i, %i) [%04X]\n", cdrom_sector_size, cdrom_sector_type, real_sector_type, cdrom_sector_flags);
if ((cdrom_sector_flags & 0x06) == 0x02)
{
/* Add error flags. */
@@ -546,7 +549,7 @@ void iso_reset(uint8_t id)
int iso_open(uint8_t id, char *fn)
{
struct stat st;
struct stat64 st;
if (strcmp(fn, cdrom_iso[id].iso_path) != 0)
{
@@ -557,7 +560,6 @@ int iso_open(uint8_t id, char *fn)
if (!cdrom_iso[id].iso_inited || cdrom_iso[id].iso_changed)
{
sprintf(cdrom_iso[id].iso_path, "%s", fn);
// cdrom_iso_log("Path is %s\n", cdrom_iso[id].iso_path);
}
cdrom_iso[id].iso_image = fopen(cdrom_iso[id].iso_path, "rb");
cdrom_drives[id].handler = &iso_cdrom;
@@ -567,7 +569,7 @@ int iso_open(uint8_t id, char *fn)
fclose(cdrom_iso[id].iso_image);
}
stat(cdrom_iso[id].iso_path, &st);
stat64(cdrom_iso[id].iso_path, &st);
cdrom_iso[id].image_size = st.st_size;
return 0;

View File

@@ -42,11 +42,6 @@ static int null_readsector_raw(uint8_t id, uint8_t *buffer, int sector, int isms
return 0;
}
static int null_read_track_information(uint8_t id, uint8_t *in_cdb, uint8_t *b)
{
return 0;
}
static int null_readtoc(uint8_t id, unsigned char *b, unsigned char starttrack, int msf, int maxlen, int single)
{
return 0;

View File

@@ -1,14 +1,14 @@
/* Copyright holders: Sarah Walker
see COPYING for more details
*/
#ifndef CDROM_IOCTL_H
#define CDROM_IOCTL_H
#ifndef CDROM_NULL_H
#define CDROM_NULL_H
/* this header file lists the functions provided by
various platform specific cdrom-ioctl files */
extern int cdrom_null_open(uint8_t id, char d);
extern void cdrom_null_reset(uint8_t id);
extern void null_close(uint8_t id);
int cdrom_null_open(uint8_t id, char d);
void cdrom_null_reset(uint8_t id);
void null_close(uint8_t id);
#endif /* ! CDROM_IOCTL_H */
#endif /* ! CDROM_NULL_H */

File diff suppressed because it is too large Load Diff

View File

@@ -46,7 +46,12 @@ typedef struct CDROM
void (*exit)(uint8_t id);
} CDROM;
#ifdef __MSC__
# pragma pack(push,1)
typedef struct
#else
typedef struct __attribute__((__packed__))
#endif
{
uint8_t previous_command;
int toctimes;
@@ -115,10 +120,18 @@ typedef struct __attribute__((__packed__))
int init_length;
} cdrom_t;
#ifdef __MSC__
# pragma pack(pop)
#endif
extern cdrom_t cdrom[CDROM_NUM];
#ifdef __MSC__
# pragma pack(push,1)
typedef struct
#else
typedef struct __attribute__((__packed__))
#endif
{
int enabled;
@@ -141,6 +154,9 @@ typedef struct __attribute__((__packed__))
uint8_t sound_on;
uint8_t atapi_dma;
} cdrom_drive_t;
#ifdef __MSC__
# pragma pack(pop)
#endif
extern cdrom_drive_t cdrom_drives[CDROM_NUM];
@@ -199,6 +215,8 @@ int cdrom_lba_to_msf_accurate(int lba);
void cdrom_reset(uint8_t id);
void cdrom_set_signature(int id);
void cdrom_request_sense_for_scsi(uint8_t id, uint8_t *buffer, uint8_t alloc_length);
void cdrom_update_cdb(uint8_t *cdb, int lba_pos, int number_of_blocks);
void cdrom_insert(uint8_t id);
#define cdrom_sense_error cdrom[id].sense[0]
#define cdrom_sense_key cdrom[id].sense[2]

View File

@@ -69,7 +69,7 @@ typedef struct codeblock_t
/*Code block is always entered with the same FPU top-of-stack*/
#define CODEBLOCK_STATIC_TOP 2
static inline codeblock_t *codeblock_tree_find(uint32_t phys, uint32_t _cs)
static __inline codeblock_t *codeblock_tree_find(uint32_t phys, uint32_t _cs)
{
codeblock_t *block = pages[phys >> 12].head;
uint64_t a = _cs | ((uint64_t)phys << 32);
@@ -87,7 +87,7 @@ static inline codeblock_t *codeblock_tree_find(uint32_t phys, uint32_t _cs)
return block;
}
static inline void codeblock_tree_add(codeblock_t *new_block)
static __inline void codeblock_tree_add(codeblock_t *new_block)
{
codeblock_t *block = pages[new_block->phys >> 12].head;
uint64_t a = new_block->_cs | ((uint64_t)new_block->phys << 32);
@@ -121,7 +121,7 @@ static inline void codeblock_tree_add(codeblock_t *new_block)
}
}
static inline void codeblock_tree_delete(codeblock_t *block)
static __inline void codeblock_tree_delete(codeblock_t *block)
{
codeblock_t *parent = block->parent;
@@ -297,7 +297,7 @@ extern int block_pos;
#define CPU_BLOCK_END() cpu_block_end = 1
static inline void addbyte(uint8_t val)
static __inline void addbyte(uint8_t val)
{
codeblock[block_current].data[block_pos++] = val;
if (block_pos >= BLOCK_MAX)
@@ -306,7 +306,7 @@ static inline void addbyte(uint8_t val)
}
}
static inline void addword(uint16_t val)
static __inline void addword(uint16_t val)
{
*(uint16_t *)&codeblock[block_current].data[block_pos] = val;
block_pos += 2;
@@ -316,7 +316,7 @@ static inline void addword(uint16_t val)
}
}
static inline void addlong(uint32_t val)
static __inline void addlong(uint32_t val)
{
*(uint32_t *)&codeblock[block_current].data[block_pos] = val;
block_pos += 4;
@@ -326,7 +326,7 @@ static inline void addlong(uint32_t val)
}
}
static inline void addquad(uint64_t val)
static __inline void addquad(uint64_t val)
{
*(uint64_t *)&codeblock[block_current].data[block_pos] = val;
block_pos += 8;

View File

@@ -2,7 +2,7 @@ static uint32_t ropINC_rw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
{
int host_reg;
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
host_reg = LOAD_REG_W(opcode & 7);
@@ -21,7 +21,7 @@ static uint32_t ropINC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
{
int host_reg;
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
host_reg = LOAD_REG_L(opcode & 7);
@@ -40,7 +40,7 @@ static uint32_t ropDEC_rw(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
{
int host_reg;
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
host_reg = LOAD_REG_W(opcode & 7);
@@ -59,7 +59,7 @@ static uint32_t ropDEC_rl(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
{
int host_reg;
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
host_reg = LOAD_REG_L(opcode & 7);

View File

@@ -200,30 +200,30 @@ static uint32_t ropF ## name ## size(uint8_t opcode, uint32_t fetchdat, uint32_t
return op_pc + 1; \
}
ropFarith(ADD, s, MEM_LOAD_ADDR_EA_L, FP_OP_S);
ropFarith(DIV, s, MEM_LOAD_ADDR_EA_L, FP_OP_S);
ropFarith(DIVR, s, MEM_LOAD_ADDR_EA_L, FP_OP_S);
ropFarith(MUL, s, MEM_LOAD_ADDR_EA_L, FP_OP_S);
ropFarith(SUB, s, MEM_LOAD_ADDR_EA_L, FP_OP_S);
ropFarith(SUBR, s, MEM_LOAD_ADDR_EA_L, FP_OP_S);
ropFarith(ADD, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D);
ropFarith(DIV, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D);
ropFarith(DIVR, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D);
ropFarith(MUL, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D);
ropFarith(SUB, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D);
ropFarith(SUBR, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D);
ropFarith(ADD, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW);
ropFarith(DIV, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW);
ropFarith(DIVR, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW);
ropFarith(MUL, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW);
ropFarith(SUB, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW);
ropFarith(SUBR, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW);
ropFarith(ADD, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL);
ropFarith(DIV, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL);
ropFarith(DIVR, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL);
ropFarith(MUL, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL);
ropFarith(SUB, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL);
ropFarith(SUBR, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL);
ropFarith(ADD, s, MEM_LOAD_ADDR_EA_L, FP_OP_S)
ropFarith(DIV, s, MEM_LOAD_ADDR_EA_L, FP_OP_S)
ropFarith(DIVR, s, MEM_LOAD_ADDR_EA_L, FP_OP_S)
ropFarith(MUL, s, MEM_LOAD_ADDR_EA_L, FP_OP_S)
ropFarith(SUB, s, MEM_LOAD_ADDR_EA_L, FP_OP_S)
ropFarith(SUBR, s, MEM_LOAD_ADDR_EA_L, FP_OP_S)
ropFarith(ADD, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D)
ropFarith(DIV, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D)
ropFarith(DIVR, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D)
ropFarith(MUL, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D)
ropFarith(SUB, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D)
ropFarith(SUBR, d, MEM_LOAD_ADDR_EA_Q, FP_OP_D)
ropFarith(ADD, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW)
ropFarith(DIV, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW)
ropFarith(DIVR, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW)
ropFarith(MUL, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW)
ropFarith(SUB, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW)
ropFarith(SUBR, iw, MEM_LOAD_ADDR_EA_W, FP_OP_IW)
ropFarith(ADD, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL)
ropFarith(DIV, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL)
ropFarith(DIVR, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL)
ropFarith(MUL, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL)
ropFarith(SUB, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL)
ropFarith(SUBR, il, MEM_LOAD_ADDR_EA_L, FP_OP_IL)
#define ropFcompare(name, size, load, op) \
static uint32_t ropF ## name ## size(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \
@@ -252,10 +252,10 @@ static uint32_t ropF ## name ## P ## size(uint8_t opcode, uint32_t fetchdat, uin
return new_pc; \
}
ropFcompare(COM, s, MEM_LOAD_ADDR_EA_L, FP_COMPARE_S);
ropFcompare(COM, d, MEM_LOAD_ADDR_EA_Q, FP_COMPARE_D);
ropFcompare(COM, iw, MEM_LOAD_ADDR_EA_W, FP_COMPARE_IW);
ropFcompare(COM, il, MEM_LOAD_ADDR_EA_L, FP_COMPARE_IL);
ropFcompare(COM, s, MEM_LOAD_ADDR_EA_L, FP_COMPARE_S)
ropFcompare(COM, d, MEM_LOAD_ADDR_EA_Q, FP_COMPARE_D)
ropFcompare(COM, iw, MEM_LOAD_ADDR_EA_W, FP_COMPARE_IW)
ropFcompare(COM, il, MEM_LOAD_ADDR_EA_L, FP_COMPARE_IL)
/*static uint32_t ropFADDs(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
@@ -491,7 +491,7 @@ static uint32_t ropFSTSW_AX(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, u
int host_reg;
FP_ENTER();
host_reg = LOAD_VAR_W(&cpu_state.npxs);
host_reg = LOAD_VAR_W((uintptr_t) &cpu_state.npxs);
STORE_REG_TARGET_W_RELEASE(host_reg, REG_AX);
return op_pc;
@@ -631,8 +631,8 @@ static uint32_t ropFCHS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
opFLDimm(1, 1.0)
opFLDimm(L2T, 3.3219280948873623)
opFLDimm(L2E, 1.4426950408889634);
opFLDimm(PI, 3.141592653589793);
opFLDimm(EG2, 0.3010299956639812);
opFLDimm(LN2, 0.693147180559945);
opFLDimm(L2E, 1.4426950408889634)
opFLDimm(PI, 3.141592653589793)
opFLDimm(EG2, 0.3010299956639812)
opFLDimm(LN2, 0.693147180559945)
opFLDimm(Z, 0.0)

View File

@@ -75,16 +75,16 @@ static uint32_t ropLOOP(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
return op_pc+1;
}
static int BRANCH_COND_B(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
static void BRANCH_COND_B(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
{
CALL_FUNC(CF_SET);
CALL_FUNC((void *) CF_SET);
if (not)
TEST_ZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
else
TEST_NONZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
}
static int BRANCH_COND_E(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
static void BRANCH_COND_E(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
{
int host_reg;
@@ -122,7 +122,7 @@ static int BRANCH_COND_E(int pc_offset, uint32_t op_pc, uint32_t offset, int not
break;
case FLAGS_UNKNOWN:
CALL_FUNC(ZF_SET);
CALL_FUNC((void *) ZF_SET);
if (not)
TEST_ZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
else
@@ -131,25 +131,25 @@ static int BRANCH_COND_E(int pc_offset, uint32_t op_pc, uint32_t offset, int not
}
}
static int BRANCH_COND_O(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
static void BRANCH_COND_O(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
{
CALL_FUNC(VF_SET);
CALL_FUNC((void *) VF_SET);
if (not)
TEST_ZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
else
TEST_NONZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
}
static int BRANCH_COND_P(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
static void BRANCH_COND_P(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
{
CALL_FUNC(PF_SET);
CALL_FUNC((void *) PF_SET);
if (not)
TEST_ZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
else
TEST_NONZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
}
static int BRANCH_COND_S(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
static void BRANCH_COND_S(int pc_offset, uint32_t op_pc, uint32_t offset, int not)
{
int host_reg;
@@ -204,7 +204,7 @@ static int BRANCH_COND_S(int pc_offset, uint32_t op_pc, uint32_t offset, int not
break;
case FLAGS_UNKNOWN:
CALL_FUNC(NF_SET);
CALL_FUNC((void *) NF_SET);
if (not)
TEST_ZERO_JUMP_L(0, op_pc+pc_offset+offset, timing_bt);
else

View File

@@ -33,7 +33,7 @@ static uint32_t ropFE(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_
if ((fetchdat & 0x30) != 0x00)
return 0;
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
if ((fetchdat & 0xc0) == 0xc0)
host_reg = LOAD_REG_B(fetchdat & 7);
@@ -86,7 +86,7 @@ static uint32_t ropFF_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint
return 0;
if ((fetchdat & 0x30) == 0x00)
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
if ((fetchdat & 0xc0) == 0xc0)
host_reg = LOAD_REG_W(fetchdat & 7);
@@ -167,6 +167,9 @@ static uint32_t ropFF_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint
MEM_STORE_ADDR_EA_W(&_ss, host_reg);
SP_MODIFY(-2);
return op_pc + 1;
default:
return -1;
}
}
static uint32_t ropFF_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
@@ -178,7 +181,7 @@ static uint32_t ropFF_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint
return 0;
if ((fetchdat & 0x30) == 0x00)
CALL_FUNC(flags_rebuild_c);
CALL_FUNC((void *) flags_rebuild_c);
if ((fetchdat & 0xc0) == 0xc0)
host_reg = LOAD_REG_L(fetchdat & 7);
@@ -259,5 +262,8 @@ static uint32_t ropFF_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint
MEM_STORE_ADDR_EA_L(&_ss, host_reg);
SP_MODIFY(-4);
return op_pc + 1;
default:
return -1;
}
}

View File

@@ -154,22 +154,22 @@ MMX_OP(ropPSUBSW, MMX_SUBSW)
MMX_OP(ropPSUBUSB, MMX_SUBUSB)
MMX_OP(ropPSUBUSW, MMX_SUBUSW)
MMX_OP(ropPUNPCKLBW, MMX_PUNPCKLBW);
MMX_OP(ropPUNPCKLWD, MMX_PUNPCKLWD);
MMX_OP(ropPUNPCKLDQ, MMX_PUNPCKLDQ);
MMX_OP(ropPACKSSWB, MMX_PACKSSWB);
MMX_OP(ropPCMPGTB, MMX_PCMPGTB);
MMX_OP(ropPCMPGTW, MMX_PCMPGTW);
MMX_OP(ropPCMPGTD, MMX_PCMPGTD);
MMX_OP(ropPACKUSWB, MMX_PACKUSWB);
MMX_OP(ropPUNPCKHBW, MMX_PUNPCKHBW);
MMX_OP(ropPUNPCKHWD, MMX_PUNPCKHWD);
MMX_OP(ropPUNPCKHDQ, MMX_PUNPCKHDQ);
MMX_OP(ropPACKSSDW, MMX_PACKSSDW);
MMX_OP(ropPUNPCKLBW, MMX_PUNPCKLBW)
MMX_OP(ropPUNPCKLWD, MMX_PUNPCKLWD)
MMX_OP(ropPUNPCKLDQ, MMX_PUNPCKLDQ)
MMX_OP(ropPACKSSWB, MMX_PACKSSWB)
MMX_OP(ropPCMPGTB, MMX_PCMPGTB)
MMX_OP(ropPCMPGTW, MMX_PCMPGTW)
MMX_OP(ropPCMPGTD, MMX_PCMPGTD)
MMX_OP(ropPACKUSWB, MMX_PACKUSWB)
MMX_OP(ropPUNPCKHBW, MMX_PUNPCKHBW)
MMX_OP(ropPUNPCKHWD, MMX_PUNPCKHWD)
MMX_OP(ropPUNPCKHDQ, MMX_PUNPCKHDQ)
MMX_OP(ropPACKSSDW, MMX_PACKSSDW)
MMX_OP(ropPCMPEQB, MMX_PCMPEQB);
MMX_OP(ropPCMPEQW, MMX_PCMPEQW);
MMX_OP(ropPCMPEQD, MMX_PCMPEQD);
MMX_OP(ropPCMPEQB, MMX_PCMPEQB)
MMX_OP(ropPCMPEQW, MMX_PCMPEQW)
MMX_OP(ropPCMPEQD, MMX_PCMPEQD)
MMX_OP(ropPSRLW, MMX_PSRLW)
MMX_OP(ropPSRLD, MMX_PSRLD)
@@ -180,9 +180,9 @@ MMX_OP(ropPSLLW, MMX_PSLLW)
MMX_OP(ropPSLLD, MMX_PSLLD)
MMX_OP(ropPSLLQ, MMX_PSLLQ)
MMX_OP(ropPMULLW, MMX_PMULLW);
MMX_OP(ropPMULHW, MMX_PMULHW);
MMX_OP(ropPMADDWD, MMX_PMADDWD);
MMX_OP(ropPMULLW, MMX_PMULLW)
MMX_OP(ropPMULHW, MMX_PMULHW)
MMX_OP(ropPMADDWD, MMX_PMADDWD)
static uint32_t ropPSxxW_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{

View File

@@ -512,22 +512,22 @@ static uint32_t ropMOV_w_seg(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
switch (fetchdat & 0x38)
{
case 0x00: /*ES*/
host_reg = LOAD_VAR_WL(&ES);
host_reg = LOAD_VAR_WL((uintptr_t) &ES);
break;
case 0x08: /*CS*/
host_reg = LOAD_VAR_WL(&CS);
host_reg = LOAD_VAR_WL((uintptr_t) &CS);
break;
case 0x18: /*DS*/
host_reg = LOAD_VAR_WL(&DS);
host_reg = LOAD_VAR_WL((uintptr_t) &DS);
break;
case 0x10: /*SS*/
host_reg = LOAD_VAR_WL(&SS);
host_reg = LOAD_VAR_WL((uintptr_t) &SS);
break;
case 0x20: /*FS*/
host_reg = LOAD_VAR_WL(&FS);
host_reg = LOAD_VAR_WL((uintptr_t) &FS);
break;
case 0x28: /*GS*/
host_reg = LOAD_VAR_WL(&GS);
host_reg = LOAD_VAR_WL((uintptr_t) &GS);
break;
default:
return 0;

View File

@@ -85,7 +85,7 @@ static uint32_t ropPUSH_imm_b32(uint8_t opcode, uint32_t fetchdat, uint32_t op_3
static uint32_t ropPOP_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
int host_reg;
/* int host_reg; */
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc);
LOAD_STACK_TO_EA(0);
@@ -97,7 +97,7 @@ static uint32_t ropPOP_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
}
static uint32_t ropPOP_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
int host_reg;
/* int host_reg; */
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc);
LOAD_STACK_TO_EA(0);
@@ -110,7 +110,7 @@ static uint32_t ropPOP_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
static uint32_t ropRET_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
int host_reg;
/* int host_reg; */
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc);
LOAD_STACK_TO_EA(0);
@@ -122,7 +122,7 @@ static uint32_t ropRET_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
}
static uint32_t ropRET_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
int host_reg;
/* int host_reg; */
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc);
LOAD_STACK_TO_EA(0);
@@ -136,7 +136,7 @@ static uint32_t ropRET_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
static uint32_t ropRET_imm_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
uint16_t offset = fetchdat & 0xffff;
int host_reg;
/* int host_reg; */
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc);
LOAD_STACK_TO_EA(0);
@@ -149,7 +149,7 @@ static uint32_t ropRET_imm_16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
static uint32_t ropRET_imm_32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
uint16_t offset = fetchdat & 0xffff;
int host_reg;
/* int host_reg; */
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc);
LOAD_STACK_TO_EA(0);
@@ -254,8 +254,6 @@ ROP_PUSH_SEG(SS)
#define ROP_POP_SEG(seg, rseg) \
static uint32_t ropPOP_ ## seg ## _16(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \
{ \
int host_reg; \
\
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc); \
LOAD_STACK_TO_EA(0); \
MEM_LOAD_ADDR_EA_W(&_ss); \
@@ -266,8 +264,6 @@ static uint32_t ropPOP_ ## seg ## _16(uint8_t opcode, uint32_t fetchdat, uint32_
} \
static uint32_t ropPOP_ ## seg ## _32(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \
{ \
int host_reg; \
\
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.oldpc, op_old_pc); \
LOAD_STACK_TO_EA(0); \
MEM_LOAD_ADDR_EA_W(&_ss); \

View File

@@ -8,7 +8,7 @@
#define HOST_REG_END 4
#define HOST_REG_XMM_START 0
#define HOST_REG_XMM_END 7
static inline int find_host_reg()
static __inline int find_host_reg()
{
int c;
for (c = HOST_REG_START; c < HOST_REG_END; c++)
@@ -21,7 +21,7 @@ static inline int find_host_reg()
fatal("Out of host regs!\n");
return c;
}
static inline int find_host_xmm_reg()
static __inline int find_host_xmm_reg()
{
int c;
for (c = HOST_REG_XMM_START; c < HOST_REG_XMM_END; c++)
@@ -942,7 +942,7 @@ static x86seg *FETCH_EA_16(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, u
break;
case 2:
addbyte(0xb8); /*MOVL EAX, imm16*/
addlong((fetchdat >> 8) & 0xffff);// pc++;
addlong((fetchdat >> 8) & 0xffff);
addbyte(0x03); /*ADDL EAX, *mod1add[0][rm]*/
addbyte(0x05);
addlong((uint32_t)mod1add[0][rm]);
@@ -983,7 +983,7 @@ static x86seg *FETCH_EA_32(x86seg *op_ea_seg, uint32_t fetchdat, int op_ssegs, u
{
new_eaaddr = fastreadl(cs + (*op_pc) + 1);
addbyte(0xb8); /*MOVL EAX, imm32*/
addlong(new_eaaddr);// pc++;
addlong(new_eaaddr);
(*op_pc) += 4;
}
else
@@ -3600,29 +3600,29 @@ MMX_x86_OP(SUBSW, 0xe9)
MMX_x86_OP(SUBUSB, 0xd8)
MMX_x86_OP(SUBUSW, 0xd9)
MMX_x86_OP(PUNPCKLBW, 0x60);
MMX_x86_OP(PUNPCKLWD, 0x61);
MMX_x86_OP(PUNPCKLDQ, 0x62);
MMX_x86_OP(PCMPGTB, 0x64);
MMX_x86_OP(PCMPGTW, 0x65);
MMX_x86_OP(PCMPGTD, 0x66);
MMX_x86_OP(PUNPCKLBW, 0x60)
MMX_x86_OP(PUNPCKLWD, 0x61)
MMX_x86_OP(PUNPCKLDQ, 0x62)
MMX_x86_OP(PCMPGTB, 0x64)
MMX_x86_OP(PCMPGTW, 0x65)
MMX_x86_OP(PCMPGTD, 0x66)
MMX_x86_OP(PCMPEQB, 0x74);
MMX_x86_OP(PCMPEQW, 0x75);
MMX_x86_OP(PCMPEQD, 0x76);
MMX_x86_OP(PCMPEQB, 0x74)
MMX_x86_OP(PCMPEQW, 0x75)
MMX_x86_OP(PCMPEQD, 0x76)
MMX_x86_OP(PSRLW, 0xd1);
MMX_x86_OP(PSRLD, 0xd2);
MMX_x86_OP(PSRLQ, 0xd3);
MMX_x86_OP(PSRAW, 0xe1);
MMX_x86_OP(PSRAD, 0xe2);
MMX_x86_OP(PSLLW, 0xf1);
MMX_x86_OP(PSLLD, 0xf2);
MMX_x86_OP(PSLLQ, 0xf3);
MMX_x86_OP(PSRLW, 0xd1)
MMX_x86_OP(PSRLD, 0xd2)
MMX_x86_OP(PSRLQ, 0xd3)
MMX_x86_OP(PSRAW, 0xe1)
MMX_x86_OP(PSRAD, 0xe2)
MMX_x86_OP(PSLLW, 0xf1)
MMX_x86_OP(PSLLD, 0xf2)
MMX_x86_OP(PSLLQ, 0xf3)
MMX_x86_OP(PMULLW, 0xd5);
MMX_x86_OP(PMULHW, 0xe5);
MMX_x86_OP(PMADDWD, 0xf5);
MMX_x86_OP(PMULLW, 0xd5)
MMX_x86_OP(PMULHW, 0xe5)
MMX_x86_OP(PMADDWD, 0xf5)
static void MMX_PACKSSWB(int dst_reg, int src_reg)
{

View File

@@ -44,9 +44,9 @@ OP_XCHG_EAX_(EBP)
static uint32_t ropXCHG_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{
// #ifdef __amd64__
// return 0;
// #else
/* #ifdef __amd64__
return 0;
#else */
int src_reg, dst_reg, temp_reg;
if ((fetchdat & 0xc0) != 0xc0)
@@ -59,7 +59,7 @@ static uint32_t ropXCHG_b(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uin
STORE_REG_TARGET_B_RELEASE(temp_reg, fetchdat & 7);
return op_pc + 1;
// #endif
/* #endif */
}
static uint32_t ropXCHG_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{

View File

@@ -251,7 +251,7 @@ static int *opcode_timings_8x[8] =
static int timing_count;
static uint8_t last_prefix;
static inline int COUNT(int *c, int op_32)
static __inline int COUNT(int *c, int op_32)
{
if ((uintptr_t)c <= 10000)
return (int)c;

View File

@@ -819,7 +819,7 @@ static uint32_t opcode_timings_8x[8] =
static int decode_delay;
static uint8_t last_prefix;
static inline int COUNT(uint32_t c, int op_32)
static __inline int COUNT(uint32_t c, int op_32)
{
if (c & CYCLES_HAS_MULTI)
{
@@ -863,48 +863,39 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
{
case 0x0f:
timings = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f;
// pclog("timings 0f\n");
break;
case 0xd8:
timings = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8;
opcode = (opcode >> 3) & 7;
// pclog("timings d8\n");
break;
case 0xd9:
timings = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
// pclog("timings d9\n");
break;
case 0xda:
timings = mod3 ? opcode_timings_da_mod3 : opcode_timings_da;
opcode = (opcode >> 3) & 7;
// pclog("timings da\n");
break;
case 0xdb:
timings = mod3 ? opcode_timings_db_mod3 : opcode_timings_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
// pclog("timings db\n");
break;
case 0xdc:
timings = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc;
opcode = (opcode >> 3) & 7;
// pclog("timings dc\n");
break;
case 0xdd:
timings = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd;
opcode = (opcode >> 3) & 7;
// pclog("timings dd\n");
break;
case 0xde:
timings = mod3 ? opcode_timings_de_mod3 : opcode_timings_de;
opcode = (opcode >> 3) & 7;
// pclog("timings de\n");
break;
case 0xdf:
timings = mod3 ? opcode_timings_df_mod3 : opcode_timings_df;
opcode = (opcode >> 3) & 7;
// pclog("timings df\n");
break;
default:
@@ -914,7 +905,6 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
timings = mod3 ? opcode_timings_mod3 : opcode_timings_8x;
if (!mod3)
opcode = (fetchdat >> 3) & 7;
// pclog("timings 80 %p %p %p\n", (void *)timings, (void *)opcode_timings_mod3, (void *)opcode_timings_8x);
break;
case 0xc0: case 0xc1:
@@ -935,22 +925,18 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
case 0xf6:
timings = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6;
opcode = (fetchdat >> 3) & 7;
// pclog("timings f6\n");
break;
case 0xf7:
timings = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7;
opcode = (fetchdat >> 3) & 7;
// pclog("timings f7\n");
break;
case 0xff:
timings = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff;
opcode = (fetchdat >> 3) & 7;
// pclog("timings ff\n");
break;
default:
timings = mod3 ? opcode_timings_mod3 : opcode_timings;
// pclog("timings normal\n");
break;
}
}
@@ -970,7 +956,6 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
codegen_block_cycles += COUNT(prev_timings[prev_opcode], prev_op_32) + decode_delay;
decode_delay = (-COUNT(prev_timings[prev_opcode], prev_op_32)) + 1;
prev_full = 0;
// pclog("Not pairable %i\n", COUNT(prev_timings[prev_opcode], prev_op_32) + decode_delay);
}
else if (((timings[opcode] & PAIR_MASK) == PAIR_X || (timings[opcode] & PAIR_MASK) == PAIR_X_BRANCH)
&& (prev_timings[opcode] & PAIR_MASK) == PAIR_X)
@@ -980,7 +965,6 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
codegen_block_cycles += COUNT(prev_timings[prev_opcode], prev_op_32) + decode_delay;
decode_delay = (-COUNT(prev_timings[prev_opcode], prev_op_32)) + 1;
prev_full = 0;
// pclog("Not pairable %i\n", COUNT(prev_timings[prev_opcode], prev_op_32) + decode_delay);
}
else if (prev_regmask & regmask)
{
@@ -989,7 +973,6 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
codegen_block_cycles += COUNT(prev_timings[prev_opcode], prev_op_32) + decode_delay;
decode_delay = (-COUNT(prev_timings[prev_opcode], prev_op_32)) + 1;
prev_full = 0;
// pclog("Not pairable %i\n", COUNT(prev_timings[prev_opcode], prev_op_32) + decode_delay);
}
else
{
@@ -1003,7 +986,6 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
decode_delay = (-t_pair) + 1;
prev_full = 0;
// pclog("Pairable %i %i %i %02x %02x\n", t_pair, t1, t2, opcode, prev_opcode);
return;
}
}
@@ -1016,12 +998,10 @@ void codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32)
/*Instruction not pairable*/
codegen_block_cycles += COUNT(timings[opcode], op_32) + decode_delay;
decode_delay = (-COUNT(timings[opcode], op_32)) + 1;
// pclog("Not pairable %i\n", COUNT(timings[opcode], op_32) + decode_delay);
}
else
{
/*Instruction might pair with next*/
// pclog("Might pair - %02x %02x %08x %08x %08x %p %p %p\n", last_prefix, opcode, timings[opcode], timings[opcode] & PAIR_MASK, PAIR_X_BRANCH, timings, opcode_timings_0f, opcode_timings_0f_mod3);
prev_full = 1;
prev_opcode = opcode;
prev_timings = timings;

Some files were not shown because too many files have changed in this diff Show More