mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
mario:
- Hooked up flipscreen - Changed monitor orientation to ROT0
This commit is contained in:
parent
2187a280cd
commit
2cadf1a98a
@ -6,6 +6,8 @@ TODO:
|
||||
- combine sh_* writes into one routine
|
||||
|
||||
Done:
|
||||
- Hooked up flipscreen
|
||||
- Changed monitor orientation to ROT0
|
||||
- fixed mario0110u1gre
|
||||
- rewrote driver, separate MACHINE_DRIVER(mario_audio)
|
||||
- palette from schematics
|
||||
@ -114,6 +116,7 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x7c80, 0x7c80) AM_WRITE(mario_sh2_w) /* Luigi run sample */
|
||||
AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
|
||||
AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w)
|
||||
AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w)
|
||||
AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w)
|
||||
AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
|
||||
AM_RANGE(0x7f00, 0x7f00) AM_WRITE(mario_sh_w) /* death */
|
||||
@ -459,7 +462,7 @@ ROM_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
GAME( 1983, mario, 0, mario, mario, 0, ROT180, "Nintendo of America", "Mario Bros. (US, set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, marioo, mario, mario, marioo, 0, ROT180, "Nintendo of America", "Mario Bros. (US, set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, marioj, mario, mario, marioj, 0, ROT180, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, masao, mario, masao, masao, 0, ROT180, "bootleg", "Masao", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, mario, 0, mario, mario, 0, ROT0, "Nintendo of America", "Mario Bros. (US, set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, marioo, mario, mario, marioo, 0, ROT0, "Nintendo of America", "Mario Bros. (US, set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, marioj, mario, mario, marioj, 0, ROT0, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1983, masao, mario, masao, masao, 0, ROT0, "bootleg", "Masao", GAME_SUPPORTS_SAVE )
|
||||
|
@ -53,6 +53,7 @@ WRITE8_HANDLER( mario_videoram_w );
|
||||
WRITE8_HANDLER( mario_gfxbank_w );
|
||||
WRITE8_HANDLER( mario_palettebank_w );
|
||||
WRITE8_HANDLER( mario_scroll_w );
|
||||
WRITE8_HANDLER( mario_flip_w );
|
||||
|
||||
PALETTE_INIT( mario );
|
||||
VIDEO_START( mario );
|
||||
|
@ -111,6 +111,13 @@ WRITE8_HANDLER( mario_scroll_w )
|
||||
tilemap_set_scrolly(bg_tilemap, 0, data + 17);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( mario_flip_w )
|
||||
{
|
||||
|
||||
flip_screen_set(data & 0x01);
|
||||
tilemap_set_scrollx(bg_tilemap, 0, flip_screen ? (HTOTAL-HBSTART) : 0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_bg_tile_info )
|
||||
{
|
||||
int code = videoram[tile_index] + 256 * gfx_bank;
|
||||
@ -130,6 +137,11 @@ VIDEO_START( mario )
|
||||
state_save_register_global(palette_bank);
|
||||
}
|
||||
|
||||
/*
|
||||
* Erratic line at top when scrolling down "Marios Bros" Title
|
||||
* confirmed on mametests.org as being present on real PCB as well.
|
||||
*/
|
||||
|
||||
static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
@ -138,12 +150,39 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
|
||||
{
|
||||
if (spriteram[offs])
|
||||
{
|
||||
drawgfx(bitmap,machine->gfx[1],
|
||||
spriteram[offs + 2],
|
||||
(spriteram[offs + 1] & 0x0f) + 16 * palette_bank+32 * monitor,
|
||||
spriteram[offs + 1] & 0x80,spriteram[offs + 1] & 0x40,
|
||||
spriteram[offs + 3] - 8,(VBSTART - 1) - spriteram[offs] + 8,
|
||||
cliprect,TRANSPARENCY_PEN,0);
|
||||
int x, y;
|
||||
|
||||
// from schematics ....
|
||||
y = (spriteram[offs] + (flip_screen ? 0xF7 : 0xF9) + 1) & 0xFF;
|
||||
x = spriteram[offs+3];
|
||||
// sprite will be drawn if (y + scanline) & 0xF0 = 0xF0
|
||||
y = 240 - y; /* logical screen position */
|
||||
|
||||
y = y ^ (flip_screen ? 0xFF : 0x00); /* physical screen location */
|
||||
x = x ^ (flip_screen ? 0xFF : 0x00); /* physical screen location */
|
||||
|
||||
if (flip_screen)
|
||||
{
|
||||
y -= 6;
|
||||
x -= 7;
|
||||
drawgfx(bitmap,machine->gfx[1],
|
||||
spriteram[offs + 2],
|
||||
(spriteram[offs + 1] & 0x0f) + 16 * palette_bank+32 * monitor,
|
||||
!(spriteram[offs + 1] & 0x80),!(spriteram[offs + 1] & 0x40),
|
||||
x, y,
|
||||
cliprect,TRANSPARENCY_PEN,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
y += 1;
|
||||
x -= 8;
|
||||
drawgfx(bitmap,machine->gfx[1],
|
||||
spriteram[offs + 2],
|
||||
(spriteram[offs + 1] & 0x0f) + 16 * palette_bank+32 * monitor,
|
||||
(spriteram[offs + 1] & 0x80),(spriteram[offs + 1] & 0x40),
|
||||
x, y,
|
||||
cliprect,TRANSPARENCY_PEN,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user