trunk/src/mame/drivers/gluck2.c
| r243622 | r243623 | |
| 204 | 204 | public: |
| 205 | 205 | gluck2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 206 | 206 | : driver_device(mconfig, type, tag) , |
| 207 | m_maincpu(*this, "maincpu"), |
| 208 | m_gfxdecode(*this, "gfxdecode"), |
| 207 | 209 | m_videoram(*this, "videoram"), |
| 208 | | m_colorram(*this, "colorram"), |
| 209 | | m_maincpu(*this, "maincpu"), |
| 210 | | m_gfxdecode(*this, "gfxdecode"){ } |
| 210 | m_colorram(*this, "colorram") { } |
| 211 | 211 | |
| 212 | required_device<cpu_device> m_maincpu; |
| 213 | required_device<gfxdecode_device> m_gfxdecode; |
| 214 | |
| 212 | 215 | required_shared_ptr<UINT8> m_videoram; |
| 213 | 216 | required_shared_ptr<UINT8> m_colorram; |
| 217 | |
| 214 | 218 | tilemap_t *m_bg_tilemap; |
| 215 | | DECLARE_WRITE8_MEMBER(gluck2_videoram_w); |
| 216 | | DECLARE_WRITE8_MEMBER(gluck2_colorram_w); |
| 219 | |
| 220 | DECLARE_WRITE8_MEMBER(videoram_w); |
| 221 | DECLARE_WRITE8_MEMBER(colorram_w); |
| 217 | 222 | DECLARE_WRITE8_MEMBER(counters_w); |
| 218 | | TILE_GET_INFO_MEMBER(get_gluck2_tile_info); |
| 223 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 224 | |
| 219 | 225 | virtual void video_start(); |
| 220 | 226 | DECLARE_PALETTE_INIT(gluck2); |
| 221 | | UINT32 screen_update_gluck2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 222 | | required_device<cpu_device> m_maincpu; |
| 223 | | required_device<gfxdecode_device> m_gfxdecode; |
| 227 | |
| 228 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 224 | 229 | }; |
| 225 | 230 | |
| 226 | 231 | |
| r243622 | r243623 | |
| 229 | 234 | *********************************************/ |
| 230 | 235 | |
| 231 | 236 | |
| 232 | | WRITE8_MEMBER(gluck2_state::gluck2_videoram_w) |
| 237 | WRITE8_MEMBER(gluck2_state::videoram_w) |
| 233 | 238 | { |
| 234 | 239 | m_videoram[offset] = data; |
| 235 | 240 | m_bg_tilemap->mark_tile_dirty(offset); |
| 236 | 241 | } |
| 237 | 242 | |
| 238 | | WRITE8_MEMBER(gluck2_state::gluck2_colorram_w) |
| 243 | WRITE8_MEMBER(gluck2_state::colorram_w) |
| 239 | 244 | { |
| 240 | 245 | m_colorram[offset] = data; |
| 241 | 246 | m_bg_tilemap->mark_tile_dirty(offset); |
| 242 | 247 | } |
| 243 | 248 | |
| 244 | 249 | |
| 245 | | TILE_GET_INFO_MEMBER(gluck2_state::get_gluck2_tile_info) |
| 250 | TILE_GET_INFO_MEMBER(gluck2_state::get_tile_info) |
| 246 | 251 | { |
| 247 | 252 | /* - bits - |
| 248 | 253 | 7654 3210 |
| r243622 | r243623 | |
| 261 | 266 | |
| 262 | 267 | void gluck2_state::video_start() |
| 263 | 268 | { |
| 264 | | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gluck2_state::get_gluck2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 269 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gluck2_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 265 | 270 | } |
| 266 | 271 | |
| 267 | 272 | |
| 268 | | UINT32 gluck2_state::screen_update_gluck2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 273 | UINT32 gluck2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 269 | 274 | { |
| 270 | 275 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 271 | 276 | return 0; |
| r243622 | r243623 | |
| 340 | 345 | AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_device, address_w) |
| 341 | 346 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| 342 | 347 | AM_RANGE(0x0844, 0x084b) AM_NOP /* see below */ |
| 343 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(gluck2_videoram_w) AM_SHARE("videoram") /* 6116 #1 (2K x 8) RAM (only 1st half used) */ |
| 344 | | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(gluck2_colorram_w) AM_SHARE("colorram") /* 6116 #2 (2K x 8) RAM (only 1st half used) */ |
| 348 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") /* 6116 #1 (2K x 8) RAM (only 1st half used) */ |
| 349 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") /* 6116 #2 (2K x 8) RAM (only 1st half used) */ |
| 345 | 350 | AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW1") |
| 346 | 351 | AM_RANGE(0x2d00, 0x2d01) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 347 | 352 | AM_RANGE(0x3400, 0x3400) AM_READ_PORT("IN0") |
| r243622 | r243623 | |
| 525 | 530 | */ |
| 526 | 531 | MCFG_SCREEN_SIZE((39+1)*8, (38+1)*8) /* from MC6845 init, registers 00 & 04. (value - 1) */ |
| 527 | 532 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1) /* from MC6845 init, registers 01 & 06. */ |
| 528 | | MCFG_SCREEN_UPDATE_DRIVER(gluck2_state, screen_update_gluck2) |
| 533 | MCFG_SCREEN_UPDATE_DRIVER(gluck2_state, screen_update) |
| 529 | 534 | MCFG_SCREEN_PALETTE("palette") |
| 530 | 535 | |
| 531 | 536 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", gluck2) |
| r243622 | r243623 | |
| 578 | 583 | *********************************************/ |
| 579 | 584 | |
| 580 | 585 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS... */ |
| 581 | | GAME( 1992, gluck2, 0, gluck2, gluck2, driver_device, 0, ROT0, "Yung Yu / CYE", "Good Luck II", 0 ) |
| 586 | GAME( 1992, gluck2, 0, gluck2, gluck2, driver_device, 0, ROT0, "Yung Yu / CYE", "Good Luck II", GAME_SUPPORTS_SAVE ) |