Initial SiS496/497 emulation.
Fixed ESP value on ENTER when page fault after first push. Fixed execution time of IDE Set Idle command. Fixed head number on FDC Read Sector ID command.
This commit is contained in:
parent
f431e74917
commit
f195495f3a
7 changed files with 40 additions and 17 deletions
|
|
@ -310,7 +310,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
|
||||||
fdc.stat = 1 << fdc.drive;
|
fdc.stat = 1 << fdc.drive;
|
||||||
// disctime = 8000000;
|
// disctime = 8000000;
|
||||||
}
|
}
|
||||||
if (discint == 0xf)
|
if (discint == 0xf || discint == 10)
|
||||||
{
|
{
|
||||||
fdc.head = (fdc.params[0] & 4) ? 1 : 0;
|
fdc.head = (fdc.params[0] & 4) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@ enum
|
||||||
ROM_AMI486,
|
ROM_AMI486,
|
||||||
ROM_WIN486,
|
ROM_WIN486,
|
||||||
ROM_PCI486,
|
ROM_PCI486,
|
||||||
|
ROM_SIS496,
|
||||||
ROM_430VX
|
ROM_430VX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
13
src/ide.c
13
src/ide.c
|
|
@ -651,7 +651,7 @@ void writeide(int ide_board, uint16_t addr, uint8_t val)
|
||||||
}*/
|
}*/
|
||||||
#endif
|
#endif
|
||||||
// if ((cr0&1) && !(eflags&VM_FLAG))
|
// if ((cr0&1) && !(eflags&VM_FLAG))
|
||||||
// pclog("WriteIDE %04X %02X from %04X(%08X):%08X\n", addr, val, CS, cs, pc);
|
// pclog("WriteIDE %04X %02X from %04X(%08X):%08X %i\n", addr, val, CS, cs, pc, ins);
|
||||||
// return;
|
// return;
|
||||||
addr|=0x80;
|
addr|=0x80;
|
||||||
// if (ide_board) pclog("Write IDEb %04X %02X %04X(%08X):%04X %i %02X %02X\n",addr,val,CS,cs,pc,ins,ide->atastat,ide_drives[0].atastat);
|
// if (ide_board) pclog("Write IDEb %04X %02X %04X(%08X):%04X %i %02X %02X\n",addr,val,CS,cs,pc,ins,ide->atastat,ide_drives[0].atastat);
|
||||||
|
|
@ -847,7 +847,8 @@ void writeide(int ide_board, uint16_t addr, uint8_t val)
|
||||||
case WIN_SETIDLE1: /* Idle */
|
case WIN_SETIDLE1: /* Idle */
|
||||||
ide->atastat = BUSY_STAT;
|
ide->atastat = BUSY_STAT;
|
||||||
timer_process();
|
timer_process();
|
||||||
idecallback[ide_board]=200*IDE_TIME;
|
callbackide(ide_board);
|
||||||
|
// idecallback[ide_board]=200*IDE_TIME;
|
||||||
timer_update_outstanding();
|
timer_update_outstanding();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -913,7 +914,7 @@ uint8_t readide(int ide_board, uint16_t addr)
|
||||||
}*/
|
}*/
|
||||||
#endif
|
#endif
|
||||||
// if ((cr0&1) && !(eflags&VM_FLAG))
|
// if ((cr0&1) && !(eflags&VM_FLAG))
|
||||||
// pclog("ReadIDE %04X from %04X(%08X):%08X\n", addr, CS, cs, pc);
|
// pclog("ReadIDE %04X from %04X(%08X):%08X\n", addr, CS, cs, pc);
|
||||||
// return 0xFF;
|
// return 0xFF;
|
||||||
|
|
||||||
if (ide->type == IDE_NONE && addr != 0x1f6) return 0xff;
|
if (ide->type == IDE_NONE && addr != 0x1f6) return 0xff;
|
||||||
|
|
@ -1060,13 +1061,15 @@ uint16_t readidew(int ide_board)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (ide_board) pclog("Read IDEw %04X\n",temp);
|
// pclog("Read IDEw %04X\n",temp);
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t readidel(int ide_board)
|
uint32_t readidel(int ide_board)
|
||||||
{
|
{
|
||||||
uint16_t temp = readidew(ide_board);
|
uint16_t temp;
|
||||||
|
// pclog("Read IDEl %i\n", ide_board);
|
||||||
|
temp = readidew(ide_board);
|
||||||
return temp | (readidew(ide_board) << 16);
|
return temp | (readidew(ide_board) << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
24
src/mem.c
24
src/mem.c
|
|
@ -586,6 +586,14 @@ int loadbios()
|
||||||
//is486=1;
|
//is486=1;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
case ROM_SIS496:
|
||||||
|
f = romfopen("roms/sis496/SIS496-1.AWA", "rb");
|
||||||
|
if (!f) break;
|
||||||
|
fread(rom, 0x20000, 1, f);
|
||||||
|
fclose(f);
|
||||||
|
biosmask = 0x1ffff;
|
||||||
|
return 1;
|
||||||
|
|
||||||
case ROM_430VX:
|
case ROM_430VX:
|
||||||
// f = romfopen("roms/430vx/Ga586atv.bin", "rb");
|
// f = romfopen("roms/430vx/Ga586atv.bin", "rb");
|
||||||
// f = fopen("roms/430vx/vx29.BIN", "rb");
|
// f = fopen("roms/430vx/vx29.BIN", "rb");
|
||||||
|
|
@ -792,7 +800,7 @@ uint32_t mmutranslatereal(uint32_t addr, int rw)
|
||||||
// if (output == 3) pclog("Do translate %08X %i %08X\n", addr, rw, temp);
|
// if (output == 3) pclog("Do translate %08X %i %08X\n", addr, rw, temp);
|
||||||
if (!(temp&1))// || (CPL==3 && !(temp&4) && !cpl_override) || (rw && !(temp&2) && (CPL==3 || cr0&WP_FLAG)))
|
if (!(temp&1))// || (CPL==3 && !(temp&4) && !cpl_override) || (rw && !(temp&2) && (CPL==3 || cr0&WP_FLAG)))
|
||||||
{
|
{
|
||||||
// /*if (!nopageerrors && opcode != 0xf3 && opcode != 0x89) */pclog("Section not present! %08X %08X %02X %04X:%08X %i %i\n",addr,temp,opcode,CS,pc,CPL,rw);
|
// if (!nopageerrors) pclog("Section not present! %08X %08X %02X %04X:%08X %i %i\n",addr,temp,opcode,CS,pc,CPL,rw);
|
||||||
|
|
||||||
cr2=addr;
|
cr2=addr;
|
||||||
temp&=1;
|
temp&=1;
|
||||||
|
|
@ -812,7 +820,7 @@ uint32_t mmutranslatereal(uint32_t addr, int rw)
|
||||||
// if (output == 3) pclog("Do translate %08X %08X\n", temp, temp3);
|
// if (output == 3) pclog("Do translate %08X %08X\n", temp, temp3);
|
||||||
if (!(temp&1) || (CPL==3 && !(temp3&4) && !cpl_override) || (rw && !(temp3&2) && (CPL==3 || cr0&WP_FLAG)))
|
if (!(temp&1) || (CPL==3 && !(temp3&4) && !cpl_override) || (rw && !(temp3&2) && (CPL==3 || cr0&WP_FLAG)))
|
||||||
{
|
{
|
||||||
// /*if (!nopageerrors && opcode != 0xf3 && opcode != 0x89) */pclog("Page not present! %08X %08X %02X %02X %i %08X %04X:%08X %04X:%08X %i %i %i\n",addr,temp,opcode,opcode2,frame,rmdat32, CS,pc,SS,ESP,ins,CPL,rw);
|
// if (!nopageerrors) pclog("Page not present! %08X %08X %02X %02X %i %08X %04X:%08X %04X:%08X %i %i %i\n",addr,temp,opcode,opcode2,frame,rmdat32, CS,pc,SS,ESP,ins,CPL,rw);
|
||||||
|
|
||||||
// dumpregs();
|
// dumpregs();
|
||||||
// exit(-1);
|
// exit(-1);
|
||||||
|
|
@ -1006,7 +1014,7 @@ void writemembl(uint32_t addr, uint8_t val)
|
||||||
addr &= rammask;
|
addr &= rammask;
|
||||||
|
|
||||||
if (_mem_write_b[addr >> 14]) _mem_write_b[addr >> 14](addr, val, _mem_priv[addr >> 14]);
|
if (_mem_write_b[addr >> 14]) _mem_write_b[addr >> 14](addr, val, _mem_priv[addr >> 14]);
|
||||||
// else pclog("Bad write %08X %02X %04X:%08X\n", addr, val, CS, pc);
|
// else pclog("Bad write %08X %02X %04X:%08X\n", addr, val, CS, pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t readmemb386l(uint32_t seg, uint32_t addr)
|
uint8_t readmemb386l(uint32_t seg, uint32_t addr)
|
||||||
|
|
@ -1058,7 +1066,7 @@ void writememb386l(uint32_t seg, uint32_t addr, uint8_t val)
|
||||||
pclog("writemembl %08X %02X\n", addr, val);*/
|
pclog("writemembl %08X %02X\n", addr, val);*/
|
||||||
|
|
||||||
if (_mem_write_b[addr >> 14]) _mem_write_b[addr >> 14](addr, val, _mem_priv[addr >> 14]);
|
if (_mem_write_b[addr >> 14]) _mem_write_b[addr >> 14](addr, val, _mem_priv[addr >> 14]);
|
||||||
// else pclog("Bad write %08X %02X %04X:%08X\n", addr, val, CS, pc);
|
// else pclog("Bad write %08X %02X %04X:%08X\n", addr, val, CS, pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t readmemwl(uint32_t seg, uint32_t addr)
|
uint16_t readmemwl(uint32_t seg, uint32_t addr)
|
||||||
|
|
@ -1150,7 +1158,7 @@ void writememwl(uint32_t seg, uint32_t addr, uint16_t val)
|
||||||
_mem_write_b[(addr2 + 1) >> 14](addr2 + 1, val >> 8, _mem_priv[addr2 >> 14]);
|
_mem_write_b[(addr2 + 1) >> 14](addr2 + 1, val >> 8, _mem_priv[addr2 >> 14]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// pclog("Bad write %08X %04X\n", addr, val);
|
// pclog("Bad write %08X %04X\n", addr2, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t readmemll(uint32_t seg, uint32_t addr)
|
uint32_t readmemll(uint32_t seg, uint32_t addr)
|
||||||
|
|
@ -1241,7 +1249,7 @@ void writememll(uint32_t seg, uint32_t addr, uint32_t val)
|
||||||
_mem_write_b[addr2 >> 14](addr2 + 3, val >> 24, _mem_priv[addr2 >> 14]);
|
_mem_write_b[addr2 >> 14](addr2 + 3, val >> 24, _mem_priv[addr2 >> 14]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// pclog("Bad write %08X %08X\n", addr, val);
|
// pclog("Bad write %08X %08X\n", addr2, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t mem_read_ram(uint32_t addr, void *priv)
|
uint8_t mem_read_ram(uint32_t addr, void *priv)
|
||||||
|
|
@ -1290,12 +1298,12 @@ uint8_t mem_read_bios(uint32_t addr, void *priv)
|
||||||
// if (pc==0x547D) output=3;
|
// if (pc==0x547D) output=3;
|
||||||
return 0x40;
|
return 0x40;
|
||||||
}
|
}
|
||||||
// if (output) pclog("Read BIOS %08X %02X %04X:%04X\n", addr, rom[addr & biosmask], CS, pc);
|
// pclog("Read BIOS %08X %02X %04X:%04X\n", addr, rom[addr & biosmask], CS, pc);
|
||||||
return rom[addr & biosmask];
|
return rom[addr & biosmask];
|
||||||
}
|
}
|
||||||
uint16_t mem_read_biosw(uint32_t addr, void *priv)
|
uint16_t mem_read_biosw(uint32_t addr, void *priv)
|
||||||
{
|
{
|
||||||
// /*if (output) */pclog("Read BIOS %08X %04X %04X:%04X\n", addr, *(uint16_t *)&rom[addr & biosmask], CS, pc);
|
// pclog("Read BIOS %08X %04X %04X:%04X\n", addr, *(uint16_t *)&rom[addr & biosmask], CS, pc);
|
||||||
return *(uint16_t *)&rom[addr & biosmask];
|
return *(uint16_t *)&rom[addr & biosmask];
|
||||||
}
|
}
|
||||||
uint32_t mem_read_biosl(uint32_t addr, void *priv)
|
uint32_t mem_read_biosl(uint32_t addr, void *priv)
|
||||||
|
|
|
||||||
11
src/model.c
11
src/model.c
|
|
@ -28,6 +28,7 @@
|
||||||
#include "piix.h"
|
#include "piix.h"
|
||||||
#include "pit.h"
|
#include "pit.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
#include "sis496.h"
|
||||||
#include "sound_sn76489.h"
|
#include "sound_sn76489.h"
|
||||||
#include "um8669f.h"
|
#include "um8669f.h"
|
||||||
#include "um8881f.h"
|
#include "um8881f.h"
|
||||||
|
|
@ -46,6 +47,7 @@ void at_wd76c10_init();
|
||||||
void at_ali1429_init();
|
void at_ali1429_init();
|
||||||
void at_headland_init();
|
void at_headland_init();
|
||||||
void at_um8881f_init();
|
void at_um8881f_init();
|
||||||
|
void at_sis496_init();
|
||||||
void at_i430vx_init();
|
void at_i430vx_init();
|
||||||
|
|
||||||
int model;
|
int model;
|
||||||
|
|
@ -74,6 +76,7 @@ MODEL models[] =
|
||||||
{"AMI 486 clone", ROM_AMI486, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_ali1429_init},
|
{"AMI 486 clone", ROM_AMI486, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_ali1429_init},
|
||||||
{"AMI WinBIOS 486", ROM_WIN486, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_ali1429_init},
|
{"AMI WinBIOS 486", ROM_WIN486, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_ali1429_init},
|
||||||
{"AMI WinBIOS 486 PCI", ROM_PCI486, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_um8881f_init},
|
{"AMI WinBIOS 486 PCI", ROM_PCI486, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_um8881f_init},
|
||||||
|
{"Award SiS 496/497", ROM_SIS496, { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486}, 0, at_sis496_init},
|
||||||
{"Award 430VX PCI", ROM_430VX, { "IDT", cpus_WinChip, "", NULL, "", NULL}, 0, at_i430vx_init},
|
{"Award 430VX PCI", ROM_430VX, { "IDT", cpus_WinChip, "", NULL, "", NULL}, 0, at_i430vx_init},
|
||||||
{"", -1, {"", 0, "", 0, "", 0}, 0}
|
{"", -1, {"", 0, "", 0, "", 0}, 0}
|
||||||
};
|
};
|
||||||
|
|
@ -198,6 +201,14 @@ void at_um8881f_init()
|
||||||
um8881f_init();
|
um8881f_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void at_sis496_init()
|
||||||
|
{
|
||||||
|
at_init();
|
||||||
|
mouse_serial_init();
|
||||||
|
pci_init();
|
||||||
|
device_add(&sis496_device);
|
||||||
|
}
|
||||||
|
|
||||||
void at_i430vx_init()
|
void at_i430vx_init()
|
||||||
{
|
{
|
||||||
at_init();
|
at_init();
|
||||||
|
|
|
||||||
|
|
@ -552,7 +552,7 @@ void svga_poll(void *p)
|
||||||
|
|
||||||
svga->video_res_x = wx;
|
svga->video_res_x = wx;
|
||||||
svga->video_res_y = wy + 1;
|
svga->video_res_y = wy + 1;
|
||||||
pclog("%i %i %i\n", svga->video_res_x, svga->video_res_y, svga->lowres);
|
// pclog("%i %i %i\n", svga->video_res_x, svga->video_res_y, svga->lowres);
|
||||||
if (!(svga->gdcreg[6] & 1)) /*Text mode*/
|
if (!(svga->gdcreg[6] & 1)) /*Text mode*/
|
||||||
{
|
{
|
||||||
svga->video_res_x /= (svga->seqregs[1] & 1) ? 8 : 9;
|
svga->video_res_x /= (svga->seqregs[1] & 1) ? 8 : 9;
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ static int opENTER_w(uint32_t fetchdat)
|
||||||
int count = (fetchdat >> 16) & 0xff; pc++;
|
int count = (fetchdat >> 16) & 0xff; pc++;
|
||||||
uint32_t tempEBP = EBP, tempESP = ESP, frame_ptr;
|
uint32_t tempEBP = EBP, tempESP = ESP, frame_ptr;
|
||||||
|
|
||||||
PUSH_W(BP);
|
PUSH_W(BP); if (abrt) return 0;
|
||||||
frame_ptr = ESP;
|
frame_ptr = ESP;
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
|
|
@ -337,7 +337,7 @@ static int opENTER_l(uint32_t fetchdat)
|
||||||
int count = (fetchdat >> 16) & 0xff; pc++;
|
int count = (fetchdat >> 16) & 0xff; pc++;
|
||||||
uint32_t tempEBP = EBP, tempESP = ESP, frame_ptr;
|
uint32_t tempEBP = EBP, tempESP = ESP, frame_ptr;
|
||||||
|
|
||||||
PUSH_L(EBP);
|
PUSH_L(EBP); if (abrt) return 0;
|
||||||
frame_ptr = ESP;
|
frame_ptr = ESP;
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue