trunk/src/mess/drivers/c64.c
| r20547 | r20548 | |
| 644 | 644 | |
| 645 | 645 | // keyboard |
| 646 | 646 | UINT8 cia1_pa = m_cia1->pa_r(); |
| 647 | | UINT8 row[8] = { m_row0->read(), m_row1->read() & m_lock->read(), m_row2->read(), m_row3->read(), |
| 648 | | m_row4->read(), m_row5->read(), m_row6->read(), m_row7->read() }; |
| 649 | 647 | |
| 650 | | if (!BIT(cia1_pa, 7)) data &= row[7]; |
| 651 | | if (!BIT(cia1_pa, 6)) data &= row[6]; |
| 652 | | if (!BIT(cia1_pa, 5)) data &= row[5]; |
| 653 | | if (!BIT(cia1_pa, 4)) data &= row[4]; |
| 654 | | if (!BIT(cia1_pa, 3)) data &= row[3]; |
| 655 | | if (!BIT(cia1_pa, 2)) data &= row[2]; |
| 656 | | if (!BIT(cia1_pa, 1)) data &= row[1]; |
| 657 | | if (!BIT(cia1_pa, 0)) data &= row[0]; |
| 648 | if (!BIT(cia1_pa, 7)) data &= m_row7->read(); |
| 649 | if (!BIT(cia1_pa, 6)) data &= m_row6->read(); |
| 650 | if (!BIT(cia1_pa, 5)) data &= m_row5->read(); |
| 651 | if (!BIT(cia1_pa, 4)) data &= m_row4->read(); |
| 652 | if (!BIT(cia1_pa, 3)) data &= m_row3->read(); |
| 653 | if (!BIT(cia1_pa, 2)) data &= m_row2->read(); |
| 654 | if (!BIT(cia1_pa, 1)) data &= m_row1->read() & m_lock->read(); |
| 655 | if (!BIT(cia1_pa, 0)) data &= m_row0->read(); |
| 658 | 656 | |
| 659 | 657 | return data; |
| 660 | 658 | } |
trunk/src/mess/drivers/c128.c
| r20547 | r20548 | |
| 3 | 3 | TODO: |
| 4 | 4 | |
| 5 | 5 | - connect CAPS LOCK to charom A12 on international variants |
| 6 | | - remove frame interrupt handler |
| 7 | 6 | - expansion DMA |
| 8 | 7 | |
| 9 | 8 | */ |
| r20547 | r20548 | |
| 161 | 160 | if (!rom1) |
| 162 | 161 | { |
| 163 | 162 | // CR: data = m_rom1[(ms3 << 14) | ((BIT(ta, 14) && BIT(offset, 13)) << 13) | (ta & 0x1000) | (offset & 0xfff)]; |
| 164 | | data = m_rom1[((BIT(ta, 14) && BIT(offset, 13)) << 13) | (ta & 0x1000) | (offset & 0xfff)]; |
| 163 | data = m_rom->base()[((BIT(ta, 14) && BIT(offset, 13)) << 13) | (ta & 0x1000) | (offset & 0xfff)]; |
| 165 | 164 | } |
| 166 | 165 | if (!rom2) |
| 167 | 166 | { |
| 168 | | data = m_rom2[offset & 0x3fff]; |
| 167 | data = m_rom->base()[0x4000 | (offset & 0x3fff)]; |
| 169 | 168 | } |
| 170 | 169 | if (!rom3) |
| 171 | 170 | { |
| 172 | 171 | // CR: data = m_rom3[(BIT(offset, 15) << 14) | (offset & 0x3fff)]; |
| 173 | | data = m_rom3[offset & 0x3fff]; |
| 172 | data = m_rom->base()[0x8000 | (offset & 0x3fff)]; |
| 174 | 173 | } |
| 175 | 174 | if (!rom4) |
| 176 | 175 | { |
| 177 | | data = m_rom4[(ta & 0x1000) | (offset & 0x2fff)]; |
| 176 | data = m_rom->base()[0xc000 | (ta & 0x1000) | (offset & 0x2fff)]; |
| 178 | 177 | } |
| 179 | 178 | if (!charom) |
| 180 | 179 | { |
| 181 | | data = m_charom[(ms3 << 12) | (ta & 0xf00) | sa]; |
| 180 | data = m_charom->base()[(ms3 << 12) | (ta & 0xf00) | sa]; |
| 182 | 181 | } |
| 183 | 182 | if (!colorram && aec) |
| 184 | 183 | { |
| r20547 | r20548 | |
| 190 | 189 | } |
| 191 | 190 | if (!from1) |
| 192 | 191 | { |
| 193 | | data = m_from[offset & 0x7fff]; |
| 192 | data = m_from->base()[offset & 0x7fff]; |
| 194 | 193 | } |
| 195 | 194 | if (!iocs && BIT(offset, 10)) |
| 196 | 195 | { |
| r20547 | r20548 | |
| 1066 | 1065 | |
| 1067 | 1066 | // keyboard |
| 1068 | 1067 | UINT8 cia1_pa = m_cia1->pa_r(); |
| 1069 | | UINT8 row[8] = { m_row0->read(), m_row1->read() & m_lock->read(), m_row2->read(), m_row3->read(), |
| 1070 | | m_row4->read(), m_row5->read(), m_row6->read(), m_row7->read() }; |
| 1071 | 1068 | |
| 1072 | | if (!BIT(cia1_pa, 7)) data &= row[7]; |
| 1073 | | if (!BIT(cia1_pa, 6)) data &= row[6]; |
| 1074 | | if (!BIT(cia1_pa, 5)) data &= row[5]; |
| 1075 | | if (!BIT(cia1_pa, 4)) data &= row[4]; |
| 1076 | | if (!BIT(cia1_pa, 3)) data &= row[3]; |
| 1077 | | if (!BIT(cia1_pa, 2)) data &= row[2]; |
| 1078 | | if (!BIT(cia1_pa, 1)) data &= row[1]; |
| 1079 | | if (!BIT(cia1_pa, 0)) data &= row[0]; |
| 1069 | if (!BIT(cia1_pa, 7)) data &= m_row7->read(); |
| 1070 | if (!BIT(cia1_pa, 6)) data &= m_row6->read(); |
| 1071 | if (!BIT(cia1_pa, 5)) data &= m_row5->read(); |
| 1072 | if (!BIT(cia1_pa, 4)) data &= m_row4->read(); |
| 1073 | if (!BIT(cia1_pa, 3)) data &= m_row3->read(); |
| 1074 | if (!BIT(cia1_pa, 2)) data &= m_row2->read(); |
| 1075 | if (!BIT(cia1_pa, 1)) data &= m_row1->read() & m_lock->read(); |
| 1076 | if (!BIT(cia1_pa, 0)) data &= m_row0->read(); |
| 1080 | 1077 | |
| 1081 | 1078 | if (!BIT(m_vic_k, 0)) data &= m_k0->read(); |
| 1082 | 1079 | if (!BIT(m_vic_k, 1)) data &= m_k1->read(); |
| r20547 | r20548 | |
| 1433 | 1430 | |
| 1434 | 1431 | void c128_state::machine_start() |
| 1435 | 1432 | { |
| 1436 | | cbm_common_init(); |
| 1437 | | |
| 1438 | | // find memory regions |
| 1439 | | m_rom1 = memregion(M8502_TAG)->base(); |
| 1440 | | m_rom2 = m_rom1 + 0x4000; |
| 1441 | | m_rom3 = m_rom1 + 0x8000; |
| 1442 | | m_rom4 = m_rom1 + 0xc000; |
| 1443 | | m_from = memregion("from")->base(); |
| 1444 | | m_charom = memregion("charom")->base(); |
| 1445 | | |
| 1446 | 1433 | // allocate memory |
| 1447 | 1434 | m_color_ram.allocate(0x800); |
| 1448 | 1435 | |
trunk/src/mess/includes/c128.h
| r20547 | r20548 | |
| 57 | 57 | m_user(*this, C64_USER_PORT_TAG), |
| 58 | 58 | m_ram(*this, RAM_TAG), |
| 59 | 59 | m_cassette(*this, PET_DATASSETTE_PORT_TAG), |
| 60 | m_rom(*this, M8502_TAG), |
| 61 | m_from(*this, "from"), |
| 62 | m_charom(*this, "charom"), |
| 63 | m_color_ram(*this, "color_ram"), |
| 60 | 64 | m_row0(*this, "ROW0"), |
| 61 | 65 | m_row1(*this, "ROW1"), |
| 62 | 66 | m_row2(*this, "ROW2"), |
| r20547 | r20548 | |
| 78 | 82 | m_charen(1), |
| 79 | 83 | m_game(1), |
| 80 | 84 | m_exrom(1), |
| 81 | | m_rom1(NULL), |
| 82 | | m_rom2(NULL), |
| 83 | | m_rom3(NULL), |
| 84 | | m_rom4(NULL), |
| 85 | | m_from(NULL), |
| 86 | | m_charom(NULL), |
| 87 | | m_color_ram(*this, "color_ram"), |
| 88 | 85 | m_va14(1), |
| 89 | 86 | m_va15(1), |
| 90 | 87 | m_clrbank(0), |
| r20547 | r20548 | |
| 118 | 115 | required_device<c64_user_port_device> m_user; |
| 119 | 116 | required_device<ram_device> m_ram; |
| 120 | 117 | required_device<pet_datassette_port_device> m_cassette; |
| 118 | required_memory_region m_rom; |
| 119 | required_memory_region m_from; |
| 120 | required_memory_region m_charom; |
| 121 | optional_shared_ptr<UINT8> m_color_ram; |
| 121 | 122 | required_ioport m_row0; |
| 122 | 123 | required_ioport m_row1; |
| 123 | 124 | required_ioport m_row2; |
| r20547 | r20548 | |
| 203 | 204 | int m_game; |
| 204 | 205 | int m_exrom; |
| 205 | 206 | int m_reset; |
| 206 | | const UINT8 *m_rom1; |
| 207 | | const UINT8 *m_rom2; |
| 208 | | const UINT8 *m_rom3; |
| 209 | | const UINT8 *m_rom4; |
| 210 | | const UINT8 *m_from; |
| 211 | | const UINT8 *m_charom; |
| 212 | 207 | |
| 213 | 208 | // video state |
| 214 | | optional_shared_ptr<UINT8> m_color_ram; |
| 215 | 209 | int m_va14; |
| 216 | 210 | int m_va15; |
| 217 | 211 | int m_clrbank; |