around WAB (and HOSTDRV fix)

This commit is contained in:
Tomohiro Yoshidomi 2018-03-22 09:29:06 +09:00
parent 987c32334e
commit 55a7a5a1a0
17 changed files with 1028 additions and 16 deletions

View File

@ -14,6 +14,12 @@
#ifdef SUPPORT_LGY98
#include "lgy98.h"
#endif
#ifdef SUPPORT_WAB
#include "wab.h"
#endif
#ifdef SUPPORT_CL_GD5430
#include "cirrus_vga_extern.h"
#endif
static const FNIORESET resetfn[] = {
@ -26,6 +32,12 @@ static const FNIORESET resetfn[] = {
#if defined(SUPPORT_LGY98)
lgy98_reset,
#endif
#if defined(SUPPORT_CL_GD5430)
pc98_cirrus_vga_reset,
#endif
#if defined(SUPPORT_WAB)
np2wab_reset,
#endif
#if defined(SUPPORT_SASI)
sasiio_reset,
#endif
@ -51,6 +63,12 @@ static const FNIOBIND bindfn[] = {
#if defined(SUPPORT_LGY98)
lgy98_bind,
#endif
#if defined(SUPPORT_WAB)
np2wab_bind,
#endif
#if defined(SUPPORT_CL_GD5430)
pc98_cirrus_vga_bind,
#endif
#if defined(SUPPORT_SASI)
sasiio_bind,
#endif

View File

@ -18,6 +18,9 @@
#include "memepp.h"
#include "vram.h"
#include "font/font.h"
#if defined(SUPPORT_CL_GD5430)
#include "wab/cirrus_vga_extern.h"
#endif
UINT8 mem[0x200000];
@ -442,6 +445,28 @@ REG8 MEMCALL memp_read8(UINT32 address) {
return(mem[address]);
}
else {
#if defined(SUPPORT_CL_GD5430)
if(np2cfg.usegd5430 && cirrusvga_opaque){
if(np2clvga.VRAMWindowAddr){
if(np2clvga.VRAMWindowAddr <= address){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE){
return cirrus_linear_readb(cirrusvga_opaque, address);
}else if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT) return 0;
return cirrus_linear_readb(cirrusvga_opaque, address);
}
}
if(np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH <= address){
if(address < np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH + BBLTWINDOW_SIZE){
return cirrus_linear_bitblt_readb(cirrusvga_opaque, address);
}
}
}
if(np2clvga.VRAMWindowAddr2 && np2clvga.VRAMWindowAddr2 <= address && address < np2clvga.VRAMWindowAddr2 + 0x10000){
return CIRRUS_VRAMWND2_FUNC_rb(cirrusvga_opaque, address);
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
return(memfn0.rd8[address >> 15](address));
@ -480,6 +505,28 @@ REG16 MEMCALL memp_read16(UINT32 address) {
return(LOADINTELWORD(mem + address));
}
else if ((address + 1) & 0x7fff) { // non 32kb boundary
#if defined(SUPPORT_CL_GD5430)
if(np2cfg.usegd5430 && cirrusvga_opaque){
if(np2clvga.VRAMWindowAddr){
if(np2clvga.VRAMWindowAddr <= address){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE){
return cirrus_linear_readw(cirrusvga_opaque, address);
}else if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT) return 0;
return cirrus_linear_readw(cirrusvga_opaque, address);
}
}
if(np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH <= address){
if(address < np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH + BBLTWINDOW_SIZE){
return cirrus_linear_bitblt_readw(cirrusvga_opaque, address);
}
}
}
if(np2clvga.VRAMWindowAddr2 && np2clvga.VRAMWindowAddr2 <= address && address < np2clvga.VRAMWindowAddr2 + 0x10000){
return CIRRUS_VRAMWND2_FUNC_rw(cirrusvga_opaque, address);
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
return(memfn0.rd16[address >> 15](address));
@ -519,7 +566,29 @@ UINT32 MEMCALL memp_read32(UINT32 address) {
UINT32 pos;
UINT32 ret;
#if defined(SUPPORT_CL_GD5430)
if(np2cfg.usegd5430 && cirrusvga_opaque){
if(np2clvga.VRAMWindowAddr){
if(np2clvga.VRAMWindowAddr <= address){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE){
return cirrus_linear_readl(cirrusvga_opaque, address);
}else if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT) return 0;
return cirrus_linear_readl(cirrusvga_opaque, address);
}
}
if(np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH <= address){
if(address < np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH + BBLTWINDOW_SIZE){
return cirrus_linear_bitblt_readl(cirrusvga_opaque, address);
}
}
}
if(np2clvga.VRAMWindowAddr2 && np2clvga.VRAMWindowAddr2 <= address && address < np2clvga.VRAMWindowAddr2 + 0x10000){
return CIRRUS_VRAMWND2_FUNC_rl(cirrusvga_opaque, address);
}
}
#endif
if (address < (I286_MEMREADMAX - 3)) {
return(LOADINTELDWORD(mem + address));
}
@ -547,6 +616,32 @@ void MEMCALL memp_write8(UINT32 address, REG8 value) {
mem[address] = (UINT8)value;
}
else {
#if defined(SUPPORT_CL_GD5430)
if(np2cfg.usegd5430 && cirrusvga_opaque){
if(np2clvga.VRAMWindowAddr){
if(np2clvga.VRAMWindowAddr <= address){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE){
g_cirrus_linear_write[0](cirrusvga_opaque, address, value);
return;
}else if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT);
g_cirrus_linear_write[0](cirrusvga_opaque, address, value);
return;
}
}
if(np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH <= address){
if(address < np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH + BBLTWINDOW_SIZE){
cirrus_linear_bitblt_writeb(cirrusvga_opaque, address, value);
return;
}
}
}
if(np2clvga.VRAMWindowAddr2 && np2clvga.VRAMWindowAddr2 <= address && address < np2clvga.VRAMWindowAddr2 + 0x10000){
CIRRUS_VRAMWND2_FUNC_wb(cirrusvga_opaque, address, value);
return;
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
// 強制RAM化
@ -588,6 +683,32 @@ void MEMCALL memp_write16(UINT32 address, REG16 value) {
STOREINTELWORD(mem + address, value);
}
else if ((address + 1) & 0x7fff) { // non 32kb boundary
#if defined(SUPPORT_CL_GD5430)
if(np2cfg.usegd5430 && cirrusvga_opaque){
if(np2clvga.VRAMWindowAddr){
if(np2clvga.VRAMWindowAddr <= address){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE){
g_cirrus_linear_write[1](cirrusvga_opaque, address, value);
return;
}else if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT);
g_cirrus_linear_write[1](cirrusvga_opaque, address, value);
return;
}
}
if(np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH <= address){
if(address < np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH + BBLTWINDOW_SIZE){
cirrus_linear_bitblt_writew(cirrusvga_opaque, address, value);
return;
}
}
}
if(np2clvga.VRAMWindowAddr2 && np2clvga.VRAMWindowAddr2 <= address && address < np2clvga.VRAMWindowAddr2 + 0x10000){
CIRRUS_VRAMWND2_FUNC_ww(cirrusvga_opaque, address, value);
return;
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
// 強制RAM化
@ -646,7 +767,33 @@ void MEMCALL memp_write16(UINT32 address, REG16 value) {
void MEMCALL memp_write32(UINT32 address, UINT32 value) {
UINT32 pos;
#if defined(SUPPORT_CL_GD5430)
if(np2cfg.usegd5430 && cirrusvga_opaque){
if(np2clvga.VRAMWindowAddr){
if(np2clvga.VRAMWindowAddr <= address){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE){
g_cirrus_linear_write[2](cirrusvga_opaque, address, value);
return;
}else if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address < np2clvga.VRAMWindowAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT);
g_cirrus_linear_write[2](cirrusvga_opaque, address, value);
return;
}
}
if(np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH <= address){
if(address < np2clvga.VRAMWindowAddr + BBLTWINDOW_ADSH + BBLTWINDOW_SIZE){
cirrus_linear_bitblt_writel(cirrusvga_opaque, address, value);
return;
}
}
}
if(np2clvga.VRAMWindowAddr2 && np2clvga.VRAMWindowAddr2 <= address && address < np2clvga.VRAMWindowAddr2 + 0x10000){
CIRRUS_VRAMWND2_FUNC_wl(cirrusvga_opaque, address, value);
return;
}
}
#endif
if (address < (I286_MEMWRITEMAX - 3)) {
STOREINTELDWORD(mem + address, value);
return;

View File

@ -20,6 +20,9 @@
#include "memepp.h"
#include "vram.h"
#include "font/font.h"
#if defined(SUPPORT_CL_GD5430)
#include "cirrus_vga_extern.h"
#endif
UINT8 mem[0x200000];
@ -553,6 +556,42 @@ REG16 MEMCALL memp_read16(UINT32 address) {
}
else {
if ((address + 1) & 0x7fff) { // non 32kb boundary
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
UINT32 vramWndAddr = np2clvga.VRAMWindowAddr;
UINT32 vramWndAddr2 = np2clvga.VRAMWindowAddr2;
UINT32 vramWndAddr3 = np2clvga.VRAMWindowAddr3;
if(vramWndAddr){
if(vramWndAddr <= address){
if(address < vramWndAddr + VRAMWINDOW_SIZE){
return cirrus_linear_readw(cirrusvga_opaque, address);
}else if(address < vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address >= vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT)
return cirrus_linear_readw(cirrusvga_opaque, address);
}
}
}
if(vramWndAddr3){
UINT32 addr3 = address;
if(vramWndAddr3 <= addr3 && addr3 < vramWndAddr3 + VRA3WINDOW_SIZEX){
return CIRRUS_VRAMWND3_FUNC_rw(cirrusvga_opaque, addr3);
}
}
if(vramWndAddr2 && (vramWndAddr2 != 0xE0000 || !(gdc.analog & ((1 << GDCANALOG_16) | (1 << GDCANALOG_256) | (1 << GDCANALOG_256E))))){
UINT32 addr2 = address;
if((vramWndAddr2 & 0xfff00000UL) == 0){
UINT32 addrtmp = addr2 & 0xfff80000UL;
if(addrtmp == 0xfff80000UL || addrtmp == 0x00f80000UL){
// XXX: 0xFFFA0000 - 0xFFFFFFFF or 0xFA0000 - 0xFFFFFF
addr2 = addr2 & 0xfffff;
}
}
if((addr2 & CIRRUS_VRAMWINDOW2MASK) == vramWndAddr2){
return CIRRUS_VRAMWND2_FUNC_rw(cirrusvga_opaque, addr2);
}
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
return(memfn0.rd16[address >> 15](address));
@ -607,6 +646,42 @@ UINT32 MEMCALL memp_read32(UINT32 address) {
}
else{
if ((address + 1) & 0x7fff) { // non 32kb boundary
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
UINT32 vramWndAddr = np2clvga.VRAMWindowAddr;
UINT32 vramWndAddr2 = np2clvga.VRAMWindowAddr2;
UINT32 vramWndAddr3 = np2clvga.VRAMWindowAddr3;
if(vramWndAddr){
if(vramWndAddr <= address){
if(address < vramWndAddr + VRAMWINDOW_SIZE){
return cirrus_linear_readl(cirrusvga_opaque, address);
}else if(address < vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address >= vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT)
return cirrus_linear_readl(cirrusvga_opaque, address);
}
}
}
if(vramWndAddr3){
UINT32 addr3 = address;
if(vramWndAddr3 <= addr3 && addr3 < vramWndAddr3 + VRA3WINDOW_SIZEX){
return CIRRUS_VRAMWND3_FUNC_rl(cirrusvga_opaque, addr3);
}
}
if(vramWndAddr2 && (vramWndAddr2 != 0xE0000 || !(gdc.analog & ((1 << GDCANALOG_16) | (1 << GDCANALOG_256) | (1 << GDCANALOG_256E))))){
UINT32 addr2 = address;
if((vramWndAddr2 & 0xfff00000UL) == 0){
UINT32 addrtmp = addr2 & 0xfff80000UL;
if(addrtmp == 0xfff80000UL || addrtmp == 0x00f80000UL){
// XXX: 0xFFFA0000 - 0xFFFFFFFF or 0xFA0000 - 0xFFFFFF
addr2 = addr2 & 0xfffff;
}
}
if((addr2 & CIRRUS_VRAMWINDOW2MASK) == vramWndAddr2){
return CIRRUS_VRAMWND2_FUNC_rl(cirrusvga_opaque, addr2);
}
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
return(memfn0.rd32[address >> 15](address));
@ -799,6 +874,50 @@ void MEMCALL memp_write8(UINT32 address, REG8 value) {
mem[address] = (UINT8)value;
}
else {
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
UINT32 vramWndAddr = np2clvga.VRAMWindowAddr;
UINT32 vramWndAddr2 = np2clvga.VRAMWindowAddr2;
UINT32 vramWndAddr3 = np2clvga.VRAMWindowAddr3;
if(vramWndAddr){
if(vramWndAddr <= address){
if(address < vramWndAddr + VRAMWINDOW_SIZE){
g_cirrus_linear_write[0](cirrusvga_opaque, address, value);
return;
}else if(address < vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address >= vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT){
g_cirrus_linear_write[0](cirrusvga_opaque, address, value);
return;
}
}
}
}
if(vramWndAddr3){
UINT32 addr3 = address;
if(vramWndAddr3 <= addr3 && addr3 < vramWndAddr3 + VRA3WINDOW_SIZEX){
CIRRUS_VRAMWND3_FUNC_wb(cirrusvga_opaque, addr3, value);
TRACEOUT(("mem (write8): %x", address));
if(!(gdc.analog & ((1 << GDCANALOG_256) | (1 << GDCANALOG_256E))))
return;
}
}
if(vramWndAddr2){
UINT32 addr2 = address;
if((vramWndAddr2 & 0xfff00000UL) == 0){
UINT32 addrtmp = addr2 & 0xfff80000UL;
if(addrtmp == 0xfff80000UL || addrtmp == 0x00f80000UL){
// XXX: 0xFFFA0000 - 0xFFFFFFFF or 0xFA0000 - 0xFFFFFF
addr2 = addr2 & 0xfffff;
}
}
if((addr2 & CIRRUS_VRAMWINDOW2MASK) == vramWndAddr2){
CIRRUS_VRAMWND2_FUNC_wb(cirrusvga_opaque, addr2, value);
//if((vramWndAddr2 != 0xE0000 || !(gdc.analog & ((1 << GDCANALOG_16) | (1 << GDCANALOG_256) | (1 << GDCANALOG_256E)))) && !(gdc.display & (1 << GDCDISP_31)))
// return;
}
}
}
#endif
// 強制RAM化
if ((address >= 0xa5000) && (address < 0xa7fff)) {
if (CPU_RAM_D000 & (1 << ((address >> 12) & 15))) {
@ -850,6 +969,50 @@ void MEMCALL memp_write16(UINT32 address, REG16 value) {
}
else{
if ((address + 1) & 0x7fff) { // non 32kb boundary
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
UINT32 vramWndAddr = np2clvga.VRAMWindowAddr;
UINT32 vramWndAddr2 = np2clvga.VRAMWindowAddr2;
UINT32 vramWndAddr3 = np2clvga.VRAMWindowAddr3;
if(vramWndAddr){
if(vramWndAddr <= address){
if(address < vramWndAddr + VRAMWINDOW_SIZE){
g_cirrus_linear_write[1](cirrusvga_opaque, address, value);
return;
}else if(address < vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address >= vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT){
g_cirrus_linear_write[1](cirrusvga_opaque, address, value);
return;
}
}
}
}
if(vramWndAddr3){
UINT32 addr3 = address;
if(vramWndAddr3 <= addr3 && addr3 < vramWndAddr3 + VRA3WINDOW_SIZEX){
CIRRUS_VRAMWND3_FUNC_ww(cirrusvga_opaque, addr3, value);
TRACEOUT(("mem (write16): %x", address));
if(!(gdc.analog & ((1 << GDCANALOG_256) | (1 << GDCANALOG_256E))))
return;
}
}
if(vramWndAddr2){
UINT32 addr2 = address;
if((vramWndAddr2 & 0xfff00000UL) == 0){
UINT32 addrtmp = addr2 & 0xfff80000UL;
if(addrtmp == 0xfff80000UL || addrtmp == 0x00f80000UL){
// XXX: 0xFFFA0000 - 0xFFFFFFFF or 0xFA0000 - 0xFFFFFF
addr2 = addr2 & 0xfffff;
}
}
if((addr2 & CIRRUS_VRAMWINDOW2MASK) == vramWndAddr2){
CIRRUS_VRAMWND2_FUNC_ww(cirrusvga_opaque, addr2, value);
//if((vramWndAddr2 != 0xE0000 || !(gdc.analog & ((1 << GDCANALOG_16) | (1 << GDCANALOG_256) | (1 << GDCANALOG_256E)))) && !(gdc.display & (1 << GDCDISP_31)))
// return;
}
}
}
#endif
// 強制RAM化
if ((address >= 0xa5000) && (address < 0xa7fff)) {
@ -924,6 +1087,50 @@ void MEMCALL memp_write32(UINT32 address, UINT32 value) {
}
else{
if ((address + 1) & 0x7fff) { // non 32kb boundary
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
UINT32 vramWndAddr = np2clvga.VRAMWindowAddr;
UINT32 vramWndAddr2 = np2clvga.VRAMWindowAddr2;
UINT32 vramWndAddr3 = np2clvga.VRAMWindowAddr3;
if(vramWndAddr){
if(vramWndAddr <= address){
if(address < vramWndAddr + VRAMWINDOW_SIZE){
g_cirrus_linear_write[2](cirrusvga_opaque, address, value);
return;
}else if(address < vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SIZE){
if(address >= vramWndAddr + VRAMWINDOW_SIZE + EXT_WINDOW_SHFT){
g_cirrus_linear_write[2](cirrusvga_opaque, address, value);
return;
}
}
}
}
if(vramWndAddr3){
UINT32 addr3 = address;
if(vramWndAddr3 <= addr3 && addr3 < vramWndAddr3 + VRA3WINDOW_SIZEX){
CIRRUS_VRAMWND3_FUNC_wl(cirrusvga_opaque, addr3, value);
TRACEOUT(("mem (write32): %x", address));
if(!(gdc.analog & ((1 << GDCANALOG_256) | (1 << GDCANALOG_256E))))
return;
}
}
if(vramWndAddr2){
UINT32 addr2 = address;
if((vramWndAddr2 & 0xfff00000UL) == 0){
UINT32 addrtmp = addr2 & 0xfff80000UL;
if(addrtmp == 0xfff80000UL || addrtmp == 0x00f80000UL){
// XXX: 0xFFFA0000 - 0xFFFFFFFF or 0xFA0000 - 0xFFFFFF
addr2 = addr2 & 0xfffff;
}
}
if((addr2 & CIRRUS_VRAMWINDOW2MASK) == vramWndAddr2){
CIRRUS_VRAMWND2_FUNC_wl(cirrusvga_opaque, addr2, value);
//if((vramWndAddr2 != 0xE0000 || !(gdc.analog & ((1 << GDCANALOG_16) | (1 << GDCANALOG_256) | (1 << GDCANALOG_256E)))) && !(gdc.display & (1 << GDCDISP_31)))
// return;
}
}
}
#endif
address = address & CPU_ADRSMASK;
if (address < USE_HIMEM) {
memfn0.wr32[address >> 15](address, value);

View File

@ -10,6 +10,12 @@
#include "iocore16.tbl"
#ifdef SUPPORT_LGY98
#include "lgy98.h"
#endif
#ifdef SUPPORT_WAB
#include "wab.h"
#endif
#ifdef SUPPORT_CL_GD5430
#include "cirrus_vga_extern.h"
#endif
@ -577,6 +583,25 @@ void IOOUTCALL iocore_out16(UINT port, REG16 dat) {
lgy98_ob200_16(port, dat);
return;
}
#endif
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
if(np2clvga.gd54xxtype == CIRRUS_98ID_WAB || np2clvga.gd54xxtype == CIRRUS_98ID_WSN || np2clvga.gd54xxtype == CIRRUS_98ID_WSN_A2F || np2clvga.gd54xxtype == CIRRUS_98ID_GA98NB){
if(pc98_cirrus_isWABport(port)){
cirrusvga_ioport_write_wrap16(port, (UINT16)dat);
return;
}
}else if(np2clvga.gd54xxtype <= 0xff){
if(port == 0xc44){
if(dat == 0xffff){
np2clvga.VRAMWindowAddr3 = 0;
}else{
np2clvga.VRAMWindowAddr3 = ((UINT32)dat) << 16;
}
return;
}
}
}
#endif
if ((port & 0xfff1) == 0x04a0) {
egc_w16(port, dat);
@ -618,6 +643,19 @@ REG16 IOINPCALL iocore_inp16(UINT port) {
if (lgy98cfg.enabled && port == lgy98cfg.baseaddr + 0x200) {
return(lgy98_ib200_16(port));
}
#endif
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
if(np2clvga.gd54xxtype == CIRRUS_98ID_WAB || np2clvga.gd54xxtype == CIRRUS_98ID_WSN || np2clvga.gd54xxtype == CIRRUS_98ID_WSN_A2F || np2clvga.gd54xxtype == CIRRUS_98ID_GA98NB){
if(pc98_cirrus_isWABport(port)){
return(cirrusvga_ioport_read_wrap16(port));
}
}else if(np2clvga.gd54xxtype <= 0xff){
if(port == 0xc44){
return(np2clvga.VRAMWindowAddr3 >> 16);
}
}
}
#endif
if ((port & 0xfffc) == 0x005c) {
return(artic_r16(port));
@ -658,6 +696,16 @@ void IOOUTCALL iocore_out32(UINT port, UINT32 dat) {
pcidev_w32(port, dat);
return;
}
#endif
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
if(np2clvga.gd54xxtype == CIRRUS_98ID_WAB || np2clvga.gd54xxtype == CIRRUS_98ID_WSN || np2clvga.gd54xxtype == CIRRUS_98ID_WSN_A2F || np2clvga.gd54xxtype == CIRRUS_98ID_GA98NB){
if(pc98_cirrus_isWABport(port)){
cirrusvga_ioport_write_wrap32(port, (UINT32)dat);
return;
}
}
}
#endif
iocore_out16(port, (UINT16)dat);
iocore_out16(port+2, (UINT16)(dat >> 16));
@ -672,6 +720,15 @@ UINT32 IOINPCALL iocore_inp32(UINT port) {
if ((port & 0xfffb) == 0x0cf8) {
return(pcidev_r32(port));
}
#endif
#if defined(SUPPORT_CL_GD5430)
if(np2clvga.enabled && cirrusvga_opaque){
if(np2clvga.gd54xxtype == CIRRUS_98ID_WAB || np2clvga.gd54xxtype == CIRRUS_98ID_WSN || np2clvga.gd54xxtype == CIRRUS_98ID_WSN_A2F || np2clvga.gd54xxtype == CIRRUS_98ID_GA98NB){
if(pc98_cirrus_isWABport(port)){
return(cirrusvga_ioport_read_wrap32(port));
}
}
}
#endif
ret = iocore_inp16(port);
return(ret + (iocore_inp16(port+2) << 16));

View File

@ -49,6 +49,12 @@
#include "timing.h"
#include "keystat.h"
#include "debugsub.h"
#if defined(SUPPORT_WAB)
#include "wab.h"
#endif
#if defined(SUPPORT_CL_GD5430)
#include "cirrus_vga_extern.h"
#endif
#if defined(SUPPORT_HRTIMER)
#include "upd4990.h"
#endif /* SUPPORT_HRTIMER */
@ -87,13 +93,7 @@ const OEMCHAR np2version[] = OEMTEXT(NP2VER_CORE);
OEMTEXT("VX"), PCBASECLOCK25, PCBASEMULTIPLE, 1,
{0x48, 0x05, 0x04, 0x00, 0x01, 0x00, 0x00, 0x6e},
1, 3,
#if defined(SUPPORT_PC9821)
3,
#else /* SUPPORT_PC9821 */
2,
#endif /* SUPPORT_PC9821 */
1, 0x000000, 0xffffff,
1, 13, 2, 1, 0x000000, 0xffffff,
44100, 150, 4, 0,
{0, 0, 0}, 0xd1, 0x7f, 0xd1, 0, 0, 1,
@ -132,6 +132,12 @@ const OEMCHAR np2version[] = OEMTEXT(NP2VER_CORE);
#if defined(SUPPORT_LGY98)
0, 0x10D0, 5, {0x00, 0x40, 0x26, 0x12, 0x34, 0x56},
#endif
#if defined(SUPPORT_WAB)
0,
#endif
#if defined(SUPPORT_CL_GD5430)
0, 0x5B, 0,
#endif
#if defined(SUPPORT_STATSAVE)
0, /* statsave */
#endif
@ -644,6 +650,18 @@ static void drawscreen(void) {
if (!pcstat.drawframe) {
return;
}
#ifdef SUPPORT_WAB
if(np2wab.relay & 0x3){
if(!np2wabcfg.multiwindow){
pcstat.screenupdate = scrndraw_draw((UINT8)(pcstat.screenupdate & 2));
drawcount++;
return;
}else{
pcstat.screenupdate = 1;
drawcount++;
}
}
#endif
if ((gdcs.textdisp & GDCSCRN_EXT) || (gdcs.grphdisp & GDCSCRN_EXT)) {
if (dispsync_renewalvertical()) {
gdcs.textdisp |= GDCSCRN_ALLDRAW2;
@ -832,6 +850,13 @@ void pccore_exec(BOOL draw) {
pic_irq();
if (CPU_RESETREQ) {
CPU_RESETREQ = 0;
#if defined(SUPPORT_WAB)
np2wab.relaystateint = np2wab.relaystateext = 0;
np2wab_setRelayState(0); // XXX:
#endif
#if defined(SUPPORT_CL_GD5430)
np2clvga.gd54xxtype = np2clvga.defgd54xxtype; // Auto Select用
#endif
#if defined(SUPPORT_IDEIO)
ideio_reset(&np2cfg); // XXX: Win9xの再起動で必要
#endif

View File

@ -207,6 +207,14 @@ struct tagNP2Config
UINT8 lgy98irq;
UINT8 lgy98mac[6];
#endif
#ifdef SUPPORT_WAB
UINT8 wabasw;
#endif
#ifdef SUPPORT_CL_GD5430
UINT8 usegd5430;
UINT16 gd5430type;
UINT8 gd5430fakecur;
#endif
#if defined(SUPPORT_STATSAVE)
UINT8 statsave;

View File

@ -657,6 +657,14 @@ static const INITBL iniitem[] = {
{"LGY98_IO", INITYPE_UINT16, &np2cfg.lgy98io, 0},
{"LGY98IRQ", INITYPE_UINT8, &np2cfg.lgy98irq, 0},
{"LGY98MAC", INITYPE_ARGH8, np2cfg.lgy98mac, 6},
#endif
#if defined(SUPPORT_WAB)
{"WAB_ANSW", INITYPE_UINT8, &np2cfg.wabasw, 0},
#endif
#if defined(SUPPORT_CL_GD5430)
{"USE_CLGD", INITYPE_BOOL, &np2cfg.usegd5430, 0},
{"CLGDTYPE", INITYPE_UINT16, &np2cfg.gd5430type, 0},
{"CLGDFCUR", INITYPE_BOOL, &np2cfg.gd5430fakecur, 0},
#endif
{"TIMERFIX", INITYPE_BOOL, &np2cfg.timerfix, 0},

View File

@ -39,6 +39,12 @@
#include "calendar.h"
#include "keystat.h"
#include "bmsio.h"
#if defined(SUPPORT_WAB)
#include "wab.h"
#endif
#if defined(SUPPORT_CL_GD5430)
#include "cirrus_vga_extern.h"
#endif
#if defined(SUPPORT_NET)
#include "net.h"
#endif
@ -1258,6 +1264,10 @@ const SFENTRY *tblterm;
if (sffh == NULL) {
return(STATFLAG_FAILURE);
}
#if defined(SUPPORT_CL_GD5430)
pc98_cirrus_vga_save();
#endif
ret = STATFLAG_SUCCESS;
tbl = np2tbl;
@ -1557,6 +1567,13 @@ const SFENTRY *tblterm;
#if defined(SUPPORT_LGY98)
lgy98_bind();
#endif
#if defined(SUPPORT_WAB)
np2wab_bind();
#endif
#if defined(SUPPORT_CL_GD5430)
pc98_cirrus_vga_bind();
pc98_cirrus_vga_load();
#endif
gdcs.textdisp |= GDCSCRN_EXT;
gdcs.textdisp |= GDCSCRN_ALLDRAW2;
@ -1572,6 +1589,16 @@ const SFENTRY *tblterm;
MEMM_VRAM(vramop.operate);
fddmtr_reset();
soundmng_play();
#if defined(SUPPORT_WAB)
np2wab.relay = 0;
np2wab_setRelayState(np2wab.relaystateint|np2wab.relaystateext);
np2wab.realWidth = np2wab.wndWidth; // XXX: ???
np2wab.realHeight = np2wab.wndHeight; // XXX: ???
np2wab.lastWidth = 0;
np2wab.lastHeight = 0;
np2wab_setScreenSize(np2wab.wndWidth, np2wab.wndHeight);
#endif
return(ret);
}

View File

@ -1,5 +1,5 @@
#define NP2STATUS_VERSION 850
#define NP2STATUS_VERSION 10850
static const NP2FHDR np2flagdef = {
"Neko Project II",
@ -149,6 +149,14 @@ static const SFENTRY np2tbl[] = {
{"LGY98", 0, STATFLAG_BIN, &lgy98, sizeof(lgy98)},
{"LGY98CFG", 0, STATFLAG_BIN, &lgy98cfg, sizeof(lgy98cfg)},
#endif
#if defined(SUPPORT_WAB)
{"WAB", 0, STATFLAG_BIN, &np2wab, sizeof(np2wab)},
{"WABCFG", 0, STATFLAG_BIN, &np2wabcfg, sizeof(np2wabcfg)},
#endif
#if defined(SUPPORT_CL_GD5430)
{"NP2CLVGA", 0, STATFLAG_BIN, &np2clvga, sizeof(np2clvga)},
{"CLVGA", 0, STATFLAG_BIN, cirrusvga_statsavebuf, sizeof(cirrusvga_statsavebuf)},
#endif
#if defined(SUPPORT_HOSTDRV)
{"HOSTDRV", 0, STATFLAG_HDRV, NULL, 0},
#endif

View File

@ -6,6 +6,9 @@
#include "sdraw.h"
#include "dispsync.h"
#include "palettes.h"
#ifdef SUPPORT_WAB
#include "wab/wab.h"
#endif
UINT8 renewal_line[SURFACE_HEIGHT];
@ -145,6 +148,17 @@ const SDRAWFN *sdrawfn;
}
ret = 0;
#ifdef SUPPORT_WAB
if(np2wab.relay & 0x3){
np2wab_drawframe();
if(!np2wabwnd.multiwindow){
// XXX: ウィンドウアクセラレータ動作中は内蔵グラフィックを描画しない
scrnmng_update();
ret = 1;
return(ret);
}
}
#endif
surf = scrnmng_surflock();
if (surf == NULL) {
goto sddr_exit1;

View File

@ -606,9 +606,9 @@ static const PFTBL s_IniItems[] =
PFVAL("WAB_ANSW", PFTYPE_UINT8, &np2cfg.wabasw),
#endif
#if defined(SUPPORT_CL_GD5430)
PFVAL("USEGD5430", PFTYPE_BOOL, &np2cfg.usegd5430),
PFVAL("GD5430TYPE",PFTYPE_UINT16, &np2cfg.gd5430type),
PFVAL("GD5430FCUR",PFTYPE_BOOL, &np2cfg.gd5430fakecur),
PFVAL("USE_CLGD", PFTYPE_BOOL, &np2cfg.usegd5430),
PFVAL("CLGDTYPE", PFTYPE_UINT16, &np2cfg.gd5430type),
PFVAL("CLGDFCUR", PFTYPE_BOOL, &np2cfg.gd5430fakecur),
#endif
PFMAX("DAVOLUME", PFTYPE_UINT8, &np2cfg.davolume, 255),

442
x11/gtk2/dialog_wab.c Normal file
View File

@ -0,0 +1,442 @@
#include "compiler.h"
#include "gtk2/xnp2.h"
#include "gtk2/gtk_menu.h"
#include "np2.h"
#include "dosio.h"
#include "ini.h"
#include "pccore.h"
#include "iocore.h"
#include "sysmng.h"
#include "wab.h"
#if defined(SUPPORT_CL_GD5430)
#include "cirrus_vga_extern.h"
#endif /* SUPPORT_CL_GD5430 */
#if defined(SUPPORT_WAB)
/*
* General
*/
static GtkWidget *wab_useanalogswitchic_checkbutton;
static GtkWidget *wab_multiwindow_checkbutton;
static GtkWidget *wab_multithread_checkbutton;
#if defined(SUPPORT_CL_GD5430)
/*
* CL_GD54xx
*/
static const char *cl_gd54xx_type_str[] = {
"PC-9821Bp,Bs,Be,Bf built-in",
"PC-9821Xe built-in",
"PC-9821Cb built-in",
"PC-9821Cf built-in",
"PC-9821Xe10,Xa7e,Xb10 built-in",
"PC-9821Cb2 built-in",
"PC-9821Cx2 built-in",
"MELCO WAB-S",
"MELCO WSN-A2F",
"MELCO WSN-A4F",
"I-O DATA GA-98NBI/C,II,IV",
"PC-9801-96(PC-9801B3-E02)",
"Auto Select(Xe10, WAB-S)",
"Auto Select(Xe10, WSN-A2F)",
"Auto Select(Xe10, WSN-A4F)",
};
static GtkWidget *cl_gd54xx_en_checkbutton;
static GtkWidget *cl_gd54xx_usefakehardwarecursor_checkbutton;
static GtkWidget *cl_gd54xx_type_entry;
#endif /* SUPPORT_CL_GD5430 */
static void
ok_button_clicked(GtkButton *b, gpointer d)
{
/* General */
gint wab_useanalogswitchic;
gint wab_multiwindow;
gint wab_multithread;
#if defined(SUPPORT_CL_GD5430)
/* CL_GD54xx */
gint cl_gd54xx_en;
gint cl_gd54xx_usefakehardwarecursor;
const gchar *cl_gd54xx_type;
#endif /* SUPPORT_CL_GD5430 */
/* common */
int i;
int temp;
BOOL renewal = FALSE;
/* General */
wab_useanalogswitchic = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(wab_useanalogswitchic_checkbutton));
wab_multiwindow = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(wab_multiwindow_checkbutton));
wab_multithread = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(wab_multithread_checkbutton));
#if defined(SUPPORT_CL_GD5430)
/* CL_GD54xx */
cl_gd54xx_en = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(cl_gd54xx_en_checkbutton));
cl_gd54xx_usefakehardwarecursor = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(cl_gd54xx_usefakehardwarecursor_checkbutton));
cl_gd54xx_type = gtk_entry_get_text(GTK_ENTRY(cl_gd54xx_type_entry));
#endif /* SUPPORT_CL_GD5430 */
if (np2cfg.wabasw != wab_useanalogswitchic) {
np2cfg.wabasw = wab_useanalogswitchic;
renewal = TRUE;
}
if (np2wabcfg.multiwindow != wab_multiwindow) {
np2wabcfg.multiwindow = wab_multiwindow;
renewal = TRUE;
}
if (np2wabcfg.multithread != wab_multithread) {
np2wabcfg.multithread = wab_multithread;
renewal = TRUE;
}
#if defined(SUPPORT_CL_GD5430)
if (np2cfg.usegd5430 != cl_gd54xx_en) {
np2cfg.usegd5430 = cl_gd54xx_en;
renewal = TRUE;
}
if (np2cfg.gd5430fakecur != cl_gd54xx_usefakehardwarecursor) {
np2cfg.gd5430fakecur = cl_gd54xx_usefakehardwarecursor;
renewal = TRUE;
}
for (i = 0; i < NELEMENTS(cl_gd54xx_type_str); i++) {
if (strcmp(cl_gd54xx_type, cl_gd54xx_type_str[i]) == 0) {
switch (i) {
case 0:
if(np2cfg.gd5430type != CIRRUS_98ID_Be) {
np2cfg.gd5430type = CIRRUS_98ID_Be;
renewal = TRUE;
}
break;
case 1:
if(np2cfg.gd5430type != CIRRUS_98ID_Xe) {
np2cfg.gd5430type = CIRRUS_98ID_Xe;
renewal = TRUE;
}
break;
case 2:
if(np2cfg.gd5430type != CIRRUS_98ID_Cb) {
np2cfg.gd5430type = CIRRUS_98ID_Cb;
renewal = TRUE;
}
break;
case 3:
if(np2cfg.gd5430type != CIRRUS_98ID_Cf) {
np2cfg.gd5430type = CIRRUS_98ID_Cf;
renewal = TRUE;
}
break;
case 4:
if(np2cfg.gd5430type != CIRRUS_98ID_Xe10) {
np2cfg.gd5430type = CIRRUS_98ID_Xe10;
renewal = TRUE;
}
break;
case 5:
if(np2cfg.gd5430type != CIRRUS_98ID_Cb2) {
np2cfg.gd5430type = CIRRUS_98ID_Cb2;
renewal = TRUE;
}
break;
case 6:
if(np2cfg.gd5430type != CIRRUS_98ID_Cx2) {
np2cfg.gd5430type = CIRRUS_98ID_Cx2;
renewal = TRUE;
}
break;
case 7:
if(np2cfg.gd5430type != CIRRUS_98ID_WAB) {
np2cfg.gd5430type = CIRRUS_98ID_WAB;
renewal = TRUE;
}
break;
case 8:
if(np2cfg.gd5430type != CIRRUS_98ID_WSN_A2F) {
np2cfg.gd5430type = CIRRUS_98ID_WSN_A2F;
renewal = TRUE;
}
break;
case 9:
if(np2cfg.gd5430type != CIRRUS_98ID_WSN) {
np2cfg.gd5430type = CIRRUS_98ID_WSN;
renewal = TRUE;
}
break;
case 10:
if(np2cfg.gd5430type != CIRRUS_98ID_GA98NB) {
np2cfg.gd5430type = CIRRUS_98ID_GA98NB;
renewal = TRUE;
}
break;
case 11:
if(np2cfg.gd5430type != CIRRUS_98ID_96) {
np2cfg.gd5430type = CIRRUS_98ID_96;
renewal = TRUE;
}
break;
case 12:
if(np2cfg.gd5430type != CIRRUS_98ID_AUTO_XE10_WABS) {
np2cfg.gd5430type = CIRRUS_98ID_AUTO_XE10_WABS;
renewal = TRUE;
}
break;
case 13:
if(np2cfg.gd5430type != CIRRUS_98ID_AUTO_XE10_WSN2) {
np2cfg.gd5430type = CIRRUS_98ID_AUTO_XE10_WSN2;
renewal = TRUE;
}
break;
case 14:
if(np2cfg.gd5430type != CIRRUS_98ID_AUTO_XE10_WSN4) {
np2cfg.gd5430type = CIRRUS_98ID_AUTO_XE10_WSN4;
renewal = TRUE;
}
break;
}
break;
}
}
#endif /* SUPPORT_CL_GD5430 */
if (renewal) {
sysmng_update(renewal);
}
gtk_widget_destroy((GtkWidget *)d);
}
static void
dialog_destroy(GtkWidget *w, GtkWidget **wp)
{
install_idle_process();
gtk_widget_destroy(w);
}
static GtkWidget *
create_general_note(void)
{
GtkWidget *root_widget;
root_widget = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(root_widget), 5);
gtk_widget_show(root_widget);
/* Use Analog Switch IC */
wab_useanalogswitchic_checkbutton = gtk_check_button_new_with_label("Use Analog Switch IC (No relay sound)");
gtk_widget_show(wab_useanalogswitchic_checkbutton);
gtk_container_add(GTK_CONTAINER(root_widget), wab_useanalogswitchic_checkbutton);
if (np2cfg.wabasw)
g_signal_emit_by_name(G_OBJECT(wab_useanalogswitchic_checkbutton), "clicked");
/* Multi Window Mode */
wab_multiwindow_checkbutton = gtk_check_button_new_with_label("Multi Window Mode");
gtk_widget_show(wab_multiwindow_checkbutton);
gtk_container_add(GTK_CONTAINER(root_widget), wab_multiwindow_checkbutton);
if (np2wabcfg.multiwindow)
g_signal_emit_by_name(G_OBJECT(wab_multiwindow_checkbutton), "clicked");
/* Multi Thread Mode */
wab_multithread_checkbutton = gtk_check_button_new_with_label("Multi Thread Mode");
gtk_widget_show(wab_multithread_checkbutton);
gtk_container_add(GTK_CONTAINER(root_widget), wab_multithread_checkbutton);
if (np2wabcfg.multithread)
g_signal_emit_by_name(G_OBJECT(wab_multithread_checkbutton), "clicked");
return root_widget;
}
#if defined(SUPPORT_CL_GD5430)
static GtkWidget *
create_cl_gd54xx_note(void)
{
GtkWidget *root_widget;
GtkWidget *type_hbox;
GtkWidget *type_label;
GtkWidget *type_combo;
int i;
root_widget = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(root_widget), 5);
gtk_widget_show(root_widget);
/* Enabled */
cl_gd54xx_en_checkbutton = gtk_check_button_new_with_label("Enabled");
gtk_widget_show(cl_gd54xx_en_checkbutton);
gtk_container_add(GTK_CONTAINER(root_widget), cl_gd54xx_en_checkbutton);
if (np2cfg.usegd5430)
g_signal_emit_by_name(G_OBJECT(cl_gd54xx_en_checkbutton), "clicked");
/* Type */
type_hbox = gtk_hbox_new(FALSE, 0);
gtk_widget_show(type_hbox);
gtk_box_pack_start(GTK_BOX(root_widget), type_hbox, TRUE, TRUE, 0);
type_label = gtk_label_new("Type");
gtk_widget_show(type_label);
gtk_container_add(GTK_CONTAINER(type_hbox), type_label);
type_combo = gtk_combo_box_entry_new_text();
gtk_widget_show(type_combo);
gtk_container_add(GTK_CONTAINER(type_hbox), type_combo);
gtk_widget_set_size_request(type_combo, 300, -1);
for (i = 0; i < NELEMENTS(cl_gd54xx_type_str); i++) {
gtk_combo_box_append_text(GTK_COMBO_BOX(type_combo), cl_gd54xx_type_str[i]);
}
cl_gd54xx_type_entry = gtk_bin_get_child(GTK_BIN(type_combo));
gtk_widget_show(cl_gd54xx_type_entry);
gtk_editable_set_editable(GTK_EDITABLE(cl_gd54xx_type_entry), FALSE);
switch (np2cfg.gd5430type) {
case CIRRUS_98ID_Be:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[0]);
break;
case CIRRUS_98ID_Xe:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[1]);
break;
case CIRRUS_98ID_Cb:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[2]);
break;
case CIRRUS_98ID_Cf:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[3]);
break;
case CIRRUS_98ID_Xe10:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[4]);
break;
case CIRRUS_98ID_Cb2:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[5]);
break;
case CIRRUS_98ID_Cx2:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[6]);
break;
case CIRRUS_98ID_WAB:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[7]);
break;
case CIRRUS_98ID_WSN_A2F:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[8]);
break;
case CIRRUS_98ID_WSN:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[9]);
break;
case CIRRUS_98ID_GA98NB:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[10]);
break;
case CIRRUS_98ID_96:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[11]);
break;
case CIRRUS_98ID_AUTO_XE10_WABS:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[12]);
break;
case CIRRUS_98ID_AUTO_XE10_WSN2:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[13]);
break;
case CIRRUS_98ID_AUTO_XE10_WSN4:
gtk_entry_set_text(GTK_ENTRY(cl_gd54xx_type_entry), cl_gd54xx_type_str[14]);
break;
}
/* Use Fake Hardware Cursor */
cl_gd54xx_usefakehardwarecursor_checkbutton = gtk_check_button_new_with_label("Use Fake Hardware Cursor");
gtk_widget_show(cl_gd54xx_usefakehardwarecursor_checkbutton);
gtk_container_add(GTK_CONTAINER(root_widget), cl_gd54xx_usefakehardwarecursor_checkbutton);
if (np2cfg.gd5430fakecur)
g_signal_emit_by_name(G_OBJECT(cl_gd54xx_usefakehardwarecursor_checkbutton), "clicked");
return root_widget;
}
#endif /* defined(SUPPORT_CL_GD5430) */
void
create_wab_dialog(void)
{
GtkWidget *wab_dialog;
GtkWidget *main_vbox;
GtkWidget *notebook;
GtkWidget *general_note;
#if defined(SUPPORT_CL_GD5430)
GtkWidget *cl_gd5430_note;
#endif /* SUPPORT_CL_GD5430 */
GtkWidget *confirm_widget;
GtkWidget *ok_button;
GtkWidget *cancel_button;
uninstall_idle_process();
wab_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(wab_dialog), "Window Accelerator board option");
gtk_window_set_position(GTK_WINDOW(wab_dialog), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(wab_dialog), TRUE);
gtk_window_set_resizable(GTK_WINDOW(wab_dialog), FALSE);
g_signal_connect(G_OBJECT(wab_dialog), "destroy",
G_CALLBACK(dialog_destroy), NULL);
main_vbox = gtk_vbox_new(FALSE, 0);
gtk_widget_show(main_vbox);
gtk_container_add(GTK_CONTAINER(wab_dialog), main_vbox);
notebook = gtk_notebook_new();
gtk_widget_show(notebook);
gtk_box_pack_start(GTK_BOX(main_vbox), notebook, TRUE, TRUE, 0);
/* "General" note */
general_note = create_general_note();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), general_note, gtk_label_new("General"));
#if defined(SUPPORT_CL_GD5430)
/* "CL-CD54xx" note */
cl_gd5430_note = create_cl_gd54xx_note();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), cl_gd5430_note, gtk_label_new("CL-CD54xx"));
#endif /* SUPPORT_CL_GD5430 */
/*
* OK, Cancel button
*/
confirm_widget = gtk_hbox_new(FALSE, 5);
gtk_widget_show(confirm_widget);
gtk_box_pack_start(GTK_BOX(main_vbox), confirm_widget, FALSE, FALSE, 5);
cancel_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
gtk_widget_show(cancel_button);
gtk_box_pack_end(GTK_BOX(confirm_widget), cancel_button, FALSE, FALSE, 0);
#if GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18)
gtk_widget_set_can_default(cancel_button, TRUE);
#else
GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT);
#endif
g_signal_connect_swapped(G_OBJECT(cancel_button), "clicked",
G_CALLBACK(gtk_widget_destroy), G_OBJECT(wab_dialog));
ok_button = gtk_button_new_from_stock(GTK_STOCK_OK);
gtk_widget_show(ok_button);
gtk_box_pack_end(GTK_BOX(confirm_widget), ok_button, FALSE, FALSE, 0);
#if GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18)
gtk_widget_set_can_default(ok_button, TRUE);
gtk_widget_has_default(ok_button);
#else
GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT);
GTK_WIDGET_SET_FLAGS(ok_button, GTK_HAS_DEFAULT);
#endif
g_signal_connect(G_OBJECT(ok_button), "clicked",
G_CALLBACK(ok_button_clicked), (gpointer)wab_dialog);
gtk_widget_grab_default(ok_button);
gtk_widget_show_all(wab_dialog);
}
#endif

View File

@ -158,6 +158,9 @@ static GtkActionEntry menu_entries[] = {
#if defined(SUPPORT_NET)
{ "networkopt", NULL, "Network option...", NULL, NULL, G_CALLBACK(cb_dialog) },
#endif /* SUPPORT_NET */
#if defined(SUPPORT_WAB)
{ "wabopt", NULL, "Window Accelerator option...", NULL, NULL, G_CALLBACK(cb_dialog) },
#endif /* SUPPORT_WAB */
#if defined(SUPPORT_HOSTDRV)
{ "hostdrvopt", NULL, "Hostdrv option...", NULL, NULL, G_CALLBACK(cb_dialog) },
#endif /* SUPPORT_HOSTDRV */
@ -563,6 +566,10 @@ static const gchar *ui_info =
" <separator/>\n"
" <menuitem action='networkopt'/>\n"
#endif /* SUPPORT_NET */
#if defined(SUPPORT_WAB)
" <separator/>\n"
" <menuitem action='wabopt'/>\n"
#endif /* SUPPORT_WAB */
#if defined(SUPPORT_HOSTDRV)
" <separator/>\n"
" <menuitem action='hostdrvopt'/>\n"
@ -1457,6 +1464,10 @@ cb_dialog(GtkAction *action, gpointer user_data)
#endif /* SUPPORT_IDEIO */
} else if (g_ascii_strcasecmp(name, "soundopt") == 0) {
create_sound_dialog();
#if defined(SUPPORT_WAB)
} else if (g_ascii_strcasecmp(name, "wabopt") == 0) {
create_wab_dialog();
#endif /* SUPPORT_WAB */
#if defined(SUPPORT_NET)
} else if (g_ascii_strcasecmp(name, "networkopt") == 0) {
create_network_dialog();

View File

@ -660,9 +660,9 @@ static INITBL iniitem[] = {
{"WAB_ANSW", INITYPE_UINT8, &np2cfg.wabasw, 0},
#endif
#if defined(SUPPORT_CL_GD5430)
{"USEGD5430", INITYPE_BOOL, &np2cfg.usegd5430, 0},
{"GD5430TYPE", INITYPE_UINT16, &np2cfg.gd5430type, 0},
{"GD5430FCUR", INITYPE_BOOL, &np2cfg.gd5430fakecur, 0},
{"USE_CLGD", INITYPE_BOOL, &np2cfg.usegd5430, 0},
{"CLGDTYPE", INITYPE_UINT16, &np2cfg.gd5430type, 0},
{"CLGDFCUR", INITYPE_BOOL, &np2cfg.gd5430fakecur, 0},
#endif
{"TIMERFIX", INITYPE_BOOL, &np2cfg.timerfix, 0},

View File

@ -64,6 +64,13 @@
#if defined(SUPPORT_NET)
#include "net.h"
#endif
#if defined(SUPPORT_WAB)
#include "wab.h"
#include "wabbmpsave.h"
#endif
#if defined(SUPPORT_CL_GD5430)
#include "cirrus_vga_extern.h"
#endif
static const char appname[] =
@ -246,6 +253,12 @@ main(int argc, char *argv[])
toolwin_readini();
kdispwin_readini();
skbdwin_readini();
#if defined(SUPPORT_WAB)
wabwin_readini();
#endif // defined(SUPPORT_WAB)
#if defined(SUPPORT_HOSTDRV)
hostdrv_readini();
#endif // defined(SUPPORT_HOSTDRV)
rand_setseed((SINT32)time(NULL));
@ -293,6 +306,14 @@ main(int argc, char *argv[])
if (result == SUCCESS) {
soundmng_pcmvolume(SOUND_PCMSEEK1, np2cfg.MOTORVOL);
}
result = soundmng_pcmload(SOUND_RELAY1, file_getcd("relay1.wav"));
if (result != SUCCESS) {
result = soundmng_pcmload(SOUND_RELAY1, SYSRESPATH "/relay1.wav");
}
if (result == SUCCESS) {
soundmng_pcmvolume(SOUND_RELAY1, np2cfg.MOTORVOL);
}
}
joymng_initialize();
@ -310,6 +331,12 @@ main(int argc, char *argv[])
#if defined(SUPPORT_NET)
np2net_init();
#endif
#ifdef SUPPORT_WAB
np2wab_init();
#endif
#ifdef SUPPORT_CL_GD5430
pc98_cirrus_vga_init();
#endif
toolkit_widget_show();
scrndraw_redraw();
@ -366,6 +393,12 @@ main(int argc, char *argv[])
#if defined(SUPPORT_NET)
np2net_shutdown();
#endif
#ifdef SUPPORT_CL_GD5430
pc98_cirrus_vga_shutdown();
#endif
#ifdef SUPPORT_WAB
np2wab_shutdown();
#endif
pccore_term();
debugwin_destroy();
@ -385,6 +418,12 @@ fontmng_failure:
skbdwin_writeini();
}
#if defined(SUPPORT_HOSTDRV)
hostdrv_writeini();
#endif // defined(SUPPORT_HOSTDRV)
#if defined(SUPPORT_WAB)
wabwin_writeini();
#endif // defined(SUPPORT_WAB)
skbdwin_deinitialize();
#if defined(USE_SDLAUDIO) || defined(USE_SDLMIXER)

BIN
x11/resources/relay1.wav Normal file

Binary file not shown.

View File

@ -6,6 +6,7 @@ G_BEGIN_DECLS
enum {
SOUND_PCMSEEK,
SOUND_PCMSEEK1,
SOUND_RELAY1,
SOUND_MAXPCM
};