trunk/src/mess/includes/cbm2.h
| r18074 | r18075 | |
| 90 | 90 | DECLARE_MACHINE_START( cbm2_pal ); |
| 91 | 91 | DECLARE_MACHINE_RESET( cbm2 ); |
| 92 | 92 | |
| 93 | virtual void read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4); |
| 94 | |
| 93 | 95 | void bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen, |
| 94 | 96 | int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs, |
| 95 | 97 | int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs, |
| r18074 | r18075 | |
| 113 | 115 | |
| 114 | 116 | DECLARE_WRITE8_MEMBER( tpi2_pa_w ); |
| 115 | 117 | DECLARE_WRITE8_MEMBER( tpi2_pb_w ); |
| 118 | DECLARE_READ8_MEMBER( tpi2_pc_r ); |
| 116 | 119 | |
| 117 | 120 | DECLARE_READ8_MEMBER( cia_pa_r ); |
| 118 | 121 | DECLARE_WRITE8_MEMBER( cia_pa_w ); |
| r18074 | r18075 | |
| 151 | 154 | }; |
| 152 | 155 | |
| 153 | 156 | |
| 157 | class cbm2hp_state : public cbm2_state |
| 158 | { |
| 159 | public: |
| 160 | cbm2hp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 161 | : cbm2_state(mconfig, type, tag) |
| 162 | { } |
| 163 | |
| 164 | virtual void read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4); |
| 165 | |
| 166 | DECLARE_READ8_MEMBER( tpi2_pc_r ); |
| 167 | }; |
| 168 | |
| 169 | |
| 154 | 170 | class p500_state : public cbm2_state |
| 155 | 171 | { |
| 156 | 172 | public: |
| r18074 | r18075 | |
| 203 | 219 | }; |
| 204 | 220 | |
| 205 | 221 | |
| 206 | | class cbm2lp_state : public cbm2_state |
| 207 | | { |
| 208 | | public: |
| 209 | | cbm2lp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 210 | | : cbm2_state(mconfig, type, tag) |
| 211 | | { } |
| 212 | 222 | |
| 213 | | DECLARE_READ8_MEMBER( tpi2_pc_r ); |
| 214 | | }; |
| 215 | | |
| 216 | | |
| 217 | | class cbm2hp_state : public cbm2_state |
| 218 | | { |
| 219 | | public: |
| 220 | | cbm2hp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 221 | | : cbm2_state(mconfig, type, tag) |
| 222 | | { } |
| 223 | | |
| 224 | | DECLARE_READ8_MEMBER( tpi2_pc_r ); |
| 225 | | }; |
| 226 | | |
| 227 | | |
| 228 | | |
| 229 | 223 | #endif |
trunk/src/mess/drivers/cbm2.c
| r18074 | r18075 | |
| 39 | 39 | //************************************************************************** |
| 40 | 40 | |
| 41 | 41 | //------------------------------------------------- |
| 42 | | // bankswitch - |
| 42 | // read_pla - |
| 43 | 43 | //------------------------------------------------- |
| 44 | 44 | |
| 45 | | void cbm2_state::bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen, |
| 46 | | int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs, |
| 47 | | int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs, |
| 48 | | int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs) |
| 45 | void cbm2_state::read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4) |
| 49 | 46 | { |
| 50 | 47 | UINT32 input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6; |
| 51 | 48 | UINT32 data = m_pla1->read(input); |
| r18074 | r18075 | |
| 58 | 55 | *casseg4 = BIT(data, 5); |
| 59 | 56 | *casseg3 = BIT(data, 6); |
| 60 | 57 | //*rasseg3 = BIT(data, 7); |
| 58 | } |
| 61 | 59 | |
| 60 | void cbm2hp_state::read_pla(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *casseg1, int *casseg2, int *casseg3, int *casseg4) |
| 61 | { |
| 62 | UINT32 input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0; |
| 63 | UINT32 data = m_pla1->read(input); |
| 64 | |
| 65 | *casseg1 = BIT(data, 0); |
| 66 | *casseg2 = BIT(data, 1); |
| 67 | *casseg3 = BIT(data, 2); |
| 68 | *casseg4 = BIT(data, 3); |
| 69 | //*rasseg1 = BIT(data, 4); |
| 70 | //*rasseg2 = BIT(data, 5); |
| 71 | //*rasseg3 = BIT(data, 6); |
| 72 | //*rasseg4 = BIT(data, 7); |
| 73 | } |
| 74 | |
| 75 | |
| 76 | //------------------------------------------------- |
| 77 | // bankswitch - |
| 78 | //------------------------------------------------- |
| 79 | |
| 80 | void cbm2_state::bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen, |
| 81 | int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs, |
| 82 | int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs, |
| 83 | int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs) |
| 84 | { |
| 85 | //this->read_pla(offset, busy2, eras, ecas, refen, cas, ras, casseg1, casseg2, casseg3, casseg4); |
| 86 | |
| 87 | switch (offset >> 16) |
| 88 | { |
| 89 | case 1: *casseg1 = 0; break; |
| 90 | case 2: *casseg2 = 0; break; |
| 91 | case 3: *casseg3 = 0; break; |
| 92 | case 4: *casseg4 = 0; break; |
| 93 | } |
| 94 | |
| 62 | 95 | int busen1 = m_dramon; |
| 63 | 96 | int decoden = 0; // TODO |
| 64 | 97 | *sysioen = !(P0 && P1 && P2 && P3) && busen1; |
| r18074 | r18075 | |
| 415 | 448 | */ |
| 416 | 449 | UINT8 data = 0xff; |
| 417 | 450 | |
| 418 | | if (ae) |
| 419 | | { |
| 420 | | data = m_vic->bus_r(); |
| 421 | | } |
| 422 | | |
| 423 | 451 | if (aec && !datxen && !_64kcasen) |
| 424 | 452 | { |
| 425 | 453 | data = m_ram->pointer()[offset & 0xffff]; |
| r18074 | r18075 | |
| 1257 | 1285 | m_tpi2_pb = data; |
| 1258 | 1286 | } |
| 1259 | 1287 | |
| 1260 | | READ8_MEMBER( cbm2lp_state::tpi2_pc_r ) |
| 1288 | READ8_MEMBER( cbm2_state::tpi2_pc_r ) |
| 1261 | 1289 | { |
| 1262 | 1290 | /* |
| 1263 | 1291 | |
| r18074 | r18075 | |
| 1344 | 1372 | DEVCB_DRIVER_MEMBER(cbm2_state, tpi2_pa_w), |
| 1345 | 1373 | DEVCB_NULL, |
| 1346 | 1374 | DEVCB_DRIVER_MEMBER(cbm2_state, tpi2_pb_w), |
| 1347 | | DEVCB_DRIVER_MEMBER(cbm2lp_state, tpi2_pc_r), |
| 1375 | DEVCB_DRIVER_MEMBER(cbm2_state, tpi2_pc_r), |
| 1348 | 1376 | DEVCB_NULL, |
| 1349 | 1377 | DEVCB_NULL, |
| 1350 | 1378 | DEVCB_NULL |
| r18074 | r18075 | |
| 1729 | 1757 | // MACHINE_CONFIG( cbm2lp_ntsc ) |
| 1730 | 1758 | //------------------------------------------------- |
| 1731 | 1759 | |
| 1732 | | static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2lp_state ) |
| 1760 | static MACHINE_CONFIG_START( cbm2lp_ntsc, cbm2_state ) |
| 1733 | 1761 | MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_ntsc) |
| 1734 | 1762 | MCFG_MACHINE_RESET_OVERRIDE(cbm2_state, cbm2) |
| 1735 | 1763 | |
| r18074 | r18075 | |
| 1780 | 1808 | // MACHINE_CONFIG( b128 ) |
| 1781 | 1809 | //------------------------------------------------- |
| 1782 | 1810 | |
| 1783 | | static MACHINE_CONFIG_START( b128, cbm2lp_state ) |
| 1811 | static MACHINE_CONFIG_START( b128, cbm2_state ) |
| 1784 | 1812 | MCFG_FRAGMENT_ADD(cbm2lp_ntsc) |
| 1785 | 1813 | MCFG_FRAGMENT_ADD(128k) |
| 1786 | 1814 | MACHINE_CONFIG_END |
| r18074 | r18075 | |
| 1790 | 1818 | // MACHINE_CONFIG( b256 ) |
| 1791 | 1819 | //------------------------------------------------- |
| 1792 | 1820 | |
| 1793 | | static MACHINE_CONFIG_START( b256, cbm2lp_state ) |
| 1821 | static MACHINE_CONFIG_START( b256, cbm2_state ) |
| 1794 | 1822 | MCFG_FRAGMENT_ADD(cbm2lp_ntsc) |
| 1795 | 1823 | MCFG_FRAGMENT_ADD(256k) |
| 1796 | 1824 | MACHINE_CONFIG_END |
| r18074 | r18075 | |
| 1800 | 1828 | // MACHINE_CONFIG( cbm2lp_pal ) |
| 1801 | 1829 | //------------------------------------------------- |
| 1802 | 1830 | |
| 1803 | | static MACHINE_CONFIG_START( cbm2lp_pal, cbm2lp_state ) |
| 1831 | static MACHINE_CONFIG_START( cbm2lp_pal, cbm2_state ) |
| 1804 | 1832 | MCFG_FRAGMENT_ADD(cbm2lp_ntsc) |
| 1805 | 1833 | |
| 1806 | 1834 | MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal) |
| r18074 | r18075 | |
| 1814 | 1842 | // MACHINE_CONFIG( cbm610 ) |
| 1815 | 1843 | //------------------------------------------------- |
| 1816 | 1844 | |
| 1817 | | static MACHINE_CONFIG_START( cbm610, cbm2lp_state ) |
| 1845 | static MACHINE_CONFIG_START( cbm610, cbm2_state ) |
| 1818 | 1846 | MCFG_FRAGMENT_ADD(cbm2lp_pal) |
| 1819 | 1847 | MCFG_FRAGMENT_ADD(128k) |
| 1820 | 1848 | MACHINE_CONFIG_END |
| r18074 | r18075 | |
| 1824 | 1852 | // MACHINE_CONFIG( cbm620 ) |
| 1825 | 1853 | //------------------------------------------------- |
| 1826 | 1854 | |
| 1827 | | static MACHINE_CONFIG_START( cbm620, cbm2lp_state ) |
| 1855 | static MACHINE_CONFIG_START( cbm620, cbm2_state ) |
| 1828 | 1856 | MCFG_FRAGMENT_ADD(cbm2lp_pal) |
| 1829 | 1857 | MCFG_FRAGMENT_ADD(256k) |
| 1830 | 1858 | MACHINE_CONFIG_END |