trunk/src/mame/drivers/toki.c
| r243365 | r243366 | |
| 91 | 91 | AM_RANGE(0x060000, 0x06d7ff) AM_RAM |
| 92 | 92 | AM_RANGE(0x06d800, 0x06dfff) AM_RAM AM_SHARE("spriteram") |
| 93 | 93 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 94 | | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_SHARE("bg1_vram16") |
| 95 | | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_SHARE("bg2_vram16") |
| 96 | | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_SHARE("videoram") |
| 94 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(background1_videoram_w) AM_SHARE("bg1_vram") |
| 95 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(background2_videoram_w) AM_SHARE("bg2_vram") |
| 96 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(foreground_videoram_w) AM_SHARE("videoram") |
| 97 | 97 | AM_RANGE(0x080000, 0x08000d) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, main_word_r, main_word_w) |
| 98 | | AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_SHARE("scrollram16") |
| 98 | AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_SHARE("scrollram") |
| 99 | 99 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW") |
| 100 | 100 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS") |
| 101 | 101 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM") |
| r243365 | r243366 | |
| 106 | 106 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 107 | 107 | AM_RANGE(0x060000, 0x06dfff) AM_RAM |
| 108 | 108 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 109 | | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_SHARE("bg1_vram16") |
| 110 | | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_SHARE("bg2_vram16") |
| 111 | | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_SHARE("videoram") |
| 109 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(background1_videoram_w) AM_SHARE("bg1_vram") |
| 110 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(background2_videoram_w) AM_SHARE("bg2_vram") |
| 111 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(foreground_videoram_w) AM_SHARE("videoram") |
| 112 | 112 | AM_RANGE(0x071000, 0x071001) AM_WRITENOP /* sprite related? seems another scroll register */ |
| 113 | 113 | /* gets written the same value as 75000a (bg2 scrollx) */ |
| 114 | 114 | AM_RANGE(0x071804, 0x071807) AM_WRITENOP /* sprite related, always 01be0100 */ |
| 115 | 115 | AM_RANGE(0x07180e, 0x071e45) AM_WRITEONLY AM_SHARE("spriteram") |
| 116 | 116 | AM_RANGE(0x072000, 0x072001) AM_READ(watchdog_reset16_r) /* probably */ |
| 117 | 117 | AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand16_w) |
| 118 | | AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram16") |
| 118 | AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram") |
| 119 | 119 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW") |
| 120 | 120 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS") |
| 121 | 121 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM") |
| r243365 | r243366 | |
| 826 | 826 | memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800); |
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | |
| 830 | save_item(NAME(m_msm5205next)); |
| 831 | save_item(NAME(m_toggle)); |
| 829 | 832 | } |
| 830 | 833 | |
| 831 | 834 | DRIVER_INIT_MEMBER(toki_state,jujuba) |
| r243365 | r243366 | |
| 877 | 880 | |
| 878 | 881 | |
| 879 | 882 | // these 2 are both unique revisions |
| 880 | | GAME( 1989, toki, 0, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", 0 ) |
| 881 | | GAME( 1989, tokiu, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", 0 ) |
| 883 | GAME( 1989, toki, 0, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", GAME_SUPPORTS_SAVE ) |
| 884 | GAME( 1989, tokiu, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", GAME_SUPPORTS_SAVE ) |
| 882 | 885 | |
| 883 | 886 | // these 3 are all the same revision, only the region byte differs |
| 884 | | GAME( 1989, tokia, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", 0 ) |
| 885 | | GAME( 1989, tokiua,toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", 0 ) |
| 886 | | GAME( 1989, juju, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", 0 ) |
| 887 | GAME( 1989, tokia, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", GAME_SUPPORTS_SAVE ) |
| 888 | GAME( 1989, tokiua,toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", GAME_SUPPORTS_SAVE ) |
| 889 | GAME( 1989, juju, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", GAME_SUPPORTS_SAVE ) |
| 887 | 890 | |
| 888 | | GAME( 1990, tokib, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", 0 ) |
| 889 | | GAME( 1990, jujub, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", 0 ) |
| 891 | GAME( 1990, tokib, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", GAME_SUPPORTS_SAVE ) |
| 892 | GAME( 1990, jujub, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", GAME_SUPPORTS_SAVE ) |
| 890 | 893 | /* Sound hardware seems to have been slightly modified, the coins are handled ok, but there is no music and bad sfx. Program roms have a slight bitswap, Flipscreen also seems to be ignored */ |
| 891 | | GAME( 1989, jujuba, toki, toki, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND ) // bootleg of tokia/juju revison |
| 894 | GAME( 1989, jujuba, toki, toki, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // bootleg of tokia/juju revison |
trunk/src/mame/includes/toki.h
| r243365 | r243366 | |
| 7 | 7 | public: |
| 8 | 8 | toki_state(const machine_config &mconfig, device_type type, const char *tag) |
| 9 | 9 | : driver_device(mconfig, type, tag), |
| 10 | | m_spriteram(*this, "spriteram") , |
| 11 | | m_background1_videoram16(*this, "bg1_vram16"), |
| 12 | | m_background2_videoram16(*this, "bg2_vram16"), |
| 13 | | m_videoram(*this, "videoram"), |
| 14 | | m_scrollram16(*this, "scrollram16"), |
| 15 | 10 | m_maincpu(*this, "maincpu"), |
| 16 | 11 | m_audiocpu(*this, "audiocpu"), |
| 17 | 12 | m_seibu_sound(*this, "seibu_sound"), |
| 18 | 13 | m_msm(*this, "msm"), |
| 19 | 14 | m_gfxdecode(*this, "gfxdecode"), |
| 20 | 15 | m_screen(*this, "screen"), |
| 21 | | m_palette(*this, "palette") { } |
| 16 | m_palette(*this, "palette"), |
| 17 | m_spriteram(*this, "spriteram") , |
| 18 | m_background1_videoram(*this, "bg1_vram"), |
| 19 | m_background2_videoram(*this, "bg2_vram"), |
| 20 | m_videoram(*this, "videoram"), |
| 21 | m_scrollram(*this, "scrollram") { } |
| 22 | 22 | |
| 23 | | required_device<buffered_spriteram16_device> m_spriteram; |
| 24 | | required_shared_ptr<UINT16> m_background1_videoram16; |
| 25 | | required_shared_ptr<UINT16> m_background2_videoram16; |
| 26 | | required_shared_ptr<UINT16> m_videoram; |
| 27 | | required_shared_ptr<UINT16> m_scrollram16; |
| 28 | | |
| 29 | 23 | required_device<cpu_device> m_maincpu; |
| 30 | 24 | required_device<cpu_device> m_audiocpu; |
| 31 | 25 | optional_device<seibu_sound_device> m_seibu_sound; |
| r243365 | r243366 | |
| 34 | 28 | required_device<screen_device> m_screen; |
| 35 | 29 | required_device<palette_device> m_palette; |
| 36 | 30 | |
| 31 | required_device<buffered_spriteram16_device> m_spriteram; |
| 32 | required_shared_ptr<UINT16> m_background1_videoram; |
| 33 | required_shared_ptr<UINT16> m_background2_videoram; |
| 34 | required_shared_ptr<UINT16> m_videoram; |
| 35 | required_shared_ptr<UINT16> m_scrollram; |
| 36 | |
| 37 | 37 | int m_msm5205next; |
| 38 | 38 | int m_toggle; |
| 39 | |
| 39 | 40 | tilemap_t *m_background_layer; |
| 40 | 41 | tilemap_t *m_foreground_layer; |
| 41 | 42 | tilemap_t *m_text_layer; |
| 42 | 43 | |
| 43 | 44 | DECLARE_WRITE16_MEMBER(tokib_soundcommand16_w); |
| 44 | 45 | DECLARE_READ16_MEMBER(pip16_r); |
| 45 | | DECLARE_WRITE8_MEMBER(toki_adpcm_data_w); |
| 46 | 46 | DECLARE_WRITE16_MEMBER(toki_control_w); |
| 47 | | DECLARE_WRITE16_MEMBER(toki_foreground_videoram16_w); |
| 48 | | DECLARE_WRITE16_MEMBER(toki_background1_videoram16_w); |
| 49 | | DECLARE_WRITE16_MEMBER(toki_background2_videoram16_w); |
| 47 | DECLARE_WRITE16_MEMBER(foreground_videoram_w); |
| 48 | DECLARE_WRITE16_MEMBER(background1_videoram_w); |
| 49 | DECLARE_WRITE16_MEMBER(background2_videoram_w); |
| 50 | 50 | DECLARE_WRITE8_MEMBER(toki_adpcm_control_w); |
| 51 | DECLARE_WRITE8_MEMBER(toki_adpcm_data_w); |
| 52 | DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int); |
| 53 | |
| 51 | 54 | DECLARE_DRIVER_INIT(tokib); |
| 52 | 55 | DECLARE_DRIVER_INIT(jujuba); |
| 53 | 56 | DECLARE_DRIVER_INIT(toki); |
| 57 | |
| 54 | 58 | TILE_GET_INFO_MEMBER(get_text_tile_info); |
| 55 | 59 | TILE_GET_INFO_MEMBER(get_back_tile_info); |
| 56 | 60 | TILE_GET_INFO_MEMBER(get_fore_tile_info); |
| 61 | |
| 57 | 62 | virtual void video_start(); |
| 63 | |
| 58 | 64 | UINT32 screen_update_toki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 59 | 65 | UINT32 screen_update_tokib(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 60 | 66 | void toki_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 61 | 67 | void tokib_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 62 | | DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int); |
| 63 | 68 | }; |
trunk/src/mame/video/toki.c
| r243365 | r243366 | |
| 29 | 29 | WRITE16_MEMBER(toki_state::toki_control_w) |
| 30 | 30 | { |
| 31 | 31 | m_screen->update_partial(m_screen->vpos() - 1); |
| 32 | | COMBINE_DATA(&m_scrollram16[offset]); |
| 32 | COMBINE_DATA(&m_scrollram[offset]); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | TILE_GET_INFO_MEMBER(toki_state::get_text_tile_info) |
| r243365 | r243366 | |
| 48 | 48 | |
| 49 | 49 | TILE_GET_INFO_MEMBER(toki_state::get_back_tile_info) |
| 50 | 50 | { |
| 51 | | int tile = m_background1_videoram16[tile_index]; |
| 51 | int tile = m_background1_videoram[tile_index]; |
| 52 | 52 | int color = (tile >> 12) & 0xf; |
| 53 | 53 | |
| 54 | 54 | tile &= 0xfff; |
| r243365 | r243366 | |
| 61 | 61 | |
| 62 | 62 | TILE_GET_INFO_MEMBER(toki_state::get_fore_tile_info) |
| 63 | 63 | { |
| 64 | | int tile = m_background2_videoram16[tile_index]; |
| 64 | int tile = m_background2_videoram[tile_index]; |
| 65 | 65 | int color = (tile >> 12) & 0xf; |
| 66 | 66 | |
| 67 | 67 | tile &= 0xfff; |
| r243365 | r243366 | |
| 92 | 92 | |
| 93 | 93 | /*************************************/ |
| 94 | 94 | |
| 95 | | WRITE16_MEMBER(toki_state::toki_foreground_videoram16_w) |
| 95 | WRITE16_MEMBER(toki_state::foreground_videoram_w) |
| 96 | 96 | { |
| 97 | 97 | UINT16 *videoram = m_videoram; |
| 98 | 98 | COMBINE_DATA(&videoram[offset]); |
| 99 | 99 | m_text_layer->mark_tile_dirty(offset); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | | WRITE16_MEMBER(toki_state::toki_background1_videoram16_w) |
| 102 | WRITE16_MEMBER(toki_state::background1_videoram_w) |
| 103 | 103 | { |
| 104 | | COMBINE_DATA(&m_background1_videoram16[offset]); |
| 104 | COMBINE_DATA(&m_background1_videoram[offset]); |
| 105 | 105 | m_background_layer->mark_tile_dirty(offset); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | | WRITE16_MEMBER(toki_state::toki_background2_videoram16_w) |
| 108 | WRITE16_MEMBER(toki_state::background2_videoram_w) |
| 109 | 109 | { |
| 110 | | COMBINE_DATA(&m_background2_videoram16[offset]); |
| 110 | COMBINE_DATA(&m_background2_videoram[offset]); |
| 111 | 111 | m_foreground_layer->mark_tile_dirty(offset); |
| 112 | 112 | } |
| 113 | 113 | |
| r243365 | r243366 | |
| 249 | 249 | { |
| 250 | 250 | int background_y_scroll,foreground_y_scroll,background_x_scroll,foreground_x_scroll; |
| 251 | 251 | |
| 252 | | background_x_scroll=((m_scrollram16[0x06] &0x7f) << 1) |
| 253 | | |((m_scrollram16[0x06] &0x80) >> 7) |
| 254 | | |((m_scrollram16[0x05] &0x10) << 4); |
| 255 | | background_y_scroll=((m_scrollram16[0x0d]&0x10)<<4)+((m_scrollram16[0x0e]&0x7f)<<1)+((m_scrollram16[0x0e]&0x80)>>7); |
| 252 | background_x_scroll=((m_scrollram[0x06] &0x7f) << 1) |
| 253 | |((m_scrollram[0x06] &0x80) >> 7) |
| 254 | |((m_scrollram[0x05] &0x10) << 4); |
| 255 | background_y_scroll=((m_scrollram[0x0d]&0x10)<<4)+((m_scrollram[0x0e]&0x7f)<<1)+((m_scrollram[0x0e]&0x80)>>7); |
| 256 | 256 | |
| 257 | 257 | m_background_layer->set_scrollx(0, background_x_scroll ); |
| 258 | 258 | m_background_layer->set_scrolly(0, background_y_scroll ); |
| 259 | 259 | |
| 260 | | foreground_x_scroll= ((m_scrollram16[0x16] &0x7f) << 1) |
| 261 | | |((m_scrollram16[0x16] &0x80) >> 7) |
| 262 | | |((m_scrollram16[0x15] &0x10) << 4); |
| 263 | | foreground_y_scroll=((m_scrollram16[0x1d]&0x10)<<4)+((m_scrollram16[0x1e]&0x7f)<<1)+((m_scrollram16[0x1e]&0x80)>>7); |
| 260 | foreground_x_scroll= ((m_scrollram[0x16] &0x7f) << 1) |
| 261 | |((m_scrollram[0x16] &0x80) >> 7) |
| 262 | |((m_scrollram[0x15] &0x10) << 4); |
| 263 | foreground_y_scroll=((m_scrollram[0x1d]&0x10)<<4)+((m_scrollram[0x1e]&0x7f)<<1)+((m_scrollram[0x1e]&0x80)>>7); |
| 264 | 264 | |
| 265 | 265 | m_foreground_layer->set_scrollx(0, foreground_x_scroll ); |
| 266 | 266 | m_foreground_layer->set_scrolly(0, foreground_y_scroll ); |
| 267 | 267 | |
| 268 | | flip_screen_set((m_scrollram16[0x28]&0x8000)==0); |
| 268 | flip_screen_set((m_scrollram[0x28]&0x8000)==0); |
| 269 | 269 | |
| 270 | | if (m_scrollram16[0x28]&0x100) { |
| 270 | if (m_scrollram[0x28]&0x100) { |
| 271 | 271 | m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 272 | 272 | m_foreground_layer->draw(screen, bitmap, cliprect, 0,0); |
| 273 | 273 | } else { |
| r243365 | r243366 | |
| 283 | 283 | { |
| 284 | 284 | m_foreground_layer->set_scroll_rows(1); |
| 285 | 285 | m_background_layer->set_scroll_rows(1); |
| 286 | | m_background_layer->set_scrolly(0, m_scrollram16[0]+1 ); |
| 287 | | m_background_layer->set_scrollx(0, m_scrollram16[1]-0x103 ); |
| 288 | | m_foreground_layer->set_scrolly(0, m_scrollram16[2]+1 ); |
| 289 | | m_foreground_layer->set_scrollx(0, m_scrollram16[3]-0x101 ); |
| 286 | m_background_layer->set_scrolly(0, m_scrollram[0]+1 ); |
| 287 | m_background_layer->set_scrollx(0, m_scrollram[1]-0x103 ); |
| 288 | m_foreground_layer->set_scrolly(0, m_scrollram[2]+1 ); |
| 289 | m_foreground_layer->set_scrollx(0, m_scrollram[3]-0x101 ); |
| 290 | 290 | |
| 291 | | if (m_scrollram16[3]&0x2000) { |
| 291 | if (m_scrollram[3]&0x2000) { |
| 292 | 292 | m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 293 | 293 | m_foreground_layer->draw(screen, bitmap, cliprect, 0,0); |
| 294 | 294 | } else { |
trunk/src/mess/drivers/c65.c
| r243365 | r243366 | |
| 20 | 20 | |
| 21 | 21 | #include "emu.h" |
| 22 | 22 | #include "cpu/m6502/m4510.h" |
| 23 | #include "machine/mos6526.h" |
| 23 | 24 | |
| 24 | 25 | #define MAIN_CLOCK XTAL_3_5MHz |
| 25 | 26 | |
| r243365 | r243366 | |
| 29 | 30 | c65_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | 31 | : driver_device(mconfig, type, tag), |
| 31 | 32 | m_maincpu(*this, "maincpu"), |
| 33 | m_cia0(*this, "cia_0"), |
| 34 | m_cia1(*this, "cia_1"), |
| 32 | 35 | m_screen(*this, "screen"), |
| 33 | 36 | m_palette(*this, "palette"), |
| 34 | 37 | m_workram(*this, "wram"), |
| r243365 | r243366 | |
| 42 | 45 | |
| 43 | 46 | // devices |
| 44 | 47 | required_device<m4510_device> m_maincpu; |
| 48 | required_device<mos6526_device> m_cia0; |
| 49 | required_device<mos6526_device> m_cia1; |
| 45 | 50 | required_device<screen_device> m_screen; |
| 46 | 51 | required_device<palette_device> m_palette; |
| 47 | 52 | required_shared_ptr<UINT8> m_workram; |
| r243365 | r243366 | |
| 53 | 58 | required_device<gfxdecode_device> m_gfxdecode; |
| 54 | 59 | |
| 55 | 60 | UINT8 *m_iplrom; |
| 56 | | |
| 61 | UINT8 m_keyb_input[10]; |
| 62 | UINT8 m_keyb_mux; |
| 57 | 63 | |
| 58 | 64 | DECLARE_READ8_MEMBER(vic4567_dummy_r); |
| 59 | 65 | DECLARE_WRITE8_MEMBER(vic4567_dummy_w); |
| r243365 | r243366 | |
| 63 | 69 | DECLARE_WRITE8_MEMBER(DMAgic_w); |
| 64 | 70 | DECLARE_READ8_MEMBER(CIASelect_r); |
| 65 | 71 | DECLARE_WRITE8_MEMBER(CIASelect_w); |
| 72 | DECLARE_READ8_MEMBER(cia0_porta_r); |
| 73 | DECLARE_WRITE8_MEMBER(cia0_porta_w); |
| 74 | DECLARE_READ8_MEMBER(cia0_portb_r); |
| 75 | DECLARE_WRITE8_MEMBER(cia0_portb_w); |
| 76 | DECLARE_WRITE_LINE_MEMBER(cia0_irq); |
| 66 | 77 | |
| 67 | 78 | DECLARE_READ8_MEMBER(dummy_r); |
| 68 | | |
| 79 | |
| 69 | 80 | // screen updates |
| 70 | 81 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 71 | 82 | DECLARE_PALETTE_INIT(c65); |
| r243365 | r243366 | |
| 89 | 100 | UINT8 m_VIC3_ControlB; |
| 90 | 101 | void PalEntryFlush(UINT8 offset); |
| 91 | 102 | void DMAgicExecute(address_space &space,UINT32 address); |
| 103 | void IRQCheck(UINT8 irq_cause); |
| 92 | 104 | int inner_x_char(int xoffs); |
| 93 | 105 | int inner_y_char(int yoffs); |
| 94 | 106 | }; |
| r243365 | r243366 | |
| 154 | 166 | case 0x12: |
| 155 | 167 | res = (m_screen->vpos() & 0xff); |
| 156 | 168 | return res; |
| 169 | case 0x15: |
| 170 | return 0xff; // silence log for now |
| 171 | case 0x19: |
| 172 | return m_VIC2_IRQPend; |
| 173 | |
| 174 | case 0x1a: |
| 175 | return m_VIC2_IRQMask; |
| 176 | |
| 157 | 177 | case 0x20: |
| 158 | 178 | return m_VIC2_EXTColor; |
| 159 | | case 0x19: |
| 160 | | return m_VIC2_IRQPend; |
| 179 | |
| 161 | 180 | case 0x30: |
| 162 | 181 | return m_VIC3_ControlA; |
| 163 | 182 | case 0x31: |
| r243365 | r243366 | |
| 174 | 193 | switch(offset) |
| 175 | 194 | { |
| 176 | 195 | case 0x19: |
| 177 | | m_VIC2_IRQPend = data & 0x8f; |
| 196 | m_VIC2_IRQPend &= ~data; |
| 197 | IRQCheck(0); |
| 178 | 198 | break; |
| 179 | 199 | case 0x1a: |
| 180 | 200 | m_VIC2_IRQMask = data & 0xf; |
| 201 | IRQCheck(0); |
| 181 | 202 | break; |
| 182 | 203 | case 0x20: |
| 183 | 204 | m_VIC2_EXTColor = data & 0xf; |
| r243365 | r243366 | |
| 307 | 328 | else |
| 308 | 329 | { |
| 309 | 330 | // CIA at 0xdc00 |
| 331 | switch((offset & 0x700) | 0x800) |
| 332 | { |
| 333 | case 0xc00: |
| 334 | return m_cia0->read(space,offset); |
| 335 | case 0xd00: |
| 336 | return m_cia1->read(space,offset); |
| 337 | default: |
| 338 | printf("Unknown I/O access read to offset %04x\n",offset); |
| 339 | break; |
| 340 | } |
| 341 | |
| 310 | 342 | } |
| 311 | 343 | |
| 312 | 344 | return 0xff; |
| r243365 | r243366 | |
| 319 | 351 | else |
| 320 | 352 | { |
| 321 | 353 | // CIA at 0xdc00 |
| 354 | switch((offset & 0x700) | 0x800) |
| 355 | { |
| 356 | case 0xc00: |
| 357 | m_cia0->write(space,offset,data); |
| 358 | break; |
| 359 | |
| 360 | case 0xd00: |
| 361 | m_cia1->write(space,offset,data); |
| 362 | break; |
| 363 | default: |
| 364 | printf("Unknown I/O access write to offset %04x data = %02x\n",offset,data); |
| 365 | break; |
| 366 | } |
| 322 | 367 | } |
| 323 | 368 | |
| 324 | 369 | } |
| 325 | 370 | |
| 371 | READ8_MEMBER(c65_state::cia0_porta_r) |
| 372 | { |
| 373 | |
| 374 | return 0xff; |
| 375 | } |
| 376 | |
| 377 | READ8_MEMBER(c65_state::cia0_portb_r) |
| 378 | { |
| 379 | static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" }; |
| 380 | UINT8 res; |
| 381 | |
| 382 | res = 0xff; |
| 383 | for(int i=0;i<8;i++) |
| 384 | { |
| 385 | |
| 386 | m_keyb_input[i] = machine().root_device().ioport(c64ports[i])->read(); |
| 387 | |
| 388 | if(m_keyb_mux & 1 << (i)) |
| 389 | res &= m_keyb_input[i]; |
| 390 | } |
| 391 | |
| 392 | return res; |
| 393 | } |
| 394 | |
| 395 | WRITE8_MEMBER(c65_state::cia0_porta_w) |
| 396 | { |
| 397 | m_keyb_mux = ~data; |
| 398 | printf("%02x\n",m_keyb_mux); |
| 399 | } |
| 400 | |
| 401 | WRITE8_MEMBER(c65_state::cia0_portb_w) |
| 402 | { |
| 403 | } |
| 404 | |
| 326 | 405 | READ8_MEMBER(c65_state::dummy_r) |
| 327 | 406 | { |
| 328 | 407 | return 0; |
| r243365 | r243366 | |
| 357 | 436 | |
| 358 | 437 | |
| 359 | 438 | static INPUT_PORTS_START( c65 ) |
| 360 | | /* dummy active high structure */ |
| 361 | | PORT_START("SYSA") |
| 362 | | PORT_DIPNAME( 0x01, 0x00, "SYSA" ) |
| 363 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 364 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 365 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 366 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 367 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 368 | | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 369 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 370 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 371 | | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 372 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 373 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 374 | | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 375 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 376 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 377 | | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 378 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 379 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 380 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 381 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 382 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 383 | | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 384 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 385 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 439 | PORT_START( "ROW0" ) |
| 440 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Down Up") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 441 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 442 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 443 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 444 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 445 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Right Left") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 446 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 447 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INST DEL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 386 | 448 | |
| 387 | | /* dummy active low structure */ |
| 388 | | PORT_START("DSWA") |
| 389 | | PORT_DIPNAME( 0x01, 0x01, "DSWA" ) |
| 390 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 391 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 392 | | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 393 | | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 394 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 395 | | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 396 | | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 397 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 398 | | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 399 | | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 400 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 401 | | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 402 | | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 403 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 404 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 405 | | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 406 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 407 | | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 408 | | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 409 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 410 | | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 411 | | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 412 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 449 | PORT_START( "ROW1" ) |
| 450 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Left)") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 451 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 452 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 453 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 454 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 455 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 456 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 457 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 458 | |
| 459 | PORT_START( "ROW2" ) |
| 460 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 461 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 462 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 463 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 464 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 465 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 466 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 467 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 468 | |
| 469 | PORT_START( "ROW3" ) |
| 470 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 471 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 472 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 473 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 474 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 475 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 476 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 477 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 478 | |
| 479 | PORT_START( "ROW4" ) |
| 480 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 481 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 482 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 483 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 484 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 485 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 486 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 487 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 488 | |
| 489 | PORT_START( "ROW5" ) |
| 490 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 491 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') |
| 492 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('[') |
| 493 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 494 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') |
| 495 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 496 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 497 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('+') |
| 498 | |
| 499 | PORT_START( "ROW6" ) |
| 500 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 501 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x91 Pi") PORT_CODE(KEYCODE_DEL) PORT_CHAR(0x2191) PORT_CHAR(0x03C0) |
| 502 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('=') |
| 503 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Right)") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 504 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CLR HOME") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(HOME)) |
| 505 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR(']') |
| 506 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('*') |
| 507 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\xA3') |
| 508 | |
| 509 | PORT_START( "ROW7" ) |
| 510 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUN STOP") PORT_CODE(KEYCODE_HOME) |
| 511 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 512 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CBM") PORT_CODE(KEYCODE_LALT) |
| 513 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 514 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') |
| 515 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_SHIFT_2) |
| 516 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x90") PORT_CODE(KEYCODE_TILDE) PORT_CHAR(0x2190) |
| 517 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 518 | |
| 413 | 519 | INPUT_PORTS_END |
| 414 | 520 | |
| 415 | 521 | |
| r243365 | r243366 | |
| 445 | 551 | GFXDECODE_ENTRY( "maincpu", 0xd000, charlayout, 0, 16 ) // another identical copy is at 0x9000 |
| 446 | 552 | GFXDECODE_END |
| 447 | 553 | |
| 554 | void c65_state::IRQCheck(UINT8 irq_cause) |
| 555 | { |
| 556 | m_VIC2_IRQPend |= (irq_cause != 0) ? 0x80 : 0x00; |
| 557 | m_VIC2_IRQPend |= irq_cause; |
| 558 | |
| 559 | m_maincpu->set_input_line(M4510_IRQ_LINE,m_VIC2_IRQMask & m_VIC2_IRQPend ? ASSERT_LINE : CLEAR_LINE); |
| 560 | } |
| 561 | |
| 448 | 562 | INTERRUPT_GEN_MEMBER(c65_state::vic3_vblank_irq) |
| 449 | 563 | { |
| 564 | IRQCheck(1); |
| 450 | 565 | //if(m_VIC2_IRQMask & 1) |
| 451 | 566 | // m_maincpu->set_input_line(M4510_IRQ_LINE,HOLD_LINE); |
| 452 | 567 | } |
| 453 | 568 | |
| 569 | WRITE_LINE_MEMBER(c65_state::cia0_irq) |
| 570 | { |
| 571 | printf("%d IRQ\n",state); |
| 572 | |
| 573 | #if 0 |
| 574 | if(state) |
| 575 | { |
| 576 | static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" }; |
| 577 | for(int i=0;i<8;i++) |
| 578 | m_keyb_input[i] = machine().root_device().ioport(c64ports[i])->read(); |
| 579 | } |
| 580 | #endif |
| 581 | // m_cia0_irq = state; |
| 582 | // c65_irq(state || m_vicirq); |
| 583 | } |
| 584 | |
| 454 | 585 | static MACHINE_CONFIG_START( c65, c65_state ) |
| 455 | 586 | |
| 456 | 587 | /* basic machine hardware */ |
| r243365 | r243366 | |
| 458 | 589 | MCFG_CPU_PROGRAM_MAP(c65_map) |
| 459 | 590 | MCFG_CPU_VBLANK_INT_DRIVER("screen",c65_state,vic3_vblank_irq) |
| 460 | 591 | |
| 592 | MCFG_DEVICE_ADD("cia_0", MOS6526, MAIN_CLOCK) |
| 593 | MCFG_MOS6526_TOD(60) |
| 594 | MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, cia0_irq)) |
| 595 | MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, cia0_porta_r)) |
| 596 | MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, cia0_porta_w)) |
| 597 | MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c65_state, cia0_portb_r)) |
| 598 | MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c65_state, cia0_portb_w)) |
| 599 | |
| 600 | MCFG_DEVICE_ADD("cia_1", MOS6526, MAIN_CLOCK) |
| 601 | MCFG_MOS6526_TOD(60) |
| 602 | // MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, c65_cia1_interrupt)) |
| 603 | // MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, c65_cia1_port_a_r)) |
| 604 | // MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, c65_cia1_port_a_w)) |
| 605 | |
| 606 | |
| 461 | 607 | /* video hardware */ |
| 462 | 608 | MCFG_SCREEN_ADD("screen", RASTER) |
| 463 | 609 | // MCFG_SCREEN_REFRESH_RATE(60) |