trunk/src/mame/drivers/mrgame.c
| r31292 | r31293 | |
| 25 | 25 | - Support for electronic volume control |
| 26 | 26 | - Audio rom banking |
| 27 | 27 | - Wrong colours |
| 28 | | - Bad scrolling |
| 29 | 28 | - Most sounds missing due to unemulated M114 chip |
| 30 | 29 | - wcup90 is different hardware and there's no schematic |
| 31 | 30 | |
| r31292 | r31293 | |
| 76 | 75 | DECLARE_READ8_MEMBER(rsw_r); |
| 77 | 76 | TIMER_DEVICE_CALLBACK_MEMBER(irq_timer); |
| 78 | 77 | UINT32 screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 78 | bitmap_ind16 *m_tile_bitmap; |
| 79 | 79 | required_device<palette_device> m_palette; |
| 80 | 80 | required_shared_ptr<UINT8> m_p_videoram; |
| 81 | 81 | required_shared_ptr<UINT8> m_p_objectram; |
| r31292 | r31293 | |
| 91 | 91 | UINT8 m_video_data; |
| 92 | 92 | UINT8 m_video_status; |
| 93 | 93 | UINT8 m_video_ctrl[8]; |
| 94 | | const UINT8 *m_p_chargen; |
| 94 | virtual void machine_start(); |
| 95 | 95 | virtual void machine_reset(); |
| 96 | 96 | required_device<m68000_device> m_maincpu; |
| 97 | 97 | required_device<z80_device> m_audiocpu1; |
| r31292 | r31293 | |
| 292 | 292 | return m_io_dsw1->read() | ((UINT8)m_ackv << 4); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | void mrgame_state::machine_start() |
| 296 | { |
| 297 | m_tile_bitmap=auto_bitmap_ind16_alloc(machine(),256,256); |
| 298 | } |
| 299 | |
| 295 | 300 | void mrgame_state::machine_reset() |
| 296 | 301 | { |
| 297 | 302 | m_sound_data = 0xff; |
| r31292 | r31293 | |
| 303 | 308 | m_ack2 = 0; |
| 304 | 309 | m_ackv = 0; |
| 305 | 310 | m_row_data = 0; |
| 306 | | m_p_chargen = memregion("chargen")->base(); |
| 307 | 311 | } |
| 308 | 312 | |
| 309 | 313 | DRIVER_INIT_MEMBER( mrgame_state, mrgame ) |
| r31292 | r31293 | |
| 398 | 402 | // most of this came from pinmame as the diagram doesn't make a lot of sense |
| 399 | 403 | UINT32 mrgame_state::screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 400 | 404 | { |
| 401 | | UINT8 y,ptr,col; |
| 402 | | UINT16 sy=0,x,chr; |
| 405 | UINT8 x,y,ptr=0,col; |
| 406 | INT32 scrolly[32]; |
| 407 | UINT16 chr; |
| 403 | 408 | bool flipx,flipy; |
| 404 | 409 | |
| 405 | 410 | // text |
| 406 | | for (y = 0; y < 32; y++) |
| 411 | for (x = 0; x < 32; x++) |
| 407 | 412 | { |
| 408 | | ptr = 1; |
| 409 | | for (x = 0; x < 32; x++) |
| 413 | scrolly[x] = -m_p_objectram[ptr++]; |
| 414 | col = m_p_objectram[ptr++]; |
| 415 | |
| 416 | for (y = 0; y < 32; y++) |
| 410 | 417 | { |
| 411 | | col = m_p_objectram[ptr]; |
| 412 | | ptr+=2; |
| 413 | | chr = m_p_videoram[x+y*32] + (m_gfx_bank << 8); |
| 418 | chr = m_p_videoram[x+y*32] | (m_gfx_bank << 8); |
| 414 | 419 | |
| 415 | | m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, |
| 420 | m_gfxdecode->gfx(0)->opaque(*m_tile_bitmap, m_tile_bitmap->cliprect(), |
| 416 | 421 | chr, |
| 417 | 422 | col, |
| 418 | 423 | 0,0, |
| r31292 | r31293 | |
| 420 | 425 | } |
| 421 | 426 | } |
| 422 | 427 | |
| 428 | // scroll each column as needed |
| 429 | copyscrollbitmap(bitmap,*m_tile_bitmap,0,0,32,scrolly,cliprect); |
| 430 | |
| 431 | |
| 423 | 432 | // sprites |
| 424 | 433 | for (ptr = 0x40; ptr < 0x60; ptr += 4) |
| 425 | 434 | { |
| 426 | 435 | x = m_p_objectram[ptr + 3] + 1; |
| 427 | | sy = 255 - m_p_objectram[ptr]; |
| 436 | y = 255 - m_p_objectram[ptr]; |
| 428 | 437 | flipx = BIT(m_p_objectram[ptr + 1], 6); |
| 429 | 438 | flipy = BIT(m_p_objectram[ptr + 1], 7); |
| 430 | | chr = (m_p_objectram[ptr + 1] & 0x3f) + (m_gfx_bank << 8); |
| 439 | chr = (m_p_objectram[ptr + 1] & 0x3f) | (m_gfx_bank << 6); |
| 431 | 440 | col = m_p_objectram[ptr + 2]; |
| 432 | 441 | |
| 433 | | if ((sy > 16) && (x > 24)) |
| 442 | if ((y > 16) && (x > 24)) |
| 434 | 443 | m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, |
| 435 | 444 | chr, |
| 436 | 445 | col, |
| 437 | 446 | flipx,flipy, |
| 438 | | x,sy-16,0); |
| 447 | x,y-16,0); |
| 439 | 448 | } |
| 440 | 449 | |
| 441 | 450 | return 0; |
| r31292 | r31293 | |
| 463 | 472 | MCFG_SCREEN_REFRESH_RATE(50) |
| 464 | 473 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 465 | 474 | MCFG_SCREEN_SIZE(256, 256) |
| 466 | | MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 247) // If you align with X on test screen some info is chopped off |
| 475 | MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 247) // If you align with X on test screen some info is chopped off |
| 467 | 476 | MCFG_SCREEN_UPDATE_DRIVER(mrgame_state, screen_update_mrgame) |
| 468 | 477 | MCFG_SCREEN_PALETTE("palette") |
| 469 | 478 | MCFG_PALETTE_ADD_INIT_BLACK("palette", 32) |
| r31292 | r31293 | |
| 520 | 529 | ROM_END |
| 521 | 530 | |
| 522 | 531 | /*------------------------------------------------------------------- |
| 523 | | / Motor Show (1988?) |
| 532 | / Motor Show (1989) |
| 524 | 533 | /-------------------------------------------------------------------*/ |
| 525 | 534 | ROM_START(motrshow) |
| 526 | 535 | ROM_REGION(0x10000, "roms", 0) |
| r31292 | r31293 | |
| 643 | 652 | |
| 644 | 653 | |
| 645 | 654 | GAME(1988, dakar, 0, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "Dakar", GAME_IS_SKELETON_MECHANICAL) |
| 646 | | GAME(1988, motrshow, 0, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "Motor Show (set 1)", GAME_IS_SKELETON_MECHANICAL) |
| 647 | | GAME(1988, motrshowa, motrshow, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "Motor Show (set 2)", GAME_IS_SKELETON_MECHANICAL) |
| 655 | GAME(1989, motrshow, 0, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "Motor Show (set 1)", GAME_IS_SKELETON_MECHANICAL) |
| 656 | GAME(1989, motrshowa, motrshow, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "Motor Show (set 2)", GAME_IS_SKELETON_MECHANICAL) |
| 648 | 657 | GAME(1990, macattck, 0, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "Mac Attack", GAME_IS_SKELETON_MECHANICAL) |
| 649 | 658 | GAME(1990, wcup90, 0, mrgame, mrgame, mrgame_state, mrgame, ROT0, "Mr Game", "World Cup 90", GAME_IS_SKELETON_MECHANICAL) |