Fixed some Buslogic bugs;
Implemented the EuroPC JIM chip NVR saving/loading correctly.
This commit is contained in:
52
src/jim.c
52
src/jim.c
@@ -7,7 +7,10 @@
|
||||
#include "CPU/cpu.h"
|
||||
#include "io.h"
|
||||
#include "device.h"
|
||||
#include "jim.h"
|
||||
#include "mem.h"
|
||||
#include "model.h"
|
||||
#include "rom.h"
|
||||
|
||||
|
||||
uint8_t europcdat[16];
|
||||
@@ -15,11 +18,43 @@ uint8_t europcdat[16];
|
||||
struct
|
||||
{
|
||||
uint8_t dat[16];
|
||||
int stat;
|
||||
int addr;
|
||||
uint8_t stat;
|
||||
uint8_t addr;
|
||||
} europc_rtc;
|
||||
|
||||
|
||||
static uint8_t jim_load_nvr(void)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = nvrfopen(L"europc_jim.nvr", L"rb");
|
||||
if (f)
|
||||
{
|
||||
fread(europcdat, 1, 16, f);
|
||||
fread(europc_rtc.dat, 1, 16, f);
|
||||
fclose(f);
|
||||
f = NULL;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void jim_save_nvr(void)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = nvrfopen(L"europc_jim.nvr", L"wb");
|
||||
if (f)
|
||||
{
|
||||
fwrite(europcdat, 1, 16, f);
|
||||
fwrite(europc_rtc.dat, 1, 16, f);
|
||||
fclose(f);
|
||||
f = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void writejim(uint16_t addr, uint8_t val, void *p)
|
||||
{
|
||||
if ((addr&0xFF0)==0x250) europcdat[addr&0xF]=val;
|
||||
@@ -73,12 +108,15 @@ void jim_init(void)
|
||||
{
|
||||
uint8_t viddat;
|
||||
memset(europc_rtc.dat,0,16);
|
||||
europc_rtc.dat[0xF]=1;
|
||||
europc_rtc.dat[3]=1;
|
||||
europc_rtc.dat[4]=1;
|
||||
europc_rtc.dat[5]=0x88;
|
||||
if (!jim_load_nvr())
|
||||
{
|
||||
europc_rtc.dat[0xF]=1;
|
||||
europc_rtc.dat[3]=1;
|
||||
europc_rtc.dat[4]=1;
|
||||
europc_rtc.dat[5]=0x88;
|
||||
}
|
||||
if (gfxcard==GFX_CGA || gfxcard == GFX_COLORPLUS) viddat=0x12;
|
||||
else if (gfxcard==GFX_MDA || gfxcard==GFX_HERCULES || gfxcard==GFX_INCOLOR) viddat=3;
|
||||
else if (gfxcard==GFX_MDA || gfxcard==GFX_HERCULES || gfxcard==GFX_INCOLOR) viddat=3;
|
||||
else viddat=0x10;
|
||||
europc_rtc.dat[0xB]=viddat;
|
||||
europc_rtc.dat[0xD]=viddat; /*Checksum*/
|
||||
|
||||
@@ -146,7 +146,7 @@ MODEL models[] =
|
||||
{"[8088] Generic XT clone", ROM_GENXT, "genxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL },
|
||||
{"[8088] Juko XT clone", ROM_JUKOPC, "jukopc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL },
|
||||
{"[8088] Phoenix XT clone", ROM_PXXT, "pxxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, xt_init, NULL },
|
||||
{"[8088] Schneider EuroPC", ROM_EUROPC, "europc", {{"", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 512, 640, 128, 63, europc_init, NULL },
|
||||
{"[8088] Schneider EuroPC", ROM_EUROPC, "europc", {{"", cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 512, 640, 128, 0, europc_init, NULL },
|
||||
{"[8088] Tandy 1000", ROM_TANDY, "tandy", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 128, 640, 128, 0, tandy1k_init, &tandy1000_device },
|
||||
{"[8088] Tandy 1000 HX", ROM_TANDY1000HX, "tandy1000hx", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 256, 640, 128, 0, tandy1k_init, &tandy1000hx_device },
|
||||
{"[8088] VTech Laser Turbo XT", ROM_LTXT, "ltxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 1152, 64, 0, xt_laserxt_init, NULL },
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "CPU/cpu.h"
|
||||
#include "device.h"
|
||||
#include "io.h"
|
||||
#include "jim.h"
|
||||
#include "mem.h"
|
||||
#include "model.h"
|
||||
#include "nmi.h"
|
||||
@@ -279,6 +280,12 @@ void savenvr(void)
|
||||
wchar_t *model_name;
|
||||
wchar_t *nvr_name;
|
||||
|
||||
if (romset == ROM_EUROPC)
|
||||
{
|
||||
jim_save_nvr();
|
||||
return;
|
||||
}
|
||||
|
||||
model_name = (wchar_t *) malloc((strlen(model_get_internal_name_ex(oldmodel)) << 1) + 2);
|
||||
mbstowcs(model_name, model_get_internal_name_ex(oldmodel), strlen(model_get_internal_name_ex(oldmodel)) + 1);
|
||||
nvr_name = (wchar_t *) malloc((wcslen(model_name) << 1) + 2 + 8);
|
||||
|
||||
@@ -3041,9 +3041,9 @@ BuslogicInit(int chip)
|
||||
{
|
||||
rom_init(&bl->bios, L"roms/scsi/buslogic/428A494G.BIN", 0xd8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
memset(bl->AutoSCSIROM, 0xff, 32768);
|
||||
f = romfopen(L"roms/scsi/buslogic/AutoSCSI.rom", L"rb");
|
||||
}
|
||||
|
||||
f = romfopen(L"roms/scsi/buslogic/AutoSCSI.rom", L"rb");
|
||||
if (f)
|
||||
{
|
||||
fread(bl->AutoSCSIROM, 1, 32768, f);
|
||||
@@ -3063,7 +3063,7 @@ BuslogicInit(int chip)
|
||||
timer_add(BuslogicCommandCallback,
|
||||
&BuslogicCallback, &BuslogicCallback, bl);
|
||||
|
||||
f = nvrfopen(BuslogicGetNVRFileName(bl), L"wb");
|
||||
f = nvrfopen(BuslogicGetNVRFileName(bl), L"rb");
|
||||
if (f)
|
||||
{
|
||||
fread(&(bl->LocalRAM.u8View[64]), 1, 64, f);
|
||||
|
||||
Reference in New Issue
Block a user