trunk/src/mame/drivers/rmhaihai.c
| r245149 | r245150 | |
| 39 | 39 | public: |
| 40 | 40 | rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag) |
| 41 | 41 | : driver_device(mconfig, type, tag), |
| 42 | m_colorram(*this, "colorram"), |
| 43 | m_videoram(*this, "videoram"), |
| 42 | 44 | m_maincpu(*this, "maincpu"), |
| 43 | 45 | m_msm(*this, "msm"), |
| 44 | | m_gfxdecode(*this, "gfxdecode"), |
| 45 | | m_colorram(*this, "colorram"), |
| 46 | | m_videoram(*this, "videoram") { } |
| 46 | m_gfxdecode(*this, "gfxdecode") { } |
| 47 | 47 | |
| 48 | | required_device<cpu_device> m_maincpu; |
| 49 | | required_device<msm5205_device> m_msm; |
| 50 | | required_device<gfxdecode_device> m_gfxdecode; |
| 51 | | |
| 48 | int m_gfxbank; |
| 52 | 49 | required_shared_ptr<UINT8> m_colorram; |
| 53 | 50 | required_shared_ptr<UINT8> m_videoram; |
| 54 | | |
| 55 | 51 | tilemap_t *m_bg_tilemap; |
| 56 | 52 | int m_keyboard_cmd; |
| 57 | | int m_gfxbank; |
| 58 | | |
| 59 | 53 | DECLARE_WRITE8_MEMBER(rmhaihai_videoram_w); |
| 60 | 54 | DECLARE_WRITE8_MEMBER(rmhaihai_colorram_w); |
| 61 | 55 | DECLARE_READ8_MEMBER(keyboard_r); |
| r245149 | r245150 | |
| 64 | 58 | DECLARE_WRITE8_MEMBER(ctrl_w); |
| 65 | 59 | DECLARE_WRITE8_MEMBER(themj_rombank_w); |
| 66 | 60 | DECLARE_WRITE8_MEMBER(adpcm_w); |
| 67 | | |
| 68 | 61 | DECLARE_DRIVER_INIT(rmhaihai); |
| 62 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 69 | 63 | virtual void video_start(); |
| 70 | | DECLARE_MACHINE_START(themj); |
| 71 | 64 | DECLARE_MACHINE_RESET(themj); |
| 72 | | |
| 73 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 74 | | |
| 75 | | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 65 | UINT32 screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 66 | required_device<cpu_device> m_maincpu; |
| 67 | required_device<msm5205_device> m_msm; |
| 68 | required_device<gfxdecode_device> m_gfxdecode; |
| 76 | 69 | }; |
| 77 | 70 | |
| 78 | 71 | |
| r245149 | r245150 | |
| 102 | 95 | { |
| 103 | 96 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(rmhaihai_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, |
| 104 | 97 | 8, 8, 64, 32); |
| 105 | | |
| 106 | | save_item(NAME(m_keyboard_cmd)); |
| 107 | | save_item(NAME(m_gfxbank)); |
| 108 | 98 | } |
| 109 | 99 | |
| 110 | | UINT32 rmhaihai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 100 | UINT32 rmhaihai_state::screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 111 | 101 | { |
| 112 | 102 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 113 | 103 | return 0; |
| r245149 | r245150 | |
| 200 | 190 | |
| 201 | 191 | WRITE8_MEMBER(rmhaihai_state::themj_rombank_w) |
| 202 | 192 | { |
| 203 | | logerror("banksw %d\n", data & 0x03); |
| 204 | | membank("bank1")->set_entry(data & 0x03); |
| 205 | | membank("bank2")->set_entry(data & 0x03); |
| 193 | UINT8 *rom = memregion("maincpu")->base() + 0x10000; |
| 194 | int bank = data & 0x03; |
| 195 | logerror("banksw %d\n",bank); |
| 196 | membank("bank1")->set_base(rom + bank*0x4000); |
| 197 | membank("bank2")->set_base(rom + bank*0x4000 + 0x2000); |
| 206 | 198 | } |
| 207 | 199 | |
| 208 | | MACHINE_START_MEMBER(rmhaihai_state,themj) |
| 209 | | { |
| 210 | | membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); |
| 211 | | membank("bank2")->configure_entries(0, 4, memregion("maincpu")->base() + 0x12000, 0x4000); |
| 212 | | } |
| 213 | | |
| 214 | 200 | MACHINE_RESET_MEMBER(rmhaihai_state,themj) |
| 215 | 201 | { |
| 216 | | membank("bank1")->set_entry(0); |
| 217 | | membank("bank2")->set_entry(0); |
| 202 | themj_rombank_w(m_maincpu->space(AS_IO), 0, 0); |
| 218 | 203 | } |
| 219 | 204 | |
| 220 | 205 | |
| r245149 | r245150 | |
| 480 | 465 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 481 | 466 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 482 | 467 | MCFG_SCREEN_VISIBLE_AREA(4*8, 60*8-1, 2*8, 30*8-1) |
| 483 | | MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update) |
| 468 | MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update_rmhaihai) |
| 484 | 469 | MCFG_SCREEN_PALETTE("palette") |
| 485 | 470 | |
| 486 | 471 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", rmhaihai) |
| r245149 | r245150 | |
| 518 | 503 | MCFG_CPU_PROGRAM_MAP(themj_map) |
| 519 | 504 | MCFG_CPU_IO_MAP(themj_io_map) |
| 520 | 505 | |
| 521 | | MCFG_MACHINE_START_OVERRIDE(rmhaihai_state,themj) |
| 522 | 506 | MCFG_MACHINE_RESET_OVERRIDE(rmhaihai_state,themj) |
| 523 | 507 | |
| 524 | 508 | /* video hardware */ |
| r245149 | r245150 | |
| 694 | 678 | } |
| 695 | 679 | |
| 696 | 680 | |
| 697 | | GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan)", GAME_SUPPORTS_SAVE ) |
| 698 | | GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", GAME_SUPPORTS_SAVE ) |
| 699 | | GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", GAME_SUPPORTS_SAVE ) |
| 700 | | GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", GAME_SUPPORTS_SAVE ) |
| 701 | | GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", GAME_SUPPORTS_SAVE ) |
| 681 | GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan)", 0 ) |
| 682 | GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", 0 ) |
| 683 | GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", 0 ) |
| 684 | GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", 0 ) |
| 685 | GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", 0 ) |
trunk/src/mame/drivers/ttchamp.c
| r245149 | r245150 | |
| 53 | 53 | |
| 54 | 54 | - works in a very similar way to 'Spider' (twins.c) |
| 55 | 55 | including the blitter (seems to be doubled up hardware tho, twice as many layers?) |
| 56 | | - need to work out how it selects between upper/lower |
| 57 | | program roms as blitter source |
| 58 | 56 | - PIC is not for sound, what is is for? |
| 59 | 57 | - eeprom? (I don't see one, maybe PIC is used for settings?) |
| 60 | | - more than one layer |
| 61 | | - layer clearing |
| 58 | - Convert this to a blitter device, and share it with twins.c |
| 59 | - A bunch of spurious RAM writes to ROM area (genuine bug? left-overs?) |
| 62 | 60 | |
| 61 | |
| 63 | 62 | */ |
| 64 | 63 | |
| 65 | 64 | #include "emu.h" |
| r245149 | r245150 | |
| 335 | 334 | |
| 336 | 335 | for (int i = 0; i < m_spriteswidth; i++) |
| 337 | 336 | { |
| 338 | | if ((m_port10 & 0xf) == 0x01) // this is set when moving objects are cleared, although not screen clears? |
| 337 | if (m_port10 & 0x30) // this is set when moving objects are cleared, although not screen clears? |
| 339 | 338 | { |
| 340 | | vram[offset] = 0x0000; |
| 339 | /* guess: assume that bit 4 is for layer 0 and bit 5 for layer 1 |
| 340 | (according to 0x21 setted at the "Clubs League" color fade-out) |
| 341 | */ |
| 342 | if(m_port10 & 0x10) |
| 343 | m_videoram0[offset] = 0x0000; |
| 344 | if(m_port10 & 0x20) |
| 345 | m_videoram2[offset] = 0x0000; |
| 346 | |
| 341 | 347 | offset++; |
| 342 | 348 | } |
| 343 | 349 | else |
| 344 | 350 | { |
| 345 | 351 | UINT8 data; |
| 346 | | |
| 352 | |
| 347 | 353 | data = (src[(m_spritesaddr * 2) + 1]); |
| 348 | 354 | //data |= vram[offset] >> 8; |
| 349 | 355 | |
| r245149 | r245150 | |
| 352 | 358 | vram[offset] = (vram[offset] & 0x00ff) | data << 8; |
| 353 | 359 | |
| 354 | 360 | data = src[(m_spritesaddr * 2)]; |
| 355 | | //data |= vram[offset] & 0xff; |
| 356 | 361 | |
| 357 | 362 | if (data || (m_port10 & 2) == 0) |
| 358 | 363 | vram[offset] = (vram[offset] & 0xff00) | data; |
| r245149 | r245150 | |
| 392 | 397 | return 0xff; |
| 393 | 398 | } |
| 394 | 399 | |
| 400 | /* blitter mode select */ |
| 395 | 401 | WRITE16_MEMBER(ttchamp_state::port10_w) |
| 396 | 402 | { |
| 397 | | UINT8 res; |
| 403 | /* |
| 404 | --xx ---- fill enable |
| 405 | ---- --x- opacity enable (Gamart logo) |
| 406 | ---- ---x layer select |
| 407 | */ |
| 398 | 408 | COMBINE_DATA(&m_port10); |
| 399 | | |
| 400 | | res = m_port10 & 0xf0; |
| 401 | | /* Assume that both bits clears layers. */ |
| 402 | | if(res == 0x30) |
| 403 | | { |
| 404 | | for (int i = 0; i < 0x8000; i++) |
| 405 | | { |
| 406 | | m_videoram0[i] = 0x0000; |
| 407 | | m_videoram2[i] = 0x0000; |
| 408 | | } |
| 409 | | } |
| 410 | | else if(res != 0) |
| 411 | | printf("Check me, i/o 0x10 used with %02x\n",res); |
| 412 | 409 | } |
| 413 | 410 | |
| 414 | 411 | /* selects upper bank for the blitter */ |
| 415 | 412 | WRITE16_MEMBER(ttchamp_state::port20_w) |
| 416 | 413 | { |
| 417 | | printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 414 | //printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 418 | 415 | m_rombank = 1; |
| 419 | 416 | } |
| 420 | 417 | |
| 421 | 418 | /* selects lower bank for the blitter */ |
| 422 | 419 | WRITE16_MEMBER(ttchamp_state::port62_w) |
| 423 | 420 | { |
| 424 | | printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 421 | //printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 425 | 422 | m_rombank = 0; |
| 426 | 423 | } |
| 427 | 424 | |
| r245149 | r245150 | |
| 581 | 578 | // membank("bank2")->set_base(&ROM1[0x180000]); |
| 582 | 579 | } |
| 583 | 580 | |
| 584 | | GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions", GAME_NOT_WORKING ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' |
| 585 | | GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", GAME_NOT_WORKING ) // this only has Palencia Elektronik advertising boards |
| 581 | GAME( 1995, ttchamp, 0, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart", "Table Tennis Champions", 0 ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam' |
| 582 | GAME( 1995, ttchampa,ttchamp, ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0, "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", 0 ) // this only has Palencia Elektronik advertising boards |