|
|
| version 1.1, 2003/10/16 17:57:50 | version 1.4, 2004/02/07 07:53:44 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "sysmng.h" | #include "sysmng.h" |
| #include "i286.h" | #include "cpucore.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "sound.h" | |
| #include "beep.h" | |
| void IOOUTCALL dipsw_w8(UINT port, BYTE value) { | void IOOUTCALL dipsw_w8(UINT port, REG8 value) { |
| BYTE set; | BYTE set; |
| UINT update; | UINT update; |
| Line 14 void IOOUTCALL dipsw_w8(UINT port, BYTE | Line 16 void IOOUTCALL dipsw_w8(UINT port, BYTE |
| switch(port & 0x0f00) { | switch(port & 0x0f00) { |
| case 0x0400: | case 0x0400: |
| if (!(iflags[value] & 0x04)) { | if (!(iflags[value] & 0x04)) { |
| set = (value ^ 0x04) & 0xbc; | set = value & 0xfc; |
| if ((np2cfg.dipsw[0] ^ set) & 0xbc) { | if ((np2cfg.dipsw[0] ^ set) & 0xfc) { |
| np2cfg.dipsw[0] &= ~(0xbc); | np2cfg.dipsw[0] &= ~(0xfc); |
| np2cfg.dipsw[0] |= set; | np2cfg.dipsw[0] |= set; |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| } | } |
| Line 25 void IOOUTCALL dipsw_w8(UINT port, BYTE | Line 27 void IOOUTCALL dipsw_w8(UINT port, BYTE |
| case 0x0500: | case 0x0500: |
| if (!(iflags[value] & 0x04)) { | if (!(iflags[value] & 0x04)) { |
| set = value & 0xaf; | set = value & 0xef; |
| if ((np2cfg.dipsw[1] ^ set) & 0xaf) { | if ((np2cfg.dipsw[1] ^ set) & 0xef) { |
| np2cfg.dipsw[1] &= ~(0xaf); | np2cfg.dipsw[1] &= ~(0xef); |
| np2cfg.dipsw[1] |= set; | np2cfg.dipsw[1] |= set; |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| } | } |
| Line 36 void IOOUTCALL dipsw_w8(UINT port, BYTE | Line 38 void IOOUTCALL dipsw_w8(UINT port, BYTE |
| case 0x0600: | case 0x0600: |
| if (!(iflags[value] & 0x04)) { | if (!(iflags[value] & 0x04)) { |
| set = (value ^ 0x08) & 0x3f; | set = value & 0x7f; |
| if ((np2cfg.dipsw[2] ^ set) & 0x3f) { | if ((np2cfg.dipsw[2] ^ set) & 0x7f) { |
| np2cfg.dipsw[2] &= ~(0x3f); | np2cfg.dipsw[2] &= ~(0x7f); |
| np2cfg.dipsw[2] |= set; | np2cfg.dipsw[2] |= set; |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| } | } |
| Line 55 void IOOUTCALL dipsw_w8(UINT port, BYTE | Line 57 void IOOUTCALL dipsw_w8(UINT port, BYTE |
| set = (value >> 2) & 0x03; | set = (value >> 2) & 0x03; |
| if (np2cfg.BEEP_VOL != set) { | if (np2cfg.BEEP_VOL != set) { |
| np2cfg.BEEP_VOL = set; | np2cfg.BEEP_VOL = set; |
| beep_setvol(set); | |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| } | } |
| } | } |
| Line 73 void IOOUTCALL dipsw_w8(UINT port, BYTE | Line 76 void IOOUTCALL dipsw_w8(UINT port, BYTE |
| sysmng_update(update); | sysmng_update(update); |
| } | } |
| BYTE IOINPCALL dipsw_r8(UINT port) { | REG8 IOINPCALL dipsw_r8(UINT port) { |
| BYTE ret = 0xff; | REG8 ret; |
| ret = 0xff; | |
| switch(port & 0x0f00) { | switch(port & 0x0f00) { |
| case 0x0400: | case 0x0400: |
| ret = (np2cfg.dipsw[0] ^ 0x04) & 0xbc; | ret = np2cfg.dipsw[0] & 0xfc; |
| if (iflags[ret] & 0x04) { | if (iflags[ret] & 0x04) { |
| ret |= 0x01; | ret |= 0x01; |
| } | } |
| break; | break; |
| case 0x0500: | case 0x0500: |
| ret = np2cfg.dipsw[1] & 0xaf; | ret = np2cfg.dipsw[1] & 0xef; |
| if (iflags[ret] & 0x04) { | if (iflags[ret] & 0x04) { |
| ret |= 0x10; | ret |= 0x10; |
| } | } |
| break; | break; |
| case 0x0600: | case 0x0600: |
| ret = (np2cfg.dipsw[2] ^ 0x02) & 0x33; | ret = np2cfg.dipsw[2] & 0x7f; |
| if (iflags[ret] & 0x04) { | if (iflags[ret] & 0x04) { |
| ret |= 0x80; | ret |= 0x80; |
| } | } |