|
|
| version 1.1.1.1, 2003/10/16 17:58:01 | version 1.3, 2004/01/05 09:31:25 |
|---|---|
| Line 7 | Line 7 |
| #include "fmboard.h" | #include "fmboard.h" |
| static void IOOUTCALL csctrl_oc24(UINT port, BYTE dat) { | static void IOOUTCALL csctrl_oc24(UINT port, REG8 dat) { |
| cs4231.portctrl = dat; | cs4231.portctrl = dat; |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL csctrl_oc2b(UINT port, BYTE dat) { | static void IOOUTCALL csctrl_oc2b(UINT port, REG8 dat) { |
| if ((cs4231.portctrl & 0x2f) == 0x20) { | if ((cs4231.portctrl & 0x2f) == 0x20) { |
| cs4231.port &= 0xff00; | cs4231.port &= 0xff00; |
| Line 22 static void IOOUTCALL csctrl_oc2b(UINT p | Line 22 static void IOOUTCALL csctrl_oc2b(UINT p |
| (void)port; | (void)port; |
| } | } |
| static void IOOUTCALL csctrl_oc2d(UINT port, BYTE dat) { | static void IOOUTCALL csctrl_oc2d(UINT port, REG8 dat) { |
| if ((cs4231.portctrl & 0x2f) == 0x20) { | if ((cs4231.portctrl & 0x2f) == 0x20) { |
| cs4231.port &= 0x00ff; | cs4231.port &= 0x00ff; |
| Line 31 static void IOOUTCALL csctrl_oc2d(UINT p | Line 31 static void IOOUTCALL csctrl_oc2d(UINT p |
| (void)port; | (void)port; |
| } | } |
| static BYTE IOINPCALL csctrl_ic24(UINT port) { | static REG8 IOINPCALL csctrl_ic24(UINT port) { |
| (void)port; | (void)port; |
| return(0x80 | cs4231.portctrl); | return(0x80 | cs4231.portctrl); |
| } | } |
| static BYTE IOINPCALL csctrl_ic2b(UINT port) { | static REG8 IOINPCALL csctrl_ic2b(UINT port) { |
| switch(cs4231.portctrl & 0x0f) { | switch(cs4231.portctrl & 0x0f) { |
| case 0x00: | case 0x00: |
| Line 53 static BYTE IOINPCALL csctrl_ic2b(UINT p | Line 53 static BYTE IOINPCALL csctrl_ic2b(UINT p |
| return(0xff); | return(0xff); |
| } | } |
| static BYTE IOINPCALL csctrl_ic2d(UINT port) { | static REG8 IOINPCALL csctrl_ic2d(UINT port) { |
| switch(cs4231.portctrl & 0x0f) { | switch(cs4231.portctrl & 0x0f) { |
| case 0x00: | case 0x00: |
| Line 74 static BYTE IOINPCALL csctrl_ic2d(UINT p | Line 74 static BYTE IOINPCALL csctrl_ic2d(UINT p |
| void cs4231io_reset(void) { | void cs4231io_reset(void) { |
| cs4231.enable = 0; | |
| cs4231.port = 0xffff; | |
| } | |
| void cs4231io_bind(void) { | |
| cs4231.enable = 1; | cs4231.enable = 1; |
| cs4231.port = 0xf40; | cs4231.port = 0xf40; |
| cs4231.adrs = 0x21; | cs4231.adrs = 0x21; |
| cs4231.dmach = 0; | cs4231.dmach = 0; |
| cs4231.dmairq = 0x0c; | cs4231.dmairq = 0x0c; |
| cs4231.step = 22050; | cs4231.step = 22050; |
| sound_streamregist(&cs4231, (SOUNDCB)cs4231_getpcm); | dmac_attach(DMADEV_CS4231, 0); |
| } | |
| void cs4231io_bind(void) { | |
| sound_streamregist(&cs4231, (SOUNDCB)cs4231_getpcm); | |
| iocore_attachout(0xc24, csctrl_oc24); | iocore_attachout(0xc24, csctrl_oc24); |
| iocore_attachout(0xc2b, csctrl_oc2b); | iocore_attachout(0xc2b, csctrl_oc2b); |
| iocore_attachout(0xc2d, csctrl_oc2d); | iocore_attachout(0xc2d, csctrl_oc2d); |
| Line 96 void cs4231io_bind(void) { | Line 94 void cs4231io_bind(void) { |
| iocore_attachinp(0xc2d, csctrl_ic2d); | iocore_attachinp(0xc2d, csctrl_ic2d); |
| } | } |
| void IOOUTCALL cs4231io_w8(UINT port, BYTE value) { | void IOOUTCALL cs4231io_w8(UINT port, REG8 value) { |
| switch(port & 0x0f) { | switch(port & 0x0f) { |
| case 0: | case 0: |
| Line 121 void IOOUTCALL cs4231io_w8(UINT port, BY | Line 119 void IOOUTCALL cs4231io_w8(UINT port, BY |
| } | } |
| } | } |
| BYTE IOINPCALL cs4231io_r8(UINT port) { | REG8 IOINPCALL cs4231io_r8(UINT port) { |
| switch(port & 0x0f) { | switch(port & 0x0f) { |
| case 0: | case 0: |