| Previous | 199869 Revisions | Next |
| r18707 Thursday 25th October, 2012 at 16:56:12 UTC by Curt Coder |
|---|
| (MESS) mos6566: Added BA/AEC outputs in preparation for 6502 RDY support, and implemented light pen trigger. (nw) |
| [src/mess] | mess.lst |
| [src/mess/drivers] | c128.c c64.c cbm2.c plus4.c vic10.c vic20.c |
| [src/mess/includes] | c64.h cbm2.h vic10.h |
| [src/mess/machine] | c128_comal80.c c128_comal80.h c64_16kb.c c64_16kb.h c64_comal80.c c64_comal80.h c64_cpm.c c64_cpm.h c64_currah_speech.c c64_currah_speech.h c64_dela_ep256.c c64_dela_ep256.h c64_dela_ep64.c c64_dela_ep64.h c64_dela_ep7x8.c c64_dela_ep7x8.h c64_dinamic.c c64_dinamic.h c64_dqbb.c c64_dqbb.h c64_easy_calc_result.c c64_easy_calc_result.h c64_easyflash.c c64_easyflash.h c64_epyx_fast_load.c c64_epyx_fast_load.h c64_exos.c c64_exos.h c64_final.c c64_final.h c64_final3.c c64_final3.h c64_fun_play.c c64_fun_play.h c64_georam.c c64_georam.h c64_ide64.c c64_ide64.h c64_ieee488.c c64_ieee488.h c64_kingsoft.c c64_kingsoft.h c64_mach5.c c64_mach5.h c64_magic_desk.c c64_magic_desk.h c64_magic_formel.c c64_magic_formel.h c64_mikro_assembler.c c64_mikro_assembler.h c64_multiscreen.c c64_multiscreen.h c64_neoram.c c64_neoram.h c64_ocean.c c64_ocean.h c64_pagefox.c c64_pagefox.h c64_prophet64.c c64_prophet64.h c64_ps64.c c64_ps64.h c64_reu.c c64_reu.h c64_rex.c c64_rex.h c64_rex_ep256.c c64_rex_ep256.h c64_ross.c c64_ross.h c64_sfx_sound_expander.c c64_sfx_sound_expander.h c64_silverrock.c c64_silverrock.h c64_simons_basic.c c64_simons_basic.h c64_stardos.c c64_stardos.h c64_std.c c64_std.h c64_structured_basic.c c64_structured_basic.h c64_super_explode.c c64_super_explode.h c64_super_games.c c64_super_games.h c64_sw8k.c c64_sw8k.h c64_system3.c c64_system3.h c64_tdos.c c64_tdos.h c64_vw64.c c64_vw64.h c64_warp_speed.c c64_warp_speed.h c64_westermann.c c64_westermann.h c64_xl80.c c64_xl80.h c64_zaxxon.c c64_zaxxon.h c64exp.c c64exp.h |
| [src/mess/video] | mos6566.c mos6566.h |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_reset(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | |
| 49 | 49 | private: |
| 50 | 50 | inline void set_osc1(int voice, int intonation); |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 75 | 75 | // c64_cd_w - cartridge data write |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void c64_fun_play_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 78 | void c64_fun_play_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 79 | 79 | { |
| 80 | 80 | if (!io1) |
| 81 | 81 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 47 | 47 | // c64_cd_r - cartridge data read |
| 48 | 48 | //------------------------------------------------- |
| 49 | 49 | |
| 50 | UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 50 | UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 51 | 51 | { |
| 52 | 52 | if (!roml && m_roml_mask) |
| 53 | 53 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_start(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 |
| r18706 | r18707 | |
|---|---|---|
| 120 | 120 | // c64_cd_r - cartridge data read |
| 121 | 121 | //------------------------------------------------- |
| 122 | 122 | |
| 123 | UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 123 | UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 124 | 124 | { |
| 125 | 125 | if (!roml) |
| 126 | 126 | { |
| r18706 | r18707 | |
| 144 | 144 | // c64_cd_w - cartridge data write |
| 145 | 145 | //------------------------------------------------- |
| 146 | 146 | |
| 147 | void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 147 | void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 148 | 148 | { |
| 149 | 149 | if (!io1) |
| 150 | 150 | { |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_reset(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | |
| 49 | 49 | private: |
| 50 | 50 | UINT8 *m_rom; |
| r18706 | r18707 | |
|---|---|---|
| 106 | 106 | data |= m_bus->ifc_r(); |
| 107 | 107 | data |= m_bus->srq_r() << 1; |
| 108 | 108 | |
| 109 | data |= m_exp->exrom_r(offset, 1, 1, 0) << 7; | |
| 109 | data |= m_exp->exrom_r(offset, 1, 1, 1, 0) << 7; | |
| 110 | 110 | |
| 111 | 111 | return data; |
| 112 | 112 | } |
| r18706 | r18707 | |
| 277 | 277 | // c64_cd_r - cartridge data read |
| 278 | 278 | //------------------------------------------------- |
| 279 | 279 | |
| 280 | UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 280 | UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 281 | 281 | { |
| 282 | data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
| 282 | data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 283 | 283 | |
| 284 | 284 | if (!roml) |
| 285 | 285 | { |
| r18706 | r18707 | |
| 301 | 301 | // c64_cd_w - cartridge data write |
| 302 | 302 | //------------------------------------------------- |
| 303 | 303 | |
| 304 | void c64_ieee488_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 304 | void c64_ieee488_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 305 | 305 | { |
| 306 | 306 | if (!io2) |
| 307 | 307 | { |
| 308 | 308 | tpi6525_w(m_tpi, space, offset & 0x07, data); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2); | |
| 311 | m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
| r18706 | r18707 | |
| 316 | 316 | // c64_game_r - GAME read |
| 317 | 317 | //------------------------------------------------- |
| 318 | 318 | |
| 319 | int c64_ieee488_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 319 | int c64_ieee488_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 320 | 320 | { |
| 321 | return m_exp->game_r(offset, ba, rw, hiram); | |
| 321 | return m_exp->game_r(offset, sphi2, ba, rw, hiram); | |
| 322 | 322 | } |
| r18706 | r18707 | |
|---|---|---|
| 57 | 57 | virtual void device_reset(); |
| 58 | 58 | |
| 59 | 59 | // device_c64_expansion_card_interface overrides |
| 60 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 61 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 62 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 60 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 61 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 62 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 63 | 63 | |
| 64 | 64 | private: |
| 65 | 65 | required_device<device_t> m_tpi; |
| r18706 | r18707 | |
|---|---|---|
| 92 | 92 | // c64_cd_r - cartridge data read |
| 93 | 93 | //------------------------------------------------- |
| 94 | 94 | |
| 95 | UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 95 | UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 96 | 96 | { |
| 97 | 97 | if (!roml) |
| 98 | 98 | { |
| r18706 | r18707 | |
| 109 | 109 | // c64_cd_w - cartridge data write |
| 110 | 110 | //------------------------------------------------- |
| 111 | 111 | |
| 112 | void c64_silverrock_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 112 | void c64_silverrock_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 113 | 113 | { |
| 114 | 114 | if (!io1) |
| 115 | 115 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_super_games_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_super_games_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml || !romh) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 75 | 75 | // c64_cd_w - cartridge data write |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void c64_super_games_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 78 | void c64_super_games_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 79 | 79 | { |
| 80 | 80 | if (!io2) |
| 81 | 81 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 76 | 76 | // c64_cd_r - cartridge data read |
| 77 | 77 | //------------------------------------------------- |
| 78 | 78 | |
| 79 | UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 79 | UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 80 | 80 | { |
| 81 | 81 | if (!m_cs && (!roml || !romh)) |
| 82 | 82 | { |
| r18706 | r18707 | |
| 91 | 91 | // c64_cd_w - cartridge data write |
| 92 | 92 | //------------------------------------------------- |
| 93 | 93 | |
| 94 | void c64_dqbb_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 94 | void c64_dqbb_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 95 | 95 | { |
| 96 | 96 | if (!m_cs && m_we && (offset >= 0x8000 && offset < 0xc000)) |
| 97 | 97 | { |
| r18706 | r18707 | |
|---|---|---|
| 45 | 45 | virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } |
| 46 | 46 | |
| 47 | 47 | // device_c64_expansion_card_interface overrides |
| 48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 50 | 50 | |
| 51 | 51 | private: |
| 52 | 52 | int m_cs; |
| r18706 | r18707 | |
|---|---|---|
| 148 | 148 | // c64_cd_r - cartridge data read |
| 149 | 149 | //------------------------------------------------- |
| 150 | 150 | |
| 151 | UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 151 | UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 152 | 152 | { |
| 153 | 153 | if (!roml || !romh) |
| 154 | 154 | { |
| r18706 | r18707 | |
| 172 | 172 | // c64_cd_w - cartridge data write |
| 173 | 173 | //------------------------------------------------- |
| 174 | 174 | |
| 175 | void c64_stardos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 175 | void c64_stardos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 176 | 176 | { |
| 177 | 177 | if (!io1) |
| 178 | 178 | { |
| r18706 | r18707 | |
| 189 | 189 | // c64_game_r - GAME read |
| 190 | 190 | //------------------------------------------------- |
| 191 | 191 | |
| 192 | int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 192 | int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 193 | 193 | { |
| 194 | 194 | return !(ba & rw & ((offset & 0xe000) == 0xe000) & hiram); |
| 195 | 195 | } |
| r18706 | r18707 | |
|---|---|---|
| 223 | 223 | // c64_cd_r - cartridge data read |
| 224 | 224 | //------------------------------------------------- |
| 225 | 225 | |
| 226 | UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 226 | UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 227 | 227 | { |
| 228 | 228 | if (!romh && !m_rom_oe) |
| 229 | 229 | { |
| r18706 | r18707 | |
| 245 | 245 | // c64_cd_w - cartridge data write |
| 246 | 246 | //------------------------------------------------- |
| 247 | 247 | |
| 248 | void c64_magic_formel_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 248 | void c64_magic_formel_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 249 | 249 | { |
| 250 | 250 | if (!io1) |
| 251 | 251 | { |
| r18706 | r18707 | |
| 269 | 269 | // c64_game_r - GAME read |
| 270 | 270 | //------------------------------------------------- |
| 271 | 271 | |
| 272 | int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 272 | int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 273 | 273 | { |
| 274 | 274 | return !(ba & rw & ((offset & 0xe000) == 0xe000) & !(m_pb7 & m_cb2_ff)); |
| 275 | 275 | } |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_start(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 49 | 49 | |
| 50 | 50 | private: |
| 51 | 51 | inline void charge_io1_capacitor(); |
| r18706 | r18707 | |
|---|---|---|
| 50 | 50 | virtual void device_reset(); |
| 51 | 51 | |
| 52 | 52 | // device_c64_expansion_card_interface overrides |
| 53 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 54 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 55 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 53 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 54 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 55 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 56 | 56 | |
| 57 | 57 | private: |
| 58 | 58 | required_device<pia6821_device> m_pia; |
| r18706 | r18707 | |
|---|---|---|
| 235 | 235 | // c64_cd_r - cartridge data read |
| 236 | 236 | //------------------------------------------------- |
| 237 | 237 | |
| 238 | UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 238 | UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 239 | 239 | { |
| 240 | data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
| 240 | data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 241 | 241 | |
| 242 | 242 | if (!io2) |
| 243 | 243 | { |
| r18706 | r18707 | |
| 269 | 269 | // c64_cd_w - cartridge data write |
| 270 | 270 | //------------------------------------------------- |
| 271 | 271 | |
| 272 | void c64_sfx_sound_expander_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 272 | void c64_sfx_sound_expander_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 273 | 273 | { |
| 274 | 274 | if (!io2 && BIT(offset, 5)) |
| 275 | 275 | { |
| 276 | 276 | ym3526_w(m_opl, space, BIT(offset, 4), data); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2); | |
| 279 | m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | |
| r18706 | r18707 | |
| 284 | 284 | // c64_game_r - GAME read |
| 285 | 285 | //------------------------------------------------- |
| 286 | 286 | |
| 287 | int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 287 | int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 288 | 288 | { |
| 289 | return m_exp->game_r(offset, ba, rw, hiram); | |
| 289 | return m_exp->game_r(offset, sphi2, ba, rw, hiram); | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | |
| r18706 | r18707 | |
| 294 | 294 | // c64_exrom_r - EXROM read |
| 295 | 295 | //------------------------------------------------- |
| 296 | 296 | |
| 297 | int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram) | |
| 297 | int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 298 | 298 | { |
| 299 | return m_exp->exrom_r(offset, ba, rw, hiram); | |
| 299 | return m_exp->exrom_r(offset, sphi2, ba, rw, hiram); | |
| 300 | 300 | } |
| r18706 | r18707 | |
|---|---|---|
| 52 | 52 | virtual void device_reset(); |
| 53 | 53 | |
| 54 | 54 | // device_c64_expansion_card_interface overrides |
| 55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 57 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 58 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); | |
| 55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 57 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 58 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 59 | 59 | |
| 60 | 60 | private: |
| 61 | 61 | required_device<device_t> m_opl; |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml || !romh) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 75 | 75 | // c64_cd_w - cartridge data write |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void c64_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 78 | void c64_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 79 | 79 | { |
| 80 | 80 | if (!io1) |
| 81 | 81 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_config_complete() { m_shortname = "c64_comal80"; } |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 169 | 169 | // c64_cd_w - cartridge data write |
| 170 | 170 | //------------------------------------------------- |
| 171 | 171 | |
| 172 | void c64_cpm_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 172 | void c64_cpm_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 173 | 173 | { |
| 174 | 174 | if (!io1) |
| 175 | 175 | { |
| r18706 | r18707 | |
| 184 | 184 | // c64_game_r - GAME read |
| 185 | 185 | //------------------------------------------------- |
| 186 | 186 | |
| 187 | int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 187 | int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 188 | 188 | { |
| 189 | 189 | if (m_ba != ba) |
| 190 | 190 | { |
| r18706 | r18707 | |
|---|---|---|
| 47 | 47 | virtual void device_config_complete() { m_shortname = "c64_cpm"; } |
| 48 | 48 | |
| 49 | 49 | // device_c64_expansion_card_interface overrides |
| 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 51 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 51 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 52 | 52 | |
| 53 | 53 | private: |
| 54 | 54 | inline void update_signals(); |
| r18706 | r18707 | |
|---|---|---|
| 127 | 127 | // c64_cd_r - cartridge data read |
| 128 | 128 | //------------------------------------------------- |
| 129 | 129 | |
| 130 | UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 130 | UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 131 | 131 | { |
| 132 | 132 | if (!roml || !romh || !io1 || !io2) |
| 133 | 133 | { |
| r18706 | r18707 | |
| 143 | 143 | // c64_cd_w - cartridge data write |
| 144 | 144 | //------------------------------------------------- |
| 145 | 145 | |
| 146 | void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 146 | void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 147 | 147 | { |
| 148 | 148 | if (!io1) |
| 149 | 149 | { |
| r18706 | r18707 | |
|---|---|---|
| 130 | 130 | // c64_cd_r - cartridge data read |
| 131 | 131 | //------------------------------------------------- |
| 132 | 132 | |
| 133 | UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 133 | UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 134 | 134 | { |
| 135 | 135 | if (!roml) |
| 136 | 136 | { |
| r18706 | r18707 | |
| 149 | 149 | // c64_cd_w - cartridge data write |
| 150 | 150 | //------------------------------------------------- |
| 151 | 151 | |
| 152 | void c64_ps64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 152 | void c64_ps64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 153 | 153 | { |
| 154 | 154 | if (!io1) |
| 155 | 155 | { |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_reset(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | |
| 49 | 49 | private: |
| 50 | 50 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 42 | 42 | virtual void device_reset(); |
| 43 | 43 | |
| 44 | 44 | // device_c64_expansion_card_interface overrides |
| 45 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 45 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | 49 |
| r18706 | r18707 | |
|---|---|---|
| 47 | 47 | // c64_cd_r - cartridge data read |
| 48 | 48 | //------------------------------------------------- |
| 49 | 49 | |
| 50 | UINT8 c64_mikro_assembler_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 50 | UINT8 c64_mikro_assembler_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 51 | 51 | { |
| 52 | 52 | if (!roml || !romh || !io1 || !io2) |
| 53 | 53 | { |
| r18706 | r18707 | |
|---|---|---|
| 37 | 37 | virtual void device_start(); |
| 38 | 38 | |
| 39 | 39 | // device_c64_expansion_card_interface overrides |
| 40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | 43 |
| r18706 | r18707 | |
|---|---|---|
| 49 | 49 | // c64_cd_r - cartridge data read |
| 50 | 50 | //------------------------------------------------- |
| 51 | 51 | |
| 52 | UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 52 | UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 53 | 53 | { |
| 54 | 54 | if (!roml) |
| 55 | 55 | { |
| r18706 | r18707 | |
|---|---|---|
| 37 | 37 | virtual void device_start(); |
| 38 | 38 | |
| 39 | 39 | // device_c64_expansion_card_interface overrides |
| 40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 41 | 41 | |
| 42 | 42 | private: |
| 43 | 43 | int m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 62 | 62 | // c64_cd_r - cartridge data read |
| 63 | 63 | //------------------------------------------------- |
| 64 | 64 | |
| 65 | UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 65 | UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 66 | 66 | { |
| 67 | 67 | if (!io1) |
| 68 | 68 | { |
| r18706 | r18707 | |
| 78 | 78 | // c64_cd_w - cartridge data write |
| 79 | 79 | //------------------------------------------------- |
| 80 | 80 | |
| 81 | void c64_georam_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 81 | void c64_georam_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 82 | 82 | { |
| 83 | 83 | if (!io1) |
| 84 | 84 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT16 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml) |
| 65 | 65 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_config_complete() { m_shortname = "c64_dinamic"; } |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | 42 | |
| 43 | 43 | private: |
| 44 | 44 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 215 | 215 | // c64_cd_r - cartridge data read |
| 216 | 216 | //------------------------------------------------- |
| 217 | 217 | |
| 218 | UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 218 | UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 219 | 219 | { |
| 220 | data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
| 220 | data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 221 | 221 | |
| 222 | 222 | // TODO |
| 223 | 223 | |
| r18706 | r18707 | |
| 229 | 229 | // c64_cd_w - cartridge data write |
| 230 | 230 | //------------------------------------------------- |
| 231 | 231 | |
| 232 | void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 232 | void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 233 | 233 | { |
| 234 | 234 | // TODO |
| 235 | m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2); | |
| 235 | m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
| r18706 | r18707 | |
| 240 | 240 | // c64_game_r - GAME read |
| 241 | 241 | //------------------------------------------------- |
| 242 | 242 | |
| 243 | int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 243 | int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 244 | 244 | { |
| 245 | return m_exp->game_r(offset, ba, rw, hiram); | |
| 245 | return m_exp->game_r(offset, sphi2, ba, rw, hiram); | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
| r18706 | r18707 | |
| 250 | 250 | // c64_exrom_r - EXROM read |
| 251 | 251 | //------------------------------------------------- |
| 252 | 252 | |
| 253 | int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram) | |
| 253 | int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 254 | 254 | { |
| 255 | return m_exp->exrom_r(offset, ba, rw, hiram); | |
| 255 | return m_exp->exrom_r(offset, sphi2, ba, rw, hiram); | |
| 256 | 256 | } |
| r18706 | r18707 | |
|---|---|---|
| 52 | 52 | virtual void device_reset(); |
| 53 | 53 | |
| 54 | 54 | // device_c64_expansion_card_interface overrides |
| 55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 57 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 58 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); | |
| 55 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 56 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 57 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 58 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 59 | 59 | |
| 60 | 60 | private: |
| 61 | 61 | required_device<mc6852_device> m_ssda; |
| r18706 | r18707 | |
|---|---|---|
| 57 | 57 | // c64_cd_r - cartridge data read |
| 58 | 58 | //------------------------------------------------- |
| 59 | 59 | |
| 60 | UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 60 | UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 61 | 61 | { |
| 62 | 62 | if (!roml) |
| 63 | 63 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 |
| r18706 | r18707 | |
|---|---|---|
| 85 | 85 | // c64_cd_r - cartridge data read |
| 86 | 86 | //------------------------------------------------- |
| 87 | 87 | |
| 88 | UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 88 | UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 89 | 89 | { |
| 90 | 90 | if (!roml) |
| 91 | 91 | { |
| r18706 | r18707 | |
| 112 | 112 | // c64_cd_w - cartridge data write |
| 113 | 113 | //------------------------------------------------- |
| 114 | 114 | |
| 115 | void c64_super_explode_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 115 | void c64_super_explode_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 116 | 116 | { |
| 117 | 117 | if (!io1) |
| 118 | 118 | { |
| r18706 | r18707 | |
|---|---|---|
| 39 | 39 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 40 | 40 | |
| 41 | 41 | // device_c64_expansion_card_interface overrides |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 44 | 44 | |
| 45 | 45 | private: |
| 46 | 46 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 75 | 75 | // c64_cd_w - cartridge data write |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void c64_prophet64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 78 | void c64_prophet64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 79 | 79 | { |
| 80 | 80 | if (!io2) |
| 81 | 81 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 80 | 80 | // c64_cd_r - cartridge data read |
| 81 | 81 | //------------------------------------------------- |
| 82 | 82 | |
| 83 | UINT8 c64_epyx_fast_load_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 83 | UINT8 c64_epyx_fast_load_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 84 | 84 | { |
| 85 | 85 | if (!roml) |
| 86 | 86 | { |
| r18706 | r18707 | |
| 107 | 107 | // c64_cd_w - cartridge data write |
| 108 | 108 | //------------------------------------------------- |
| 109 | 109 | |
| 110 | void c64_epyx_fast_load_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 110 | void c64_epyx_fast_load_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 111 | 111 | { |
| 112 | 112 | if (!io1) |
| 113 | 113 | { |
| r18706 | r18707 | |
|---|---|---|
| 39 | 39 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 40 | 40 | |
| 41 | 41 | // device_c64_expansion_card_interface overrides |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 44 | 44 | |
| 45 | 45 | private: |
| 46 | 46 | emu_timer *m_exrom_timer; |
| r18706 | r18707 | |
|---|---|---|
| 47 | 47 | // c64_cd_r - cartridge data read |
| 48 | 48 | //------------------------------------------------- |
| 49 | 49 | |
| 50 | UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 50 | UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 51 | 51 | { |
| 52 | 52 | if (!romh) |
| 53 | 53 | { |
| r18706 | r18707 | |
| 62 | 62 | // c64_game_r - GAME read |
| 63 | 63 | //------------------------------------------------- |
| 64 | 64 | |
| 65 | int c64_exos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 65 | int c64_exos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 66 | 66 | { |
| 67 | 67 | return !(ba & rw & ((offset & 0xe000) == 0xe000) & hiram); |
| 68 | 68 | } |
| r18706 | r18707 | |
|---|---|---|
| 37 | 37 | virtual void device_start(); |
| 38 | 38 | |
| 39 | 39 | // device_c64_expansion_card_interface overrides |
| 40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 40 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 |
| r18706 | r18707 | |
|---|---|---|
| 208 | 208 | // c64_cd_r - cartridge data read |
| 209 | 209 | //------------------------------------------------- |
| 210 | 210 | |
| 211 | UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 211 | UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 212 | 212 | { |
| 213 | 213 | if (!io2 && BIT(offset, 2)) |
| 214 | 214 | { |
| r18706 | r18707 | |
| 234 | 234 | // c64_cd_w - cartridge data write |
| 235 | 235 | //------------------------------------------------- |
| 236 | 236 | |
| 237 | void c64_xl80_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 237 | void c64_xl80_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 238 | 238 | { |
| 239 | 239 | if (offset >= 0x9800 && offset < 0xa000) |
| 240 | 240 | { |
| r18706 | r18707 | |
|---|---|---|
| 46 | 46 | virtual void device_reset(); |
| 47 | 47 | |
| 48 | 48 | // device_c64_expansion_card_interface overrides |
| 49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 51 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return 1; } | |
| 52 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; } | |
| 49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 51 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 1; } | |
| 52 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 0; } | |
| 53 | 53 | |
| 54 | 54 | private: |
| 55 | 55 | required_device<h46505_device> m_crtc; |
| r18706 | r18707 | |
|---|---|---|
| 132 | 132 | // c64_cd_r - cartridge data read |
| 133 | 133 | //------------------------------------------------- |
| 134 | 134 | |
| 135 | UINT8 c64_reu_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 135 | UINT8 c64_reu_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 136 | 136 | { |
| 137 | 137 | if (!m_dmac->romsel_r(roml, romh)) |
| 138 | 138 | { |
| r18706 | r18707 | |
| 151 | 151 | // c64_cd_w - cartridge data write |
| 152 | 152 | //------------------------------------------------- |
| 153 | 153 | |
| 154 | void c64_reu_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 154 | void c64_reu_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 155 | 155 | { |
| 156 | 156 | if (!io2) |
| 157 | 157 | { |
| r18706 | r18707 | |
|---|---|---|
| 51 | 51 | virtual void device_reset(); |
| 52 | 52 | |
| 53 | 53 | // device_c64_expansion_card_interface overrides |
| 54 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 55 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 54 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 55 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 56 | 56 | |
| 57 | 57 | required_device<mos8726_device> m_dmac; |
| 58 | 58 |
| r18706 | r18707 | |
|---|---|---|
| 132 | 132 | // c64_cd_r - cartridge data read |
| 133 | 133 | //------------------------------------------------- |
| 134 | 134 | |
| 135 | UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 135 | UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 136 | 136 | { |
| 137 | 137 | if (!roml) |
| 138 | 138 | { |
| r18706 | r18707 | |
|---|---|---|
| 44 | 44 | virtual void device_reset(); |
| 45 | 45 | |
| 46 | 46 | // device_c64_expansion_card_interface overrides |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | 50 |
| r18706 | r18707 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | c64_ocean_cartridge_device::c64_ocean_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 53 | 53 | device_t(mconfig, C64_OCEAN, "C64 Ocean cartridge", tag, owner, clock), |
| 54 | device_c64_expansion_card_interface(mconfig, *this) | |
| 54 | device_c64_expansion_card_interface(mconfig, *this), | |
| 55 | m_bank(0) | |
| 55 | 56 | { |
| 56 | 57 | } |
| 57 | 58 | |
| r18706 | r18707 | |
| 81 | 82 | // c64_cd_r - cartridge data read |
| 82 | 83 | //------------------------------------------------- |
| 83 | 84 | |
| 84 | UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 85 | UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 85 | 86 | { |
| 86 | 87 | if (!roml) |
| 87 | 88 | { |
| 88 | 89 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
| 89 | 90 | data = m_roml[addr & m_roml_mask]; |
| 90 | 91 | } |
| 91 | else if (!romh) | |
| 92 | else if (!romh && m_romh) | |
| 92 | 93 | { |
| 93 | 94 | offs_t addr = (m_bank << 13) | (offset & 0x1fff); |
| 94 | 95 | data = m_romh[addr & m_romh_mask]; |
| r18706 | r18707 | |
| 106 | 107 | // c64_cd_w - cartridge data write |
| 107 | 108 | //------------------------------------------------- |
| 108 | 109 | |
| 109 | void c64_ocean_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 110 | void c64_ocean_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 110 | 111 | { |
| 111 | 112 | if (!io1) |
| 112 | 113 | { |
| r18706 | r18707 | |
|---|---|---|
| 208 | 208 | // c64_cd_r - cartridge data read |
| 209 | 209 | //------------------------------------------------- |
| 210 | 210 | |
| 211 | UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 211 | UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 212 | 212 | { |
| 213 | 213 | if (!roml) |
| 214 | 214 | { |
| r18706 | r18707 | |
| 245 | 245 | // c64_cd_w - cartridge data write |
| 246 | 246 | //------------------------------------------------- |
| 247 | 247 | |
| 248 | void c64_multiscreen_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 248 | void c64_multiscreen_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 249 | 249 | { |
| 250 | 250 | if (offset >= 0x8000 && offset < 0xa000) |
| 251 | 251 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 44 | 44 | virtual void device_reset(); |
| 45 | 45 | |
| 46 | 46 | // device_c64_expansion_card_interface overrides |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 49 | 49 | |
| 50 | 50 | private: |
| 51 | 51 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 57 | 57 | // c64_cd_r - cartridge data read |
| 58 | 58 | //------------------------------------------------- |
| 59 | 59 | |
| 60 | UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 60 | UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 61 | 61 | { |
| 62 | 62 | if (!roml) |
| 63 | 63 | { |
| r18706 | r18707 | |
| 76 | 76 | // c64_cd_w - cartridge data write |
| 77 | 77 | //------------------------------------------------- |
| 78 | 78 | |
| 79 | void c64_simons_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 79 | void c64_simons_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 80 | 80 | { |
| 81 | 81 | if (!io1) |
| 82 | 82 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | 45 |
| r18706 | r18707 | |
|---|---|---|
| 132 | 132 | // c64_cd_r - cartridge data read |
| 133 | 133 | //------------------------------------------------- |
| 134 | 134 | |
| 135 | UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 135 | UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 136 | 136 | { |
| 137 | 137 | if (!roml) |
| 138 | 138 | { |
| r18706 | r18707 | |
| 157 | 157 | // c64_cd_w - cartridge data write |
| 158 | 158 | //------------------------------------------------- |
| 159 | 159 | |
| 160 | void c64_easyflash_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 160 | void c64_easyflash_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 161 | 161 | { |
| 162 | 162 | if (!roml) |
| 163 | 163 | { |
| r18706 | r18707 | |
| 221 | 221 | // c64_exrom_r - EXROM read |
| 222 | 222 | //------------------------------------------------- |
| 223 | 223 | |
| 224 | int c64_easyflash_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram) | |
| 224 | int c64_easyflash_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 225 | 225 | { |
| 226 | 226 | return !BIT(m_mode, 1); |
| 227 | 227 | } |
| r18706 | r18707 | |
| 231 | 231 | // c64_game_r - GAME read |
| 232 | 232 | //------------------------------------------------- |
| 233 | 233 | |
| 234 | int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 234 | int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 235 | 235 | { |
| 236 | 236 | return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | device().ioport("JP1")->read())); |
| 237 | 237 | } |
| r18706 | r18707 | |
|---|---|---|
| 80 | 80 | // c64_cd_r - cartridge data read |
| 81 | 81 | //------------------------------------------------- |
| 82 | 82 | |
| 83 | UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 83 | UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 84 | 84 | { |
| 85 | 85 | if (!roml) |
| 86 | 86 | { |
| r18706 | r18707 | |
| 99 | 99 | // c64_cd_w - cartridge data write |
| 100 | 100 | //------------------------------------------------- |
| 101 | 101 | |
| 102 | void c64_easy_calc_result_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 102 | void c64_easy_calc_result_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 103 | 103 | { |
| 104 | 104 | if (!io1) |
| 105 | 105 | { |
| r18706 | r18707 | |
|---|---|---|
| 45 | 45 | virtual void device_reset(); |
| 46 | 46 | |
| 47 | 47 | // device_c64_expansion_card_interface overrides |
| 48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 50 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); | |
| 51 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 48 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 49 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 50 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 51 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 52 | 52 | |
| 53 | 53 | private: |
| 54 | 54 | required_device<amd_29f040_device> m_flash_roml; |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_config_complete() { m_shortname = "c64_easy_calc_result"; } |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | int m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 111 | 111 | // c64_cd_r - cartridge data read |
| 112 | 112 | //------------------------------------------------- |
| 113 | 113 | |
| 114 | UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 114 | UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 115 | 115 | { |
| 116 | 116 | if (!roml) |
| 117 | 117 | { |
| r18706 | r18707 | |
|---|---|---|
| 39 | 39 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 40 | 40 | |
| 41 | 41 | // device_c64_expansion_card_interface overrides |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; } | |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 0; } | |
| 44 | 44 | |
| 45 | 45 | private: |
| 46 | 46 | emu_timer *m_game_timer; |
| r18706 | r18707 | |
|---|---|---|
| 57 | 57 | // c64_cd_r - cartridge data read |
| 58 | 58 | //------------------------------------------------- |
| 59 | 59 | |
| 60 | UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 60 | UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 61 | 61 | { |
| 62 | 62 | if (!roml || !io1 || !io2) |
| 63 | 63 | { |
| r18706 | r18707 | |
| 72 | 72 | // c64_cd_w - cartridge data write |
| 73 | 73 | //------------------------------------------------- |
| 74 | 74 | |
| 75 | void c64_mach5_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 75 | void c64_mach5_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 76 | 76 | { |
| 77 | 77 | if (!io1) |
| 78 | 78 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | 45 |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!romh) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 79 | 79 | // c64_cd_w - cartridge data write |
| 80 | 80 | //------------------------------------------------- |
| 81 | 81 | |
| 82 | void c128_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 82 | void c128_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 83 | 83 | { |
| 84 | 84 | if (!io1) |
| 85 | 85 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_config_complete() { m_shortname = "c128_comal80"; } |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 57 | 57 | // c64_cd_r - cartridge data read |
| 58 | 58 | //------------------------------------------------- |
| 59 | 59 | |
| 60 | UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 60 | UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 61 | 61 | { |
| 62 | 62 | if (!roml) |
| 63 | 63 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 |
| r18706 | r18707 | |
|---|---|---|
| 110 | 110 | // c64_cd_r - cartridge data read |
| 111 | 111 | //------------------------------------------------- |
| 112 | 112 | |
| 113 | UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 113 | UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 114 | 114 | { |
| 115 | 115 | if (!roml) |
| 116 | 116 | { |
| r18706 | r18707 | |
| 136 | 136 | // c64_cd_w - cartridge data write |
| 137 | 137 | //------------------------------------------------- |
| 138 | 138 | |
| 139 | void c64_dela_ep64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 139 | void c64_dela_ep64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 140 | 140 | { |
| 141 | 141 | if (!io1) |
| 142 | 142 | { |
| r18706 | r18707 | |
|---|---|---|
| 61 | 61 | // c64_cd_r - cartridge data read |
| 62 | 62 | //------------------------------------------------- |
| 63 | 63 | |
| 64 | UINT8 c64_structured_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 64 | UINT8 c64_structured_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 65 | 65 | { |
| 66 | 66 | if (!roml) |
| 67 | 67 | { |
| r18706 | r18707 | |
| 78 | 78 | // c64_cd_w - cartridge data write |
| 79 | 79 | //------------------------------------------------- |
| 80 | 80 | |
| 81 | void c64_structured_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 81 | void c64_structured_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 82 | 82 | { |
| 83 | 83 | if (!io1) |
| 84 | 84 | { |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_reset(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | |
| 49 | 49 | private: |
| 50 | 50 | UINT8 *m_rom; |
| r18706 | r18707 | |
|---|---|---|
| 39 | 39 | virtual void device_reset(); |
| 40 | 40 | |
| 41 | 41 | // device_c64_expansion_card_interface overrides |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 44 | 44 | |
| 45 | 45 | private: |
| 46 | 46 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 62 | 62 | // c64_cd_r - cartridge data read |
| 63 | 63 | //------------------------------------------------- |
| 64 | 64 | |
| 65 | UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 65 | UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 66 | 66 | { |
| 67 | 67 | if (!roml || !romh) |
| 68 | 68 | { |
| r18706 | r18707 | |
| 79 | 79 | // c64_cd_w - cartridge data write |
| 80 | 80 | //------------------------------------------------- |
| 81 | 81 | |
| 82 | void c64_ross_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 82 | void c64_ross_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 83 | 83 | { |
| 84 | 84 | if (!io1) |
| 85 | 85 | { |
| r18706 | r18707 | |
|---|---|---|
| 39 | 39 | virtual void device_reset(); |
| 40 | 40 | |
| 41 | 41 | // device_c64_expansion_card_interface overrides |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 44 | 44 | |
| 45 | 45 | private: |
| 46 | 46 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 126 | 126 | // c64_cd_r - cartridge data read |
| 127 | 127 | //------------------------------------------------- |
| 128 | 128 | |
| 129 | UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 129 | UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 130 | 130 | { |
| 131 | 131 | if (!roml) |
| 132 | 132 | { |
| r18706 | r18707 | |
| 160 | 160 | // c64_cd_w - cartridge data write |
| 161 | 161 | //------------------------------------------------- |
| 162 | 162 | |
| 163 | void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 163 | void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 164 | 164 | { |
| 165 | 165 | if (!io2 && ((offset & 0xf0) == 0xa0)) |
| 166 | 166 | { |
| r18706 | r18707 | |
|---|---|---|
| 63 | 63 | // c64_cd_r - cartridge data read |
| 64 | 64 | //------------------------------------------------- |
| 65 | 65 | |
| 66 | UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 66 | UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 67 | 67 | { |
| 68 | 68 | if (!io1) |
| 69 | 69 | { |
| r18706 | r18707 | |
| 79 | 79 | // c64_cd_w - cartridge data write |
| 80 | 80 | //------------------------------------------------- |
| 81 | 81 | |
| 82 | void c64_neoram_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 82 | void c64_neoram_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 83 | 83 | { |
| 84 | 84 | if (!io1) |
| 85 | 85 | { |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_reset(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | |
| 49 | 49 | private: |
| 50 | 50 | UINT8 *m_rom; |
| r18706 | r18707 | |
|---|---|---|
| 44 | 44 | virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } } |
| 45 | 45 | |
| 46 | 46 | // device_c64_expansion_card_interface overrides |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 49 | 49 | |
| 50 | 50 | private: |
| 51 | 51 | UINT16 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 95 | 95 | // c64_cd_r - cartridge data read |
| 96 | 96 | //------------------------------------------------- |
| 97 | 97 | |
| 98 | UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 98 | UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 99 | 99 | { |
| 100 | 100 | if (!roml || !romh || !io1 || !io2) |
| 101 | 101 | { |
| r18706 | r18707 | |
| 121 | 121 | // c64_cd_w - cartridge data write |
| 122 | 122 | //------------------------------------------------- |
| 123 | 123 | |
| 124 | void c64_final_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 124 | void c64_final_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 125 | 125 | { |
| 126 | 126 | if (!io1) |
| 127 | 127 | { |
| r18706 | r18707 | |
|---|---|---|
| 44 | 44 | virtual void device_reset(); |
| 45 | 45 | |
| 46 | 46 | // device_c64_expansion_card_interface overrides |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | 51 |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 75 | 75 | // c64_cd_w - cartridge data write |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void c64_system3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 78 | void c64_system3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 79 | 79 | { |
| 80 | 80 | if (!io1) |
| 81 | 81 | { |
| r18706 | r18707 | |
|---|---|---|
| 148 | 148 | // c64_cd_r - cartridge data read |
| 149 | 149 | //------------------------------------------------- |
| 150 | 150 | |
| 151 | UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 151 | UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 152 | 152 | { |
| 153 | 153 | if (!m_enable) return data; |
| 154 | 154 | |
| 155 | 155 | int rom_oe = 1, ram_oe = 1; |
| 156 | 156 | |
| 157 | if (!m_game && m_exrom && ba) | |
| 157 | if (!m_game && m_exrom && sphi2 && ba) | |
| 158 | 158 | { |
| 159 | 159 | if (offset >= 0x1000 && offset < 0x8000) |
| 160 | 160 | { |
| r18706 | r18707 | |
| 175 | 175 | rom_oe = 0; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | if (!io1) | |
| 178 | if (!io1 && sphi2 && ba) | |
| 179 | 179 | { |
| 180 | 180 | // 0x20-0x2f IDE |
| 181 | 181 | // 0x30-0x37 I/O |
| r18706 | r18707 | |
| 248 | 248 | // c64_cd_w - cartridge data write |
| 249 | 249 | //------------------------------------------------- |
| 250 | 250 | |
| 251 | void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 251 | void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 252 | 252 | { |
| 253 | 253 | if (!m_enable) return; |
| 254 | 254 | |
| 255 | if (!m_game && m_exrom | |
| 255 | if (!m_game && m_exrom) | |
| 256 | 256 | { |
| 257 | 257 | if (offset >= 0x1000 && offset < 0x8000) |
| 258 | 258 | { |
| r18706 | r18707 | |
| 335 | 335 | // c64_game_r - GAME read |
| 336 | 336 | //------------------------------------------------- |
| 337 | 337 | |
| 338 | int c64_ide64_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 338 | int c64_ide64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 339 | 339 | { |
| 340 | return ba ? m_game : 1; | |
| 340 | return (sphi2 && ba) ? m_game : 1; | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
| r18706 | r18707 | |
| 345 | 345 | // c64_exrom_r - EXROM read |
| 346 | 346 | //------------------------------------------------- |
| 347 | 347 | |
| 348 | int c64_ide64_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram) | |
| 348 | int c64_ide64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 349 | 349 | { |
| 350 | return ba ? m_exrom : 1; | |
| 350 | return (sphi2 && ba) ? m_exrom : 1; | |
| 351 | 351 | } |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 46 | 46 | virtual void device_reset(); |
| 47 | 47 | |
| 48 | 48 | // device_c64_expansion_card_interface overrides |
| 49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 51 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 52 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram); | |
| 49 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 50 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 51 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 52 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 53 | 53 | |
| 54 | 54 | private: |
| 55 | 55 | required_device<atmel_29c010_device> m_flash_rom; |
| r18706 | r18707 | |
|---|---|---|
| 102 | 102 | // c64_cd_r - cartridge data read |
| 103 | 103 | //------------------------------------------------- |
| 104 | 104 | |
| 105 | UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 105 | UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 106 | 106 | { |
| 107 | 107 | if (!roml) |
| 108 | 108 | { |
| r18706 | r18707 | |
|---|---|---|
| 41 | 41 | virtual void device_reset(); |
| 42 | 42 | |
| 43 | 43 | // device_c64_expansion_card_interface overrides |
| 44 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 44 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 45 | 45 | |
| 46 | 46 | private: |
| 47 | 47 | int m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 105 | 105 | // c64_cd_r - cartridge data read |
| 106 | 106 | //------------------------------------------------- |
| 107 | 107 | |
| 108 | UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 108 | UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 109 | 109 | { |
| 110 | 110 | if (!roml || !romh || !io1 || !io2) |
| 111 | 111 | { |
| r18706 | r18707 | |
| 121 | 121 | // c64_cd_w - cartridge data write |
| 122 | 122 | //------------------------------------------------- |
| 123 | 123 | |
| 124 | void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 124 | void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 125 | 125 | { |
| 126 | 126 | if (!m_hidden && !io2 && ((offset & 0xff) == 0xff)) |
| 127 | 127 | { |
| r18706 | r18707 | |
|---|---|---|
| 44 | 44 | virtual void device_reset(); |
| 45 | 45 | |
| 46 | 46 | // device_c64_expansion_card_interface overrides |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 49 | 49 | |
| 50 | 50 | private: |
| 51 | 51 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 59 | 59 | // c64_cd_r - cartridge data read |
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | UINT8 c64_magic_desk_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 62 | UINT8 c64_magic_desk_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 63 | 63 | { |
| 64 | 64 | if (!roml) |
| 65 | 65 | { |
| r18706 | r18707 | |
| 75 | 75 | // c64_cd_w - cartridge data write |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void c64_magic_desk_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 78 | void c64_magic_desk_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 79 | 79 | { |
| 80 | 80 | if (!io1) |
| 81 | 81 | { |
| r18706 | r18707 | |
|---|---|---|
| 81 | 81 | // c64_cd_r - cartridge data read |
| 82 | 82 | //------------------------------------------------- |
| 83 | 83 | |
| 84 | UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 84 | UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 85 | 85 | { |
| 86 | 86 | if (!roml || !romh) |
| 87 | 87 | { |
| r18706 | r18707 | |
| 106 | 106 | // c64_cd_w - cartridge data write |
| 107 | 107 | //------------------------------------------------- |
| 108 | 108 | |
| 109 | void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 109 | void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 110 | 110 | { |
| 111 | 111 | if (offset >= 0x8000 && offset < 0xc000) |
| 112 | 112 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | 43 | |
| 44 | 44 | private: |
| 45 | 45 | UINT8 m_bank; |
| r18706 | r18707 | |
|---|---|---|
| 57 | 57 | // c64_cd_r - cartridge data read |
| 58 | 58 | //------------------------------------------------- |
| 59 | 59 | |
| 60 | UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 60 | UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 61 | 61 | { |
| 62 | 62 | if (!roml) |
| 63 | 63 | { |
| r18706 | r18707 | |
| 80 | 80 | // c64_cd_w - cartridge data write |
| 81 | 81 | //------------------------------------------------- |
| 82 | 82 | |
| 83 | void c64_kingsoft_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 83 | void c64_kingsoft_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 84 | 84 | { |
| 85 | 85 | if (!io1) |
| 86 | 86 | { |
| r18706 | r18707 | |
| 93 | 93 | // c64_game_r - GAME read |
| 94 | 94 | //------------------------------------------------- |
| 95 | 95 | |
| 96 | int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram) | |
| 96 | int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 97 | 97 | { |
| 98 | 98 | return m_exrom & !(ba & rw & ((offset >= 0x8000 && offset < 0xc000) || (offset >= 0xe000))); |
| 99 | 99 | } |
| r18706 | r18707 | |
|---|---|---|
| 126 | 126 | // c64_cd_r - cartridge data read |
| 127 | 127 | //------------------------------------------------- |
| 128 | 128 | |
| 129 | UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 129 | UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 130 | 130 | { |
| 131 | 131 | if (!roml) |
| 132 | 132 | { |
| r18706 | r18707 | |
| 149 | 149 | // c64_cd_w - cartridge data write |
| 150 | 150 | //------------------------------------------------- |
| 151 | 151 | |
| 152 | void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 152 | void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 153 | 153 | { |
| 154 | 154 | if (!io2 && ((offset & 0xf0) == 0xa0)) |
| 155 | 155 | { |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | virtual void device_reset(); |
| 39 | 39 | |
| 40 | 40 | // device_c64_expansion_card_interface overrides |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram); | |
| 41 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 42 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 43 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | 46 |
| r18706 | r18707 | |
|---|---|---|
| 43 | 43 | virtual void device_reset(); |
| 44 | 44 | |
| 45 | 45 | // device_c64_expansion_card_interface overrides |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 46 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 47 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 48 | 48 | |
| 49 | 49 | private: |
| 50 | 50 | UINT8 *m_rom; |
| r18706 | r18707 | |
|---|---|---|
| 359 | 359 | // cd_r - cartridge data read |
| 360 | 360 | //------------------------------------------------- |
| 361 | 361 | |
| 362 | UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 362 | UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 363 | 363 | { |
| 364 | 364 | if (m_cart != NULL) |
| 365 | 365 | { |
| 366 | data = m_cart->c64_cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
| 366 | data = m_cart->c64_cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | return data; |
| r18706 | r18707 | |
| 374 | 374 | // cd_w - cartridge data write |
| 375 | 375 | //------------------------------------------------- |
| 376 | 376 | |
| 377 | void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 377 | void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 378 | 378 | { |
| 379 | 379 | if (m_cart != NULL) |
| 380 | 380 | { |
| 381 | m_cart->c64_cd_w(space, offset, data, ba, roml, romh, io1, io2); | |
| 381 | m_cart->c64_cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 382 | 382 | } |
| 383 | 383 | } |
| 384 | 384 | |
| r18706 | r18707 | |
| 387 | 387 | // game_r - GAME read |
| 388 | 388 | //------------------------------------------------- |
| 389 | 389 | |
| 390 | int c64_expansion_slot_device::game_r(offs_t offset, int ba, int rw, int hiram) | |
| 390 | int c64_expansion_slot_device::game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 391 | 391 | { |
| 392 | 392 | int state = 1; |
| 393 | 393 | |
| 394 | 394 | if (m_cart != NULL) |
| 395 | 395 | { |
| 396 | state = m_cart->c64_game_r(offset, ba, rw, hiram); | |
| 396 | state = m_cart->c64_game_r(offset, sphi2, ba, rw, hiram); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | return state; |
| r18706 | r18707 | |
| 404 | 404 | // exrom_r - EXROM read |
| 405 | 405 | //------------------------------------------------- |
| 406 | 406 | |
| 407 | int c64_expansion_slot_device::exrom_r(offs_t offset, int ba, int rw, int hiram) | |
| 407 | int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) | |
| 408 | 408 | { |
| 409 | 409 | int state = 1; |
| 410 | 410 | |
| 411 | 411 | if (m_cart != NULL) |
| 412 | 412 | { |
| 413 | state = m_cart->c64_exrom_r(offset, ba, rw, hiram); | |
| 413 | state = m_cart->c64_exrom_r(offset, sphi2, ba, rw, hiram); | |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | return state; |
| r18706 | r18707 | |
|---|---|---|
| 97 | 97 | virtual ~c64_expansion_slot_device(); |
| 98 | 98 | |
| 99 | 99 | // computer interface |
| 100 | UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 101 | void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2); | |
| 102 | int game_r(offs_t offset, int ba, int rw, int hiram); | |
| 103 | int exrom_r(offs_t offset, int ba, int rw, int hiram); | |
| 100 | UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 101 | void cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); | |
| 102 | int game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 103 | int exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); | |
| 104 | 104 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 105 | 105 | DECLARE_WRITE_LINE_MEMBER( port_reset_w ); |
| 106 | 106 | |
| r18706 | r18707 | |
| 168 | 168 | virtual UINT8* c64_nvram_pointer(running_machine &machine, size_t size); |
| 169 | 169 | |
| 170 | 170 | // runtime |
| 171 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { return data; }; | |
| 172 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { }; | |
| 173 | virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return m_game; } | |
| 174 | virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return m_exrom; } | |
| 171 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { return data; }; | |
| 172 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { }; | |
| 173 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_game; } | |
| 174 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_exrom; } | |
| 175 | 175 | virtual void c64_reset_w(int state) { }; |
| 176 | 176 | |
| 177 | 177 | c64_expansion_slot_device *m_slot; |
| r18706 | r18707 | |
|---|---|---|
| 200 | 200 | // c64_cd_r - cartridge data read |
| 201 | 201 | //------------------------------------------------- |
| 202 | 202 | |
| 203 | UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 203 | UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 204 | 204 | { |
| 205 | 205 | if (!romh) |
| 206 | 206 | { |
| r18706 | r18707 | |
| 240 | 240 | // c64_cd_w - cartridge data write |
| 241 | 241 | //------------------------------------------------- |
| 242 | 242 | |
| 243 | void c64_currah_speech_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) | |
| 243 | void c64_currah_speech_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) | |
| 244 | 244 | { |
| 245 | 245 | if (!io1) |
| 246 | 246 | { |
| r18706 | r18707 | |
|---|---|---|
| 201 | 201 | DECLARE_MACHINE_START( p500_pal ); |
| 202 | 202 | DECLARE_MACHINE_RESET( p500 ); |
| 203 | 203 | |
| 204 | void read_pla1(offs_t offset, int b | |
| 204 | void read_pla1(offs_t offset, int busy2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw, | |
| 205 | 205 | int *datxen, int *dramxen, int *clrniben, int *segf, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr); |
| 206 | 206 | |
| 207 | void read_pla2(offs_t offset, offs_t va, int ba, int | |
| 207 | void read_pla2(offs_t offset, offs_t va, int ba, int vicen, int ae, int segf, int bank0, | |
| 208 | 208 | int *clrnibcsb, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *procvid, int *viccs, int *vidmatcs); |
| 209 | 209 | |
| 210 | void bankswitch(offs_t offset, offs_t va, int srw, int | |
| 210 | void bankswitch(offs_t offset, offs_t va, int srw, int ba, int ae, int busy2, int refen, | |
| 211 | 211 | int *datxen, int *dramxen, int *clrniben, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr, |
| 212 | 212 | int *clrnibcs, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *viccs, int *vidmatcs, |
| 213 | 213 | int *csbank1, int *csbank2, int *csbank3, int *basiclocs, int *basichics, int *kernalcs, |
| 214 | 214 | int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs, int *aec, int *vsysaden); |
| 215 | 215 | |
| 216 | UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, UINT8 *clrnib); | |
| 217 | void write_memory(address_space &space, offs_t offset, UINT8 data, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas); | |
| 216 | UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae, UINT8 *clrnib); | |
| 217 | void write_memory(address_space &space, offs_t offset, UINT8 data, int ba, int ae); | |
| 218 | 218 | |
| 219 | 219 | DECLARE_READ8_MEMBER( read ); |
| 220 | 220 | DECLARE_WRITE8_MEMBER( write ); |
| r18706 | r18707 | |
|---|---|---|
| 38 | 38 | m_exp(*this, VIC10_EXPANSION_SLOT_TAG), |
| 39 | 39 | m_ram(*this, RAM_TAG), |
| 40 | 40 | m_cassette(*this, PET_DATASSETTE_PORT_TAG), |
| 41 | m_color_ram(*this, "color_ram"), | |
| 41 | 42 | m_cia_irq(CLEAR_LINE), |
| 42 | 43 | m_vic_irq(CLEAR_LINE), |
| 43 | 44 | m_exp_irq(CLEAR_LINE) |
| r18706 | r18707 | |
| 84 | 85 | DECLARE_WRITE_LINE_MEMBER( exp_irq_w ); |
| 85 | 86 | |
| 86 | 87 | // video state |
| 87 | UINT8 | |
| 88 | optional_shared_ptr<UINT8> m_color_ram; | |
| 88 | 89 | |
| 89 | 90 | // interrupt state |
| 90 | 91 | int m_cia_irq; |
| r18706 | r18707 | |
|---|---|---|
| 81 | 81 | virtual void machine_reset(); |
| 82 | 82 | |
| 83 | 83 | void check_interrupts(); |
| 84 | void read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int cas, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh); | |
| 85 | UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int rw, int aec, int ba, int cas); | |
| 86 | void write_memory(address_space &space, offs_t offset, UINT8 data, int rw, int aec, int ba, int cas); | |
| 84 | void read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh); | |
| 85 | UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba); | |
| 86 | void write_memory(address_space &space, offs_t offset, UINT8 data, int aec, int ba); | |
| 87 | 87 | |
| 88 | 88 | DECLARE_READ8_MEMBER( read ); |
| 89 | 89 | DECLARE_WRITE8_MEMBER( write ); |
| 90 | 90 | |
| 91 | 91 | INTERRUPT_GEN_MEMBER( frame_interrupt ); |
| 92 | 92 | DECLARE_READ8_MEMBER( vic_videoram_r ); |
| 93 | DECLARE_READ8_MEMBER( vic_colorram_r ); | |
| 93 | 94 | DECLARE_WRITE_LINE_MEMBER( vic_irq_w ); |
| 94 | 95 | |
| 95 | 96 | DECLARE_READ8_MEMBER( sid_potx_r ); |
| r18706 | r18707 | |
| 127 | 128 | UINT8 *m_charom; |
| 128 | 129 | |
| 129 | 130 | // video state |
| 130 | | |
| 131 | optional_shared_ptr<UINT8> m_color_ram; | |
| 131 | 132 | int m_va14; |
| 132 | 133 | int m_va15; |
| 133 | 134 |
| r18706 | r18707 | |
|---|---|---|
| 21 | 21 | TODO: |
| 22 | 22 | |
| 23 | 23 | - cleanup |
| 24 | - light pen | |
| 25 | 24 | - http://hitmen.c02.at/temp/palstuff/ |
| 26 | 25 | |
| 27 | 26 | */ |
| r18706 | r18707 | |
| 175 | 174 | |
| 176 | 175 | #define GFXMODE ((m_reg[0x11] & 0x60) | (m_reg[0x16] & 0x10)) >> 4 |
| 177 | 176 | #define SCREENON (m_reg[0x11] & 0x10) |
| 178 | #define VERTICALPOS (m_reg[0x11] & 0x07) | |
| 179 | #define HORIZONTALPOS (m_reg[0x16] & 0x07) | |
| 177 | #define YSCROLL (m_reg[0x11] & 0x07) | |
| 178 | #define XSCROLL (m_reg[0x16] & 0x07) | |
| 180 | 179 | #define ECMON (m_reg[0x11] & 0x40) |
| 181 | 180 | #define HIRESON (m_reg[0x11] & 0x20) |
| 182 | 181 | #define COLUMNS40 (m_reg[0x16] & 0x08) /* else 38 Columns */ |
| r18706 | r18707 | |
| 202 | 201 | #define VIC2_FIRSTCOLUMN (IS_PAL ? VIC6569_FIRSTCOLUMN : VIC6567_FIRSTCOLUMN) |
| 203 | 202 | #define VIC2_X_2_EMU(a) (IS_PAL ? VIC6569_X_2_EMU(a) : VIC6567_X_2_EMU(a)) |
| 204 | 203 | |
| 204 | #define IRQ_RST 0x01 | |
| 205 | #define IRQ_MBC 0x02 | |
| 206 | #define IRQ_MMC 0x04 | |
| 207 | #define IRQ_LP 0x08 | |
| 205 | 208 | |
| 206 | 209 | |
| 207 | 210 | |
| r18706 | r18707 | |
| 249 | 252 | // INLINE HELPERS |
| 250 | 253 | //************************************************************************** |
| 251 | 254 | |
| 252 | inline void mos6566_device:: | |
| 255 | inline void mos6566_device::set_interrupt( int mask ) | |
| 253 | 256 | { |
| 254 | 257 | if (((m_reg[0x19] ^ mask) & m_reg[0x1a] & 0xf)) |
| 255 | 258 | { |
| r18706 | r18707 | |
| 257 | 260 | { |
| 258 | 261 | DBG_LOG(2, "vic2", ("irq start %.2x\n", mask)); |
| 259 | 262 | m_reg[0x19] |= 0x80; |
| 260 | m_out_irq_func( | |
| 263 | m_out_irq_func(ASSERT_LINE); | |
| 261 | 264 | } |
| 262 | 265 | } |
| 263 | 266 | m_reg[0x19] |= mask; |
| 264 | 267 | } |
| 265 | 268 | |
| 266 | inline void mos6566_device:: | |
| 269 | inline void mos6566_device::clear_interrupt( int mask ) | |
| 267 | 270 | { |
| 268 | 271 | m_reg[0x19] &= ~mask; |
| 269 | 272 | if ((m_reg[0x19] & 0x80) && !(m_reg[0x19] & m_reg[0x1a] & 0xf)) |
| 270 | 273 | { |
| 271 | 274 | DBG_LOG(2, "vic2", ("irq end %.2x\n", mask)); |
| 272 | 275 | m_reg[0x19] &= ~0x80; |
| 273 | m_out_irq_func( | |
| 276 | m_out_irq_func(CLEAR_LINE); | |
| 274 | 277 | } |
| 275 | 278 | } |
| 276 | 279 | |
| 277 | 280 | inline UINT8 mos6566_device::read_videoram(offs_t offset) |
| 278 | 281 | { |
| 282 | //logerror("cycle %u VRAM %04x BA %u AEC %u\n", m_cycle, offset & 0x3fff, m_ba, m_aec); | |
| 279 | 283 | m_last_data = space(AS_0).read_byte(offset & 0x3fff); |
| 280 | 284 | |
| 281 | 285 | return m_last_data; |
| r18706 | r18707 | |
| 287 | 291 | } |
| 288 | 292 | |
| 289 | 293 | // Idle access |
| 290 | inline void mos6566_device:: | |
| 294 | inline void mos6566_device::idle_access() | |
| 291 | 295 | { |
| 292 | 296 | read_videoram(0x3fff); |
| 293 | 297 | } |
| 294 | 298 | |
| 295 | 299 | // Fetch sprite data pointer |
| 296 | inline void mos6566_device:: | |
| 300 | inline void mos6566_device::spr_ptr_access( int num ) | |
| 297 | 301 | { |
| 298 | 302 | m_spr_ptr[num] = read_videoram(SPRITE_ADDR(num)) << 6; |
| 299 | 303 | } |
| 300 | 304 | |
| 305 | inline void mos6566_device::spr_ba(int num) | |
| 306 | { | |
| 307 | if (BIT(m_spr_dma_on, num)) | |
| 308 | { | |
| 309 | set_ba(CLEAR_LINE); | |
| 310 | m_rdy_cycles += 2; | |
| 311 | } | |
| 312 | else if (num > 1 && !BIT(m_spr_dma_on, num - 1)) | |
| 313 | { | |
| 314 | set_ba(ASSERT_LINE); | |
| 315 | } | |
| 316 | } | |
| 317 | ||
| 301 | 318 | // Fetch sprite data, increment data counter |
| 302 | inline void mos6566_device:: | |
| 319 | inline void mos6566_device::spr_data_access( int num, int bytenum ) | |
| 303 | 320 | { |
| 304 | 321 | if (m_spr_dma_on & (1 << num)) |
| 305 | 322 | { |
| r18706 | r18707 | |
| 308 | 325 | } |
| 309 | 326 | else |
| 310 | 327 | if (bytenum == 1) |
| 311 | | |
| 328 | idle_access(); | |
| 312 | 329 | } |
| 313 | 330 | |
| 314 | 331 | // Turn on display if Bad Line |
| 315 | inline void mos6566_device:: | |
| 332 | inline void mos6566_device::display_if_bad_line() | |
| 316 | 333 | { |
| 317 | 334 | if (m_is_bad_line) |
| 318 | 335 | m_display_state = 1; |
| 319 | 336 | } |
| 320 | 337 | |
| 321 | // Suspend CPU | |
| 322 | inline void mos6566_device::vic2_suspend_cpu() | |
| 338 | inline void mos6566_device::set_ba(int state) | |
| 323 | 339 | { |
| 324 | if (m_ | |
| 340 | if (m_ba != state) | |
| 325 | 341 | { |
| 326 | m_first_ba_cycle = m_cycles_counter; | |
| 327 | //if (m_in_rdy_workaround_func(0) != 7 ) | |
| 342 | m_ba = state; | |
| 343 | ||
| 344 | if (m_ba) | |
| 328 | 345 | { |
| 329 | ||
| 346 | m_aec_delay = 0xff; | |
| 330 | 347 | } |
| 331 | m_device_suspended = 1; | |
| 332 | 348 | } |
| 333 | 349 | } |
| 334 | 350 | |
| 335 | // Resume CPU | |
| 336 | inline void mos6566_device::vic2_resume_cpu() | |
| 351 | inline void mos6566_device::set_aec(int state) | |
| 337 | 352 | { |
| 338 | if (m_ | |
| 353 | if (m_aec != state) | |
| 339 | 354 | { |
| 340 | // machine.firstcpu->resume(SUSPEND_REASON_SPIN); | |
| 341 | m_device_suspended = 0; | |
| 355 | m_aec = state; | |
| 342 | 356 | } |
| 343 | 357 | } |
| 344 | 358 | |
| 359 | inline void mos6566_device::bad_line_ba() | |
| 360 | { | |
| 361 | if (m_is_bad_line) | |
| 362 | { | |
| 363 | if (m_ba) | |
| 364 | { | |
| 365 | set_ba(CLEAR_LINE); | |
| 366 | m_rdy_cycles += 55 - m_cycle; | |
| 367 | } | |
| 368 | } | |
| 369 | else | |
| 370 | { | |
| 371 | set_ba(ASSERT_LINE); | |
| 372 | } | |
| 373 | } | |
| 374 | ||
| 345 | 375 | // Refresh access |
| 346 | inline void mos6566_device:: | |
| 376 | inline void mos6566_device::refresh_access() | |
| 347 | 377 | { |
| 348 | 378 | read_videoram(0x3f00 | m_ref_cnt--); |
| 349 | 379 | } |
| 350 | 380 | |
| 351 | 381 | |
| 352 | inline void mos6566_device:: | |
| 382 | inline void mos6566_device::fetch_if_bad_line() | |
| 353 | 383 | { |
| 354 | 384 | if (m_is_bad_line) |
| 355 | 385 | m_display_state = 1; |
| r18706 | r18707 | |
| 357 | 387 | |
| 358 | 388 | |
| 359 | 389 | // Turn on display and matrix access and reset RC if Bad Line |
| 360 | inline void mos6566_device:: | |
| 390 | inline void mos6566_device::rc_if_bad_line() | |
| 361 | 391 | { |
| 362 | 392 | if (m_is_bad_line) |
| 363 | 393 | { |
| r18706 | r18707 | |
| 367 | 397 | } |
| 368 | 398 | |
| 369 | 399 | // Sample border color and increment m_graphic_x |
| 370 | inline void mos6566_device:: | |
| 400 | inline void mos6566_device::sample_border() | |
| 371 | 401 | { |
| 372 | 402 | if (m_draw_this_line) |
| 373 | 403 | { |
| r18706 | r18707 | |
| 379 | 409 | |
| 380 | 410 | |
| 381 | 411 | // Turn on sprite DMA if necessary |
| 382 | inline void mos6566_device:: | |
| 412 | inline void mos6566_device::check_sprite_dma() | |
| 383 | 413 | { |
| 384 | 414 | int i; |
| 385 | 415 | UINT8 mask = 1; |
| r18706 | r18707 | |
| 395 | 425 | } |
| 396 | 426 | |
| 397 | 427 | // Video matrix access |
| 398 | inline void mos6566_device:: | |
| 428 | inline void mos6566_device::matrix_access() | |
| 399 | 429 | { |
| 400 | // if (m_device_suspended == 1) | |
| 430 | if (!m_is_bad_line) return; | |
| 431 | ||
| 432 | UINT16 adr = (m_vc & 0x03ff) | VIDEOADDR; | |
| 433 | ||
| 434 | // we're in the second clock phase | |
| 435 | m_phi0 = 1; | |
| 436 | set_aec(BIT(m_aec_delay, 2)); | |
| 437 | ||
| 438 | if (!m_ba && m_aec) | |
| 401 | 439 | { |
| 402 | if (m_cycles_counter < m_first_ba_cycle) | |
| 403 | m_matrix_line[m_ml_index] = m_color_line[m_ml_index] = 0xff; | |
| 404 | else | |
| 405 | { | |
| 406 | UINT16 adr = (m_vc & 0x03ff) | VIDEOADDR; | |
| 407 | m_matrix_line[m_ml_index] = read_videoram(adr); | |
| 408 | m_color_line[m_ml_index] = read_colorram((adr & 0x03ff)); | |
| 409 | } | |
| 440 | m_matrix_line[m_ml_index] = 0xff; | |
| 410 | 441 | } |
| 442 | else | |
| 443 | { | |
| 444 | m_matrix_line[m_ml_index] = read_videoram(adr); | |
| 445 | } | |
| 446 | ||
| 447 | m_color_line[m_ml_index] = read_colorram(adr & 0x03ff); | |
| 411 | 448 | } |
| 412 | 449 | |
| 413 | 450 | // Graphics data access |
| 414 | inline void mos6566_device:: | |
| 451 | inline void mos6566_device::graphics_access() | |
| 415 | 452 | { |
| 416 | 453 | if (m_display_state == 1) |
| 417 | 454 | { |
| r18706 | r18707 | |
| 435 | 472 | } |
| 436 | 473 | } |
| 437 | 474 | |
| 438 | inline void mos6566_device:: | |
| 475 | inline void mos6566_device::draw_background() | |
| 439 | 476 | { |
| 440 | 477 | if (m_draw_this_line) |
| 441 | 478 | { |
| r18706 | r18707 | |
| 471 | 508 | } |
| 472 | 509 | } |
| 473 | 510 | |
| 474 | inline void mos6566_device:: | |
| 511 | inline void mos6566_device::draw_mono( UINT16 p, UINT8 c0, UINT8 c1 ) | |
| 475 | 512 | { |
| 476 | 513 | UINT8 c[2]; |
| 477 | 514 | UINT8 data = m_gfx_data; |
| r18706 | r18707 | |
| 497 | 534 | m_fore_coll_buf[p + 0] = data & 1; |
| 498 | 535 | } |
| 499 | 536 | |
| 500 | inline void mos6566_device:: | |
| 537 | inline void mos6566_device::draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 ) | |
| 501 | 538 | { |
| 502 | 539 | UINT8 c[4]; |
| 503 | 540 | UINT8 data = m_gfx_data; |
| r18706 | r18707 | |
| 552 | 589 | device_execute_interface(mconfig, *this), |
| 553 | 590 | m_icount(0), |
| 554 | 591 | m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6566_videoram_map)), |
| 555 | m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)) | |
| 592 | m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)), | |
| 593 | m_phi0(1), | |
| 594 | m_ba(ASSERT_LINE), | |
| 595 | m_aec(ASSERT_LINE) | |
| 556 | 596 | { |
| 557 | 597 | } |
| 558 | 598 | |
| r18706 | r18707 | |
| 597 | 637 | // or initialize to defaults if none provided |
| 598 | 638 | else |
| 599 | 639 | { |
| 600 | // TODO | |
| 640 | memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb)); | |
| 641 | memset(&m_out_ba_cb, 0, sizeof(m_out_ba_cb)); | |
| 642 | memset(&m_out_aec_cb, 0, sizeof(m_out_aec_cb)); | |
| 643 | memset(&m_out_k_cb, 0, sizeof(m_out_k_cb)); | |
| 601 | 644 | } |
| 602 | 645 | } |
| 603 | 646 | |
| r18706 | r18707 | |
| 613 | 656 | |
| 614 | 657 | // resolve callbacks |
| 615 | 658 | m_out_irq_func.resolve(m_out_irq_cb, *this); |
| 616 | m_out_rdy_func.resolve(m_out_rdy_cb, *this); | |
| 659 | m_out_ba_func.resolve(m_out_ba_cb, *this); | |
| 660 | m_out_aec_func.resolve(m_out_aec_cb, *this); | |
| 617 | 661 | m_out_k_func.resolve(m_out_k_cb, *this); |
| 618 | 662 | |
| 619 | 663 | m_cpu = machine().device<cpu_device>(m_cpu_tag); |
| r18706 | r18707 | |
| 678 | 722 | save_item(NAME(m_spritemulti)); |
| 679 | 723 | |
| 680 | 724 | save_item(NAME(m_rasterline)); |
| 681 | save_item(NAME(m_cycles_counter)); | |
| 682 | 725 | save_item(NAME(m_cycle)); |
| 683 | 726 | save_item(NAME(m_raster_x)); |
| 684 | 727 | save_item(NAME(m_graphic_x)); |
| r18706 | r18707 | |
| 744 | 787 | // from 0 to 311 (0 first, PAL) or from 0 to 261 (? first, NTSC 6567R56A) or from 0 to 262 (? first, NTSC 6567R8) |
| 745 | 788 | m_rasterline = 0; // VIC2_LINES - 1; |
| 746 | 789 | |
| 747 | m_cycles_counter = -1; | |
| 748 | m_cycle = 63; | |
| 790 | m_cycle = 14; | |
| 791 | m_raster_x = 0x004; | |
| 749 | 792 | |
| 750 | 793 | m_on = 1; |
| 751 | 794 | |
| r18706 | r18707 | |
| 805 | 848 | m_colors[i] = 0; |
| 806 | 849 | m_spritemulti[i] = 0; |
| 807 | 850 | } |
| 851 | ||
| 852 | m_phi0 = 1; | |
| 853 | m_ba = CLEAR_LINE; | |
| 854 | m_aec = CLEAR_LINE; | |
| 855 | m_aec_delay = 0xff; | |
| 856 | m_rdy_cycles = 0; | |
| 857 | ||
| 858 | set_ba(ASSERT_LINE); | |
| 859 | set_aec(ASSERT_LINE); | |
| 808 | 860 | } |
| 809 | 861 | |
| 810 | 862 | |
| r18706 | r18707 | |
| 816 | 868 | { |
| 817 | 869 | do |
| 818 | 870 | { |
| 871 | UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff; | |
| 872 | UINT8 vic_cycles = total_cycles() & 0xff; | |
| 873 | ||
| 874 | m_phi0 = 0; | |
| 875 | ||
| 876 | m_aec_delay <<= 1; | |
| 877 | m_aec_delay |= m_ba; | |
| 878 | ||
| 879 | set_aec(CLEAR_LINE); | |
| 880 | ||
| 819 | 881 | int i; |
| 820 | 882 | UINT8 mask; |
| 821 | m_cycles_counter++; | |
| 822 | 883 | |
| 884 | if (m_rasterline == VIC2_FIRST_DMA_LINE) | |
| 885 | m_bad_lines_enabled = SCREENON; | |
| 886 | ||
| 887 | m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) && | |
| 888 | ((m_rasterline & 0x07) == YSCROLL) && m_bad_lines_enabled); | |
| 889 | ||
| 823 | 890 | switch (m_cycle) |
| 824 | 891 | { |
| 825 | ||
| 826 | 892 | // Sprite 3, raster counter, raster IRQ, bad line |
| 827 | 893 | case 1: |
| 828 | 894 | if (m_rasterline == (VIC2_LINES - 1)) |
| 829 | 895 | { |
| 830 | 896 | m_vblanking = 1; |
| 831 | ||
| 832 | // if (LIGHTPEN_BUTTON) | |
| 833 | { | |
| 834 | // m_reg[0x13] = VIC2_X_VALUE; | |
| 835 | // m_reg[0x14] = VIC2_Y_VALUE; | |
| 836 | } | |
| 837 | vic2_set_interrupt(8); | |
| 838 | 897 | } |
| 839 | 898 | else |
| 840 | 899 | { |
| 841 | 900 | m_rasterline++; |
| 842 | 901 | |
| 843 | if (m_rasterline == VIC2_FIRST_DMA_LINE) | |
| 844 | m_bad_lines_enabled = SCREENON; | |
| 845 | ||
| 846 | m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) && | |
| 847 | ((m_rasterline & 0x07) == VERTICALPOS) && m_bad_lines_enabled); | |
| 848 | ||
| 849 | 902 | m_draw_this_line = ((VIC2_RASTER_2_EMU(m_rasterline) >= VIC2_RASTER_2_EMU(VIC2_FIRST_DISP_LINE)) && |
| 850 | 903 | (VIC2_RASTER_2_EMU(m_rasterline ) <= VIC2_RASTER_2_EMU(VIC2_LAST_DISP_LINE))); |
| 851 | 904 | } |
| 852 | 905 | |
| 853 | 906 | m_border_on_sample[0] = m_border_on; |
| 854 | vic2_spr_ptr_access(3); | |
| 855 | vic2_spr_data_access(3, 0); | |
| 856 | vic2_display_if_bad_line(); | |
| 907 | spr_ptr_access(3); | |
| 908 | spr_data_access(3, 0); | |
| 909 | display_if_bad_line(); | |
| 857 | 910 | |
| 858 | if (m_spr_dma_on & 0x08) | |
| 859 | vic2_suspend_cpu(); | |
| 860 | else | |
| 861 | vic2_resume_cpu(); | |
| 862 | ||
| 863 | 911 | m_cycle++; |
| 864 | 912 | break; |
| 865 | 913 | |
| r18706 | r18707 | |
| 875 | 923 | // Trigger raster IRQ if IRQ in line 0 |
| 876 | 924 | if (RASTERLINE == 0) |
| 877 | 925 | { |
| 878 | | |
| 926 | set_interrupt(IRQ_RST); | |
| 879 | 927 | } |
| 880 | 928 | } |
| 881 | 929 | |
| 882 | 930 | if (m_rasterline == RASTERLINE) |
| 883 | 931 | { |
| 884 | | |
| 932 | set_interrupt(IRQ_RST); | |
| 885 | 933 | } |
| 886 | 934 | |
| 887 | 935 | m_graphic_x = VIC2_X_2_EMU(0); |
| 888 | 936 | |
| 889 | vic2_spr_data_access(3, 1); | |
| 890 | vic2_spr_data_access(3, 2); | |
| 891 | vic2_display_if_bad_line(); | |
| 937 | spr_data_access(3, 1); | |
| 938 | spr_data_access(3, 2); | |
| 939 | display_if_bad_line(); | |
| 892 | 940 | |
| 941 | spr_ba(5); | |
| 942 | ||
| 893 | 943 | m_cycle++; |
| 894 | 944 | break; |
| 895 | 945 | |
| 896 | 946 | // Sprite 4 |
| 897 | 947 | case 3: |
| 898 | vic2_spr_ptr_access(4); | |
| 899 | vic2_spr_data_access(4, 0); | |
| 900 | vic2_display_if_bad_line(); | |
| 948 | spr_ptr_access(4); | |
| 949 | spr_data_access(4, 0); | |
| 950 | display_if_bad_line(); | |
| 901 | 951 | |
| 902 | if (m_spr_dma_on & 0x10) | |
| 903 | vic2_suspend_cpu(); | |
| 904 | else | |
| 905 | vic2_resume_cpu(); | |
| 906 | ||
| 907 | 952 | m_cycle++; |
| 908 | 953 | break; |
| 909 | 954 | |
| 910 | 955 | // Sprite 4 |
| 911 | 956 | case 4: |
| 912 | vic2_spr_data_access(4, 1); | |
| 913 | vic2_spr_data_access(4, 2); | |
| 914 | vic2_display_if_bad_line(); | |
| 957 | spr_data_access(4, 1); | |
| 958 | spr_data_access(4, 2); | |
| 959 | display_if_bad_line(); | |
| 915 | 960 | |
| 961 | spr_ba(6); | |
| 962 | ||
| 916 | 963 | m_cycle++; |
| 917 | 964 | break; |
| 918 | 965 | |
| 919 | 966 | // Sprite 5 |
| 920 | 967 | case 5: |
| 921 | vic2_spr_ptr_access(5); | |
| 922 | vic2_spr_data_access(5, 0); | |
| 923 | vic2_display_if_bad_line(); | |
| 968 | spr_ptr_access(5); | |
| 969 | spr_data_access(5, 0); | |
| 970 | display_if_bad_line(); | |
| 924 | 971 | |
| 925 | if (m_spr_dma_on & 0x20) | |
| 926 | vic2_suspend_cpu(); | |
| 927 | else | |
| 928 | vic2_resume_cpu(); | |
| 929 | ||
| 930 | 972 | m_cycle++; |
| 931 | 973 | break; |
| 932 | 974 | |
| 933 | 975 | // Sprite 5 |
| 934 | 976 | case 6: |
| 935 | vic2_spr_data_access(5, 1); | |
| 936 | vic2_spr_data_access(5, 2); | |
| 937 | vic2_display_if_bad_line(); | |
| 977 | spr_data_access(5, 1); | |
| 978 | spr_data_access(5, 2); | |
| 979 | display_if_bad_line(); | |
| 938 | 980 | |
| 981 | spr_ba(7); | |
| 982 | ||
| 939 | 983 | m_cycle++; |
| 940 | 984 | break; |
| 941 | 985 | |
| 942 | 986 | // Sprite 6 |
| 943 | 987 | case 7: |
| 944 | vic2_spr_ptr_access(6); | |
| 945 | vic2_spr_data_access(6, 0); | |
| 946 | vic2_display_if_bad_line(); | |
| 988 | spr_ptr_access(6); | |
| 989 | spr_data_access(6, 0); | |
| 990 | display_if_bad_line(); | |
| 947 | 991 | |
| 948 | if (m_spr_dma_on & 0x40) | |
| 949 | vic2_suspend_cpu(); | |
| 950 | else | |
| 951 | vic2_resume_cpu(); | |
| 952 | ||
| 953 | 992 | m_cycle++; |
| 954 | 993 | break; |
| 955 | 994 | |
| 956 | 995 | // Sprite 6 |
| 957 | 996 | case 8: |
| 958 | vic2_spr_data_access(6, 1); | |
| 959 | vic2_spr_data_access(6, 2); | |
| 960 | vic2_display_if_bad_line(); | |
| 997 | spr_data_access(6, 1); | |
| 998 | spr_data_access(6, 2); | |
| 999 | display_if_bad_line(); | |
| 961 | 1000 | |
| 962 | 1001 | m_cycle++; |
| 963 | 1002 | break; |
| 964 | 1003 | |
| 965 | 1004 | // Sprite 7 |
| 966 | 1005 | case 9: |
| 967 | vic2_spr_ptr_access(7); | |
| 968 | vic2_spr_data_access(7, 0); | |
| 969 | vic2_display_if_bad_line(); | |
| 1006 | spr_ptr_access(7); | |
| 1007 | spr_data_access(7, 0); | |
| 1008 | display_if_bad_line(); | |
| 970 | 1009 | |
| 971 | if (m_spr_dma_on & 0x80) | |
| 972 | vic2_suspend_cpu(); | |
| 973 | else | |
| 974 | vic2_resume_cpu(); | |
| 975 | ||
| 976 | 1010 | m_cycle++; |
| 977 | 1011 | break; |
| 978 | 1012 | |
| 979 | 1013 | // Sprite 7 |
| 980 | 1014 | case 10: |
| 981 | vic2_spr_data_access(7, 1); | |
| 982 | vic2_spr_data_access(7, 2); | |
| 983 | vic2_display_if_bad_line(); | |
| 1015 | spr_data_access(7, 1); | |
| 1016 | spr_data_access(7, 2); | |
| 1017 | display_if_bad_line(); | |
| 984 | 1018 | |
| 1019 | set_ba(ASSERT_LINE); | |
| 1020 | ||
| 985 | 1021 | m_cycle++; |
| 986 | 1022 | break; |
| 987 | 1023 | |
| 988 | 1024 | // Refresh |
| 989 | 1025 | case 11: |
| 990 | vic2_refresh_access(); | |
| 991 | vic2_display_if_bad_line(); | |
| 1026 | refresh_access(); | |
| 1027 | display_if_bad_line(); | |
| 992 | 1028 | |
| 993 | vic2_resume_cpu(); | |
| 994 | ||
| 995 | 1029 | m_cycle++; |
| 996 | 1030 | break; |
| 997 | 1031 | |
| 998 | 1032 | // Refresh, fetch if bad line |
| 999 | 1033 | case 12: |
| 1000 | vic2_refresh_access(); | |
| 1001 | vic2_fetch_if_bad_line(); | |
| 1034 | bad_line_ba(); | |
| 1002 | 1035 | |
| 1036 | refresh_access(); | |
| 1037 | fetch_if_bad_line(); | |
| 1038 | ||
| 1003 | 1039 | m_cycle++; |
| 1004 | 1040 | break; |
| 1005 | 1041 | |
| 1006 | 1042 | // Refresh, fetch if bad line, raster_x |
| 1007 | 1043 | case 13: |
| 1008 | vic2_draw_background(); | |
| 1009 | vic2_sample_border(); | |
| 1010 | vic2_refresh_access(); | |
| 1011 | vic2_fetch_if_bad_line(); | |
| 1044 | bad_line_ba(); | |
| 1012 | 1045 | |
| 1013 | m_raster_x = 0xfffc; | |
| 1046 | draw_background(); | |
| 1047 | sample_border(); | |
| 1048 | refresh_access(); | |
| 1049 | fetch_if_bad_line(); | |
| 1014 | 1050 | |
| 1015 | 1051 | m_cycle++; |
| 1016 | 1052 | break; |
| 1017 | 1053 | |
| 1018 | 1054 | // Refresh, fetch if bad line, RC, VC |
| 1019 | 1055 | case 14: |
| 1020 | vic2_draw_background(); | |
| 1021 | vic2_sample_border(); | |
| 1022 | vic2_refresh_access(); | |
| 1023 | vic2_rc_if_bad_line(); | |
| 1056 | bad_line_ba(); | |
| 1024 | 1057 | |
| 1058 | draw_background(); | |
| 1059 | sample_border(); | |
| 1060 | refresh_access(); | |
| 1061 | rc_if_bad_line(); | |
| 1062 | ||
| 1025 | 1063 | m_vc = m_vc_base; |
| 1026 | 1064 | |
| 1027 | 1065 | m_cycle++; |
| r18706 | r18707 | |
| 1029 | 1067 | |
| 1030 | 1068 | // Refresh, fetch if bad line, sprite y expansion |
| 1031 | 1069 | case 15: |
| 1032 | vic2_draw_background(); | |
| 1033 | vic2_sample_border(); | |
| 1034 | vic2_refresh_access(); | |
| 1035 | vic2_fetch_if_bad_line(); | |
| 1070 | bad_line_ba(); | |
| 1036 | 1071 | |
| 1072 | draw_background(); | |
| 1073 | sample_border(); | |
| 1074 | refresh_access(); | |
| 1075 | fetch_if_bad_line(); | |
| 1076 | ||
| 1037 | 1077 | for (i = 0; i < 8; i++) |
| 1038 | 1078 | if (m_spr_exp_y & (1 << i)) |
| 1039 | 1079 | m_mc_base[i] += 2; |
| 1040 | 1080 | |
| 1041 | if (m_is_bad_line) | |
| 1042 | vic2_suspend_cpu(); | |
| 1043 | ||
| 1044 | 1081 | m_ml_index = 0; |
| 1045 | | |
| 1082 | matrix_access(); | |
| 1046 | 1083 | |
| 1047 | 1084 | m_cycle++; |
| 1048 | 1085 | break; |
| 1049 | 1086 | |
| 1050 | 1087 | // Graphics, sprite y expansion, sprite DMA |
| 1051 | 1088 | case 16: |
| 1052 | vic2_draw_background(); | |
| 1053 | vic2_sample_border(); | |
| 1054 | vic2_graphics_access(); | |
| 1055 | vic2_fetch_if_bad_line(); | |
| 1089 | bad_line_ba(); | |
| 1056 | 1090 | |
| 1091 | draw_background(); | |
| 1092 | sample_border(); | |
| 1093 | graphics_access(); | |
| 1094 | fetch_if_bad_line(); | |
| 1095 | ||
| 1057 | 1096 | mask = 1; |
| 1058 | 1097 | for (i = 0; i < 8; i++, mask <<= 1) |
| 1059 | 1098 | { |
| r18706 | r18707 | |
| 1063 | 1102 | m_spr_dma_on &= ~mask; |
| 1064 | 1103 | } |
| 1065 | 1104 | |
| 1066 | | |
| 1105 | matrix_access(); | |
| 1067 | 1106 | |
| 1068 | 1107 | m_cycle++; |
| 1069 | 1108 | break; |
| 1070 | 1109 | |
| 1071 | 1110 | // Graphics, check border |
| 1072 | 1111 | case 17: |
| 1112 | bad_line_ba(); | |
| 1113 | ||
| 1073 | 1114 | if (COLUMNS40) |
| 1074 | 1115 | { |
| 1075 | 1116 | if (m_rasterline == m_dy_stop) |
| r18706 | r18707 | |
| 1093 | 1134 | // Second sample of border state |
| 1094 | 1135 | m_border_on_sample[1] = m_border_on; |
| 1095 | 1136 | |
| 1096 | vic2_draw_background(); | |
| 1097 | vic2_draw_graphics(); | |
| 1098 | vic2_sample_border(); | |
| 1099 | vic2_graphics_access(); | |
| 1100 | vic2_fetch_if_bad_line(); | |
| 1101 | vic2_matrix_access(); | |
| 1137 | draw_background(); | |
| 1138 | draw_graphics(); | |
| 1139 | sample_border(); | |
| 1140 | graphics_access(); | |
| 1141 | fetch_if_bad_line(); | |
| 1142 | matrix_access(); | |
| 1102 | 1143 | |
| 1103 | 1144 | m_cycle++; |
| 1104 | 1145 | break; |
| 1105 | 1146 | |
| 1106 | 1147 | // Check border |
| 1107 | 1148 | case 18: |
| 1149 | bad_line_ba(); | |
| 1150 | ||
| 1108 | 1151 | if (!COLUMNS40) |
| 1109 | 1152 | { |
| 1110 | 1153 | if (m_rasterline == m_dy_stop) |
| r18706 | r18707 | |
| 1166 | 1209 | case 52: |
| 1167 | 1210 | case 53: |
| 1168 | 1211 | case 54: |
| 1169 | vic2_draw_graphics(); | |
| 1170 | vic2_sample_border(); | |
| 1171 | vic2_graphics_access(); | |
| 1172 | vic2_fetch_if_bad_line(); | |
| 1173 | vic2_matrix_access(); | |
| 1212 | draw_graphics(); | |
| 1213 | sample_border(); | |
| 1214 | graphics_access(); | |
| 1215 | fetch_if_bad_line(); | |
| 1216 | matrix_access(); | |
| 1174 | 1217 | m_last_char_data = m_char_data; |
| 1175 | 1218 | |
| 1176 | 1219 | m_cycle++; |
| r18706 | r18707 | |
| 1178 | 1221 | |
| 1179 | 1222 | // Graphics, sprite y expansion, sprite DMA |
| 1180 | 1223 | case 55: |
| 1181 | vic2_draw_graphics(); | |
| 1182 | vic2_sample_border(); | |
| 1183 | vic2_graphics_access(); | |
| 1184 | vic2_display_if_bad_line(); | |
| 1224 | if (m_is_bad_line) | |
| 1225 | set_ba(ASSERT_LINE); | |
| 1185 | 1226 | |
| 1227 | draw_graphics(); | |
| 1228 | sample_border(); | |
| 1229 | graphics_access(); | |
| 1230 | display_if_bad_line(); | |
| 1231 | ||
| 1186 | 1232 | // sprite y expansion |
| 1187 | 1233 | mask = 1; |
| 1188 | 1234 | for (i = 0; i < 8; i++, mask <<= 1) |
| 1189 | 1235 | if (SPRITE_Y_EXPAND (i)) |
| 1190 | 1236 | m_spr_exp_y ^= mask; |
| 1191 | 1237 | |
| 1192 | | |
| 1238 | check_sprite_dma(); | |
| 1193 | 1239 | |
| 1194 | vic2_resume_cpu(); | |
| 1195 | ||
| 1196 | 1240 | m_cycle++; |
| 1197 | 1241 | break; |
| 1198 | 1242 | |
| r18706 | r18707 | |
| 1204 | 1248 | // Fourth sample of border state |
| 1205 | 1249 | m_border_on_sample[3] = m_border_on; |
| 1206 | 1250 | |
| 1207 | vic2_draw_graphics(); | |
| 1208 | vic2_sample_border(); | |
| 1209 | vic2_idle_access(); | |
| 1210 | vic2_display_if_bad_line(); | |
| 1211 | vic2_check_sprite_dma(); | |
| 1251 | draw_graphics(); | |
| 1252 | sample_border(); | |
| 1253 | idle_access(); | |
| 1254 | display_if_bad_line(); | |
| 1255 | check_sprite_dma(); | |
| 1212 | 1256 | |
| 1213 | 1257 | m_cycle++; |
| 1214 | 1258 | break; |
| r18706 | r18707 | |
| 1231 | 1275 | if ((m_spr_disp_on & mask) && !(m_spr_dma_on & mask)) |
| 1232 | 1276 | m_spr_disp_on &= ~mask; |
| 1233 | 1277 | |
| 1234 | vic2_draw_background(); | |
| 1235 | vic2_sample_border(); | |
| 1236 | vic2_idle_access(); | |
| 1237 | vic2_display_if_bad_line(); | |
| 1278 | draw_background(); | |
| 1279 | sample_border(); | |
| 1280 | idle_access(); | |
| 1281 | display_if_bad_line(); | |
| 1238 | 1282 | |
| 1283 | spr_ba(0); | |
| 1284 | ||
| 1239 | 1285 | m_cycle++; |
| 1240 | 1286 | break; |
| 1241 | 1287 | |
| 1242 | 1288 | // for NTSC 6567R8 |
| 1243 | 1289 | case 58: |
| 1244 | vic2_draw_background(); | |
| 1245 | vic2_sample_border(); | |
| 1246 | vic2_idle_access(); | |
| 1247 | vic2_display_if_bad_line(); | |
| 1290 | draw_background(); | |
| 1291 | sample_border(); | |
| 1292 | idle_access(); | |
| 1293 | display_if_bad_line(); | |
| 1248 | 1294 | |
| 1249 | 1295 | m_cycle++; |
| 1250 | 1296 | break; |
| 1251 | 1297 | |
| 1252 | 1298 | // for NTSC 6567R8 |
| 1253 | 1299 | case 59: |
| 1254 | vic2_draw_background(); | |
| 1255 | vic2_sample_border(); | |
| 1256 | vic2_idle_access(); | |
| 1257 | vic2_display_if_bad_line(); | |
| 1300 | draw_background(); | |
| 1301 | sample_border(); | |
| 1302 | idle_access(); | |
| 1303 | display_if_bad_line(); | |
| 1258 | 1304 | |
| 1305 | spr_ba(1); | |
| 1306 | ||
| 1259 | 1307 | m_cycle++; |
| 1260 | 1308 | break; |
| 1261 | 1309 | |
| 1262 | 1310 | // Sprite 0, sprite DMA, MC, RC |
| 1263 | 1311 | case 60: |
| 1264 | vic2_draw_background(); | |
| 1265 | vic2_sample_border(); | |
| 1312 | draw_background(); | |
| 1313 | sample_border(); | |
| 1266 | 1314 | |
| 1267 | 1315 | mask = 1; |
| 1268 | 1316 | for (i = 0; i < 8; i++, mask <<= 1) |
| r18706 | r18707 | |
| 1272 | 1320 | m_spr_disp_on |= mask; |
| 1273 | 1321 | } |
| 1274 | 1322 | |
| 1275 | vic2_spr_ptr_access(0); | |
| 1276 | vic2_spr_data_access(0, 0); | |
| 1323 | spr_ptr_access(0); | |
| 1324 | spr_data_access(0, 0); | |
| 1277 | 1325 | |
| 1278 | 1326 | if (m_rc == 7) |
| 1279 | 1327 | { |
| r18706 | r18707 | |
| 1287 | 1335 | m_rc = (m_rc + 1) & 7; |
| 1288 | 1336 | } |
| 1289 | 1337 | |
| 1290 | if (m_spr_dma_on & 0x01) | |
| 1291 | vic2_suspend_cpu(); | |
| 1292 | else | |
| 1293 | vic2_resume_cpu(); | |
| 1294 | ||
| 1295 | 1338 | m_cycle++; |
| 1296 | 1339 | break; |
| 1297 | 1340 | |
| 1298 | 1341 | // Sprite 0 |
| 1299 | 1342 | case 61: |
| 1300 | vic2_draw_background(); | |
| 1301 | vic2_sample_border(); | |
| 1302 | vic2_spr_data_access(0, 1); | |
| 1303 | vic2_spr_data_access(0, 2); | |
| 1304 | vic2_display_if_bad_line(); | |
| 1343 | draw_background(); | |
| 1344 | sample_border(); | |
| 1345 | spr_data_access(0, 1); | |
| 1346 | spr_data_access(0, 2); | |
| 1347 | display_if_bad_line(); | |
| 1305 | 1348 | |
| 1349 | spr_ba(2); | |
| 1350 | ||
| 1306 | 1351 | m_cycle++; |
| 1307 | 1352 | break; |
| 1308 | 1353 | |
| 1309 | 1354 | // Sprite 1, draw |
| 1310 | 1355 | case 62: |
| 1311 | vic2_draw_background(); | |
| 1312 | vic2_sample_border(); | |
| 1356 | draw_background(); | |
| 1357 | sample_border(); | |
| 1313 | 1358 | |
| 1314 | 1359 | if (m_draw_this_line) |
| 1315 | 1360 | { |
| 1316 | | |
| 1361 | draw_sprites(); | |
| 1317 | 1362 | |
| 1318 | 1363 | if (m_border_on_sample[0]) |
| 1319 | 1364 | for (i = 0; i < 4; i++) |
| r18706 | r18707 | |
| 1338 | 1383 | } |
| 1339 | 1384 | } |
| 1340 | 1385 | |
| 1341 | vic2_spr_ptr_access(1); | |
| 1342 | vic2_spr_data_access(1, 0); | |
| 1343 | vic2_display_if_bad_line(); | |
| 1386 | spr_ptr_access(1); | |
| 1387 | spr_data_access(1, 0); | |
| 1388 | display_if_bad_line(); | |
| 1344 | 1389 | |
| 1345 | if (m_spr_dma_on & 0x02) | |
| 1346 | vic2_suspend_cpu(); | |
| 1347 | else | |
| 1348 | vic2_resume_cpu(); | |
| 1349 | ||
| 1350 | 1390 | m_cycle++; |
| 1351 | 1391 | break; |
| 1352 | 1392 | |
| 1353 | 1393 | // Sprite 1 |
| 1354 | 1394 | case 63: |
| 1355 | vic2_spr_data_access(1, 1); | |
| 1356 | vic2_spr_data_access(1, 2); | |
| 1357 | vic2_display_if_bad_line(); | |
| 1395 | spr_data_access(1, 1); | |
| 1396 | spr_data_access(1, 2); | |
| 1397 | display_if_bad_line(); | |
| 1358 | 1398 | |
| 1399 | spr_ba(3); | |
| 1400 | ||
| 1359 | 1401 | m_cycle++; |
| 1360 | 1402 | break; |
| 1361 | 1403 | |
| 1362 | 1404 | // Sprite 2 |
| 1363 | 1405 | case 64: |
| 1364 | vic2_spr_ptr_access(2); | |
| 1365 | vic2_spr_data_access(2, 0); | |
| 1366 | vic2_display_if_bad_line(); | |
| 1406 | spr_ptr_access(2); | |
| 1407 | spr_data_access(2, 0); | |
| 1408 | display_if_bad_line(); | |
| 1367 | 1409 | |
| 1368 | if (m_spr_dma_on & 0x04) | |
| 1369 | vic2_suspend_cpu(); | |
| 1370 | else | |
| 1371 | vic2_resume_cpu(); | |
| 1372 | ||
| 1373 | 1410 | m_cycle++; |
| 1374 | 1411 | break; |
| 1375 | 1412 | |
| 1376 | 1413 | // Sprite 2 |
| 1377 | 1414 | case 65: |
| 1378 | vic2_spr_data_access(2, 1); | |
| 1379 | vic2_spr_data_access(2, 2); | |
| 1380 | vic2_display_if_bad_line(); | |
| 1415 | spr_data_access(2, 1); | |
| 1416 | spr_data_access(2, 2); | |
| 1417 | display_if_bad_line(); | |
| 1381 | 1418 | |
| 1382 | 1419 | if (m_rasterline == m_dy_stop) |
| 1383 | 1420 | m_ud_border_on = 1; |
| r18706 | r18707 | |
| 1385 | 1422 | if (SCREENON && (m_rasterline == m_dy_start)) |
| 1386 | 1423 | m_ud_border_on = 0; |
| 1387 | 1424 | |
| 1425 | spr_ba(4); | |
| 1426 | ||
| 1388 | 1427 | // Last cycle |
| 1389 | 1428 | m_cycle = 1; |
| 1390 | 1429 | } |
| 1430 | ||
| 1431 | m_phi0 = 1; | |
| 1432 | set_aec(BIT(m_aec_delay, 2)); | |
| 1391 | 1433 | |
| 1434 | m_out_ba_func(m_ba); | |
| 1435 | m_out_aec_func(m_aec); | |
| 1436 | ||
| 1392 | 1437 | m_raster_x += 8; |
| 1438 | if (m_raster_x == 0x1fc) m_raster_x = 0x004; | |
| 1439 | ||
| 1440 | if ((cpu_cycles == vic_cycles) && (m_rdy_cycles > 0)) | |
| 1441 | { | |
| 1442 | m_cpu->spin_until_time(m_cpu->cycles_to_attotime(m_rdy_cycles)); | |
| 1443 | m_rdy_cycles = 0; | |
| 1444 | } | |
| 1445 | ||
| 1393 | 1446 | m_icount--; |
| 1394 | 1447 | } while (m_icount > 0); |
| 1395 | 1448 | } |
| r18706 | r18707 | |
| 1403 | 1456 | { |
| 1404 | 1457 | do |
| 1405 | 1458 | { |
| 1459 | UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff; | |
| 1460 | UINT8 vic_cycles = total_cycles() & 0xff; | |
| 1461 | ||
| 1462 | m_phi0 = 0; | |
| 1463 | ||
| 1464 | m_aec_delay <<= 1; | |
| 1465 | m_aec_delay |= m_ba; | |
| 1466 | ||
| 1467 | set_aec(CLEAR_LINE); | |
| 1468 | ||
| 1406 | 1469 | int i; |
| 1407 | 1470 | UINT8 mask; |
| 1408 | //static int adjust[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; | |
| 1409 | 1471 | |
| 1410 | UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff; | |
| 1411 | UINT8 vic_cycles = (m_cycles_counter + 1) & 0xff; | |
| 1412 | m_cycles_counter++; | |
| 1472 | if ((m_rasterline == VIC2_FIRST_DMA_LINE) && !m_bad_lines_enabled) | |
| 1473 | m_bad_lines_enabled = SCREENON; | |
| 1413 | 1474 | |
| 1414 | // printf("%02x %02x %02x\n",cpu_cycles,vic_cycles,m_rdy_cycles); | |
| 1415 | #if 0 | |
| 1416 | if (machine.input().code_pressed(KEYCODE_X)) | |
| 1417 | { | |
| 1418 | if (machine.input().code_pressed_once(KEYCODE_Q)) adjust[1]++; | |
| 1419 | if (machine.input().code_pressed_once(KEYCODE_W)) adjust[2]++; | |
| 1420 | if (machine.input().code_pressed_once(KEYCODE_E)) adjust[3]++; | |
| 1421 | if (machine.input().code_pressed_once(KEYCODE_R)) adjust[4]++; | |
| 1422 | if (machine.input().code_pressed_once(KEYCODE_T)) adjust[5]++; | |
| 1423 | if (machine.input().code_pressed_once(KEYCODE_Y)) adjust[6]++; | |
| 1424 | if (machine.input().code_pressed_once(KEYCODE_U)) adjust[7]++; | |
| 1425 | if (machine.input().code_pressed_once(KEYCODE_I)) adjust[8]++; | |
| 1426 | if (machine.input().code_pressed_once(KEYCODE_A)) adjust[1]--; | |
| 1427 | if (machine.input().code_pressed_once(KEYCODE_S)) adjust[2]--; | |
| 1428 | if (machine.input().code_pressed_once(KEYCODE_D)) adjust[3]--; | |
| 1429 | if (machine.input().code_pressed_once(KEYCODE_F)) adjust[4]--; | |
| 1430 | if (machine.input().code_pressed_once(KEYCODE_G)) adjust[5]--; | |
| 1431 | if (machine.input().code_pressed_once(KEYCODE_H)) adjust[6]--; | |
| 1432 | if (machine.input().code_pressed_once(KEYCODE_J)) adjust[7]--; | |
| 1433 | if (machine.input().code_pressed_once(KEYCODE_K)) adjust[8]--; | |
| 1434 | if (machine.input().code_pressed_once(KEYCODE_C)) adjust[0]++; | |
| 1435 | if (machine.input().code_pressed_once(KEYCODE_V)) adjust[0]--; | |
| 1436 | if (machine.input().code_pressed_once(KEYCODE_Z)) printf("b:%02x 1:%02x 2:%02x 3:%02x 4:%02x 5:%02x 6:%02x 7:%02x 8:%02x\n", | |
| 1437 | adjust[0],adjust[1],adjust[2],adjust[3],adjust[4],adjust[5],adjust[6],adjust[7],adjust[8]); | |
| 1438 | } | |
| 1439 | #define adjust(x) adjust[x] | |
| 1440 | #else | |
| 1441 | #define adjust(x) 0 | |
| 1442 | #endif | |
| 1475 | m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) && | |
| 1476 | ((m_rasterline & 0x07) == YSCROLL) && m_bad_lines_enabled); | |
| 1443 | 1477 | |
| 1444 | switch(m_cycle) | |
| 1478 | switch (m_cycle) | |
| 1445 | 1479 | { |
| 1446 | ||
| 1447 | 1480 | // Sprite 3, raster counter, raster IRQ, bad line |
| 1448 | 1481 | case 1: |
| 1449 | 1482 | if (m_rasterline == (VIC2_LINES - 1)) |
| 1450 | 1483 | { |
| 1451 | 1484 | m_vblanking = 1; |
| 1452 | ||
| 1453 | // if (LIGHTPEN_BUTTON) | |
| 1454 | { | |
| 1455 | // m_reg[0x13] = VIC2_X_VALUE; | |
| 1456 | // m_reg[0x14] = VIC2_Y_VALUE; | |
| 1457 | } | |
| 1458 | vic2_set_interrupt(8); | |
| 1459 | 1485 | } |
| 1460 | 1486 | else |
| 1461 | 1487 | { |
| 1462 | 1488 | m_rasterline++; |
| 1463 | 1489 | |
| 1464 | if (m_rasterline == VIC2_FIRST_DMA_LINE) | |
| 1465 | m_bad_lines_enabled = SCREENON; | |
| 1466 | ||
| 1467 | m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) && | |
| 1468 | ((m_rasterline & 0x07) == VERTICALPOS) && m_bad_lines_enabled); | |
| 1469 | ||
| 1470 | 1490 | m_draw_this_line = ((VIC2_RASTER_2_EMU(m_rasterline) >= VIC2_RASTER_2_EMU(VIC2_FIRST_DISP_LINE)) && |
| 1471 | 1491 | (VIC2_RASTER_2_EMU(m_rasterline ) <= VIC2_RASTER_2_EMU(VIC2_LAST_DISP_LINE))); |
| 1472 | 1492 | } |
| 1473 | 1493 | |
| 1474 | 1494 | m_border_on_sample[0] = m_border_on; |
| 1475 | vic2_spr_ptr_access(3); | |
| 1476 | vic2_spr_data_access(3, 0); | |
| 1477 | vic2_display_if_bad_line(); | |
| 1495 | spr_ptr_access(3); | |
| 1496 | spr_data_access(3, 0); | |
| 1497 | display_if_bad_line(); | |
| 1478 | 1498 | |
| 1479 | if (m_spr_dma_on & 0x08) | |
| 1480 | vic2_suspend_cpu(); | |
| 1481 | else | |
| 1482 | vic2_resume_cpu(); | |
| 1483 | ||
| 1484 | if (m_spr_dma_on & 0x08) m_rdy_cycles += (2 + adjust(1)); | |
| 1485 | ||
| 1486 | 1499 | m_cycle++; |
| 1487 | 1500 | break; |
| 1488 | 1501 | |
| 1489 | 1502 | // Sprite 3 |
| 1490 | 1503 | case 2: |
| 1504 | spr_ba(5); | |
| 1505 | ||
| 1491 | 1506 | if (m_vblanking) |
| 1492 | 1507 | { |
| 1493 | 1508 | // Vertical blank, reset counters |
| r18706 | r18707 | |
| 1498 | 1513 | // Trigger raster IRQ if IRQ in line 0 |
| 1499 | 1514 | if (RASTERLINE == 0) |
| 1500 | 1515 | { |
| 1501 | | |
| 1516 | set_interrupt(IRQ_RST); | |
| 1502 | 1517 | } |
| 1503 | 1518 | } |
| 1504 | 1519 | |
| 1505 | 1520 | if (m_rasterline == RASTERLINE) |
| 1506 | 1521 | { |
| 1507 | | |
| 1522 | set_interrupt(IRQ_RST); | |
| 1508 | 1523 | } |
| 1509 | 1524 | |
| 1510 | 1525 | m_graphic_x = VIC2_X_2_EMU(0); |
| 1511 | 1526 | |
| 1512 | vic2_spr_data_access(3, 1); | |
| 1513 | vic2_spr_data_access(3, 2); | |
| 1514 | vic2_display_if_bad_line(); | |
| 1527 | spr_data_access(3, 1); | |
| 1528 | spr_data_access(3, 2); | |
| 1529 | display_if_bad_line(); | |
| 1515 | 1530 | |
| 1516 | 1531 | m_cycle++; |
| 1517 | 1532 | break; |
| 1518 | 1533 | |
| 1519 | 1534 | // Sprite 4 |
| 1520 | 1535 | case 3: |
| 1521 | vic2_spr_ptr_access(4); | |
| 1522 | vic2_spr_data_access(4, 0); | |
| 1523 | vic2_display_if_bad_line(); | |
| 1536 | spr_ptr_access(4); | |
| 1537 | spr_data_access(4, 0); | |
| 1538 | display_if_bad_line(); | |
| 1524 | 1539 | |
| 1525 | if (m_spr_dma_on & 0x10) | |
| 1526 | vic2_suspend_cpu(); | |
| 1527 | else | |
| 1528 | vic2_resume_cpu(); | |
| 1529 | ||
| 1530 | if (m_spr_dma_on & 0x10) m_rdy_cycles += (2 + adjust(2)); | |
| 1531 | ||
| 1532 | 1540 | m_cycle++; |
| 1533 | 1541 | break; |
| 1534 | 1542 | |
| 1535 | 1543 | // Sprite 4 |
| 1536 | 1544 | case 4: |
| 1537 | vic2_spr_data_access(4, 1); | |
| 1538 | vic2_spr_data_access(4, 2); | |
| 1539 | vic2_display_if_bad_line(); | |
| 1545 | spr_ba(6); | |
| 1540 | 1546 | |
| 1547 | spr_data_access(4, 1); | |
| 1548 | spr_data_access(4, 2); | |
| 1549 | display_if_bad_line(); | |
| 1550 | ||
| 1541 | 1551 | m_cycle++; |
| 1542 | 1552 | break; |
| 1543 | 1553 | |
| 1544 | 1554 | // Sprite 5 |
| 1545 | 1555 | case 5: |
| 1546 | vic2_spr_ptr_access(5); | |
| 1547 | vic2_spr_data_access(5, 0); | |
| 1548 | vic2_display_if_bad_line(); | |
| 1556 | spr_ptr_access(5); | |
| 1557 | spr_data_access(5, 0); | |
| 1558 | display_if_bad_line(); | |
| 1549 | 1559 | |
| 1550 | if (m_spr_dma_on & 0x20) | |
| 1551 | vic2_suspend_cpu(); | |
| 1552 | else | |
| 1553 | vic2_resume_cpu(); | |
| 1554 | ||
| 1555 | if (m_spr_dma_on & 0x20) m_rdy_cycles += (2 + adjust(3)); | |
| 1556 | ||
| 1557 | 1560 | m_cycle++; |
| 1558 | 1561 | break; |
| 1559 | 1562 | |
| 1560 | 1563 | // Sprite 5 |
| 1561 | 1564 | case 6: |
| 1562 | vic2_spr_data_access(5, 1); | |
| 1563 | vic2_spr_data_access(5, 2); | |
| 1564 | vic2_display_if_bad_line(); | |
| 1565 | spr_ba(7); | |
| 1565 | 1566 | |
| 1567 | spr_data_access(5, 1); | |
| 1568 | spr_data_access(5, 2); | |
| 1569 | display_if_bad_line(); | |
| 1570 | ||
| 1566 | 1571 | m_cycle++; |
| 1567 | 1572 | break; |
| 1568 | 1573 | |
| 1569 | 1574 | // Sprite 6 |
| 1570 | 1575 | case 7: |
| 1571 | vic2_spr_ptr_access(6); | |
| 1572 | vic2_spr_data_access(6, 0); | |
| 1573 | vic2_display_if_bad_line(); | |
| 1576 | spr_ptr_access(6); | |
| 1577 | spr_data_access(6, 0); | |
| 1578 | display_if_bad_line(); | |
| 1574 | 1579 | |
| 1575 | if (m_spr_dma_on & 0x40) | |
| 1576 | vic2_suspend_cpu(); | |
| 1577 | else | |
| 1578 | vic2_resume_cpu(); | |
| 1579 | ||
| 1580 | if (m_spr_dma_on & 0x40) m_rdy_cycles += (2 + adjust(4)); | |
| 1581 | ||
| 1582 | 1580 | m_cycle++; |
| 1583 | 1581 | break; |
| 1584 | 1582 | |
| 1585 | 1583 | // Sprite 6 |
| 1586 | 1584 | case 8: |
| 1587 | vic2_spr_data_access(6, 1); | |
| 1588 | vic2_spr_data_access(6, 2); | |
| 1589 | vic2_display_if_bad_line(); | |
| 1585 | spr_data_access(6, 1); | |
| 1586 | spr_data_access(6, 2); | |
| 1587 | display_if_bad_line(); | |
| 1590 | 1588 | |
| 1591 | 1589 | m_cycle++; |
| 1592 | 1590 | break; |
| 1593 | 1591 | |
| 1594 | 1592 | // Sprite 7 |
| 1595 | 1593 | case 9: |
| 1596 | vic2_spr_ptr_access(7); | |
| 1597 | vic2_spr_data_access(7, 0); | |
| 1598 | vic2_display_if_bad_line(); | |
| 1594 | spr_ptr_access(7); | |
| 1595 | spr_data_access(7, 0); | |
| 1596 | display_if_bad_line(); | |
| 1599 | 1597 | |
| 1600 | if (m_spr_dma_on & 0x80) | |
| 1601 | vic2_suspend_cpu(); | |
| 1602 | else | |
| 1603 | vic2_resume_cpu(); | |
| 1604 | ||
| 1605 | if (m_spr_dma_on & 0x80) m_rdy_cycles += (2 + adjust(5)); | |
| 1606 | ||
| 1607 | 1598 | m_cycle++; |
| 1608 | 1599 | break; |
| 1609 | 1600 | |
| 1610 | 1601 | // Sprite 7 |
| 1611 | 1602 | case 10: |
| 1612 | vic2_spr_data_access(7, 1); | |
| 1613 | vic2_spr_data_access(7, 2); | |
| 1614 | vic2_display_if_bad_line(); | |
| 1603 | spr_data_access(7, 1); | |
| 1604 | spr_data_access(7, 2); | |
| 1605 | display_if_bad_line(); | |
| 1615 | 1606 | |
| 1607 | set_ba(ASSERT_LINE); | |
| 1608 | ||
| 1616 | 1609 | m_cycle++; |
| 1617 | 1610 | break; |
| 1618 | 1611 | |
| 1619 | 1612 | // Refresh |
| 1620 | 1613 | case 11: |
| 1621 | vic2_refresh_access(); | |
| 1622 | vic2_display_if_bad_line(); | |
| 1614 | refresh_access(); | |
| 1615 | display_if_bad_line(); | |
| 1623 | 1616 | |
| 1624 | vic2_resume_cpu(); | |
| 1625 | ||
| 1626 | 1617 | m_cycle++; |
| 1627 | 1618 | break; |
| 1628 | 1619 | |
| 1629 | 1620 | // Refresh, fetch if bad line |
| 1630 | 1621 | case 12: |
| 1631 | vic2_refresh_access(); | |
| 1632 | vic2_fetch_if_bad_line(); | |
| 1622 | bad_line_ba(); | |
| 1633 | 1623 | |
| 1624 | refresh_access(); | |
| 1625 | fetch_if_bad_line(); | |
| 1626 | ||
| 1634 | 1627 | m_cycle++; |
| 1635 | 1628 | break; |
| 1636 | 1629 | |
| 1637 | 1630 | // Refresh, fetch if bad line, raster_x |
| 1638 | 1631 | case 13: |
| 1639 | vic2_draw_background(); | |
| 1640 | vic2_sample_border(); | |
| 1641 | vic2_refresh_access(); | |
| 1642 | vic2_fetch_if_bad_line(); | |
| 1632 | bad_line_ba(); | |
| 1643 | 1633 | |
| 1644 | m_raster_x = 0xfffc; | |
| 1634 | draw_background(); | |
| 1635 | sample_border(); | |
| 1636 | refresh_access(); | |
| 1637 | fetch_if_bad_line(); | |
| 1645 | 1638 | |
| 1646 | // if ((m_in_rdy_workaround_func(0) == 0 ) && (m_is_bad_line)) | |
| 1647 | // m_rdy_cycles += (43+adjust(0)); | |
| 1648 | ||
| 1649 | 1639 | m_cycle++; |
| 1650 | 1640 | break; |
| 1651 | 1641 | |
| 1652 | 1642 | // Refresh, fetch if bad line, RC, VC |
| 1653 | 1643 | case 14: |
| 1654 | vic2_draw_background(); | |
| 1655 | vic2_sample_border(); | |
| 1656 | vic2_refresh_access(); | |
| 1657 | vic2_rc_if_bad_line(); | |
| 1644 | bad_line_ba(); | |
| 1658 | 1645 | |
| 1646 | draw_background(); | |
| 1647 | sample_border(); | |
| 1648 | refresh_access(); | |
| 1649 | rc_if_bad_line(); | |
| 1650 | ||
| 1659 | 1651 | m_vc = m_vc_base; |
| 1660 | 1652 | |
| 1661 | // if ((m_in_rdy_workaround_func(0) == 1 ) && (m_is_bad_line)) | |
| 1662 | // m_rdy_cycles += (42+adjust(0)); | |
| 1663 | ||
| 1664 | 1653 | m_cycle++; |
| 1665 | 1654 | break; |
| 1666 | 1655 | |
| 1667 | 1656 | // Refresh, fetch if bad line, sprite y expansion |
| 1668 | 1657 | case 15: |
| 1669 | vic2_draw_background(); | |
| 1670 | vic2_sample_border(); | |
| 1671 | vic2_refresh_access(); | |
| 1672 | vic2_fetch_if_bad_line(); | |
| 1658 | bad_line_ba(); | |
| 1673 | 1659 | |
| 1660 | draw_background(); | |
| 1661 | sample_border(); | |
| 1662 | refresh_access(); | |
| 1663 | fetch_if_bad_line(); | |
| 1664 | ||
| 1674 | 1665 | for (i = 0; i < 8; i++) |
| 1675 | 1666 | if (m_spr_exp_y & (1 << i)) |
| 1676 | 1667 | m_mc_base[i] += 2; |
| 1677 | 1668 | |
| 1678 | 1669 | m_ml_index = 0; |
| 1679 | vic2_matrix_access(); | |
| 1680 | 1670 | |
| 1681 | // if ((m_in_rdy_workaround_func(0) == 2 ) && (m_is_bad_line)) | |
| 1682 | // m_rdy_cycles += (41+adjust(0)); | |
| 1671 | matrix_access(); | |
| 1683 | 1672 | |
| 1684 | 1673 | m_cycle++; |
| 1685 | 1674 | break; |
| 1686 | 1675 | |
| 1687 | 1676 | // Graphics, sprite y expansion, sprite DMA |
| 1688 | 1677 | case 16: |
| 1689 | vic2_draw_background(); | |
| 1690 | vic2_sample_border(); | |
| 1691 | vic2_graphics_access(); | |
| 1692 | vic2_fetch_if_bad_line(); | |
| 1678 | bad_line_ba(); | |
| 1693 | 1679 | |
| 1680 | draw_background(); | |
| 1681 | sample_border(); | |
| 1682 | graphics_access(); | |
| 1683 | fetch_if_bad_line(); | |
| 1684 | ||
| 1694 | 1685 | mask = 1; |
| 1695 | 1686 | for (i = 0; i < 8; i++, mask <<= 1) |
| 1696 | 1687 | { |
| 1697 | if (m_spr_exp_y & | |
| 1688 | if (m_spr_exp_y & (1 << i)) | |
| 1698 | 1689 | m_mc_base[i]++; |
| 1699 | 1690 | if ((m_mc_base[i] & 0x3f) == 0x3f) |
| 1700 | 1691 | m_spr_dma_on &= ~mask; |
| 1701 | 1692 | } |
| 1702 | 1693 | |
| 1703 | | |
| 1694 | matrix_access(); | |
| 1704 | 1695 | |
| 1705 | // if ((m_in_rdy_workaround_func(0) == 3 ) && (m_is_bad_line)) | |
| 1706 | // m_rdy_cycles += (40+adjust(0)); | |
| 1707 | ||
| 1708 | 1696 | m_cycle++; |
| 1709 | 1697 | break; |
| 1710 | 1698 | |
| 1711 | 1699 | // Graphics, check border |
| 1712 | 1700 | case 17: |
| 1701 | bad_line_ba(); | |
| 1702 | ||
| 1713 | 1703 | if (COLUMNS40) |
| 1714 | 1704 | { |
| 1715 | 1705 | if (m_rasterline == m_dy_stop) |
| r18706 | r18707 | |
| 1732 | 1722 | // Second sample of border state |
| 1733 | 1723 | m_border_on_sample[1] = m_border_on; |
| 1734 | 1724 | |
| 1735 | vic2_draw_background(); | |
| 1736 | vic2_draw_graphics(); | |
| 1737 | vic2_sample_border(); | |
| 1738 | vic2_graphics_access(); | |
| 1739 | vic2_fetch_if_bad_line(); | |
| 1740 | vic2_matrix_access(); | |
| 1725 | draw_background(); | |
| 1726 | draw_graphics(); | |
| 1727 | sample_border(); | |
| 1728 | graphics_access(); | |
| 1729 | fetch_if_bad_line(); | |
| 1730 | matrix_access(); | |
| 1741 | 1731 | |
| 1742 | // if ((m_in_rdy_workaround_func(0) == 4 ) && (m_is_bad_line)) | |
| 1743 | // m_rdy_cycles += (40+adjust(0)); | |
| 1744 | ||
| 1745 | 1732 | m_cycle++; |
| 1746 | 1733 | break; |
| 1747 | 1734 | |
| 1748 | 1735 | // Check border |
| 1749 | 1736 | case 18: |
| 1737 | bad_line_ba(); | |
| 1738 | ||
| 1750 | 1739 | if (!COLUMNS40) |
| 1751 | 1740 | { |
| 1752 | 1741 | if (m_rasterline == m_dy_stop) |
| r18706 | r18707 | |
| 1807 | 1796 | case 52: |
| 1808 | 1797 | case 53: |
| 1809 | 1798 | case 54: |
| 1810 | vic2_draw_graphics(); | |
| 1811 | vic2_sample_border(); | |
| 1812 | vic2_graphics_access(); | |
| 1813 | vic2_fetch_if_bad_line(); | |
| 1814 | vic2_matrix_access(); | |
| 1799 | bad_line_ba(); | |
| 1800 | ||
| 1801 | draw_graphics(); | |
| 1802 | sample_border(); | |
| 1803 | graphics_access(); | |
| 1804 | fetch_if_bad_line(); | |
| 1805 | matrix_access(); | |
| 1815 | 1806 | m_last_char_data = m_char_data; |
| 1816 | 1807 | |
| 1817 | 1808 | m_cycle++; |
| r18706 | r18707 | |
| 1819 | 1810 | |
| 1820 | 1811 | // Graphics, sprite y expansion, sprite DMA |
| 1821 | 1812 | case 55: |
| 1822 | vic2_draw_graphics(); | |
| 1823 | vic2_sample_border(); | |
| 1824 | vic2_graphics_access(); | |
| 1825 | vic2_display_if_bad_line(); | |
| 1813 | if (m_is_bad_line) | |
| 1814 | set_ba(ASSERT_LINE); | |
| 1826 | 1815 | |
| 1816 | draw_graphics(); | |
| 1817 | sample_border(); | |
| 1818 | graphics_access(); | |
| 1819 | display_if_bad_line(); | |
| 1820 | ||
| 1827 | 1821 | // sprite y expansion |
| 1828 | 1822 | mask = 1; |
| 1829 | 1823 | for (i = 0; i < 8; i++, mask <<= 1) |
| 1830 | 1824 | if (SPRITE_Y_EXPAND (i)) |
| 1831 | 1825 | m_spr_exp_y ^= mask; |
| 1832 | 1826 | |
| 1833 | | |
| 1827 | check_sprite_dma(); | |
| 1834 | 1828 | |
| 1835 | vic2_resume_cpu(); | |
| 1836 | ||
| 1829 | spr_ba(0); | |
| 1830 | ||
| 1837 | 1831 | m_cycle++; |
| 1838 | 1832 | break; |
| 1839 | 1833 | |
| r18706 | r18707 | |
| 1845 | 1839 | // Fourth sample of border state |
| 1846 | 1840 | m_border_on_sample[3] = m_border_on; |
| 1847 | 1841 | |
| 1848 | vic2_draw_graphics(); | |
| 1849 | vic2_sample_border(); | |
| 1850 | vic2_idle_access(); | |
| 1851 | vic2_display_if_bad_line(); | |
| 1852 | vic2_check_sprite_dma(); | |
| 1842 | draw_graphics(); | |
| 1843 | sample_border(); | |
| 1844 | idle_access(); | |
| 1845 | display_if_bad_line(); | |
| 1846 | check_sprite_dma(); | |
| 1853 | 1847 | |
| 1854 | 1848 | m_cycle++; |
| 1855 | 1849 | break; |
| 1856 | 1850 | |
| 1857 | 1851 | // Check border, sprites |
| 1858 | 1852 | case 57: |
| 1853 | spr_ba(1); | |
| 1854 | ||
| 1859 | 1855 | if (COLUMNS40) |
| 1860 | 1856 | m_border_on = 1; |
| 1861 | 1857 | |
| r18706 | r18707 | |
| 1872 | 1868 | if ((m_spr_disp_on & mask) && !(m_spr_dma_on & mask)) |
| 1873 | 1869 | m_spr_disp_on &= ~mask; |
| 1874 | 1870 | |
| 1875 | vic2_draw_background(); | |
| 1876 | vic2_sample_border(); | |
| 1877 | vic2_idle_access(); | |
| 1878 | vic2_display_if_bad_line(); | |
| 1871 | draw_background(); | |
| 1872 | sample_border(); | |
| 1873 | idle_access(); | |
| 1874 | display_if_bad_line(); | |
| 1879 | 1875 | |
| 1880 | 1876 | m_cycle++; |
| 1881 | 1877 | break; |
| 1882 | 1878 | |
| 1883 | 1879 | // Sprite 0, sprite DMA, MC, RC |
| 1884 | 1880 | case 58: |
| 1885 | vic2_draw_background(); | |
| 1886 | vic2_sample_border(); | |
| 1881 | draw_background(); | |
| 1882 | sample_border(); | |
| 1887 | 1883 | |
| 1888 | 1884 | mask = 1; |
| 1889 | 1885 | for (i = 0; i < 8; i++, mask <<= 1) |
| r18706 | r18707 | |
| 1893 | 1889 | m_spr_disp_on |= mask; |
| 1894 | 1890 | } |
| 1895 | 1891 | |
| 1896 | vic2_spr_ptr_access(0); | |
| 1897 | vic2_spr_data_access(0, 0); | |
| 1892 | spr_ptr_access(0); | |
| 1893 | spr_data_access(0, 0); | |
| 1898 | 1894 | |
| 1899 | 1895 | if (m_rc == 7) |
| 1900 | 1896 | { |
| r18706 | r18707 | |
| 1908 | 1904 | m_rc = (m_rc + 1) & 7; |
| 1909 | 1905 | } |
| 1910 | 1906 | |
| 1911 | if (m_spr_dma_on & 0x01) | |
| 1912 | vic2_suspend_cpu(); | |
| 1913 | else | |
| 1914 | vic2_resume_cpu(); | |
| 1915 | ||
| 1916 | if (m_spr_dma_on & 0x01) m_rdy_cycles += (2 + adjust(6)); | |
| 1917 | ||
| 1918 | 1907 | m_cycle++; |
| 1919 | 1908 | break; |
| 1920 | 1909 | |
| 1921 | 1910 | // Sprite 0 |
| 1922 | 1911 | case 59: |
| 1923 | vic2_draw_background(); | |
| 1924 | vic2_sample_border(); | |
| 1925 | vic2_spr_data_access(0, 1); | |
| 1926 | vic2_spr_data_access(0, 2); | |
| 1927 | vic2_display_if_bad_line(); | |
| 1912 | spr_ba(2); | |
| 1928 | 1913 | |
| 1914 | draw_background(); | |
| 1915 | sample_border(); | |
| 1916 | spr_data_access(0, 1); | |
| 1917 | spr_data_access(0, 2); | |
| 1918 | display_if_bad_line(); | |
| 1919 | ||
| 1929 | 1920 | m_cycle++; |
| 1930 | 1921 | break; |
| 1931 | 1922 | |
| 1932 | 1923 | // Sprite 1, draw |
| 1933 | 1924 | case 60: |
| 1934 | vic2_draw_background(); | |
| 1935 | vic2_sample_border(); | |
| 1925 | draw_background(); | |
| 1926 | sample_border(); | |
| 1936 | 1927 | |
| 1937 | 1928 | if (m_draw_this_line) |
| 1938 | 1929 | { |
| 1939 | | |
| 1930 | draw_sprites(); | |
| 1940 | 1931 | |
| 1941 | 1932 | if (m_border_on_sample[0]) |
| 1942 | 1933 | for (i = 0; i < 4; i++) |
| r18706 | r18707 | |
| 1961 | 1952 | } |
| 1962 | 1953 | } |
| 1963 | 1954 | |
| 1964 | vic2_spr_ptr_access(1); | |
| 1965 | vic2_spr_data_access(1, 0); | |
| 1966 | vic2_display_if_bad_line(); | |
| 1955 | spr_ptr_access(1); | |
| 1956 | spr_data_access(1, 0); | |
| 1957 | display_if_bad_line(); | |
| 1967 | 1958 | |
| 1968 | if (m_spr_dma_on & 0x02) | |
| 1969 | vic2_suspend_cpu(); | |
| 1970 | else | |
| 1971 | vic2_resume_cpu(); | |
| 1972 | ||
| 1973 | if (m_spr_dma_on & 0x02) m_rdy_cycles += (2 + adjust(7)); | |
| 1974 | ||
| 1975 | 1959 | m_cycle++; |
| 1976 | 1960 | break; |
| 1977 | 1961 | |
| 1978 | 1962 | // Sprite 1 |
| 1979 | 1963 | case 61: |
| 1980 | vic2_spr_data_access(1, 1); | |
| 1981 | vic2_spr_data_access(1, 2); | |
| 1982 | vic2_display_if_bad_line(); | |
| 1964 | spr_ba(3); | |
| 1983 | 1965 | |
| 1966 | spr_data_access(1, 1); | |
| 1967 | spr_data_access(1, 2); | |
| 1968 | display_if_bad_line(); | |
| 1969 | ||
| 1984 | 1970 | m_cycle++; |
| 1985 | 1971 | break; |
| 1986 | 1972 | |
| 1987 | 1973 | // Sprite 2 |
| 1988 | 1974 | case 62: |
| 1989 | vic2_spr_ptr_access(2); | |
| 1990 | vic2_spr_data_access(2, 0); | |
| 1991 | vic2_display_if_bad_line(); | |
| 1975 | spr_ptr_access(2); | |
| 1976 | spr_data_access(2, 0); | |
| 1977 | display_if_bad_line(); | |
| 1992 | 1978 | |
| 1993 | if (m_spr_dma_on & 0x04) | |
| 1994 | vic2_suspend_cpu(); | |
| 1995 | else | |
| 1996 | vic2_resume_cpu(); | |
| 1997 | ||
| 1998 | if (m_spr_dma_on & 0x04) m_rdy_cycles += (2 + adjust(8)); | |
| 1999 | ||
| 2000 | 1979 | m_cycle++; |
| 2001 | 1980 | break; |
| 2002 | 1981 | |
| 2003 | 1982 | // Sprite 2 |
| 2004 | 1983 | case 63: |
| 2005 | vic2_spr_data_access(2, 1); | |
| 2006 | vic2_spr_data_access(2, 2); | |
| 2007 | vic2_display_if_bad_line(); | |
| 1984 | spr_ba(4); | |
| 2008 | 1985 | |
| 1986 | spr_data_access(2, 1); | |
| 1987 | spr_data_access(2, 2); | |
| 1988 | display_if_bad_line(); | |
| 1989 | ||
| 2009 | 1990 | if (m_rasterline == m_dy_stop) |
| 2010 | 1991 | m_ud_border_on = 1; |
| 2011 | 1992 | else |
| r18706 | r18707 | |
| 2015 | 1996 | // Last cycle |
| 2016 | 1997 | m_cycle = 1; |
| 2017 | 1998 | } |
| 1999 | ||
| 2000 | m_phi0 = 1; | |
| 2001 | set_aec(BIT(m_aec_delay, 2)); | |
| 2018 | 2002 | |
| 2003 | m_out_ba_func(m_ba); | |
| 2004 | m_out_aec_func(m_aec); | |
| 2005 | ||
| 2006 | m_raster_x += 8; | |
| 2007 | if (m_raster_x == 0x1fc) m_raster_x = 0x004; | |
| 2008 | ||
| 2019 | 2009 | if ((cpu_cycles == vic_cycles) && (m_rdy_cycles > 0)) |
| 2020 | 2010 | { |
| 2021 | 2011 | m_cpu->spin_until_time(m_cpu->cycles_to_attotime(m_rdy_cycles)); |
| 2022 | 2012 | m_rdy_cycles = 0; |
| 2023 | 2013 | } |
| 2024 | 2014 | |
| 2025 | m_raster_x += 8; | |
| 2026 | 2015 | m_icount--; |
| 2027 | 2016 | } while (m_icount > 0); |
| 2028 | 2017 | } |
| 2029 | 2018 | |
| 2030 | 2019 | // Graphics display (8 pixels) |
| 2031 | void mos6566_device:: | |
| 2020 | void mos6566_device::draw_graphics() | |
| 2032 | 2021 | { |
| 2033 | 2022 | if (m_draw_this_line == 0) |
| 2034 | 2023 | { |
| 2035 | UINT16 p = m_graphic_x + | |
| 2024 | UINT16 p = m_graphic_x + XSCROLL; | |
| 2036 | 2025 | m_fore_coll_buf[p + 7] = 0; |
| 2037 | 2026 | m_fore_coll_buf[p + 6] = 0; |
| 2038 | 2027 | m_fore_coll_buf[p + 5] = 0; |
| r18706 | r18707 | |
| 2044 | 2033 | } |
| 2045 | 2034 | else if (m_ud_border_on) |
| 2046 | 2035 | { |
| 2047 | UINT16 p = m_graphic_x + | |
| 2036 | UINT16 p = m_graphic_x + XSCROLL; | |
| 2048 | 2037 | m_fore_coll_buf[p + 7] = 0; |
| 2049 | 2038 | m_fore_coll_buf[p + 6] = 0; |
| 2050 | 2039 | m_fore_coll_buf[p + 5] = 0; |
| r18706 | r18707 | |
| 2053 | 2042 | m_fore_coll_buf[p + 2] = 0; |
| 2054 | 2043 | m_fore_coll_buf[p + 1] = 0; |
| 2055 | 2044 | m_fore_coll_buf[p + 0] = 0; |
| 2056 | | |
| 2045 | draw_background(); | |
| 2057 | 2046 | } |
| 2058 | 2047 | else |
| 2059 | 2048 | { |
| 2060 | 2049 | UINT8 tmp_col; |
| 2061 | UINT16 p = m_graphic_x + | |
| 2050 | UINT16 p = m_graphic_x + XSCROLL; | |
| 2062 | 2051 | switch (GFXMODE) |
| 2063 | 2052 | { |
| 2064 | 2053 | case 0: |
| 2065 | | |
| 2054 | draw_mono(p, m_colors[0], m_color_data & 0x0f); | |
| 2066 | 2055 | break; |
| 2067 | 2056 | case 1: |
| 2068 | 2057 | if (m_color_data & 0x08) |
| 2069 | | |
| 2058 | draw_multi(p, m_colors[0], m_colors[1], m_colors[2], m_color_data & 0x07); | |
| 2070 | 2059 | else |
| 2071 | | |
| 2060 | draw_mono(p, m_colors[0], m_color_data & 0x0f); | |
| 2072 | 2061 | break; |
| 2073 | 2062 | case 2: |
| 2074 | | |
| 2063 | draw_mono(p, m_char_data & 0x0f, m_char_data >> 4); | |
| 2075 | 2064 | break; |
| 2076 | 2065 | case 3: |
| 2077 | | |
| 2066 | draw_multi(p, m_colors[0], m_char_data >> 4, m_char_data & 0x0f, m_color_data & 0x0f); | |
| 2078 | 2067 | break; |
| 2079 | 2068 | case 4: |
| 2080 | 2069 | if (m_char_data & 0x80) |
| r18706 | r18707 | |
| 2087 | 2076 | tmp_col = m_colors[1]; |
| 2088 | 2077 | else |
| 2089 | 2078 | tmp_col = m_colors[0]; |
| 2090 | | |
| 2079 | draw_mono(p, tmp_col, m_color_data & 0x0f); | |
| 2091 | 2080 | break; |
| 2092 | 2081 | case 5: |
| 2093 | 2082 | m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE[0]; |
| r18706 | r18707 | |
| 2147 | 2136 | } |
| 2148 | 2137 | } |
| 2149 | 2138 | |
| 2150 | void mos6566_device:: | |
| 2139 | void mos6566_device::draw_sprites() | |
| 2151 | 2140 | { |
| 2152 | 2141 | int i; |
| 2153 | 2142 | UINT8 snum, sbit; |
| r18706 | r18707 | |
| 2427 | 2416 | { |
| 2428 | 2417 | SPRITE_COLL = spr_coll; |
| 2429 | 2418 | if (SPRITE_COLL) |
| 2430 | | |
| 2419 | set_interrupt(IRQ_MMC); | |
| 2431 | 2420 | } |
| 2432 | 2421 | |
| 2433 | 2422 | if (SPRITE_BG_COLL) |
| r18706 | r18707 | |
| 2436 | 2425 | { |
| 2437 | 2426 | SPRITE_BG_COLL = gfx_coll; |
| 2438 | 2427 | if (SPRITE_BG_COLL) |
| 2439 | | |
| 2428 | set_interrupt(IRQ_MBC); | |
| 2440 | 2429 | } |
| 2441 | 2430 | } |
| 2442 | 2431 | |
| r18706 | r18707 | |
| 2485 | 2474 | break; |
| 2486 | 2475 | |
| 2487 | 2476 | case 0x19: /* interrupt flag register */ |
| 2488 | /* | |
| 2477 | /* clear_interrupt(0xf); */ | |
| 2489 | 2478 | val = m_reg[offset] | 0x70; |
| 2490 | 2479 | break; |
| 2491 | 2480 | |
| r18706 | r18707 | |
| 2496 | 2485 | case 0x1e: /* sprite to sprite collision detect */ |
| 2497 | 2486 | val = m_reg[offset]; |
| 2498 | 2487 | m_reg[offset] = 0; |
| 2499 | | |
| 2488 | clear_interrupt(4); | |
| 2500 | 2489 | break; |
| 2501 | 2490 | |
| 2502 | 2491 | case 0x1f: /* sprite to background collision detect */ |
| 2503 | 2492 | val = m_reg[offset]; |
| 2504 | 2493 | m_reg[offset] = 0; |
| 2505 | | |
| 2494 | clear_interrupt(2); | |
| 2506 | 2495 | break; |
| 2507 | 2496 | |
| 2508 | 2497 | case 0x20: |
| r18706 | r18707 | |
| 2687 | 2676 | break; |
| 2688 | 2677 | |
| 2689 | 2678 | case 0x19: |
| 2690 | | |
| 2679 | clear_interrupt(data & 0x0f); | |
| 2691 | 2680 | break; |
| 2692 | 2681 | |
| 2693 | 2682 | case 0x1a: /* irq mask */ |
| 2694 | 2683 | m_reg[offset] = data; |
| 2695 | | |
| 2684 | set_interrupt(0); // beamrider needs this | |
| 2696 | 2685 | break; |
| 2697 | 2686 | |
| 2698 | 2687 | case 0x11: |
| r18706 | r18707 | |
| 2790 | 2779 | if (BIT(m_reg[offset], 0) != BIT(data, 0)) |
| 2791 | 2780 | { |
| 2792 | 2781 | m_cpu->set_unscaled_clock(clock() << BIT(data, 0)); |
| 2793 | printf("clock %u\n",clock() << BIT(data, 0)); | |
| 2794 | 2782 | } |
| 2795 | 2783 | |
| 2796 | 2784 | m_reg[offset] = data | 0xfc; |
| r18706 | r18707 | |
| 2831 | 2819 | |
| 2832 | 2820 | WRITE_LINE_MEMBER( mos6566_device::lp_w ) |
| 2833 | 2821 | { |
| 2822 | if (m_lp && !state && !(m_reg[REGISTER_IRQ] & IRQ_LP)) | |
| 2823 | { | |
| 2824 | m_reg[REGISTER_LPX] = m_raster_x >> 1; | |
| 2825 | m_reg[REGISTER_LPY] = m_rasterline; | |
| 2826 | ||
| 2827 | set_interrupt(IRQ_LP); | |
| 2828 | } | |
| 2829 | ||
| 2830 | m_lp = state; | |
| 2834 | 2831 | } |
| 2835 | 2832 | |
| 2836 | 2833 | |
| 2837 | 2834 | //------------------------------------------------- |
| 2835 | // phi0_r - phi 0 | |
| 2836 | //------------------------------------------------- | |
| 2837 | ||
| 2838 | READ_LINE_MEMBER( mos6566_device::phi0_r ) | |
| 2839 | { | |
| 2840 | return m_phi0; | |
| 2841 | } | |
| 2842 | ||
| 2843 | ||
| 2844 | //------------------------------------------------- | |
| 2845 | // ba_r - bus available | |
| 2846 | //------------------------------------------------- | |
| 2847 | ||
| 2848 | READ_LINE_MEMBER( mos6566_device::ba_r ) | |
| 2849 | { | |
| 2850 | return m_ba; | |
| 2851 | } | |
| 2852 | ||
| 2853 | ||
| 2854 | //------------------------------------------------- | |
| 2855 | // aec_r - address enable control | |
| 2856 | //------------------------------------------------- | |
| 2857 | ||
| 2858 | READ_LINE_MEMBER( mos6566_device::aec_r ) | |
| 2859 | { | |
| 2860 | return m_aec; | |
| 2861 | } | |
| 2862 | ||
| 2863 | ||
| 2864 | //------------------------------------------------- | |
| 2838 | 2865 | // bus_r - data bus read |
| 2839 | 2866 | //------------------------------------------------- |
| 2840 | 2867 |
| r18706 | r18707 | |
|---|---|---|
| 289 | 289 | const char *m_cpu_tag; |
| 290 | 290 | |
| 291 | 291 | devcb_write_line m_out_irq_cb; |
| 292 | devcb_write_line m_out_rdy_cb; | |
| 292 | devcb_write_line m_out_ba_cb; | |
| 293 | devcb_write_line m_out_aec_cb; | |
| 293 | 294 | |
| 294 | 295 | devcb_write8 m_out_k_cb; |
| 295 | 296 | }; |
| r18706 | r18707 | |
| 313 | 314 | DECLARE_WRITE8_MEMBER( write ); |
| 314 | 315 | |
| 315 | 316 | DECLARE_WRITE_LINE_MEMBER( lp_w ); |
| 317 | ||
| 318 | DECLARE_READ_LINE_MEMBER( phi0_r ); | |
| 319 | DECLARE_READ_LINE_MEMBER( ba_r ); | |
| 320 | DECLARE_READ_LINE_MEMBER( aec_r ); | |
| 316 | 321 | |
| 317 | 322 | UINT8 bus_r(); |
| 318 | 323 | |
| r18706 | r18707 | |
| 346 | 351 | const address_space_config m_videoram_space_config; |
| 347 | 352 | const address_space_config m_colorram_space_config; |
| 348 | 353 | |
| 349 | inline void vic2_set_interrupt( int mask ); | |
| 350 | inline void vic2_clear_interrupt( int mask ); | |
| 354 | inline void set_interrupt( int mask ); | |
| 355 | inline void clear_interrupt( int mask ); | |
| 356 | inline void set_ba(int state); | |
| 357 | inline void set_aec(int state); | |
| 358 | inline void bad_line_ba(); | |
| 351 | 359 | inline UINT8 read_videoram(offs_t offset); |
| 352 | 360 | inline UINT8 read_colorram(offs_t offset); |
| 353 | inline void vic2_idle_access(); | |
| 354 | inline void vic2_spr_ptr_access( int num ); | |
| 355 | inline void vic2_spr_data_access( int num, int bytenum ); | |
| 356 | inline void vic2_display_if_bad_line(); | |
| 357 | inline void vic2_suspend_cpu(); | |
| 358 | inline void vic2_resume_cpu(); | |
| 359 | inline void vic2_refresh_access(); | |
| 360 | inline void vic2_fetch_if_bad_line(); | |
| 361 | inline void vic2_rc_if_bad_line(); | |
| 362 | inline void vic2_sample_border(); | |
| 363 | inline void vic2_check_sprite_dma(); | |
| 364 | inline void vic2_matrix_access(); | |
| 365 | inline void vic2_graphics_access(); | |
| 366 | inline void vic2_draw_background(); | |
| 367 | inline void vic2_draw_mono( UINT16 p, UINT8 c0, UINT8 c1 ); | |
| 368 | inline void vic2_draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 ); | |
| 369 | void vic2_draw_graphics(); | |
| 370 | void vic2_draw_sprites(); | |
| 361 | inline void idle_access(); | |
| 362 | inline void spr_ba(int num); | |
| 363 | inline void spr_ptr_access( int num ); | |
| 364 | inline void spr_data_access( int num, int bytenum ); | |
| 365 | inline void display_if_bad_line(); | |
| 366 | inline void refresh_access(); | |
| 367 | inline void fetch_if_bad_line(); | |
| 368 | inline void rc_if_bad_line(); | |
| 369 | inline void sample_border(); | |
| 370 | inline void check_sprite_dma(); | |
| 371 | inline void matrix_access(); | |
| 372 | inline void graphics_access(); | |
| 373 | inline void draw_background(); | |
| 374 | inline void draw_mono( UINT16 p, UINT8 c0, UINT8 c1 ); | |
| 375 | inline void draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 ); | |
| 376 | void draw_graphics(); | |
| 377 | void draw_sprites(); | |
| 371 | 378 | |
| 372 | 379 | screen_device *m_screen; // screen which sets bitmap properties |
| 373 | 380 | cpu_device *m_cpu; |
| 374 | 381 | |
| 375 | UINT8 m_rdy_cycles; | |
| 382 | int m_phi0; | |
| 383 | int m_ba; | |
| 384 | int m_aec; | |
| 385 | UINT8 m_aec_delay; | |
| 386 | int m_rdy_cycles; | |
| 387 | ||
| 376 | 388 | UINT8 m_reg[0x80]; |
| 377 | 389 | |
| 378 | 390 | int m_on; /* rastering of the screen */ |
| r18706 | r18707 | |
| 384 | 396 | UINT16 m_colors[4], m_spritemulti[4]; |
| 385 | 397 | |
| 386 | 398 | int m_rasterline; |
| 387 | UINT64 m_cycles_counter; | |
| 388 | 399 | UINT8 m_cycle; |
| 389 | 400 | UINT16 m_raster_x; |
| 390 | 401 | UINT16 m_graphic_x; |
| 391 | 402 | UINT8 m_last_data; |
| 403 | int m_lp; | |
| 392 | 404 | |
| 393 | 405 | /* convert multicolor byte to background/foreground for sprite collision */ |
| 394 | 406 | UINT16 m_expandx[256]; |
| r18706 | r18707 | |
| 440 | 452 | UINT8 m_device_suspended; |
| 441 | 453 | |
| 442 | 454 | devcb_resolved_write_line m_out_irq_func; |
| 443 | devcb_resolved_write_line m_out_rdy_func; | |
| 455 | devcb_resolved_write_line m_out_ba_func; | |
| 456 | devcb_resolved_write_line m_out_aec_func; | |
| 444 | 457 | devcb_resolved_write8 m_out_k_func; |
| 445 | 458 | }; |
| 446 | 459 |
| r18706 | r18707 | |
|---|---|---|
| 583 | 583 | vic1001 // Commodore VIC-1001 (Japan) |
| 584 | 584 | vic20 // Commodore VIC 20 (NTSC) |
| 585 | 585 | vic20p // Commodore VIC 20 (PAL) |
| 586 | vic20s // Commodore VIC 20 (Swedish Expanson Kit) | |
| 586 | vic20_se // Commodore VIC 20 (Swedish Expanson Kit) | |
| 587 | 587 | |
| 588 | 588 | vic10 // Commodore Max Machine (Japan) |
| 589 | c64 | |
| 589 | c64 | |
| 590 | 590 | c64p // Commodore 64 (PAL) |
| 591 | c64j // Commodore 64 (Japan) | |
| 592 | c64sw // Commodore 64 (Sweden) | |
| 591 | c64_jp // Commodore 64 (Japan) | |
| 592 | c64_se // Commodore 64 (Sweden) | |
| 593 | 593 | pet64 // Commodore PET 64 |
| 594 | 594 | edu64 // Commodore Educator 64 |
| 595 | 595 | // clipper // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer |
| 596 | 596 | // tesa6240 // modified SX64 with label printer |
| 597 | sx64 | |
| 597 | sx64 | |
| 598 | 598 | sx64p |
| 599 | 599 | |
| 600 | 600 | vip64 // Commodore VIP64 (SX64, PAL, Swedish) |
| 601 | 601 | dx64 // Commodore DX-64 - Prototype |
| 602 | c64c | |
| 602 | c64c // Commodore 64C (NTSC) | |
| 603 | 603 | c64cp // Commodore 64C (PAL) |
| 604 | c64cs | |
| 604 | c64c_se | |
| 605 | 605 | c64g // Commodore 64G (PAL) |
| 606 | 606 | c64gs // Commodore 64 Games System |
| 607 | 607 | c64dtv // Commodore 64 Direct-to-TV |
| r18706 | r18707 | |
| 620 | 620 | cbm720 // Commodore CBM 720 |
| 621 | 621 | cbm720sw // Commodore CBM 720 (Sweden / Finland) |
| 622 | 622 | cbm730 |
| 623 | p500 | |
| 623 | p500 // Commodore P500 (proto, a.k.a. C128-40, PET-II) | |
| 624 | 624 | p500p |
| 625 | 625 | |
| 626 | 626 | c264 |
| 627 | plus4 | |
| 627 | plus4 | |
| 628 | 628 | plus4p |
| 629 | c16 | |
| 629 | c16 | |
| 630 | 630 | c16p |
| 631 | c16h | |
| 631 | c16_hu | |
| 632 | 632 | c116 |
| 633 | 633 | c232 |
| 634 | 634 | v364 |
| r18706 | r18707 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | TODO: |
| 4 | 4 | |
| 5 | - charom address | |
| 6 | - VDC colors | |
| 5 | - FROM and some cartridges don't work (IDE64) | |
| 7 | 6 | - connect CAPS LOCK to charom A12 on international variants |
| 8 | 7 | - DCR models won't boot with 1571CR drive |
| 9 | 8 | - fix fast serial |
| r18706 | r18707 | |
| 78 | 77 | int _128_256 = 1; |
| 79 | 78 | int dmaack = 1; |
| 80 | 79 | int vicfix = 1; |
| 81 | int | |
| 80 | int sphi2 = m_vic->phi0_r(); | |
| 82 | 81 | |
| 83 | m_game = m_exp->game_r(ca, ba, rw, m_hiram); | |
| 84 | m_exrom = m_exp->exrom_r(ca, ba, rw, m_hiram); | |
| 82 | m_game = m_exp->game_r(ca, sphi2, ba, rw, m_hiram); | |
| 83 | m_exrom = m_exp->exrom_r(ca, sphi2, ba, rw, m_hiram); | |
| 85 | 84 | |
| 86 | UINT32 input = | |
| 85 | UINT32 input = sphi2 << 26 | m_va14 << 25 | m_charen << 24 | | |
| 87 | 86 | m_hiram << 23 | m_loram << 22 | ba << 21 | VMA5 << 20 | VMA4 << 19 | ms0 << 18 | ms1 << 17 | ms2 << 16 | |
| 88 | 87 | m_exrom << 15 | m_game << 14 | rw << 13 | aec << 12 | A10 << 11 | A11 << 10 | A12 << 9 | A13 << 8 | |
| 89 | 88 | A14 << 7 | A15 << 6 | z80io << 5 | m_z80en << 4 | ms3 << 3 | vicfix << 2 | dmaack << 1 | _128_256; |
| r18706 | r18707 | |
| 123 | 122 | int sden = 1, dir = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1, |
| 124 | 123 | from1 = 1, romh = 1, roml = 1, dwe = 1, ioacc = 1, clrbank = 1, iocs = 1, casenb = 1; |
| 125 | 124 | int io1 = 1, io2 = 1; |
| 125 | int sphi2 = m_vic->phi0_r(); | |
| 126 | 126 | |
| 127 | 127 | UINT8 data = 0xff; |
| 128 | 128 | |
| r18706 | r18707 | |
| 138 | 138 | } |
| 139 | 139 | else |
| 140 | 140 | { |
| 141 | ta &= ~0xf00; | |
| 141 | 142 | ta |= (vma & 0xf00); |
| 142 | 143 | ma = (!m_va15 << 15) | (!m_va14 << 14) | vma; |
| 143 | 144 | sa = vma & 0xff; |
| 144 | 145 | } |
| 145 | 146 | |
| 146 | offs_t ca = ta | | |
| 147 | offs_t ca = ta | sa; | |
| 147 | 148 | |
| 148 | 149 | read_pla(offset, ca, vma, ba, rw, aec, z80io, ms3, ms2, ms1, ms0, |
| 149 | 150 | &sden, &dir, &gwe, &rom1, &rom2, &rom3, &rom4, &charom, &colorram, &vic, |
| r18706 | r18707 | |
| 231 | 232 | } |
| 232 | 233 | } |
| 233 | 234 | |
| 234 | data = m_exp->cd_r(space, ca, data, ba, roml, romh, io1, io2); | |
| 235 | data = m_exp->cd_r(space, ca, data, sphi2, ba, roml, romh, io1, io2); | |
| 235 | 236 | |
| 236 | 237 | return m_mmu->read(offset, data); |
| 237 | 238 | } |
| r18706 | r18707 | |
| 247 | 248 | int sden = 1, dir = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1, |
| 248 | 249 | from1 = 1, romh = 1, roml = 1, dwe = 1, ioacc = 1, clrbank = 1, iocs = 1, casenb = 1; |
| 249 | 250 | int io1 = 1, io2 = 1; |
| 251 | int sphi2 = m_vic->phi0_r(); | |
| 250 | 252 | |
| 251 | 253 | offs_t ta = m_mmu->ta_r(offset, aec, &ms0, &ms1, &ms2, &ms3, &cas0, &cas1); |
| 252 | 254 | offs_t ca = ta | (offset & 0xff); |
| r18706 | r18707 | |
| 313 | 315 | } |
| 314 | 316 | } |
| 315 | 317 | |
| 316 | m_exp->cd_w(space, ca, data, ba, roml, romh, io1, io2); | |
| 318 | m_exp->cd_w(space, ca, data, sphi2, ba, roml, romh, io1, io2); | |
| 317 | 319 | |
| 318 | 320 | m_mmu->write(space, offset, data); |
| 319 | 321 | } |
| r18706 | r18707 | |
| 833 | 835 | M8502_TAG, |
| 834 | 836 | DEVCB_DRIVER_LINE_MEMBER(c128_state, vic_irq_w), |
| 835 | 837 | DEVCB_NULL, |
| 838 | DEVCB_NULL, | |
| 836 | 839 | DEVCB_DRIVER_MEMBER(c128_state, vic_k_w) |
| 837 | 840 | }; |
| 838 | 841 | |
| r18706 | r18707 | |
| 843 | 846 | |
| 844 | 847 | READ8_MEMBER( c128_state::sid_potx_r ) |
| 845 | 848 | { |
| 846 | UINT8 | |
| 849 | UINT8 data = 0xff; | |
| 847 | 850 | |
| 848 | int sela = BIT(cia1_pa, 6); | |
| 849 | int selb = BIT(cia1_pa, 7); | |
| 851 | switch (m_cia1->pa_r() >> 6) | |
| 852 | { | |
| 853 | case 1: data = m_joy1->pot_x_r(); break; | |
| 854 | case 2: data = m_joy2->pot_x_r(); break; | |
| 855 | case 3: break; // TODO pot1 and pot2 in series | |
| 856 | } | |
| 850 | 857 | |
| 851 | UINT8 data = 0; | |
| 852 | ||
| 853 | if (sela) data = m_joy1->pot_x_r(); | |
| 854 | if (selb) data = m_joy2->pot_x_r(); | |
| 855 | ||
| 856 | 858 | return data; |
| 857 | 859 | } |
| 858 | 860 | |
| 859 | 861 | READ8_MEMBER( c128_state::sid_poty_r ) |
| 860 | 862 | { |
| 861 | UINT8 | |
| 863 | UINT8 data = 0xff; | |
| 862 | 864 | |
| 863 | int sela = BIT(cia1_pa, 6); | |
| 864 | int selb = BIT(cia1_pa, 7); | |
| 865 | switch (m_cia1->pa_r() >> 6) | |
| 866 | { | |
| 867 | case 1: data = m_joy1->pot_y_r(); break; | |
| 868 | case 2: data = m_joy2->pot_y_r(); break; | |
| 869 | case 3: break; // TODO pot1 and pot2 in series | |
| 870 | } | |
| 865 | 871 | |
| 866 | UINT8 data = 0; | |
| 867 | ||
| 868 | if (sela) data = m_joy1->pot_y_r(); | |
| 869 | if (selb) data = m_joy2->pot_y_r(); | |
| 870 | ||
| 871 | 872 | return data; |
| 872 | 873 | } |
| 873 | 874 | |
| r18706 | r18707 | |
| 1287 | 1288 | }; |
| 1288 | 1289 | |
| 1289 | 1290 | |
| 1291 | ||
| 1290 | 1292 | //************************************************************************** |
| 1291 | 1293 | // MACHINE INITIALIZATION |
| 1292 | 1294 | //************************************************************************** |
| r18706 | r18707 | |
| 1310 | 1312 | // allocate memory |
| 1311 | 1313 | m_color_ram.allocate(0x800); |
| 1312 | 1314 | |
| 1315 | // initialize memory | |
| 1316 | UINT8 data = 0xff; | |
| 1317 | ||
| 1318 | for (offs_t offset = 0; offset < m_ram->size(); offset++) | |
| 1319 | { | |
| 1320 | m_ram->pointer()[offset] = data; | |
| 1321 | if (!(offset % 64)) data ^= 0xff; | |
| 1322 | } | |
| 1323 | ||
| 1313 | 1324 | // state saving |
| 1314 | 1325 | save_item(NAME(m_z80en)); |
| 1315 | 1326 | save_item(NAME(m_loram)); |
| r18706 | r18707 | |
|---|---|---|
| 71 | 71 | // read_pla - |
| 72 | 72 | //------------------------------------------------- |
| 73 | 73 | |
| 74 | void c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int | |
| 74 | void c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh) | |
| 75 | 75 | { |
| 76 | int game = m_exp->game_r(offset, ba, rw, m_hiram); | |
| 77 | int exrom = m_exp->exrom_r(offset, ba, rw, m_hiram); | |
| 76 | //int ba = m_vic->ba_r(); | |
| 77 | //int aec = !m_vic->aec_r(); | |
| 78 | int sphi2 = m_vic->phi0_r(); | |
| 79 | int game = m_exp->game_r(offset, sphi2, ba, rw, m_hiram); | |
| 80 | int exrom = m_exp->exrom_r(offset, sphi2, ba, rw, m_hiram); | |
| 81 | int cas = 0; | |
| 78 | 82 | |
| 79 | 83 | UINT32 input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 | |
| 80 | 84 | A13 << 7 | A14 << 6 | A15 << 5 | m_va14 << 4 | m_charen << 3 | m_hiram << 2 | m_loram << 1 | cas; |
| r18706 | r18707 | |
| 96 | 100 | // read_memory - |
| 97 | 101 | //------------------------------------------------- |
| 98 | 102 | |
| 99 | UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int | |
| 103 | UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba) | |
| 100 | 104 | { |
| 105 | int rw = 1; | |
| 101 | 106 | int casram, basic, kernal, charom, grw, io, roml, romh; |
| 102 | 107 | int io1 = 1, io2 = 1; |
| 108 | int sphi2 = m_vic->phi0_r(); | |
| 103 | 109 | |
| 104 | read_pla(offset, va, rw, !aec, ba, | |
| 110 | read_pla(offset, va, rw, !aec, ba, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); | |
| 105 | 111 | |
| 106 | 112 | UINT8 data = 0xff; |
| 107 | 113 | |
| r18706 | r18707 | |
| 112 | 118 | |
| 113 | 119 | if (!casram) |
| 114 | 120 | { |
| 115 | data = m_ram->pointer()[offset]; | |
| 121 | if (aec) | |
| 122 | { | |
| 123 | data = m_ram->pointer()[offset]; | |
| 124 | } | |
| 125 | else | |
| 126 | { | |
| 127 | data = m_ram->pointer()[(!m_va15 << 15) | (!m_va14 << 14) | va]; | |
| 128 | } | |
| 116 | 129 | } |
| 117 | 130 | if (!basic) |
| 118 | 131 | { |
| r18706 | r18707 | |
| 165 | 178 | } |
| 166 | 179 | } |
| 167 | 180 | |
| 168 | return m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2); | |
| 181 | return m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 169 | 182 | } |
| 170 | 183 | |
| 171 | 184 | |
| r18706 | r18707 | |
| 173 | 186 | // write_memory - |
| 174 | 187 | //------------------------------------------------- |
| 175 | 188 | |
| 176 | void c64_state::write_memory(address_space &space, offs_t offset, UINT8 data, int | |
| 189 | void c64_state::write_memory(address_space &space, offs_t offset, UINT8 data, int aec, int ba) | |
| 177 | 190 | { |
| 191 | int rw = 0; | |
| 178 | 192 | int casram, basic, kernal, charom, grw, io, roml, romh; |
| 179 | 193 | offs_t va = 0; |
| 180 | 194 | int io1 = 1, io2 = 1; |
| 195 | int sphi2 = m_vic->phi0_r(); | |
| 181 | 196 | |
| 182 | read_pla(offset, va, rw, !aec, ba, | |
| 197 | read_pla(offset, va, rw, !aec, ba, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); | |
| 183 | 198 | |
| 184 | 199 | if (offset < 0x0002) |
| 185 | 200 | { |
| r18706 | r18707 | |
| 230 | 245 | } |
| 231 | 246 | } |
| 232 | 247 | |
| 233 | m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2); | |
| 248 | m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); | |
| 234 | 249 | } |
| 235 | 250 | |
| 236 | 251 | |
| r18706 | r18707 | |
| 240 | 255 | |
| 241 | 256 | READ8_MEMBER( c64_state::read ) |
| 242 | 257 | { |
| 243 | offs_t va = 0; | |
| 244 | int rw = 1, aec = 1, ba = 1, cas = 0; | |
| 258 | int aec = 1, ba = 1; | |
| 245 | 259 | |
| 246 | return read_memory(space, offset, va, rw, aec, ba, cas); | |
| 260 | // VIC address bus is floating | |
| 261 | offs_t va = 0x3fff; | |
| 262 | ||
| 263 | return read_memory(space, offset, va, aec, ba); | |
| 247 | 264 | } |
| 248 | 265 | |
| 249 | 266 | |
| r18706 | r18707 | |
| 253 | 270 | |
| 254 | 271 | WRITE8_MEMBER( c64_state::write ) |
| 255 | 272 | { |
| 256 | int | |
| 273 | int aec = 1, ba = 1; | |
| 257 | 274 | |
| 258 | write_memory(space, offset, data, | |
| 275 | write_memory(space, offset, data, aec, ba); | |
| 259 | 276 | } |
| 260 | 277 | |
| 261 | 278 | |
| r18706 | r18707 | |
| 265 | 282 | |
| 266 | 283 | READ8_MEMBER( c64_state::vic_videoram_r ) |
| 267 | 284 | { |
| 268 | offs_t va = (!m_va15 << 15) | (!m_va14 << 14) | offset; | |
| 269 | int rw = 1, aec = 0, ba = 0, cas = 0; | |
| 285 | int aec = m_vic->aec_r(), ba = m_vic->ba_r(); | |
| 286 | offs_t va = offset; | |
| 270 | 287 | |
| 271 | return read_memory(space, offset, va, rw, aec, ba, cas); | |
| 288 | // A15/A14 are not connected to VIC so they are floating | |
| 289 | offset |= 0xc000; | |
| 290 | ||
| 291 | return read_memory(space, offset, va, aec, ba); | |
| 272 | 292 | } |
| 273 | 293 | |
| 274 | 294 | |
| 295 | //------------------------------------------------- | |
| 296 | // vic_colorram_r - | |
| 297 | //------------------------------------------------- | |
| 275 | 298 | |
| 299 | READ8_MEMBER( c64_state::vic_colorram_r ) | |
| 300 | { | |
| 301 | UINT8 data; | |
| 302 | ||
| 303 | if (m_vic->aec_r()) | |
| 304 | { | |
| 305 | // TODO low nibble of last opcode | |
| 306 | data = 0x0f; | |
| 307 | } | |
| 308 | else | |
| 309 | { | |
| 310 | data = m_color_ram[offset] & 0x0f; | |
| 311 | } | |
| 312 | ||
| 313 | return data; | |
| 314 | } | |
| 315 | ||
| 316 | ||
| 317 | ||
| 276 | 318 | //************************************************************************** |
| 277 | 319 | // ADDRESS MAPS |
| 278 | 320 | //************************************************************************** |
| r18706 | r18707 | |
| 300 | 342 | //------------------------------------------------- |
| 301 | 343 | |
| 302 | 344 | static ADDRESS_MAP_START( vic_colorram_map, AS_1, 8, c64_state ) |
| 303 | AM_RANGE(0x000, 0x3ff) AM_R | |
| 345 | AM_RANGE(0x000, 0x3ff) AM_READ(vic_colorram_r) | |
| 304 | 346 | ADDRESS_MAP_END |
| 305 | 347 | |
| 306 | 348 | |
| r18706 | r18707 | |
| 402 | 444 | SCREEN_TAG, |
| 403 | 445 | M6510_TAG, |
| 404 | 446 | DEVCB_DRIVER_LINE_MEMBER(c64_state, vic_irq_w), |
| 405 | DEVCB_NULL, | |
| 447 | DEVCB_NULL, // BA -> 6502 RDY | |
| 448 | DEVCB_NULL, // AEC -> 6502 AEC | |
| 406 | 449 | DEVCB_NULL |
| 407 | 450 | }; |
| 408 | 451 | |
| r18706 | r18707 | |
| 413 | 456 | |
| 414 | 457 | READ8_MEMBER( c64_state::sid_potx_r ) |
| 415 | 458 | { |
| 416 | UINT8 | |
| 459 | UINT8 data = 0xff; | |
| 417 | 460 | |
| 418 | int sela = BIT(cia1_pa, 6); | |
| 419 | int selb = BIT(cia1_pa, 7); | |
| 461 | switch (m_cia1->pa_r() >> 6) | |
| 462 | { | |
| 463 | case 1: data = m_joy1->pot_x_r(); break; | |
| 464 | case 2: data = m_joy2->pot_x_r(); break; | |
| 465 | case 3: break; // TODO pot1 and pot2 in series | |
| 466 | } | |
| 420 | 467 | |
| 421 | UINT8 data = 0; | |
| 422 | ||
| 423 | if (sela) data = m_joy1->pot_x_r(); | |
| 424 | if (selb) data = m_joy2->pot_x_r(); | |
| 425 | ||
| 426 | 468 | return data; |
| 427 | 469 | } |
| 428 | 470 | |
| 429 | 471 | READ8_MEMBER( c64_state::sid_poty_r ) |
| 430 | 472 | { |
| 431 | UINT8 | |
| 473 | UINT8 data = 0xff; | |
| 432 | 474 | |
| 433 | int sela = BIT(cia1_pa, 6); | |
| 434 | int selb = BIT(cia1_pa, 7); | |
| 475 | switch (m_cia1->pa_r() >> 6) | |
| 476 | { | |
| 477 | case 1: data = m_joy1->pot_y_r(); break; | |
| 478 | case 2: data = m_joy2->pot_y_r(); break; | |
| 479 | case 3: break; // TODO pot1 and pot2 in series | |
| 480 | } | |
| 435 | 481 | |
| 436 | UINT8 data = 0; | |
| 437 | ||
| 438 | if (sela) data = m_joy1->pot_y_r(); | |
| 439 | if (selb) data = m_joy2->pot_y_r(); | |
| 440 | ||
| 441 | 482 | return data; |
| 442 | 483 | } |
| 443 | 484 | |
| r18706 | r18707 | |
| 919 | 960 | m_kernal = memregion("kernal")->base(); |
| 920 | 961 | m_charom = memregion("charom")->base(); |
| 921 | 962 | |
| 963 | // allocate memory | |
| 964 | m_color_ram.allocate(0x400); | |
| 965 | ||
| 966 | // initialize memory | |
| 967 | UINT8 data = 0xff; | |
| 968 | ||
| 969 | for (offs_t offset = 0; offset < m_ram->size(); offset++) | |
| 970 | { | |
| 971 | m_ram->pointer()[offset] = data; | |
| 972 | if (!(offset % 64)) data ^= 0xff; | |
| 973 | } | |
| 974 | ||
| 922 | 975 | // state saving |
| 923 | 976 | save_item(NAME(m_loram)); |
| 924 | 977 | save_item(NAME(m_hiram)); |
| r18706 | r18707 | |
| 1208 | 1261 | //************************************************************************** |
| 1209 | 1262 | |
| 1210 | 1263 | //------------------------------------------------- |
| 1211 | // ROM( c64 | |
| 1264 | // ROM( c64 ) | |
| 1212 | 1265 | //------------------------------------------------- |
| 1213 | 1266 | |
| 1214 | ROM_START( c64 | |
| 1267 | ROM_START( c64 ) | |
| 1215 | 1268 | ROM_REGION( 0x2000, "basic", 0 ) |
| 1216 | 1269 | ROM_LOAD( "901226-01.u3", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 1217 | 1270 | |
| r18706 | r18707 | |
| 1287 | 1340 | |
| 1288 | 1341 | |
| 1289 | 1342 | //------------------------------------------------- |
| 1290 | // ROM( c64j ) | |
| 1343 | // ROM( c64_jp ) | |
| 1291 | 1344 | //------------------------------------------------- |
| 1292 | 1345 | |
| 1293 | ROM_START( c64j ) | |
| 1346 | ROM_START( c64_jp ) | |
| 1294 | 1347 | ROM_REGION( 0x2000, "basic", 0 ) |
| 1295 | 1348 | ROM_LOAD( "901226-01.u3", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 1296 | 1349 | |
| r18706 | r18707 | |
| 1309 | 1362 | // ROM( c64p ) |
| 1310 | 1363 | //------------------------------------------------- |
| 1311 | 1364 | |
| 1312 | #define rom_c64p rom_c64 | |
| 1365 | #define rom_c64p rom_c64 | |
| 1313 | 1366 | |
| 1314 | 1367 | |
| 1315 | 1368 | //------------------------------------------------- |
| 1316 | // ROM( c64s | |
| 1369 | // ROM( c64_se ) | |
| 1317 | 1370 | //------------------------------------------------- |
| 1318 | 1371 | |
| 1319 | ROM_START( c64s | |
| 1372 | ROM_START( c64_se ) | |
| 1320 | 1373 | ROM_REGION( 0x2000, "basic", 0 ) |
| 1321 | 1374 | ROM_LOAD( "901226-01.u3", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 1322 | 1375 | |
| r18706 | r18707 | |
| 1357 | 1410 | // ROM( edu64 ) |
| 1358 | 1411 | //------------------------------------------------- |
| 1359 | 1412 | |
| 1360 | #define rom_edu64 rom_c64 | |
| 1413 | #define rom_edu64 rom_c64 | |
| 1361 | 1414 | |
| 1362 | 1415 | |
| 1363 | 1416 | //------------------------------------------------- |
| 1364 | // ROM( sx64 | |
| 1417 | // ROM( sx64 ) | |
| 1365 | 1418 | //------------------------------------------------- |
| 1366 | 1419 | |
| 1367 | ROM_START( sx64 | |
| 1420 | ROM_START( sx64 ) | |
| 1368 | 1421 | ROM_REGION( 0x2000, "basic", 0 ) |
| 1369 | 1422 | ROM_LOAD( "901226-01.ud4", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) ) |
| 1370 | 1423 | |
| r18706 | r18707 | |
| 1390 | 1443 | // ROM( rom_sx64p ) |
| 1391 | 1444 | //------------------------------------------------- |
| 1392 | 1445 | |
| 1393 | #define rom_sx64p rom_sx64 | |
| 1446 | #define rom_sx64p rom_sx64 | |
| 1394 | 1447 | |
| 1395 | 1448 | |
| 1396 | 1449 | //------------------------------------------------- |
| r18706 | r18707 | |
| 1417 | 1470 | //------------------------------------------------- |
| 1418 | 1471 | |
| 1419 | 1472 | // ROM_LOAD( "dx64kern.bin", 0x0000, 0x2000, CRC(58065128) ) TODO where is this illusive ROM? |
| 1420 | #define rom_dx64 rom_sx64 | |
| 1473 | #define rom_dx64 rom_sx64 | |
| 1421 | 1474 | |
| 1422 | 1475 | |
| 1423 | 1476 | //------------------------------------------------- |
| 1424 | // ROM( c64c | |
| 1477 | // ROM( c64c ) | |
| 1425 | 1478 | //------------------------------------------------- |
| 1426 | 1479 | |
| 1427 | ROM_START( c64c | |
| 1480 | ROM_START( c64c ) | |
| 1428 | 1481 | ROM_REGION( 0x4000, M6510_TAG, 0 ) |
| 1429 | 1482 | ROM_LOAD( "251913-01.u4", 0x0000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) ) |
| 1430 | 1483 | |
| r18706 | r18707 | |
| 1440 | 1493 | // ROM( c64cp ) |
| 1441 | 1494 | //------------------------------------------------- |
| 1442 | 1495 | |
| 1443 | #define rom_c64cp rom_c64c | |
| 1496 | #define rom_c64cp rom_c64c | |
| 1444 | 1497 | |
| 1445 | 1498 | |
| 1446 | 1499 | //------------------------------------------------- |
| 1447 | 1500 | // ROM( c64g ) |
| 1448 | 1501 | //------------------------------------------------- |
| 1449 | 1502 | |
| 1450 | #define rom_c64g rom_c64c | |
| 1503 | #define rom_c64g rom_c64c | |
| 1451 | 1504 | |
| 1452 | 1505 | |
| 1453 | 1506 | //------------------------------------------------- |
| 1454 | // ROM( c64cs | |
| 1507 | // ROM( c64c_se ) | |
| 1455 | 1508 | //------------------------------------------------- |
| 1456 | 1509 | |
| 1457 | ROM_START( c64cs | |
| 1510 | ROM_START( c64c_se ) | |
| 1458 | 1511 | ROM_REGION( 0x4000, M6510_TAG, 0 ) |
| 1459 | 1512 | ROM_LOAD( "325182-01.u4", 0x0000, 0x4000, CRC(2aff27d3) SHA1(267654823c4fdf2167050f41faa118218d2569ce) ) // 128/64 FI |
| 1460 | 1513 | |
| r18706 | r18707 | |
| 1488 | 1541 | //************************************************************************** |
| 1489 | 1542 | |
| 1490 | 1543 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS |
| 1491 | COMP( 1982, c64n, 0, 0, ntsc, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1492 | COMP( 1982, c64j, c64n, 0, ntsc, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64 (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1493 | COMP( 1982, c64p, c64n, 0, pal, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1494 | COMP( 1982, c64sw, c64n, 0, pal, c64sw, driver_device, 0, "Commodore Business Machines", "Commodore 64 / VIC-64S (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 1495 | COMP( 1983, pet64, c64n, 0, pet64, c64, driver_device, 0, "Commodore Business Machines", "PET 64 / CBM 4064 (NTSC)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS ) | |
| 1496 | COMP( 1983, edu64, c64n, 0, pet64, c64, driver_device, 0, "Commodore Business Machines", "Educator 64 (NTSC)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS ) | |
| 1497 | COMP( 1984, sx64n, c64n, 0, ntsc_sx, c64, driver_device, 0, "Commodore Business Machines", "SX-64 / Executive 64 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1498 | COMP( 1984, sx64p, c64n, 0, pal_sx, c64, driver_device, 0, "Commodore Business Machines", "SX-64 / Executive 64 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1499 | COMP( 1984, vip64, c64n, 0, pal_sx, c64sw, driver_device, 0, "Commodore Business Machines", "VIP-64 (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 1500 | COMP( 1984, dx64, c64n, 0, ntsc_dx, c64, driver_device, 0, "Commodore Business Machines", "DX-64 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1544 | COMP( 1982, c64, 0, 0, ntsc, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1545 | COMP( 1982, c64_jp, c64, 0, ntsc, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64 (Japan)", GAME_SUPPORTS_SAVE ) | |
| 1546 | COMP( 1982, c64p, c64, 0, pal, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1547 | COMP( 1982, c64_se, c64, 0, pal, c64sw, driver_device, 0, "Commodore Business Machines", "Commodore 64 / VIC-64S (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 1548 | COMP( 1983, pet64, c64, 0, pet64, c64, driver_device, 0, "Commodore Business Machines", "PET 64 / CBM 4064 (NTSC)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS ) | |
| 1549 | COMP( 1983, edu64, c64, 0, pet64, c64, driver_device, 0, "Commodore Business Machines", "Educator 64 (NTSC)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS ) | |
| 1550 | COMP( 1984, sx64, c64, 0, ntsc_sx, c64, driver_device, 0, "Commodore Business Machines", "SX-64 / Executive 64 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1551 | COMP( 1984, sx64p, c64, 0, pal_sx, c64, driver_device, 0, "Commodore Business Machines", "SX-64 / Executive 64 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1552 | COMP( 1984, vip64, c64, 0, pal_sx, c64sw, driver_device, 0, "Commodore Business Machines", "VIP-64 (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 1553 | COMP( 1984, dx64, c64, 0, ntsc_dx, c64, driver_device, 0, "Commodore Business Machines", "DX-64 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1501 | 1554 | //COMP(1983, clipper, c64, 0, c64pal, clipper, XXX_CLASS, c64pal, "PDC", "Clipper", GAME_NOT_WORKING) // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer |
| 1502 | 1555 | //COMP(1983, tesa6240, c64, 0, c64pal, c64, XXX_CLASS, c64pal, "Tesa", "6240", GAME_NOT_WORKING) // modified SX64 with label printer |
| 1503 | COMP( 1986, c64cn, c64n, 0, ntsc_c, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64C (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1504 | COMP( 1986, c64cp, c64n, 0, pal_c, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64C (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1505 | COMP( 1986, c64csw, c64n, 0, pal_c, c64sw, driver_device, 0, "Commodore Business Machines", "Commodore 64C (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 1506 | COMP( 1986, c64g, c64n, 0, pal_c, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64G (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1507 | CONS( 1990, c64gs, c64n, 0, pal_gs, c64gs, driver_device, 0, "Commodore Business Machines", "Commodore 64 Games System (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1556 | COMP( 1986, c64c, c64, 0, ntsc_c, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64C (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1557 | COMP( 1986, c64cp, c64, 0, pal_c, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64C (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1558 | COMP( 1986, c64c_se,c64, 0, pal_c, c64sw, driver_device, 0, "Commodore Business Machines", "Commodore 64C (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 1559 | COMP( 1986, c64g, c64, 0, pal_c, c64, driver_device, 0, "Commodore Business Machines", "Commodore 64G (PAL)", GAME_SUPPORTS_SAVE ) | |
| 1560 | CONS( 1990, c64gs, c64, 0, pal_gs, c64gs, driver_device, 0, "Commodore Business Machines", "Commodore 64 Games System (PAL)", GAME_SUPPORTS_SAVE ) |
| r18706 | r18707 | |
|---|---|---|
| 220 | 220 | M6510_TAG, |
| 221 | 221 | DEVCB_DRIVER_LINE_MEMBER(vic10_state, vic_irq_w), |
| 222 | 222 | DEVCB_NULL, |
| 223 | DEVCB_NULL, | |
| 223 | 224 | DEVCB_NULL |
| 224 | 225 | }; |
| 225 | 226 | |
| r18706 | r18707 | |
| 230 | 231 | |
| 231 | 232 | READ8_MEMBER( vic10_state::sid_potx_r ) |
| 232 | 233 | { |
| 233 | UINT8 | |
| 234 | UINT8 data = 0xff; | |
| 234 | 235 | |
| 235 | int sela = BIT(cia_pa, 6); | |
| 236 | int selb = BIT(cia_pa, 7); | |
| 236 | switch (m_cia->pa_r() >> 6) | |
| 237 | { | |
| 238 | case 1: data = m_joy1->pot_x_r(); break; | |
| 239 | case 2: data = m_joy2->pot_x_r(); break; | |
| 240 | case 3: break; // TODO pot1 and pot2 in series | |
| 241 | } | |
| 237 | 242 | |
| 238 | UINT8 data = 0; | |
| 239 | ||
| 240 | if (sela) data = m_joy1->pot_x_r(); | |
| 241 | if (selb) data = m_joy2->pot_x_r(); | |
| 242 | ||
| 243 | 243 | return data; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | READ8_MEMBER( vic10_state::sid_poty_r ) |
| 247 | 247 | { |
| 248 | UINT8 | |
| 248 | UINT8 data = 0xff; | |
| 249 | 249 | |
| 250 | int sela = BIT(cia_pa, 6); | |
| 251 | int selb = BIT(cia_pa, 7); | |
| 250 | switch (m_cia->pa_r() >> 6) | |
| 251 | { | |
| 252 | case 1: data = m_joy1->pot_y_r(); break; | |
| 253 | case 2: data = m_joy2->pot_y_r(); break; | |
| 254 | case 3: break; // TODO pot1 and pot2 in series | |
| 255 | } | |
| 252 | 256 | |
| 253 | UINT8 data = 0; | |
| 254 | ||
| 255 | if (sela) data = m_joy1->pot_y_r(); | |
| 256 | if (selb) data = m_joy2->pot_y_r(); | |
| 257 | ||
| 258 | 257 | return data; |
| 259 | 258 | } |
| 260 | 259 | |
| r18706 | r18707 | |
| 463 | 462 | void vic10_state::machine_start() |
| 464 | 463 | { |
| 465 | 464 | // allocate memory |
| 466 | m_color_ram | |
| 465 | m_color_ram.allocate(0x400); | |
| 467 | 466 | |
| 467 | // initialize memory | |
| 468 | UINT8 data = 0xff; | |
| 469 | ||
| 470 | for (offs_t offset = 0; offset < m_ram->size(); offset++) | |
| 471 | { | |
| 472 | m_ram->pointer()[offset] = data; | |
| 473 | if (!(offset % 64)) data ^= 0xff; | |
| 474 | } | |
| 475 | ||
| 468 | 476 | // state saving |
| 469 | 477 | save_item(NAME(m_cia_irq)); |
| 470 | 478 | save_item(NAME(m_vic_irq)); |
| r18706 | r18707 | |
|---|---|---|
| 696 | 696 | m_kernal = memregion("kernal")->base(); |
| 697 | 697 | m_charom = memregion("charom")->base(); |
| 698 | 698 | |
| 699 | // initialize memory | |
| 700 | UINT8 data = 0xff; | |
| 701 | ||
| 702 | for (offs_t offset = 0; offset < m_ram->size(); offset++) | |
| 703 | { | |
| 704 | m_ram->pointer()[offset] = data; | |
| 705 | if (!(offset % 64)) data ^= 0xff; | |
| 706 | } | |
| 707 | ||
| 699 | 708 | // state saving |
| 700 | 709 | save_item(NAME(m_key_col)); |
| 701 | 710 | } |
| r18706 | r18707 | |
| 859 | 868 | |
| 860 | 869 | |
| 861 | 870 | //------------------------------------------------- |
| 862 | // ROM( vic20s ) | |
| 871 | // ROM( vic20_se ) | |
| 863 | 872 | //------------------------------------------------- |
| 864 | 873 | |
| 865 | ROM_START( vic20s ) | |
| 874 | ROM_START( vic20_se ) | |
| 866 | 875 | ROM_REGION( 0x2000, "basic", 0 ) |
| 867 | 876 | ROM_LOAD( "901486-01.ue11", 0x0000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) ) |
| 868 | 877 | |
| r18706 | r18707 | |
| 883 | 892 | COMP( 1980, vic1001, 0, 0, ntsc, vic1001, driver_device, 0, "Commodore Business Machines", "VIC-1001 (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 884 | 893 | COMP( 1981, vic20, vic1001, 0, ntsc, vic20, driver_device, 0, "Commodore Business Machines", "VIC-20 (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 885 | 894 | COMP( 1981, vic20p, vic1001, 0, pal, vic20, driver_device, 0, "Commodore Business Machines", "VIC-20 / VC-20 (PAL)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 886 | COMP( 1981, vic20s, | |
| 895 | COMP( 1981, vic20_se, vic1001, 0, pal, vic20s, driver_device, 0, "Commodore Business Machines", "VIC-20 (Sweden/Finland)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| r18706 | r18707 | |
|---|---|---|
| 849 | 849 | { |
| 850 | 850 | m_c2 = memregion("c2")->base(); |
| 851 | 851 | } |
| 852 | ||
| 853 | // initialize memory | |
| 854 | UINT8 data = 0xff; | |
| 852 | 855 | |
| 856 | for (offs_t offset = 0; offset < m_ram->size(); offset++) | |
| 857 | { | |
| 858 | m_ram->pointer()[offset] = data; | |
| 859 | if (!(offset % 64)) data ^= 0xff; | |
| 860 | } | |
| 861 | ||
| 853 | 862 | // state saving |
| 854 | 863 | save_item(NAME(m_addr)); |
| 855 | 864 | save_item(NAME(m_ted_irq)); |
| r18706 | r18707 | |
| 1097 | 1106 | |
| 1098 | 1107 | |
| 1099 | 1108 | //------------------------------------------------- |
| 1100 | // ROM( plus4 | |
| 1109 | // ROM( plus4 ) | |
| 1101 | 1110 | //------------------------------------------------- |
| 1102 | 1111 | |
| 1103 | ROM_START( plus4 | |
| 1112 | ROM_START( plus4 ) | |
| 1104 | 1113 | ROM_REGION( 0x8000, "kernal", 0 ) |
| 1105 | 1114 | ROM_DEFAULT_BIOS("r5") |
| 1106 | 1115 | ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" ) |
| r18706 | r18707 | |
| 1147 | 1156 | |
| 1148 | 1157 | |
| 1149 | 1158 | //------------------------------------------------- |
| 1150 | // ROM( c16 | |
| 1159 | // ROM( c16 ) | |
| 1151 | 1160 | //------------------------------------------------- |
| 1152 | 1161 | |
| 1153 | ROM_START( c16 | |
| 1162 | ROM_START( c16 ) | |
| 1154 | 1163 | ROM_REGION( 0x8000, "kernal", 0 ) |
| 1155 | 1164 | ROM_DEFAULT_BIOS("r5") |
| 1156 | 1165 | ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" ) |
| r18706 | r18707 | |
| 1189 | 1198 | |
| 1190 | 1199 | |
| 1191 | 1200 | //------------------------------------------------- |
| 1192 | // ROM( c16h ) | |
| 1201 | // ROM( c16_hu ) | |
| 1193 | 1202 | //------------------------------------------------- |
| 1194 | 1203 | |
| 1195 | ROM_START( c16h ) | |
| 1204 | ROM_START( c16_hu ) | |
| 1196 | 1205 | ROM_REGION( 0x8000, "kernal", 0 ) |
| 1197 | 1206 | ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) |
| 1198 | 1207 | |
| r18706 | r18707 | |
| 1237 | 1246 | COMP( 1984, c264, 0, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 264 (Prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 1238 | 1247 | COMP( 1984, c232, c264, 0, c232, plus4, driver_device, 0, "Commodore Business Machines", "Commodore 232 (Prototype)", GAME_SUPPORTS_SAVE ) |
| 1239 | 1248 | COMP( 1984, v364, c264, 0, v364, plus4, driver_device, 0, "Commodore Business Machines", "Commodore V364 (Prototype)", GAME_SUPPORTS_SAVE ) |
| 1240 | COMP( 1984, plus4 | |
| 1249 | COMP( 1984, plus4, c264, 0, ntsc, plus4, driver_device, 0, "Commodore Business Machines", "Plus/4 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1241 | 1250 | COMP( 1984, plus4p, c264, 0, pal, plus4, driver_device, 0, "Commodore Business Machines", "Plus/4 (PAL)", GAME_SUPPORTS_SAVE ) |
| 1242 | COMP( 1984, c16 | |
| 1251 | COMP( 1984, c16, c264, 0, c16n, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 1243 | 1252 | COMP( 1984, c16p, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (PAL)", GAME_SUPPORTS_SAVE ) |
| 1244 | COMP( 1984, c16h, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (Hungary)", GAME_SUPPORTS_SAVE ) | |
| 1253 | COMP( 1984, c16_hu, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 16 (Hungary)", GAME_SUPPORTS_SAVE ) | |
| 1245 | 1254 | COMP( 1984, c116, c264, 0, c16p, c16, driver_device, 0, "Commodore Business Machines", "Commodore 116", GAME_SUPPORTS_SAVE ) |
| r18706 | r18707 | |
|---|---|---|
| 328 | 328 | // read_pla1 - P500 PLA #1 read |
| 329 | 329 | //------------------------------------------------- |
| 330 | 330 | |
| 331 | void p500_state::read_pla1(offs_t offset, int b | |
| 331 | void p500_state::read_pla1(offs_t offset, int busy2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw, | |
| 332 | 332 | int *datxen, int *dramxen, int *clrniben, int *segf, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr) |
| 333 | 333 | { |
| 334 | int sphi2 = m_vic->phi0_r(); | |
| 335 | int bras = 1; | |
| 336 | ||
| 334 | 337 | UINT32 input = P0 << 15 | P2 << 14 | bras << 13 | P1 << 12 | P3 << 11 | busy2 << 10 | m_statvid << 9 | sphi2 << 8 | |
| 335 | 338 | clrnibcsb << 7 | m_dramon << 6 | procvid << 5 | refen << 4 | m_vicdotsel << 3 | ba << 2 | aec << 1 | srw; |
| 336 | 339 | |
| r18706 | r18707 | |
| 351 | 354 | // read_pla2 - P500 PLA #2 read |
| 352 | 355 | //------------------------------------------------- |
| 353 | 356 | |
| 354 | void p500_state::read_pla2(offs_t offset, offs_t va, int ba, int | |
| 357 | void p500_state::read_pla2(offs_t offset, offs_t va, int ba, int vicen, int ae, int segf, int bank0, | |
| 355 | 358 | int *clrnibcsb, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *procvid, int *viccs, int *vidmatcs) |
| 356 | 359 | { |
| 360 | int sphi2 = m_vic->phi0_r(); | |
| 361 | int bcas = 1; | |
| 362 | ||
| 357 | 363 | UINT32 input = VA12 << 15 | ba << 14 | A13 << 13 | A15 << 12 | A14 << 11 | A11 << 10 | A10 << 9 | A12 << 8 | |
| 358 | 364 | sphi2 << 7 | vicen << 6 | m_statvid << 5 | m_vicdotsel << 4 | ae << 3 | segf << 2 | bcas << 1 | bank0; |
| 359 | 365 | |
| r18706 | r18707 | |
| 374 | 380 | // bankswitch - |
| 375 | 381 | //------------------------------------------------- |
| 376 | 382 | |
| 377 | void p500_state::bankswitch(offs_t offset, offs_t va, int srw, int | |
| 383 | void p500_state::bankswitch(offs_t offset, offs_t va, int srw, int ba, int ae, int busy2, int refen, | |
| 378 | 384 | int *datxen, int *dramxen, int *clrniben, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr, |
| 379 | 385 | int *clrnibcs, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *viccs, int *vidmatcs, |
| 380 | 386 | int *csbank1, int *csbank2, int *csbank3, int *basiclocs, int *basichics, int *kernalcs, |
| 381 | 387 | int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs, int *aec, int *vsysaden) |
| 382 | 388 | { |
| 389 | int sphi2 = m_vic->phi0_r(); | |
| 390 | int sphi1 = !sphi2; | |
| 391 | //int ba = !m_vic->ba_r(); | |
| 392 | //int ae = m_vic->aec_r(); | |
| 393 | int bcas = 0; | |
| 394 | ||
| 383 | 395 | *aec = !((m_statvid || ae) && sphi2); |
| 384 | 396 | *vsysaden = sphi1 || ba; |
| 385 | 397 | |
| 386 | 398 | int clrnibcsb = 1, procvid = 1, segf = 1; |
| 387 | 399 | |
| 388 | read_pla1(offset, b | |
| 400 | read_pla1(offset, busy2, clrnibcsb, procvid, refen, ba, *aec, srw, | |
| 389 | 401 | datxen, dramxen, clrniben, &segf, _64kcasen, casenb, viddaten, viddat_tr); |
| 390 | 402 | |
| 391 | 403 | int bank0 = 1, vicen = 1; |
| r18706 | r18707 | |
| 423 | 435 | |
| 424 | 436 | int vidmatcsb = 1; |
| 425 | 437 | |
| 426 | read_pla2(offset, va, ba, | |
| 438 | read_pla2(offset, va, ba, vicen, ae, segf, bank0, | |
| 427 | 439 | &clrnibcsb, extbufcs, discromcs, buframcs, charomcs, &procvid, viccs, &vidmatcsb); |
| 428 | 440 | |
| 429 | 441 | *clrnibcs = clrnibcsb || bcas; |
| 430 | 442 | *vidmatcs = vidmatcsb || bcas; |
| 431 | 443 | |
| 432 | read_pla1(offset, b | |
| 444 | read_pla1(offset, busy2, clrnibcsb, procvid, refen, ba, *aec, srw, | |
| 433 | 445 | datxen, dramxen, clrniben, &segf, _64kcasen, casenb, viddaten, viddat_tr); |
| 434 | 446 | } |
| 435 | 447 | |
| r18706 | r18707 | |
| 438 | 450 | // read_memory - |
| 439 | 451 | //------------------------------------------------- |
| 440 | 452 | |
| 441 | UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int | |
| 453 | UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae, UINT8 *clrnib) | |
| 442 | 454 | { |
| 443 | 455 | int srw = 1, busy2 = 1, refen = 0; |
| 444 | 456 | |
| r18706 | r18707 | |
| 448 | 460 | int cs1 = 1, sidcs = 1, extprtcs = 1, ciacs = 1, aciacs = 1, tript1cs = 1, tript2cs = 1; |
| 449 | 461 | int aec = 1, vsysaden = 1; |
| 450 | 462 | |
| 451 | bankswitch(offset, va, srw, | |
| 463 | bankswitch(offset, va, srw, ba, ae, busy2, refen, | |
| 452 | 464 | &datxen, &dramxen, &clrniben, &_64kcasen, &casenb, &viddaten, &viddat_tr, |
| 453 | 465 | &clrnibcs, &extbufcs, &discromcs, &buframcs, &charomcs, &viccs, &vidmatcs, |
| 454 | 466 | &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs, |
| r18706 | r18707 | |
| 560 | 572 | // write_memory - |
| 561 | 573 | //------------------------------------------------- |
| 562 | 574 | |
| 563 | void p500_state::write_memory(address_space &space, offs_t offset, UINT8 data, int | |
| 575 | void p500_state::write_memory(address_space &space, offs_t offset, UINT8 data, int ba, int ae) | |
| 564 | 576 | { |
| 565 | 577 | int srw = 0, busy2 = 1, refen = 0; |
| 566 | 578 | offs_t va = 0xffff; |
| r18706 | r18707 | |
| 571 | 583 | int cs1 = 1, sidcs = 1, extprtcs = 1, ciacs = 1, aciacs = 1, tript1cs = 1, tript2cs = 1; |
| 572 | 584 | int aec = 1, vsysaden = 1; |
| 573 | 585 | |
| 574 | bankswitch(offset, va, srw, | |
| 586 | bankswitch(offset, va, srw, ba, ae, busy2, refen, | |
| 575 | 587 | &datxen, &dramxen, &clrniben, &_64kcasen, &casenb, &viddaten, &viddat_tr, |
| 576 | 588 | &clrnibcs, &extbufcs, &discromcs, &buframcs, &charomcs, &viccs, &vidmatcs, |
| 577 | 589 | &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs, |
| r18706 | r18707 | |
| 648 | 660 | |
| 649 | 661 | READ8_MEMBER( p500_state::read ) |
| 650 | 662 | { |
| 651 | int | |
| 663 | int ba = 0, ae = 1; | |
| 652 | 664 | offs_t va = 0xffff; |
| 653 | 665 | UINT8 clrnib = 0xf; |
| 654 | 666 | |
| 655 | return read_memory(space, offset, va, | |
| 667 | return read_memory(space, offset, va, ba, ae, &clrnib); | |
| 656 | 668 | } |
| 657 | 669 | |
| 658 | 670 | |
| r18706 | r18707 | |
| 662 | 674 | |
| 663 | 675 | WRITE8_MEMBER( p500_state::write ) |
| 664 | 676 | { |
| 665 | int | |
| 677 | int ba = 0, ae = 1; | |
| 666 | 678 | |
| 667 | write_memory(space, offset, data, | |
| 679 | write_memory(space, offset, data, ba, ae); | |
| 668 | 680 | } |
| 669 | 681 | |
| 670 | 682 | |
| r18706 | r18707 | |
| 674 | 686 | |
| 675 | 687 | READ8_MEMBER( p500_state::vic_videoram_r ) |
| 676 | 688 | { |
| 677 | /* | |
| 678 | int sphi0 = 0, sphi1 = 1, sphi2 = 0, ba = 1, ae = 0, bras = 0, bcas = 0; | |
| 689 | /* int ba = !m_vic->ba_r(), ae = m_vic->aec_r(); | |
| 679 | 690 | offs_t va = offset; |
| 680 | ||
| 681 | return read_memory(space, 0, va, sphi0, sphi1, sphi2, ba, ae, bras, bcas); | |
| 682 | */ | |
| 683 | /* | |
| 684 | int ba = 1, ae = 0, bras = 1, bcas = 0; | |
| 685 | 691 | UINT8 clrnib = 0xf; |
| 692 | logerror("VIC %04x phi0 %u BA %u AEC %u VICDOTSEL %u STATVID %u\n", va, m_vic->phi0_r(), !m_vic->ba_r(), m_vic->aec_r(), m_vicdotsel, m_statvid); | |
| 686 | 693 | |
| 687 | if (offset < 0x1000) | |
| 688 | { | |
| 689 | return read_memory(space, 0, offset, 0, 1, 0, ba, ae, bras, bcas, &clrnib); | |
| 690 | } | |
| 691 | else | |
| 692 | { | |
| 693 | return read_memory(space, 0, offset, 1, 0, 1, ba, ae, bras, bcas, &clrnib); | |
| 694 | } | |
| 695 | */ | |
| 696 | ||
| 694 | return read_memory(space, 0, va, ba, ae, &clrnib); | |
| 695 | */ | |
| 697 | 696 | if (offset < 0x1000) |
| 698 | 697 | { |
| 699 | 698 | return m_charom[offset & 0xfff]; |
| r18706 | r18707 | |
| 1040 | 1039 | SCREEN_TAG, |
| 1041 | 1040 | M6509_TAG, |
| 1042 | 1041 | DEVCB_DRIVER_LINE_MEMBER(p500_state, vic_irq_w), |
| 1043 | DEVCB_NULL, // RDY | |
| 1042 | DEVCB_NULL, | |
| 1043 | DEVCB_NULL, | |
| 1044 | 1044 | DEVCB_NULL |
| 1045 | 1045 | }; |
| 1046 | 1046 | |
| r18706 | r18707 | |
| 2116 | 2116 | //************************************************************************** |
| 2117 | 2117 | |
| 2118 | 2118 | //------------------------------------------------- |
| 2119 | // ROM( p500 | |
| 2119 | // ROM( p500 ) | |
| 2120 | 2120 | //------------------------------------------------- |
| 2121 | 2121 | |
| 2122 | ROM_START( p500 | |
| 2122 | ROM_START( p500 ) | |
| 2123 | 2123 | ROM_REGION( 0x4000, "basic", 0 ) |
| 2124 | 2124 | ROM_DEFAULT_BIOS("r2") |
| 2125 | 2125 | ROM_SYSTEM_BIOS( 0, "r1", "Revision 1" ) |
| r18706 | r18707 | |
| 2148 | 2148 | // ROM( p500p ) |
| 2149 | 2149 | //------------------------------------------------- |
| 2150 | 2150 | |
| 2151 | #define rom_p500p rom_p500 | |
| 2151 | #define rom_p500p rom_p500 | |
| 2152 | 2152 | |
| 2153 | 2153 | |
| 2154 | 2154 | //------------------------------------------------- |
| r18706 | r18707 | |
| 2378 | 2378 | //************************************************************************** |
| 2379 | 2379 | |
| 2380 | 2380 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS |
| 2381 | COMP( 1983, p500n, 0, 0, p500_ntsc, cbm2, driver_device, 0, "Commodore Business Machines", "P500 ~ C128-40 ~ PET-II (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported | |
| 2382 | COMP( 1983, p500p, p500n, 0, p500_pal, cbm2, driver_device, 0, "Commodore Business Machines", "P500 ~ C128-40 ~ PET-II (PAL)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported | |
| 2381 | COMP( 1983, p500, 0, 0, p500_ntsc, cbm2, driver_device, 0, "Commodore Business Machines", "P500 ~ C128-40 ~ PET-II (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported | |
| 2382 | COMP( 1983, p500p, p500, 0, p500_pal, cbm2, driver_device, 0, "Commodore Business Machines", "P500 ~ C128-40 ~ PET-II (PAL)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported | |
| 2383 | 2383 | |
| 2384 | COMP( 1983, b500, p500n, 0, b128, cbm2, driver_device, 0, "Commodore Business Machines", "B500 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2385 | COMP( 1983, b128, p500n, 0, b128, cbm2, driver_device, 0, "Commodore Business Machines", "B128 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2386 | COMP( 1983, b256, p500n, 0, b256, cbm2, driver_device, 0, "Commodore Business Machines", "B256 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2387 | COMP( 1983, cbm610, p500n, 0, cbm610, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 610 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2388 | COMP( 1983, cbm620, p500n, 0, cbm620, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 620 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2389 | COMP( 1983, cbm620hu, p500n, 0, cbm620, cbm2hu, driver_device, 0, "Commodore Business Machines", "CBM 620 (Hungary)", GAME_SUPPORTS_SAVE ) | |
| 2384 | COMP( 1983, b500, p500, 0, b128, cbm2, driver_device, 0, "Commodore Business Machines", "B500 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2385 | COMP( 1983, b128, p500, 0, b128, cbm2, driver_device, 0, "Commodore Business Machines", "B128 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2386 | COMP( 1983, b256, p500, 0, b256, cbm2, driver_device, 0, "Commodore Business Machines", "B256 (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2387 | COMP( 1983, cbm610, p500, 0, cbm610, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 610 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2388 | COMP( 1983, cbm620, p500, 0, cbm620, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 620 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2389 | COMP( 1983, cbm620hu, p500, 0, cbm620, cbm2hu, driver_device, 0, "Commodore Business Machines", "CBM 620 (Hungary)", GAME_SUPPORTS_SAVE ) | |
| 2390 | 2390 | |
| 2391 | COMP( 1983, b128hp, p500n, 0, b128hp, cbm2, driver_device, 0, "Commodore Business Machines", "B128-80HP (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2392 | COMP( 1983, b256hp, p500n, 0, b256hp, cbm2, driver_device, 0, "Commodore Business Machines", "B256-80HP (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2393 | COMP( 1983, bx256hp, p500n, 0, bx256hp, cbm2, driver_device, 0, "Commodore Business Machines", "BX256-80HP (NTSC)", GAME_NOT_WORKING ) // 8088 co-processor is missing | |
| 2394 | COMP( 1983, cbm710, p500n, 0, cbm710, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 710 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2395 | COMP( 1983, cbm720, p500n, 0, cbm720, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 720 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2396 | COMP( 1983, cbm720sw, p500n, 0, cbm720, cbm2sw, driver_device, 0, "Commodore Business Machines", "CBM 720 (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 2397 | COMP( 1983, cbm730, p500n, 0, cbm730, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 730 (PAL)", GAME_NOT_WORKING ) // 8088 co-processor is missing | |
| 2391 | COMP( 1983, b128hp, p500, 0, b128hp, cbm2, driver_device, 0, "Commodore Business Machines", "B128-80HP (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2392 | COMP( 1983, b256hp, p500, 0, b256hp, cbm2, driver_device, 0, "Commodore Business Machines", "B256-80HP (NTSC)", GAME_SUPPORTS_SAVE ) | |
| 2393 | COMP( 1983, bx256hp, p500, 0, bx256hp, cbm2, driver_device, 0, "Commodore Business Machines", "BX256-80HP (NTSC)", GAME_NOT_WORKING ) // 8088 co-processor is missing | |
| 2394 | COMP( 1983, cbm710, p500, 0, cbm710, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 710 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2395 | COMP( 1983, cbm720, p500, 0, cbm720, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 720 (PAL)", GAME_SUPPORTS_SAVE ) | |
| 2396 | COMP( 1983, cbm720sw, p500, 0, cbm720, cbm2sw, driver_device, 0, "Commodore Business Machines", "CBM 720 (Sweden/Finland)", GAME_SUPPORTS_SAVE ) | |
| 2397 | COMP( 1983, cbm730, p500, 0, cbm730, cbm2, driver_device, 0, "Commodore Business Machines", "CBM 730 (PAL)", GAME_NOT_WORKING ) // 8088 co-processor is missing |
| Previous | 199869 Revisions | Next |