trunk/src/mess/includes/abc80x.h
| r20554 | r20555 | |
| 78 | 78 | m_discrete(*this, "discrete"), |
| 79 | 79 | m_cassette(*this, CASSETTE_TAG), |
| 80 | 80 | m_ram(*this, RAM_TAG), |
| 81 | m_rom(*this, Z80_TAG), |
| 81 | 82 | m_video_ram(*this, "video_ram"), |
| 82 | 83 | m_char_ram(*this, "char_ram"), |
| 83 | 84 | m_ctc_z0(0), |
| r20554 | r20555 | |
| 96 | 97 | optional_device<discrete_sound_device> m_discrete; |
| 97 | 98 | optional_device<cassette_image_device> m_cassette; |
| 98 | 99 | required_device<ram_device> m_ram; |
| 100 | required_memory_region m_rom; |
| 101 | optional_shared_ptr<UINT8> m_video_ram; |
| 102 | optional_shared_ptr<UINT8> m_char_ram; |
| 99 | 103 | |
| 100 | 104 | enum |
| 101 | 105 | { |
| r20554 | r20555 | |
| 133 | 137 | int m_fetch_charram; // opcode fetched from character RAM region (0x7800-0x7fff) |
| 134 | 138 | |
| 135 | 139 | // video state |
| 136 | | optional_shared_ptr<UINT8> m_video_ram; |
| 137 | | optional_shared_ptr<UINT8> m_char_ram; |
| 138 | | const UINT8 *m_char_rom; // character generator ROM |
| 139 | | const UINT8 *m_fgctl_prom; // foreground control PROM |
| 140 | 140 | UINT8 m_hrs; // HR picture start scanline |
| 141 | 141 | UINT8 m_fgctl; // HR foreground control |
| 142 | 142 | |
| r20554 | r20555 | |
| 165 | 165 | public: |
| 166 | 166 | abc800m_state(const machine_config &mconfig, device_type type, const char *tag) |
| 167 | 167 | : abc800_state(mconfig, type, tag), |
| 168 | | m_crtc(*this, MC6845_TAG) |
| 168 | m_crtc(*this, MC6845_TAG), |
| 169 | m_fgctl_prom(*this, "hru2"), |
| 170 | m_char_rom(*this, MC6845_TAG) |
| 169 | 171 | { } |
| 170 | 172 | |
| 171 | 173 | required_device<mc6845_device> m_crtc; |
| 174 | required_memory_region m_fgctl_prom; |
| 175 | required_memory_region m_char_rom; |
| 172 | 176 | |
| 173 | 177 | DECLARE_DRIVER_INIT(driver_init); |
| 174 | 178 | |
| r20554 | r20555 | |
| 184 | 188 | public: |
| 185 | 189 | abc800c_state(const machine_config &mconfig, device_type type, const char *tag) |
| 186 | 190 | : abc800_state(mconfig, type, tag), |
| 187 | | m_trom(*this, SAA5052_TAG) |
| 191 | m_trom(*this, SAA5052_TAG), |
| 192 | m_fgctl_prom(*this, "hru2") |
| 188 | 193 | { } |
| 189 | 194 | |
| 190 | 195 | required_device<saa5052_device> m_trom; |
| 196 | required_memory_region m_fgctl_prom; |
| 191 | 197 | |
| 192 | 198 | DECLARE_DRIVER_INIT(driver_init); |
| 193 | 199 | |
| r20554 | r20555 | |
| 208 | 214 | abc802_state(const machine_config &mconfig, device_type type, const char *tag) |
| 209 | 215 | : abc800_state(mconfig, type, tag), |
| 210 | 216 | m_crtc(*this, MC6845_TAG), |
| 211 | | m_abc77(*this, ABC77_TAG) |
| 217 | m_abc77(*this, ABC77_TAG), |
| 218 | m_char_rom(*this, MC6845_TAG) |
| 212 | 219 | { } |
| 213 | 220 | |
| 214 | 221 | required_device<mc6845_device> m_crtc; |
| 215 | 222 | optional_device<abc77_device> m_abc77; |
| 223 | required_memory_region m_char_rom; |
| 216 | 224 | |
| 217 | 225 | DECLARE_DRIVER_INIT(driver_init); |
| 218 | 226 | virtual void machine_start(); |
| r20554 | r20555 | |
| 233 | 241 | int m_lrs; // low RAM select |
| 234 | 242 | |
| 235 | 243 | // video state |
| 236 | | const UINT8 *m_char_rom; // character generator ROM |
| 237 | | |
| 238 | 244 | int m_flshclk_ctr; // flash clock counter |
| 239 | 245 | int m_flshclk; // flash clock |
| 240 | 246 | int m_80_40_mux; // 40/80 column mode |
| r20554 | r20555 | |
| 250 | 256 | : abc800_state(mconfig, type, tag), |
| 251 | 257 | m_crtc(*this, MC6845_TAG), |
| 252 | 258 | m_rtc(*this, E0516_TAG), |
| 253 | | m_abc77(*this, ABC77_TAG) |
| 259 | m_abc77(*this, ABC77_TAG), |
| 260 | m_rad_prom(*this, "rad"), |
| 261 | m_hru2_prom(*this, "hru"), |
| 262 | m_char_rom(*this, MC6845_TAG) |
| 254 | 263 | { } |
| 255 | 264 | |
| 256 | 265 | required_device<mc6845_device> m_crtc; |
| 257 | 266 | required_device<e0516_device> m_rtc; |
| 258 | 267 | optional_device<abc77_device> m_abc77; |
| 268 | required_memory_region m_rad_prom; |
| 269 | required_memory_region m_hru2_prom; |
| 270 | required_memory_region m_char_rom; |
| 259 | 271 | |
| 260 | 272 | DECLARE_DRIVER_INIT(driver_init); |
| 261 | 273 | virtual void machine_start(); |
| r20554 | r20555 | |
| 292 | 304 | |
| 293 | 305 | // video state |
| 294 | 306 | UINT8 *m_color_ram; // attribute RAM |
| 295 | | const UINT8 *m_rad_prom; // line address PROM |
| 296 | | const UINT8 *m_hru2_prom; // HR palette PROM |
| 297 | | const UINT8 *m_char_rom; // character generator ROM |
| 298 | 307 | |
| 299 | 308 | int m_txoff; // text display enable |
| 300 | 309 | int m_40; // 40/80 column mode |
trunk/src/mess/includes/cbm2.h
| r20554 | r20555 | |
| 70 | 70 | m_ram(*this, RAM_TAG), |
| 71 | 71 | m_cassette(*this, PET_DATASSETTE_PORT_TAG), |
| 72 | 72 | m_ieee(*this, IEEE488_TAG), |
| 73 | m_ext_cpu(*this, EXT_I8088_TAG), |
| 74 | m_ext_pic(*this, EXT_I8259A_TAG), |
| 75 | m_ext_cia(*this, EXT_MOS6526_TAG), |
| 76 | m_ext_tpi(*this, EXT_MOS6525_TAG), |
| 77 | m_basic(*this, "basic"), |
| 78 | m_kernal(*this, "kernal"), |
| 79 | m_charom(*this, "charom"), |
| 80 | m_buffer_ram(*this, "buffer_ram"), |
| 81 | m_extbuf_ram(*this, "extbuf_ram"), |
| 82 | m_video_ram(*this, "video_ram"), |
| 73 | 83 | m_pa0(*this, "PA0"), |
| 74 | 84 | m_pa1(*this, "PA1"), |
| 75 | 85 | m_pa2(*this, "PA2"), |
| r20554 | r20555 | |
| 87 | 97 | m_pb6(*this, "PB6"), |
| 88 | 98 | m_pb7(*this, "PB7"), |
| 89 | 99 | m_lock(*this, "LOCK"), |
| 90 | | m_ext_cpu(*this, EXT_I8088_TAG), |
| 91 | | m_ext_pic(*this, EXT_I8259A_TAG), |
| 92 | | m_ext_cia(*this, EXT_MOS6526_TAG), |
| 93 | | m_ext_tpi(*this, EXT_MOS6525_TAG), |
| 94 | | m_buffer_ram(*this, "buffer_ram"), |
| 95 | | m_extbuf_ram(*this, "extbuf_ram"), |
| 96 | 100 | m_dramon(1), |
| 97 | | m_video_ram(*this, "video_ram"), |
| 98 | 101 | m_video_ram_size(0x800), |
| 99 | 102 | m_graphics(1), |
| 100 | 103 | m_todclk(0), |
| r20554 | r20555 | |
| 122 | 125 | required_device<ram_device> m_ram; |
| 123 | 126 | required_device<pet_datassette_port_device> m_cassette; |
| 124 | 127 | required_device<ieee488_device> m_ieee; |
| 128 | optional_device<cpu_device> m_ext_cpu; |
| 129 | optional_device<pic8259_device> m_ext_pic; |
| 130 | optional_device<mos6526_device> m_ext_cia; |
| 131 | optional_device<tpi6525_device> m_ext_tpi; |
| 132 | required_memory_region m_basic; |
| 133 | required_memory_region m_kernal; |
| 134 | required_memory_region m_charom; |
| 135 | optional_shared_ptr<UINT8> m_buffer_ram; |
| 136 | optional_shared_ptr<UINT8> m_extbuf_ram; |
| 137 | optional_shared_ptr<UINT8> m_video_ram; |
| 125 | 138 | required_ioport m_pa0; |
| 126 | 139 | required_ioport m_pa1; |
| 127 | 140 | required_ioport m_pa2; |
| r20554 | r20555 | |
| 140 | 153 | required_ioport m_pb7; |
| 141 | 154 | required_ioport m_lock; |
| 142 | 155 | |
| 143 | | optional_device<cpu_device> m_ext_cpu; |
| 144 | | optional_device<pic8259_device> m_ext_pic; |
| 145 | | optional_device<mos6526_device> m_ext_cia; |
| 146 | | optional_device<tpi6525_device> m_ext_tpi; |
| 147 | | |
| 148 | 156 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 149 | 157 | |
| 150 | 158 | DECLARE_MACHINE_START( cbm2 ); |
| r20554 | r20555 | |
| 199 | 207 | DECLARE_WRITE8_MEMBER( ext_cia_pb_w ); |
| 200 | 208 | |
| 201 | 209 | // memory state |
| 202 | | optional_shared_ptr<UINT8> m_buffer_ram; |
| 203 | | optional_shared_ptr<UINT8> m_extbuf_ram; |
| 204 | | UINT8 *m_basic; |
| 205 | | UINT8 *m_kernal; |
| 206 | | UINT8 *m_charom; |
| 207 | 210 | int m_dramon; |
| 208 | 211 | int m_busen1; |
| 209 | 212 | int m_busy2; |
| 210 | 213 | |
| 211 | 214 | // video state |
| 212 | | optional_shared_ptr<UINT8> m_video_ram; |
| 213 | 215 | size_t m_video_ram_size; |
| 214 | 216 | int m_graphics; |
| 215 | 217 | int m_ntsc; |
| r20554 | r20555 | |
| 261 | 263 | |
| 262 | 264 | required_device<pls100_device> m_pla2; |
| 263 | 265 | required_device<mos6566_device> m_vic; |
| 266 | optional_shared_ptr<UINT8> m_color_ram; |
| 264 | 267 | |
| 265 | 268 | DECLARE_MACHINE_START( p500 ); |
| 266 | 269 | DECLARE_MACHINE_START( p500_ntsc ); |
| r20554 | r20555 | |
| 297 | 300 | DECLARE_WRITE8_MEMBER( tpi2_pc_w ); |
| 298 | 301 | |
| 299 | 302 | // video state |
| 300 | | optional_shared_ptr<UINT8> m_color_ram; |
| 301 | 303 | int m_statvid; |
| 302 | 304 | int m_vicdotsel; |
| 303 | 305 | int m_vicbnksel; |
trunk/src/mess/video/abc806.c
| r20554 | r20555 | |
| 140 | 140 | */ |
| 141 | 141 | |
| 142 | 142 | UINT16 hru2_addr = (m_hru2_a8 << 8) | (offset >> 8); |
| 143 | | UINT8 data = m_hru2_prom[hru2_addr] & 0x0f; |
| 143 | UINT8 data = m_hru2_prom->base()[hru2_addr] & 0x0f; |
| 144 | 144 | |
| 145 | 145 | logerror("HRU II %03x : %01x\n", hru2_addr, data); |
| 146 | 146 | |
| r20554 | r20555 | |
| 314 | 314 | else |
| 315 | 315 | { |
| 316 | 316 | rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 5) | (state->m_flshclk << 4) | ra; |
| 317 | | rad_data = state->m_rad_prom[rad_addr] & 0x0f; |
| 317 | rad_data = state->m_rad_prom->base()[rad_addr] & 0x0f; |
| 318 | 318 | |
| 319 | 319 | rad_data = ra; // HACK because the RAD prom is not dumped yet |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | UINT16 chargen_addr = (th << 12) | (data << 4) | rad_data; |
| 323 | | UINT8 chargen_data = state->m_char_rom[chargen_addr & 0xfff] << 2; |
| 323 | UINT8 chargen_data = state->m_char_rom->base()[chargen_addr & 0xfff] << 2; |
| 324 | 324 | int x = HORIZONTAL_PORCH_HACK + (column + 4) * ABC800_CHAR_WIDTH; |
| 325 | 325 | |
| 326 | 326 | for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++) |
| r20554 | r20555 | |
| 473 | 473 | m_vsync = 1; |
| 474 | 474 | m_40 = 1; |
| 475 | 475 | |
| 476 | | // find memory regions |
| 477 | | m_char_rom = memregion(MC6845_TAG)->base(); |
| 478 | | m_rad_prom = memregion("rad")->base(); |
| 479 | | m_hru2_prom = memregion("hru2")->base(); |
| 480 | | |
| 481 | 476 | // allocate memory |
| 482 | 477 | m_char_ram.allocate(ABC806_CHAR_RAM_SIZE); |
| 483 | 478 | m_color_ram = auto_alloc_array(machine(), UINT8, ABC806_ATTR_RAM_SIZE); |
trunk/src/mess/video/abc800.c
| r20554 | r20555 | |
| 94 | 94 | for (int dot = 0; dot < 4; dot++) |
| 95 | 95 | { |
| 96 | 96 | UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); |
| 97 | | UINT8 fgctl = m_fgctl_prom[fgctl_addr]; |
| 97 | UINT8 fgctl = m_fgctl_prom->base()[fgctl_addr]; |
| 98 | 98 | int color = fgctl & 0x07; |
| 99 | 99 | |
| 100 | 100 | if (color) |
| r20554 | r20555 | |
| 126 | 126 | |
| 127 | 127 | void abc800_state::video_start() |
| 128 | 128 | { |
| 129 | | // find memory regions |
| 130 | | m_char_rom = memregion(MC6845_TAG)->base(); |
| 131 | | m_fgctl_prom = memregion("hru2")->base(); |
| 132 | | |
| 133 | 129 | // register for state saving |
| 134 | 130 | save_item(NAME(m_hrs)); |
| 135 | 131 | save_item(NAME(m_fgctl)); |
| r20554 | r20555 | |
| 215 | 211 | for (int dot = 0; dot < 4; dot++) |
| 216 | 212 | { |
| 217 | 213 | UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); |
| 218 | | int color = (m_fgctl_prom[fgctl_addr] & 0x07) ? 1 : 0; |
| 214 | int color = (m_fgctl_prom->base()[fgctl_addr] & 0x07) ? 1 : 0; |
| 219 | 215 | |
| 220 | 216 | bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color]; |
| 221 | 217 | bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color]; |
| r20554 | r20555 | |
| 247 | 243 | int bit; |
| 248 | 244 | |
| 249 | 245 | UINT16 address = (state->m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f); |
| 250 | | UINT8 data = (state->m_char_rom[address & 0x7ff] & 0x3f); |
| 246 | UINT8 data = (state->m_char_rom->base()[address & 0x7ff] & 0x3f); |
| 251 | 247 | |
| 252 | 248 | if (column == cursor_x) |
| 253 | 249 | { |
| r20554 | r20555 | |
| 301 | 297 | screen.set_visible_area(0, 767, 0, 311); |
| 302 | 298 | |
| 303 | 299 | // clear screen |
| 304 | | bitmap.fill(get_black_pen(machine()), cliprect); |
| 300 | bitmap.fill(RGB_BLACK, cliprect); |
| 305 | 301 | |
| 306 | 302 | // draw HR graphics |
| 307 | 303 | hr_update(bitmap, cliprect); |
trunk/src/mess/drivers/cbm2.c
| r20554 | r20555 | |
| 197 | 197 | } |
| 198 | 198 | if (!basiccs || !knbcs) |
| 199 | 199 | { |
| 200 | | data = m_basic[offset & 0x3fff]; |
| 200 | data = m_basic->base()[offset & 0x3fff]; |
| 201 | 201 | } |
| 202 | 202 | if (!kernalcs) |
| 203 | 203 | { |
| 204 | | data = m_kernal[offset & 0x1fff]; |
| 204 | data = m_kernal->base()[offset & 0x1fff]; |
| 205 | 205 | } |
| 206 | 206 | if (!crtccs) |
| 207 | 207 | { |
| r20554 | r20555 | |
| 587 | 587 | } |
| 588 | 588 | if (!basiclocs || !basichics) |
| 589 | 589 | { |
| 590 | | data = m_basic[offset & 0x3fff]; |
| 590 | data = m_basic->base()[offset & 0x3fff]; |
| 591 | 591 | } |
| 592 | 592 | if (!kernalcs) |
| 593 | 593 | { |
| 594 | | data = m_kernal[offset & 0x1fff]; |
| 594 | data = m_kernal->base()[offset & 0x1fff]; |
| 595 | 595 | } |
| 596 | 596 | if (!charomcs && !vsysaden && !viddaten && viddat_tr) |
| 597 | 597 | { |
| 598 | | data = m_charom[offset & 0xfff]; |
| 598 | data = m_charom->base()[offset & 0xfff]; |
| 599 | 599 | } |
| 600 | 600 | if (!viccs && !viddaten && viddat_tr) |
| 601 | 601 | { |
| r20554 | r20555 | |
| 779 | 779 | } |
| 780 | 780 | if (!charomcs) |
| 781 | 781 | { |
| 782 | | data = m_charom[offset & 0xfff]; |
| 782 | data = m_charom->base()[offset & 0xfff]; |
| 783 | 783 | } |
| 784 | 784 | } |
| 785 | 785 | |
| r20554 | r20555 | |
| 1089 | 1089 | { |
| 1090 | 1090 | UINT8 code = state->m_video_ram[(ma + column) & 0x7ff]; |
| 1091 | 1091 | offs_t char_rom_addr = (ma & 0x1000) | (state->m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f); |
| 1092 | | UINT8 data = state->m_charom[char_rom_addr & 0xfff]; |
| 1092 | UINT8 data = state->m_charom->base()[char_rom_addr & 0xfff]; |
| 1093 | 1093 | |
| 1094 | 1094 | for (int bit = 0; bit < 9; bit++) |
| 1095 | 1095 | { |
| r20554 | r20555 | |
| 1945 | 1945 | |
| 1946 | 1946 | MACHINE_START_MEMBER( cbm2_state, cbm2 ) |
| 1947 | 1947 | { |
| 1948 | | // find memory regions |
| 1949 | | m_basic = memregion("basic")->base(); |
| 1950 | | m_kernal = memregion("kernal")->base(); |
| 1951 | | m_charom = memregion("charom")->base(); |
| 1952 | | |
| 1953 | 1948 | // allocate memory |
| 1954 | 1949 | m_video_ram.allocate(m_video_ram_size); |
| 1955 | 1950 | m_buffer_ram.allocate(0x800); |
trunk/src/mess/drivers/abc80x.c
| r20554 | r20555 | |
| 202 | 202 | else |
| 203 | 203 | { |
| 204 | 204 | // BASIC ROM selected |
| 205 | | program.install_rom(0x0000, 0x3fff, memregion(Z80_TAG)->base()); |
| 205 | program.install_rom(0x0000, 0x3fff, m_rom->base()); |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| r20554 | r20555 | |
| 218 | 218 | if (m_lrs) |
| 219 | 219 | { |
| 220 | 220 | // ROM and video RAM selected |
| 221 | | program.install_rom(0x0000, 0x77ff, memregion(Z80_TAG)->base()); |
| 221 | program.install_rom(0x0000, 0x77ff, m_rom->base()); |
| 222 | 222 | program.install_ram(0x7800, 0x7fff, m_char_ram); |
| 223 | 223 | } |
| 224 | 224 | else |
| r20554 | r20555 | |
| 1077 | 1077 | m_ctc_timer->adjust(attotime::from_hz(ABC800_X01/2/2/2), 0, attotime::from_hz(ABC800_X01/2/2/2)); |
| 1078 | 1078 | |
| 1079 | 1079 | // setup memory banking |
| 1080 | | UINT8 *mem = memregion(Z80_TAG)->base(); |
| 1080 | UINT8 *mem = m_rom->base(); |
| 1081 | 1081 | UINT32 videoram_size = m_ram->size() - (32 * 1024); |
| 1082 | 1082 | int bank; |
| 1083 | 1083 | char bank_name[10]; |
| r20554 | r20555 | |
| 1348 | 1348 | ROM_LOAD( "abc 6-1.2k", 0x6000, 0x1000, CRC(4bd5e808) SHA1(5ca0a60571de6cfa3d6d166e0cde3c78560569f3) ) // 1981-01-12 |
| 1349 | 1349 | ROM_LOAD( "abc 7-22.2j", 0x7000, 0x1000, CRC(774511ab) SHA1(5171e43213a402c2d96dee33453c8306ac1aafc8) ) |
| 1350 | 1350 | |
| 1351 | | ROM_REGION( 0x1000, "gfx1", 0 ) |
| 1352 | | ROM_LOAD( "saa5052.5c", 0x0140, 0x08c0, BAD_DUMP CRC(cda3bf79) SHA1(cf5ea94459c09001d422dadc212bc970b4b4aa20) ) |
| 1353 | | |
| 1354 | 1351 | ROM_REGION( 0x20, "hru", 0 ) |
| 1355 | 1352 | ROM_LOAD( "hru i.4g", 0x0000, 0x0020, CRC(d970a972) SHA1(c47fdd61fccc68368d42f03a01c7af90ab1fe1ab) ) |
| 1356 | 1353 | |
| r20554 | r20555 | |
| 1476 | 1473 | { |
| 1477 | 1474 | if (address >= 0x7c00 && address < 0x8000) |
| 1478 | 1475 | { |
| 1479 | | direct.explicit_configure(0x7c00, 0x7fff, 0x3ff, memregion(Z80_TAG)->base() + 0x7c00); |
| 1476 | direct.explicit_configure(0x7c00, 0x7fff, 0x3ff, m_rom->base() + 0x7c00); |
| 1480 | 1477 | |
| 1481 | 1478 | if (!m_fetch_charram) |
| 1482 | 1479 | { |
| r20554 | r20555 | |
| 1510 | 1507 | { |
| 1511 | 1508 | if (address >= 0x7800 && address < 0x8000) |
| 1512 | 1509 | { |
| 1513 | | direct.explicit_configure(0x7800, 0x7fff, 0x7ff, memregion(Z80_TAG)->base() + 0x7800); |
| 1510 | direct.explicit_configure(0x7800, 0x7fff, 0x7ff, m_rom->base() + 0x7800); |
| 1514 | 1511 | |
| 1515 | 1512 | if (!m_fetch_charram) |
| 1516 | 1513 | { |
| r20554 | r20555 | |
| 1546 | 1543 | { |
| 1547 | 1544 | if (address >= 0x7800 && address < 0x8000) |
| 1548 | 1545 | { |
| 1549 | | direct.explicit_configure(0x7800, 0x7fff, 0x7ff, memregion(Z80_TAG)->base() + 0x7800); |
| 1546 | direct.explicit_configure(0x7800, 0x7fff, 0x7ff, m_rom->base() + 0x7800); |
| 1550 | 1547 | return ~0; |
| 1551 | 1548 | } |
| 1552 | 1549 | } |
| r20554 | r20555 | |
| 1568 | 1565 | { |
| 1569 | 1566 | if (address >= 0x7800 && address < 0x8000) |
| 1570 | 1567 | { |
| 1571 | | direct.explicit_configure(0x7800, 0x7fff, 0x7ff, memregion(Z80_TAG)->base() + 0x7800); |
| 1568 | direct.explicit_configure(0x7800, 0x7fff, 0x7ff, m_rom->base() + 0x7800); |
| 1572 | 1569 | |
| 1573 | 1570 | if (!m_fetch_charram) |
| 1574 | 1571 | { |
trunk/src/mess/drivers/plus4.c
| r20554 | r20555 | |
| 181 | 181 | switch (m_addr & 0x03) |
| 182 | 182 | { |
| 183 | 183 | case CS0_BASIC: |
| 184 | | data = m_kernal[offset & 0x7fff]; |
| 184 | data = m_kernal->base()[offset & 0x7fff]; |
| 185 | 185 | break; |
| 186 | 186 | |
| 187 | 187 | case CS0_FUNCTION_LO: |
| 188 | 188 | if (m_function != NULL) |
| 189 | 189 | { |
| 190 | | data = m_function[offset & 0x7fff]; |
| 190 | data = m_function->base()[offset & 0x7fff]; |
| 191 | 191 | } |
| 192 | 192 | break; |
| 193 | 193 | |
| r20554 | r20555 | |
| 200 | 200 | |
| 201 | 201 | if (m_c2 != NULL) |
| 202 | 202 | { |
| 203 | | data = m_c2[offset & 0x7fff]; |
| 203 | data = m_c2->base()[offset & 0x7fff]; |
| 204 | 204 | } |
| 205 | 205 | break; |
| 206 | 206 | } |
| r20554 | r20555 | |
| 209 | 209 | { |
| 210 | 210 | if (kernal) |
| 211 | 211 | { |
| 212 | | data = m_kernal[offset & 0x7fff]; |
| 212 | data = m_kernal->base()[offset & 0x7fff]; |
| 213 | 213 | } |
| 214 | 214 | else |
| 215 | 215 | { |
| 216 | 216 | switch ((m_addr >> 2) & 0x03) |
| 217 | 217 | { |
| 218 | 218 | case CS1_KERNAL: |
| 219 | | data = m_kernal[offset & 0x7fff]; |
| 219 | data = m_kernal->base()[offset & 0x7fff]; |
| 220 | 220 | break; |
| 221 | 221 | |
| 222 | 222 | case CS1_FUNCTION_HI: |
| 223 | 223 | if (m_function != NULL) |
| 224 | 224 | { |
| 225 | | data = m_function[offset & 0x7fff]; |
| 225 | data = m_function->base()[offset & 0x7fff]; |
| 226 | 226 | } |
| 227 | 227 | break; |
| 228 | 228 | |
| r20554 | r20555 | |
| 235 | 235 | |
| 236 | 236 | if (m_c2 != NULL) |
| 237 | 237 | { |
| 238 | | data = m_c2[offset & 0x7fff]; |
| 238 | data = m_c2->base()[offset & 0x7fff]; |
| 239 | 239 | } |
| 240 | 240 | break; |
| 241 | 241 | } |
| r20554 | r20555 | |
| 814 | 814 | { |
| 815 | 815 | cbm_common_init(); |
| 816 | 816 | |
| 817 | | // find memory regions |
| 818 | | m_kernal = memregion("kernal")->base(); |
| 819 | | |
| 820 | | if (memregion("function") != NULL) |
| 821 | | { |
| 822 | | m_function = memregion("function")->base(); |
| 823 | | } |
| 824 | | |
| 825 | | if (memregion("c2") != NULL) |
| 826 | | { |
| 827 | | m_c2 = memregion("c2")->base(); |
| 828 | | } |
| 829 | | |
| 830 | 817 | // initialize memory |
| 831 | 818 | UINT8 data = 0xff; |
| 832 | 819 | |
| r20554 | r20555 | |
| 841 | 828 | save_item(NAME(m_ted_irq)); |
| 842 | 829 | save_item(NAME(m_acia_irq)); |
| 843 | 830 | save_item(NAME(m_exp_irq)); |
| 831 | save_item(NAME(m_port6529)); |
| 832 | save_item(NAME(m_keyline)); |
| 844 | 833 | } |
| 845 | 834 | |
| 846 | 835 | |