trunk/src/mame/drivers/portrait.c
| r245243 | r245244 | |
| 86 | 86 | #include "emu.h" |
| 87 | 87 | #include "cpu/z80/z80.h" |
| 88 | 88 | #include "cpu/mcs48/mcs48.h" |
| 89 | | #include "sound/tms5220.h" |
| 90 | 89 | #include "machine/nvram.h" |
| 91 | 90 | #include "includes/portrait.h" |
| 92 | 91 | |
| 93 | | WRITE8_MEMBER(portrait_state::portrait_ctrl_w) |
| 92 | WRITE8_MEMBER(portrait_state::ctrl_w) |
| 94 | 93 | { |
| 95 | 94 | /* bits 4 and 5 are unknown */ |
| 96 | 95 | |
| r245243 | r245244 | |
| 106 | 105 | output_set_value("photo", (data >> 7) & 1); |
| 107 | 106 | } |
| 108 | 107 | |
| 109 | | WRITE8_MEMBER(portrait_state::portrait_positive_scroll_w) |
| 108 | WRITE8_MEMBER(portrait_state::positive_scroll_w) |
| 110 | 109 | { |
| 111 | 110 | m_scroll = data; |
| 112 | 111 | } |
| 113 | 112 | |
| 114 | | WRITE8_MEMBER(portrait_state::portrait_negative_scroll_w) |
| 113 | WRITE8_MEMBER(portrait_state::negative_scroll_w) |
| 115 | 114 | { |
| 116 | 115 | m_scroll = - (data ^ 0xff); |
| 117 | 116 | } |
| 118 | 117 | |
| 119 | 118 | static ADDRESS_MAP_START( portrait_map, AS_PROGRAM, 8, portrait_state ) |
| 120 | 119 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 121 | | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(portrait_bgvideo_write) AM_SHARE("bgvideoram") |
| 122 | | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(portrait_fgvideo_write) AM_SHARE("fgvideoram") |
| 120 | AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(bgvideo_write) AM_SHARE("bgvideoram") |
| 121 | AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(fgvideo_write) AM_SHARE("fgvideoram") |
| 123 | 122 | AM_RANGE(0x9000, 0x91ff) AM_RAM AM_SHARE("spriteram") |
| 124 | 123 | AM_RANGE(0x9200, 0x97ff) AM_RAM |
| 125 | 124 | AM_RANGE(0xa000, 0xa000) AM_WRITE(soundlatch_byte_w) |
| 126 | 125 | AM_RANGE(0xa010, 0xa010) AM_WRITENOP // ? |
| 127 | 126 | AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW1") |
| 128 | 127 | AM_RANGE(0xa004, 0xa004) AM_READ_PORT("DSW2") |
| 129 | | AM_RANGE(0xa008, 0xa008) AM_READ_PORT("SYSTEM") AM_WRITE(portrait_ctrl_w) |
| 128 | AM_RANGE(0xa008, 0xa008) AM_READ_PORT("SYSTEM") AM_WRITE(ctrl_w) |
| 130 | 129 | AM_RANGE(0xa010, 0xa010) AM_READ_PORT("INPUTS") |
| 131 | | AM_RANGE(0xa018, 0xa018) AM_READNOP AM_WRITE(portrait_positive_scroll_w) |
| 132 | | AM_RANGE(0xa019, 0xa019) AM_WRITE(portrait_negative_scroll_w) |
| 130 | AM_RANGE(0xa018, 0xa018) AM_READNOP AM_WRITE(positive_scroll_w) |
| 131 | AM_RANGE(0xa019, 0xa019) AM_WRITE(negative_scroll_w) |
| 133 | 132 | AM_RANGE(0xa800, 0xa83f) AM_RAM AM_SHARE("nvram") |
| 134 | 133 | AM_RANGE(0xffff, 0xffff) AM_READNOP |
| 135 | 134 | ADDRESS_MAP_END |
| r245243 | r245244 | |
| 257 | 256 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 258 | 257 | MCFG_SCREEN_SIZE(64*8, 64*8) |
| 259 | 258 | MCFG_SCREEN_VISIBLE_AREA(0*8, 54*8-1, 0*8, 40*8-1) |
| 260 | | MCFG_SCREEN_UPDATE_DRIVER(portrait_state, screen_update_portrait) |
| 259 | MCFG_SCREEN_UPDATE_DRIVER(portrait_state, screen_update) |
| 261 | 260 | MCFG_SCREEN_PALETTE("palette") |
| 262 | 261 | |
| 263 | 262 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", portrait) |
| r245243 | r245244 | |
| 381 | 380 | |
| 382 | 381 | |
| 383 | 382 | |
| 384 | | GAME( 1983, portrait, 0, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 1)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS ) |
| 385 | | GAME( 1983, portraita,portrait, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 2)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS ) |
| 383 | GAME( 1983, portrait, 0, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 1)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) |
| 384 | GAME( 1983, portraita,portrait, portrait, portrait, driver_device, 0, ROT270, "Olympia", "Portraits (set 2)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/spool99.c
| r245243 | r245244 | |
| 101 | 101 | public: |
| 102 | 102 | spool99_state(const machine_config &mconfig, device_type type, const char *tag) |
| 103 | 103 | : driver_device(mconfig, type, tag), |
| 104 | | m_main(*this, "mainram"), |
| 105 | | m_vram(*this, "vram"), |
| 106 | | m_cram(*this, "cram"), |
| 107 | 104 | m_maincpu(*this, "maincpu"), |
| 108 | 105 | m_eeprom(*this, "eeprom"), |
| 109 | 106 | m_oki(*this, "oki"), |
| 110 | | m_gfxdecode(*this, "gfxdecode") { } |
| 107 | m_gfxdecode(*this, "gfxdecode"), |
| 108 | m_main(*this, "mainram"), |
| 109 | m_vram(*this, "vram"), |
| 110 | m_cram(*this, "cram") { } |
| 111 | 111 | |
| 112 | required_device<cpu_device> m_maincpu; |
| 113 | required_device<eeprom_serial_93cxx_device> m_eeprom; |
| 114 | required_device<okim6295_device> m_oki; |
| 115 | required_device<gfxdecode_device> m_gfxdecode; |
| 116 | |
| 112 | 117 | required_shared_ptr<UINT8> m_main; |
| 113 | 118 | required_shared_ptr<UINT8> m_vram; |
| 114 | 119 | required_shared_ptr<UINT8> m_cram; |
| 120 | |
| 115 | 121 | tilemap_t *m_sc0_tilemap; |
| 116 | | DECLARE_WRITE8_MEMBER(spool99_vram_w); |
| 117 | | DECLARE_WRITE8_MEMBER(spool99_cram_w); |
| 122 | |
| 123 | DECLARE_WRITE8_MEMBER(vram_w); |
| 124 | DECLARE_WRITE8_MEMBER(cram_w); |
| 118 | 125 | DECLARE_READ8_MEMBER(spool99_io_r); |
| 119 | 126 | DECLARE_READ8_MEMBER(vcarn_io_r); |
| 120 | 127 | DECLARE_WRITE8_MEMBER(eeprom_resetline_w); |
| 121 | 128 | DECLARE_WRITE8_MEMBER(eeprom_clockline_w); |
| 122 | 129 | DECLARE_WRITE8_MEMBER(eeprom_dataline_w); |
| 130 | |
| 123 | 131 | DECLARE_DRIVER_INIT(spool99); |
| 124 | | TILE_GET_INFO_MEMBER(get_spool99_tile_info); |
| 125 | 132 | virtual void video_start(); |
| 126 | | UINT32 screen_update_spool99(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 127 | | required_device<cpu_device> m_maincpu; |
| 128 | | required_device<eeprom_serial_93cxx_device> m_eeprom; |
| 129 | | required_device<okim6295_device> m_oki; |
| 130 | | required_device<gfxdecode_device> m_gfxdecode; |
| 133 | |
| 134 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 135 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 131 | 136 | }; |
| 132 | 137 | |
| 133 | | TILE_GET_INFO_MEMBER(spool99_state::get_spool99_tile_info) |
| 138 | TILE_GET_INFO_MEMBER(spool99_state::get_tile_info) |
| 134 | 139 | { |
| 135 | 140 | int code = ((m_vram[tile_index*2+1]<<8) | (m_vram[tile_index*2+0])); |
| 136 | 141 | int color = m_cram[tile_index*2+0]; |
| r245243 | r245244 | |
| 143 | 148 | |
| 144 | 149 | void spool99_state::video_start() |
| 145 | 150 | { |
| 146 | | m_sc0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(spool99_state::get_spool99_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 151 | m_sc0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(spool99_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 147 | 152 | } |
| 148 | 153 | |
| 149 | | UINT32 spool99_state::screen_update_spool99(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 154 | UINT32 spool99_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 150 | 155 | { |
| 151 | 156 | m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); |
| 152 | 157 | return 0; |
| 153 | 158 | } |
| 154 | 159 | |
| 155 | | WRITE8_MEMBER(spool99_state::spool99_vram_w) |
| 160 | WRITE8_MEMBER(spool99_state::vram_w) |
| 156 | 161 | { |
| 157 | 162 | m_vram[offset] = data; |
| 158 | 163 | m_sc0_tilemap->mark_tile_dirty(offset/2); |
| 159 | 164 | } |
| 160 | 165 | |
| 161 | | WRITE8_MEMBER(spool99_state::spool99_cram_w) |
| 166 | WRITE8_MEMBER(spool99_state::cram_w) |
| 162 | 167 | { |
| 163 | 168 | m_cram[offset] = data; |
| 164 | 169 | m_sc0_tilemap->mark_tile_dirty(offset/2); |
| r245243 | r245244 | |
| 229 | 234 | AM_RANGE(0xb000, 0xb3ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 230 | 235 | |
| 231 | 236 | AM_RANGE(0xb800, 0xdfff) AM_RAM |
| 232 | | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_SHARE("vram") |
| 233 | | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_SHARE("cram") |
| 237 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vram_w) AM_SHARE("vram") |
| 238 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(cram_w) AM_SHARE("cram") |
| 234 | 239 | ADDRESS_MAP_END |
| 235 | 240 | |
| 236 | 241 | READ8_MEMBER(spool99_state::vcarn_io_r) |
| r245243 | r245244 | |
| 276 | 281 | |
| 277 | 282 | AM_RANGE(0xb000, 0xdfff) AM_RAM |
| 278 | 283 | // AM_RANGE(0xdf00, 0xdfff) AM_READWRITE(vcarn_io_r,vcarn_io_w) AM_SHARE("vcarn_io") |
| 279 | | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(spool99_vram_w) AM_SHARE("vram") |
| 280 | | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(spool99_cram_w) AM_SHARE("cram") |
| 284 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(vram_w) AM_SHARE("vram") |
| 285 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(cram_w) AM_SHARE("cram") |
| 281 | 286 | ADDRESS_MAP_END |
| 282 | 287 | |
| 283 | 288 | |
| r245243 | r245244 | |
| 360 | 365 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 361 | 366 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 362 | 367 | MCFG_SCREEN_VISIBLE_AREA(7*8, 55*8-1, 1*8, 31*8-1) //384x240,raw guess |
| 363 | | MCFG_SCREEN_UPDATE_DRIVER(spool99_state, screen_update_spool99) |
| 368 | MCFG_SCREEN_UPDATE_DRIVER(spool99_state, screen_update) |
| 364 | 369 | MCFG_SCREEN_PALETTE("palette") |
| 365 | 370 | |
| 366 | 371 | MCFG_PALETTE_ADD("palette", 0x200) |
| r245243 | r245244 | |
| 455 | 460 | |
| 456 | 461 | |
| 457 | 462 | |
| 458 | | GAME( 1998, spool99, 0, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.36)", 0 ) |
| 459 | | GAME( 1998, spool99a, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.33)", 0 ) |
| 460 | | GAME( 1998, spool99b, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.31)", 0 ) |
| 461 | | GAME( 1998, spool99c, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.26)", 0 ) |
| 462 | | GAME( 1998, vcarn, 0, vcarn, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Video Carnival 1999 / Super Royal Card (Version 0.11)", 0 ) //MAME screen says '98, PCB screen says '99? |
| 463 | GAME( 1998, spool99, 0, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.36)", GAME_SUPPORTS_SAVE ) |
| 464 | GAME( 1998, spool99a, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.33)", GAME_SUPPORTS_SAVE ) |
| 465 | GAME( 1998, spool99b, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.31)", GAME_SUPPORTS_SAVE ) |
| 466 | GAME( 1998, spool99c, spool99, spool99, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Super Pool 99 (Version 0.26)", GAME_SUPPORTS_SAVE ) |
| 467 | GAME( 1998, vcarn, 0, vcarn, spool99, spool99_state, spool99, ROT0, "Electronic Projects", "Video Carnival 1999 / Super Royal Card (Version 0.11)", GAME_SUPPORTS_SAVE ) //MAME screen says '98, PCB screen says '99? |
trunk/src/mame/drivers/stactics.c
| r245243 | r245244 | |
| 135 | 135 | * |
| 136 | 136 | *************************************/ |
| 137 | 137 | |
| 138 | | WRITE8_MEMBER(stactics_state::stactics_coin_lockout_w) |
| 138 | WRITE8_MEMBER(stactics_state::coinlockout_w) |
| 139 | 139 | { |
| 140 | 140 | coin_lockout_w(machine(), offset, ~data & 0x01); |
| 141 | 141 | } |
| r245243 | r245244 | |
| 148 | 148 | * |
| 149 | 149 | *************************************/ |
| 150 | 150 | |
| 151 | | INTERRUPT_GEN_MEMBER(stactics_state::stactics_interrupt) |
| 151 | INTERRUPT_GEN_MEMBER(stactics_state::interrupt) |
| 152 | 152 | { |
| 153 | 153 | move_motor(); |
| 154 | 154 | |
| r245243 | r245244 | |
| 168 | 168 | AM_RANGE(0x4000, 0x40ff) AM_MIRROR(0x0700) AM_RAM |
| 169 | 169 | AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_READ_PORT("IN0") |
| 170 | 170 | AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ_PORT("IN1") |
| 171 | | AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x0f08) AM_WRITE(stactics_coin_lockout_w) |
| 171 | AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x0f08) AM_WRITE(coinlockout_w) |
| 172 | 172 | AM_RANGE(0x6002, 0x6005) AM_MIRROR(0x0f08) AM_WRITENOP |
| 173 | 173 | AM_RANGE(0x6006, 0x6007) AM_MIRROR(0x0f08) AM_WRITEONLY AM_SHARE("paletteram") |
| 174 | | /* AM_RANGE(0x6010, 0x6017) AM_MIRROR(0x0f08) AM_WRITE(stactics_sound_w) */ |
| 174 | /* AM_RANGE(0x6010, 0x6017) AM_MIRROR(0x0f08) AM_WRITE(sound_w) */ |
| 175 | 175 | AM_RANGE(0x6016, 0x6016) AM_MIRROR(0x0f08) AM_WRITEONLY AM_SHARE("motor_on") /* Note: This overlaps rocket sound */ |
| 176 | 176 | AM_RANGE(0x6020, 0x6027) AM_MIRROR(0x0f08) AM_WRITEONLY AM_SHARE("lamps") |
| 177 | | AM_RANGE(0x6030, 0x6030) AM_MIRROR(0x0f0f) AM_WRITE(stactics_speed_latch_w) |
| 178 | | AM_RANGE(0x6040, 0x6040) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_trigger_w) |
| 179 | | AM_RANGE(0x6050, 0x6050) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_flag_clear_w) |
| 177 | AM_RANGE(0x6030, 0x6030) AM_MIRROR(0x0f0f) AM_WRITE(speed_latch_w) |
| 178 | AM_RANGE(0x6040, 0x6040) AM_MIRROR(0x0f0f) AM_WRITE(shot_trigger_w) |
| 179 | AM_RANGE(0x6050, 0x6050) AM_MIRROR(0x0f0f) AM_WRITE(shot_flag_clear_w) |
| 180 | 180 | AM_RANGE(0x6060, 0x606f) AM_MIRROR(0x0f00) AM_WRITEONLY AM_SHARE("display_buffer") |
| 181 | 181 | AM_RANGE(0x6070, 0x609f) AM_MIRROR(0x0f00) AM_WRITENOP |
| 182 | | /* AM_RANGE(0x60a0, 0x60ef) AM_MIRROR(0x0f00) AM_WRITE(stactics_sound2_w) */ |
| 182 | /* AM_RANGE(0x60a0, 0x60ef) AM_MIRROR(0x0f00) AM_WRITE(sound2_w) */ |
| 183 | 183 | AM_RANGE(0x60f0, 0x60ff) AM_MIRROR(0x0f00) AM_WRITENOP |
| 184 | 184 | AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_READ_PORT("IN2") |
| 185 | 185 | AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_READ_PORT("IN3") |
| 186 | | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x0800) AM_WRITE(stactics_scroll_ram_w) |
| 186 | AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x0800) AM_WRITE(scroll_ram_w) |
| 187 | 187 | AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0fff) AM_READ(vert_pos_r) |
| 188 | 188 | AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0fff) AM_READ(horiz_pos_r) |
| 189 | 189 | AM_RANGE(0xb000, 0xbfff) AM_RAM AM_SHARE("videoram_b") |
| r245243 | r245244 | |
| 210 | 210 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) |
| 211 | 211 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) |
| 212 | 212 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 213 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,get_motor_not_ready, NULL) |
| 213 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_motor_not_ready, NULL) |
| 214 | 214 | |
| 215 | 215 | PORT_START("IN1") /* IN1 */ |
| 216 | 216 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_B ) ) |
| r245243 | r245244 | |
| 239 | 239 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 240 | 240 | |
| 241 | 241 | PORT_START("IN2") /* IN2 */ |
| 242 | | PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,get_rng, NULL) |
| 243 | | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_frame_count_d3, NULL) |
| 242 | PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_rng, NULL) |
| 243 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_frame_count_d3, NULL) |
| 244 | 244 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 245 | 245 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 246 | 246 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) |
| r245243 | r245244 | |
| 250 | 250 | |
| 251 | 251 | PORT_START("IN3") /* IN3 */ |
| 252 | 252 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 253 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_shot_standby, NULL) |
| 253 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_shot_standby, NULL) |
| 254 | 254 | PORT_DIPNAME( 0x04, 0x04, "Number of Barriers" ) |
| 255 | 255 | PORT_DIPSETTING( 0x04, "4" ) |
| 256 | 256 | PORT_DIPSETTING( 0x00, "6" ) |
| r245243 | r245244 | |
| 262 | 262 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 263 | 263 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 264 | 264 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 265 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_not_shot_arrive, NULL) |
| 265 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state, get_not_shot_arrive, NULL) |
| 266 | 266 | |
| 267 | 267 | PORT_START("FAKE") /* FAKE */ |
| 268 | 268 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| r245243 | r245244 | |
| 282 | 282 | m_vert_pos = 0; |
| 283 | 283 | m_horiz_pos = 0; |
| 284 | 284 | *m_motor_on = 0; |
| 285 | |
| 286 | save_item(NAME(m_vert_pos)); |
| 287 | save_item(NAME(m_horiz_pos)); |
| 285 | 288 | } |
| 286 | 289 | |
| 287 | 290 | |
| r245243 | r245244 | |
| 297 | 300 | /* basic machine hardware */ |
| 298 | 301 | MCFG_CPU_ADD("maincpu", I8080, 1933560) |
| 299 | 302 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 300 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", stactics_state, stactics_interrupt) |
| 303 | MCFG_CPU_VBLANK_INT_DRIVER("screen", stactics_state, interrupt) |
| 301 | 304 | |
| 302 | 305 | |
| 303 | 306 | /* video hardware */ |
| r245243 | r245244 | |
| 342 | 345 | * |
| 343 | 346 | *************************************/ |
| 344 | 347 | |
| 345 | | GAMEL( 1981, stactics, 0, stactics, stactics, driver_device, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_NO_SOUND, layout_stactics ) |
| 348 | GAMEL( 1981, stactics, 0, stactics, stactics, driver_device, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_stactics ) |
trunk/src/mame/drivers/tunhunt.c
| r245243 | r245244 | |
| 55 | 55 | * |
| 56 | 56 | *************************************/ |
| 57 | 57 | |
| 58 | | WRITE8_MEMBER(tunhunt_state::tunhunt_control_w) |
| 58 | WRITE8_MEMBER(tunhunt_state::control_w) |
| 59 | 59 | { |
| 60 | 60 | /* |
| 61 | 61 | 0x01 coin counter#2 "right counter" |
| r245243 | r245244 | |
| 81 | 81 | * |
| 82 | 82 | *************************************/ |
| 83 | 83 | |
| 84 | | READ8_MEMBER(tunhunt_state::tunhunt_button_r) |
| 84 | READ8_MEMBER(tunhunt_state::button_r) |
| 85 | 85 | { |
| 86 | 86 | int data = ioport("IN0")->read(); |
| 87 | 87 | return ((data>>offset)&1)?0x00:0x80; |
| r245243 | r245244 | |
| 135 | 135 | AM_RANGE(0x1800, 0x1800) AM_WRITEONLY /* SHEL0H */ |
| 136 | 136 | AM_RANGE(0x1a00, 0x1a00) AM_WRITEONLY /* SHEL1H */ |
| 137 | 137 | AM_RANGE(0x1c00, 0x1c00) AM_WRITEONLY /* MOBJV */ |
| 138 | | AM_RANGE(0x1e00, 0x1eff) AM_WRITE(tunhunt_videoram_w) AM_SHARE("videoram") /* ALPHA */ |
| 138 | AM_RANGE(0x1e00, 0x1eff) AM_WRITE(videoram_w) AM_SHARE("videoram") /* ALPHA */ |
| 139 | 139 | AM_RANGE(0x2000, 0x2000) AM_WRITENOP /* watchdog */ |
| 140 | | AM_RANGE(0x2000, 0x2007) AM_READ(tunhunt_button_r) |
| 140 | AM_RANGE(0x2000, 0x2007) AM_READ(button_r) |
| 141 | 141 | AM_RANGE(0x2400, 0x2400) AM_WRITENOP /* INT ACK */ |
| 142 | | AM_RANGE(0x2800, 0x2800) AM_WRITE(tunhunt_control_w) |
| 142 | AM_RANGE(0x2800, 0x2800) AM_WRITE(control_w) |
| 143 | 143 | AM_RANGE(0x2c00, 0x2fff) AM_WRITEONLY AM_SHARE("spriteram") |
| 144 | 144 | AM_RANGE(0x3000, 0x300f) AM_DEVREADWRITE("pokey1", pokey_device, read, write) |
| 145 | 145 | AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE("pokey2", pokey_device, read, write) |
| r245243 | r245244 | |
| 277 | 277 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 278 | 278 | MCFG_SCREEN_SIZE(256, 256-16) |
| 279 | 279 | MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 255-16) |
| 280 | | MCFG_SCREEN_UPDATE_DRIVER(tunhunt_state, screen_update_tunhunt) |
| 280 | MCFG_SCREEN_UPDATE_DRIVER(tunhunt_state, screen_update) |
| 281 | 281 | MCFG_SCREEN_PALETTE("palette") |
| 282 | 282 | |
| 283 | 283 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", tunhunt) |
| r245243 | r245244 | |
| 390 | 390 | *************************************/ |
| 391 | 391 | |
| 392 | 392 | /* rom parent machine inp init */ |
| 393 | | GAME( 1979,tunhunt, 0, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari", "Tunnel Hunt", 0 ) |
| 394 | | GAME( 1981,tunhuntc, tunhunt, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari (Centuri license)", "Tunnel Hunt (Centuri)", 0 ) |
| 393 | GAME( 1979,tunhunt, 0, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari", "Tunnel Hunt", GAME_SUPPORTS_SAVE ) |
| 394 | GAME( 1981,tunhuntc, tunhunt, tunhunt, tunhunt, driver_device, 0, ORIENTATION_SWAP_XY, "Atari (Centuri license)", "Tunnel Hunt (Centuri)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/portrait.h
| r245243 | r245244 | |
| 5 | 5 | public: |
| 6 | 6 | portrait_state(const machine_config &mconfig, device_type type, const char *tag) |
| 7 | 7 | : driver_device(mconfig, type, tag), |
| 8 | m_maincpu(*this, "maincpu"), |
| 9 | m_gfxdecode(*this, "gfxdecode"), |
| 10 | m_palette(*this, "palette"), |
| 8 | 11 | m_tms(*this, "tms"), |
| 9 | 12 | m_bgvideoram(*this, "bgvideoram"), |
| 10 | 13 | m_fgvideoram(*this, "fgvideoram"), |
| 11 | | m_spriteram(*this, "spriteram"), |
| 12 | | m_maincpu(*this, "maincpu"), |
| 13 | | m_gfxdecode(*this, "gfxdecode"), |
| 14 | | m_palette(*this, "palette") { } |
| 14 | m_spriteram(*this, "spriteram") { } |
| 15 | 15 | |
| 16 | required_device<cpu_device> m_maincpu; |
| 17 | required_device<gfxdecode_device> m_gfxdecode; |
| 18 | required_device<palette_device> m_palette; |
| 16 | 19 | required_device<tms5200_device> m_tms; |
| 20 | |
| 17 | 21 | required_shared_ptr<UINT8> m_bgvideoram; |
| 18 | 22 | required_shared_ptr<UINT8> m_fgvideoram; |
| 23 | required_shared_ptr<UINT8> m_spriteram; |
| 24 | |
| 19 | 25 | int m_scroll; |
| 20 | 26 | tilemap_t *m_foreground; |
| 21 | 27 | tilemap_t *m_background; |
| 22 | | required_shared_ptr<UINT8> m_spriteram; |
| 23 | | DECLARE_WRITE8_MEMBER(portrait_ctrl_w); |
| 24 | | DECLARE_WRITE8_MEMBER(portrait_positive_scroll_w); |
| 25 | | DECLARE_WRITE8_MEMBER(portrait_negative_scroll_w); |
| 26 | | DECLARE_WRITE8_MEMBER(portrait_bgvideo_write); |
| 27 | | DECLARE_WRITE8_MEMBER(portrait_fgvideo_write); |
| 28 | |
| 29 | DECLARE_WRITE8_MEMBER(ctrl_w); |
| 30 | DECLARE_WRITE8_MEMBER(positive_scroll_w); |
| 31 | DECLARE_WRITE8_MEMBER(negative_scroll_w); |
| 32 | DECLARE_WRITE8_MEMBER(bgvideo_write); |
| 33 | DECLARE_WRITE8_MEMBER(fgvideo_write); |
| 34 | |
| 28 | 35 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 29 | 36 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 37 | |
| 30 | 38 | virtual void video_start(); |
| 31 | 39 | DECLARE_PALETTE_INIT(portrait); |
| 32 | | UINT32 screen_update_portrait(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 40 | |
| 41 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 33 | 42 | inline void get_tile_info( tile_data &tileinfo, int tile_index, const UINT8 *source ); |
| 34 | 43 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 35 | | required_device<cpu_device> m_maincpu; |
| 36 | | required_device<gfxdecode_device> m_gfxdecode; |
| 37 | | required_device<palette_device> m_palette; |
| 38 | 44 | }; |
trunk/src/mame/includes/stactics.h
| r245243 | r245244 | |
| 12 | 12 | public: |
| 13 | 13 | stactics_state(const machine_config &mconfig, device_type type, const char *tag) |
| 14 | 14 | : driver_device(mconfig, type, tag), |
| 15 | m_maincpu(*this, "maincpu"), |
| 15 | 16 | m_palette_val(*this, "paletteram"), |
| 16 | 17 | m_motor_on(*this, "motor_on"), |
| 17 | 18 | m_lamps(*this, "lamps"), |
| r245243 | r245244 | |
| 19 | 20 | m_videoram_b(*this, "videoram_b"), |
| 20 | 21 | m_videoram_d(*this, "videoram_d"), |
| 21 | 22 | m_videoram_e(*this, "videoram_e"), |
| 22 | | m_videoram_f(*this, "videoram_f"), |
| 23 | | m_maincpu(*this, "maincpu") { } |
| 23 | m_videoram_f(*this, "videoram_f") { } |
| 24 | 24 | |
| 25 | | /* machine state */ |
| 26 | | int m_vert_pos; |
| 27 | | int m_horiz_pos; |
| 28 | | /* video state */ |
| 25 | required_device<cpu_device> m_maincpu; |
| 29 | 26 | |
| 30 | 27 | required_shared_ptr<UINT8> m_palette_val; |
| 31 | 28 | required_shared_ptr<UINT8> m_motor_on; |
| r245243 | r245244 | |
| 35 | 32 | required_shared_ptr<UINT8> m_videoram_d; |
| 36 | 33 | required_shared_ptr<UINT8> m_videoram_e; |
| 37 | 34 | required_shared_ptr<UINT8> m_videoram_f; |
| 38 | | |
| 35 | |
| 36 | /* machine state */ |
| 37 | int m_vert_pos; |
| 38 | int m_horiz_pos; |
| 39 | |
| 40 | /* video state */ |
| 39 | 41 | UINT8 m_y_scroll_d; |
| 40 | 42 | UINT8 m_y_scroll_e; |
| 41 | 43 | UINT8 m_y_scroll_f; |
| r245243 | r245244 | |
| 45 | 47 | UINT16 m_beam_state; |
| 46 | 48 | UINT16 m_old_beam_state; |
| 47 | 49 | UINT16 m_beam_states_per_frame; |
| 50 | |
| 48 | 51 | DECLARE_READ8_MEMBER(vert_pos_r); |
| 49 | 52 | DECLARE_READ8_MEMBER(horiz_pos_r); |
| 50 | | DECLARE_WRITE8_MEMBER(stactics_coin_lockout_w); |
| 51 | | DECLARE_WRITE8_MEMBER(stactics_scroll_ram_w); |
| 52 | | DECLARE_WRITE8_MEMBER(stactics_speed_latch_w); |
| 53 | | DECLARE_WRITE8_MEMBER(stactics_shot_trigger_w); |
| 54 | | DECLARE_WRITE8_MEMBER(stactics_shot_flag_clear_w); |
| 55 | | DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_frame_count_d3); |
| 56 | | DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_shot_standby); |
| 57 | | DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_not_shot_arrive); |
| 53 | DECLARE_WRITE8_MEMBER(coinlockout_w); |
| 54 | DECLARE_WRITE8_MEMBER(scroll_ram_w); |
| 55 | DECLARE_WRITE8_MEMBER(speed_latch_w); |
| 56 | DECLARE_WRITE8_MEMBER(shot_trigger_w); |
| 57 | DECLARE_WRITE8_MEMBER(shot_flag_clear_w); |
| 58 | |
| 59 | DECLARE_CUSTOM_INPUT_MEMBER(get_frame_count_d3); |
| 60 | DECLARE_CUSTOM_INPUT_MEMBER(get_shot_standby); |
| 61 | DECLARE_CUSTOM_INPUT_MEMBER(get_not_shot_arrive); |
| 58 | 62 | DECLARE_CUSTOM_INPUT_MEMBER(get_motor_not_ready); |
| 59 | 63 | DECLARE_CUSTOM_INPUT_MEMBER(get_rng); |
| 64 | INTERRUPT_GEN_MEMBER(interrupt); |
| 65 | |
| 60 | 66 | virtual void machine_start(); |
| 61 | | DECLARE_VIDEO_START(stactics); |
| 67 | virtual void video_start(); |
| 62 | 68 | DECLARE_PALETTE_INIT(stactics); |
| 63 | | UINT32 screen_update_stactics(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 64 | | INTERRUPT_GEN_MEMBER(stactics_interrupt); |
| 69 | |
| 70 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 65 | 71 | void update_beam(); |
| 66 | 72 | inline int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll); |
| 67 | 73 | void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 68 | 74 | void set_indicator_leds(int data, const char *output_name, int base_index); |
| 69 | 75 | void update_artwork(); |
| 70 | 76 | void move_motor(); |
| 71 | | required_device<cpu_device> m_maincpu; |
| 72 | 77 | }; |
| 73 | 78 | /*----------- defined in video/stactics.c -----------*/ |
| 74 | 79 | MACHINE_CONFIG_EXTERN( stactics_video ); |
trunk/src/mame/includes/tunhunt.h
| r245243 | r245244 | |
| 3 | 3 | public: |
| 4 | 4 | tunhunt_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | | m_workram(*this, "workram"), |
| 7 | | m_videoram(*this, "videoram"), |
| 8 | | m_spriteram(*this, "spriteram"), |
| 9 | 6 | m_maincpu(*this, "maincpu"), |
| 10 | 7 | m_gfxdecode(*this, "gfxdecode"), |
| 11 | 8 | m_screen(*this, "screen"), |
| 12 | 9 | m_palette(*this, "palette"), |
| 10 | m_workram(*this, "workram"), |
| 11 | m_videoram(*this, "videoram"), |
| 12 | m_spriteram(*this, "spriteram"), |
| 13 | 13 | m_generic_paletteram_8(*this, "paletteram") { } |
| 14 | 14 | |
| 15 | | UINT8 m_control; |
| 15 | required_device<cpu_device> m_maincpu; |
| 16 | required_device<gfxdecode_device> m_gfxdecode; |
| 17 | required_device<screen_device> m_screen; |
| 18 | required_device<palette_device> m_palette; |
| 19 | |
| 16 | 20 | required_shared_ptr<UINT8> m_workram; |
| 17 | 21 | required_shared_ptr<UINT8> m_videoram; |
| 18 | 22 | required_shared_ptr<UINT8> m_spriteram; |
| 23 | required_shared_ptr<UINT8> m_generic_paletteram_8; |
| 24 | |
| 25 | UINT8 m_control; |
| 19 | 26 | tilemap_t *m_fg_tilemap; |
| 20 | 27 | bitmap_ind16 m_tmpbitmap; |
| 21 | | DECLARE_WRITE8_MEMBER(tunhunt_control_w); |
| 22 | | DECLARE_READ8_MEMBER(tunhunt_button_r); |
| 23 | | DECLARE_WRITE8_MEMBER(tunhunt_videoram_w); |
| 28 | |
| 29 | DECLARE_WRITE8_MEMBER(control_w); |
| 30 | DECLARE_READ8_MEMBER(button_r); |
| 31 | DECLARE_WRITE8_MEMBER(videoram_w); |
| 24 | 32 | DECLARE_READ8_MEMBER(dsw2_0r); |
| 25 | 33 | DECLARE_READ8_MEMBER(dsw2_1r); |
| 26 | 34 | DECLARE_READ8_MEMBER(dsw2_2r); |
| 27 | 35 | DECLARE_READ8_MEMBER(dsw2_3r); |
| 28 | 36 | DECLARE_READ8_MEMBER(dsw2_4r); |
| 37 | |
| 29 | 38 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 39 | |
| 30 | 40 | virtual void video_start(); |
| 31 | 41 | DECLARE_PALETTE_INIT(tunhunt); |
| 32 | | UINT32 screen_update_tunhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 42 | |
| 43 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 33 | 44 | void set_pens(); |
| 34 | 45 | void draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 35 | 46 | void draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 36 | 47 | void draw_shell(bitmap_ind16 &bitmap, const rectangle &cliprect, int picture_code, |
| 37 | 48 | int hposition,int vstart,int vstop,int vstretch,int hstretch); |
| 38 | | required_device<cpu_device> m_maincpu; |
| 39 | | required_device<gfxdecode_device> m_gfxdecode; |
| 40 | | required_device<screen_device> m_screen; |
| 41 | | required_device<palette_device> m_palette; |
| 42 | | required_shared_ptr<UINT8> m_generic_paletteram_8; |
| 43 | 49 | }; |
trunk/src/mame/video/stactics.c
| r245243 | r245244 | |
| 90 | 90 | * |
| 91 | 91 | *************************************/ |
| 92 | 92 | |
| 93 | | WRITE8_MEMBER(stactics_state::stactics_scroll_ram_w) |
| 93 | WRITE8_MEMBER(stactics_state::scroll_ram_w) |
| 94 | 94 | { |
| 95 | 95 | if (data & 0x01) |
| 96 | 96 | { |
| r245243 | r245244 | |
| 111 | 111 | * |
| 112 | 112 | *************************************/ |
| 113 | 113 | |
| 114 | | CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_frame_count_d3) |
| 114 | CUSTOM_INPUT_MEMBER(stactics_state::get_frame_count_d3) |
| 115 | 115 | { |
| 116 | 116 | return (m_frame_count >> 3) & 0x01; |
| 117 | 117 | } |
| r245243 | r245244 | |
| 124 | 124 | * |
| 125 | 125 | *************************************/ |
| 126 | 126 | |
| 127 | | WRITE8_MEMBER(stactics_state::stactics_speed_latch_w) |
| 127 | WRITE8_MEMBER(stactics_state::speed_latch_w) |
| 128 | 128 | { |
| 129 | 129 | /* This writes to a shift register which is clocked by */ |
| 130 | 130 | /* a 555 oscillator. This value determines the speed of */ |
| r245243 | r245244 | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
| 152 | | WRITE8_MEMBER(stactics_state::stactics_shot_trigger_w) |
| 152 | WRITE8_MEMBER(stactics_state::shot_trigger_w) |
| 153 | 153 | { |
| 154 | 154 | m_shot_standby = 0; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| 158 | | WRITE8_MEMBER(stactics_state::stactics_shot_flag_clear_w) |
| 158 | WRITE8_MEMBER(stactics_state::shot_flag_clear_w) |
| 159 | 159 | { |
| 160 | 160 | m_shot_arrive = 0; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| 164 | | CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_shot_standby) |
| 164 | CUSTOM_INPUT_MEMBER(stactics_state::get_shot_standby) |
| 165 | 165 | { |
| 166 | 166 | return m_shot_standby; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| 170 | | CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_not_shot_arrive) |
| 170 | CUSTOM_INPUT_MEMBER(stactics_state::get_not_shot_arrive) |
| 171 | 171 | { |
| 172 | 172 | return !m_shot_arrive; |
| 173 | 173 | } |
| r245243 | r245244 | |
| 352 | 352 | * |
| 353 | 353 | *************************************/ |
| 354 | 354 | |
| 355 | | VIDEO_START_MEMBER(stactics_state,stactics) |
| 355 | void stactics_state::video_start() |
| 356 | 356 | { |
| 357 | 357 | m_y_scroll_d = 0; |
| 358 | 358 | m_y_scroll_e = 0; |
| r245243 | r245244 | |
| 363 | 363 | m_shot_arrive = 0; |
| 364 | 364 | m_beam_state = 0; |
| 365 | 365 | m_old_beam_state = 0; |
| 366 | |
| 367 | save_item(NAME(m_y_scroll_d)); |
| 368 | save_item(NAME(m_y_scroll_e)); |
| 369 | save_item(NAME(m_y_scroll_f)); |
| 370 | save_item(NAME(m_frame_count)); |
| 371 | save_item(NAME(m_shot_standby)); |
| 372 | save_item(NAME(m_shot_arrive)); |
| 373 | save_item(NAME(m_beam_state)); |
| 374 | save_item(NAME(m_old_beam_state)); |
| 375 | save_item(NAME(m_beam_states_per_frame)); |
| 366 | 376 | } |
| 367 | 377 | |
| 368 | 378 | |
| r245243 | r245244 | |
| 373 | 383 | * |
| 374 | 384 | *************************************/ |
| 375 | 385 | |
| 376 | | UINT32 stactics_state::screen_update_stactics(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 386 | UINT32 stactics_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 377 | 387 | { |
| 378 | 388 | update_beam(); |
| 379 | 389 | draw_background(bitmap, cliprect); |
| r245243 | r245244 | |
| 399 | 409 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 400 | 410 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 401 | 411 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1) |
| 402 | | MCFG_SCREEN_UPDATE_DRIVER(stactics_state, screen_update_stactics) |
| 412 | MCFG_SCREEN_UPDATE_DRIVER(stactics_state, screen_update) |
| 403 | 413 | MCFG_SCREEN_PALETTE("palette") |
| 404 | 414 | |
| 405 | 415 | MCFG_PALETTE_ADD("palette", 0x400) |
| 406 | 416 | |
| 407 | 417 | MCFG_PALETTE_INIT_OWNER(stactics_state,stactics) |
| 408 | | MCFG_VIDEO_START_OVERRIDE(stactics_state,stactics) |
| 409 | 418 | MACHINE_CONFIG_END |
trunk/src/mame/video/tunhunt.c
| r245243 | r245244 | |
| 48 | 48 | |
| 49 | 49 | /****************************************************************************************/ |
| 50 | 50 | |
| 51 | | WRITE8_MEMBER(tunhunt_state::tunhunt_videoram_w) |
| 51 | WRITE8_MEMBER(tunhunt_state::videoram_w) |
| 52 | 52 | { |
| 53 | 53 | m_videoram[offset] = data; |
| 54 | 54 | m_fg_tilemap->mark_tile_dirty(offset); |
| r245243 | r245244 | |
| 78 | 78 | |
| 79 | 79 | m_fg_tilemap->set_transparent_pen(0); |
| 80 | 80 | m_fg_tilemap->set_scrollx(0, 64); |
| 81 | |
| 82 | save_item(NAME(m_control)); |
| 81 | 83 | } |
| 82 | 84 | |
| 83 | 85 | PALETTE_INIT_MEMBER(tunhunt_state, tunhunt) |
| 84 | 86 | { |
| 85 | | int i; |
| 86 | | |
| 87 | 87 | /* Tunnel Hunt uses a combination of color proms and palette RAM to specify a 16 color |
| 88 | 88 | * palette. Here, we manage only the mappings for alphanumeric characters and SHELL |
| 89 | 89 | * graphics, which are unpacked ahead of time and drawn using MAME's drawgfx primitives. |
| 90 | 90 | */ |
| 91 | 91 | |
| 92 | 92 | /* motion objects/box */ |
| 93 | | for (i = 0; i < 0x10; i++) |
| 93 | for (int i = 0; i < 0x10; i++) |
| 94 | 94 | palette.set_pen_indirect(i, i); |
| 95 | 95 | |
| 96 | 96 | /* AlphaNumerics (1bpp) |
| r245243 | r245244 | |
| 152 | 152 | //const UINT8 *color_prom = memregion( "proms" )->base(); |
| 153 | 153 | int color; |
| 154 | 154 | int shade; |
| 155 | | int i; |
| 156 | 155 | int red,green,blue; |
| 157 | 156 | |
| 158 | | for( i=0; i<16; i++ ) |
| 157 | for( int i=0; i<16; i++ ) |
| 159 | 158 | { |
| 160 | 159 | color = m_generic_paletteram_8[i]; |
| 161 | 160 | shade = 0xf^(color>>4); |
| r245243 | r245244 | |
| 207 | 206 | */ |
| 208 | 207 | |
| 209 | 208 | bitmap_ind16 &tmpbitmap = m_tmpbitmap; |
| 210 | | UINT8 *spriteram = m_spriteram; |
| 211 | | UINT8 *tunhunt_ram = m_workram; |
| 212 | | //int skip = tunhunt_ram[MOBST]; |
| 213 | | int x0 = 255-tunhunt_ram[MOBJV]; |
| 214 | | int y0 = 255-tunhunt_ram[MOBJH]; |
| 209 | //int skip = m_workram[MOBST]; |
| 210 | int x0 = 255-m_workram[MOBJV]; |
| 211 | int y0 = 255-m_workram[MOBJH]; |
| 215 | 212 | int scalex,scaley; |
| 216 | 213 | int line,span; |
| 217 | 214 | int x,span_data; |
| r245243 | r245244 | |
| 222 | 219 | for( line=0; line<64; line++ ) |
| 223 | 220 | { |
| 224 | 221 | x = 0; |
| 225 | | source = &spriteram[line*0x10]; |
| 222 | source = &m_spriteram[line*0x10]; |
| 226 | 223 | for( span=0; span<0x10; span++ ) |
| 227 | 224 | { |
| 228 | 225 | span_data = source[span]; |
| r245243 | r245244 | |
| 236 | 233 | tmpbitmap.pix16(line, x++) = 0; |
| 237 | 234 | } /* next line */ |
| 238 | 235 | |
| 239 | | switch( tunhunt_ram[VSTRLO] ) |
| 236 | switch( m_workram[VSTRLO] ) |
| 240 | 237 | { |
| 241 | 238 | case 0x01: |
| 242 | 239 | scaley = (1<<16)*0.33; /* seems correct */ |
| r245243 | r245244 | |
| 247 | 244 | break; |
| 248 | 245 | |
| 249 | 246 | default: |
| 250 | | scaley = (1<<16)*tunhunt_ram[VSTRLO]/4; /* ??? */ |
| 247 | scaley = (1<<16)*m_workram[VSTRLO]/4; /* ??? */ |
| 251 | 248 | break; |
| 252 | 249 | } |
| 253 | 250 | scalex = (1<<16); |
| r245243 | r245244 | |
| 284 | 281 | 1280: 07 03 00 01 07 06 04 05 02 07 03 00 09 0a 0b 0c palette select |
| 285 | 282 | ->hue 06 02 ff 60 06 05 03 04 01 06 02 ff d2 00 c2 ff |
| 286 | 283 | */ |
| 287 | | UINT8 *tunhunt_ram = m_workram; |
| 288 | 284 | int span,x,y; |
| 289 | 285 | int color; |
| 290 | 286 | // rectangle bbox; |
| r245243 | r245244 | |
| 300 | 296 | z = 0; |
| 301 | 297 | for( span=3; span<16; span++ ) |
| 302 | 298 | { |
| 303 | | x0 = tunhunt_ram[span+0x1080]; |
| 304 | | y0 = tunhunt_ram[span+0x1480]; |
| 305 | | y1 = tunhunt_ram[span+0x1400]; |
| 299 | x0 = m_workram[span+0x1080]; |
| 300 | y0 = m_workram[span+0x1480]; |
| 301 | y1 = m_workram[span+0x1400]; |
| 306 | 302 | |
| 307 | 303 | if( y>=y0 && y<=y1 && x>=x0 && x0>=z ) |
| 308 | 304 | { |
| 309 | | color = tunhunt_ram[span+0x1280]&0xf; |
| 305 | color = m_workram[span+0x1280]&0xf; |
| 310 | 306 | z = x0; /* give priority to rightmost spans */ |
| 311 | 307 | } |
| 312 | 308 | } |
| r245243 | r245244 | |
| 365 | 361 | 255-hposition-16,vstart-32,0 ); |
| 366 | 362 | } |
| 367 | 363 | |
| 368 | | UINT32 tunhunt_state::screen_update_tunhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 364 | UINT32 tunhunt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 369 | 365 | { |
| 370 | 366 | set_pens(); |
| 371 | 367 | |