From 26c5fd0b65ab7da8a21eb05db3bafb385e26a731 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 31 May 2017 17:33:04 -0400 Subject: tail2nos: Add flip screen support; document non-effect of "Country" switch --- src/mame/drivers/tail2nos.cpp | 26 +++++++++++-------- src/mame/includes/tail2nos.h | 5 ++-- src/mame/video/tail2nos.cpp | 59 ++++++++++++++++++++++++------------------- 3 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/mame/drivers/tail2nos.cpp b/src/mame/drivers/tail2nos.cpp index 30ed318b936..61d20606526 100644 --- a/src/mame/drivers/tail2nos.cpp +++ b/src/mame/drivers/tail2nos.cpp @@ -8,6 +8,10 @@ keep pressed F1 during POST to see ROM/RAM/GFX tests. + The "Country" DIP switch is intended to select the game's title. + However, the program code in all known sets forces it to one value or + the other whenever it reads it outside of service mode. + ***************************************************************************/ #include "emu.h" @@ -55,7 +59,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, tail2nos_state ) AM_RANGE(0xffc300, 0xffcfff) AM_RAM AM_RANGE(0xffd000, 0xffdfff) AM_RAM_WRITE(tail2nos_txvideoram_w) AM_SHARE("txvideoram") AM_RANGE(0xffe000, 0xffefff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") - AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE(tail2nos_gfxbank_w) + AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE8(tail2nos_gfxbank_w, 0x00ff) AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_RANGE(0xfff008, 0xfff009) AM_READWRITE8(sound_semaphore_r,sound_command_w,0x00ff) @@ -172,10 +176,9 @@ static INPUT_PORTS_START( tail2nos ) PORT_DIPNAME( 0x4000, 0x4000, "Control Panel" ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x4000, DEF_STR( Standard ) ) PORT_DIPSETTING( 0x0000, "Original" ) - // TODO: what's this for? PORT_DIPNAME( 0x8000, 0x0000, "Country" ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x0000, "Domestic" ) - PORT_DIPSETTING( 0x8000, "Overseas" ) + PORT_DIPSETTING( 0x0000, "Domestic" ) // "Super Formula" + PORT_DIPSETTING( 0x8000, "Overseas" ) // "Tail to Nose" INPUT_PORTS_END @@ -219,17 +222,20 @@ void tail2nos_state::machine_start() membank("bank3")->configure_entries(0, 2, &ROM[0x10000], 0x8000); membank("bank3")->set_entry(0); + m_txbank = 0; + m_txpalette = 0; + m_video_enable = false; + m_flip_screen = false; + save_item(NAME(m_txbank)); save_item(NAME(m_txpalette)); save_item(NAME(m_video_enable)); + save_item(NAME(m_flip_screen)); save_item(NAME(m_pending_command)); } void tail2nos_state::machine_reset() { - m_txbank = 0; - m_txpalette = 0; - m_video_enable = 0; } static MACHINE_CONFIG_START( tail2nos ) @@ -380,6 +386,6 @@ ROM_START( sformulaa ) ROM_LOAD( "osb", 0x00000, 0x20000, CRC(d49ab2f5) SHA1(92f7f6c8f35ac39910879dd88d2cfb6db7c848c9) ) ROM_END -GAME( 1989, tail2nos, 0, tail2nos, tail2nos, tail2nos_state, 0, ROT90, "V-System Co.", "Tail to Nose - Great Championship", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1989, sformula, tail2nos, tail2nos, tail2nos, tail2nos_state, 0, ROT90, "V-System Co.", "Super Formula (Japan, set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1989, sformulaa, tail2nos, tail2nos, tail2nos, tail2nos_state, 0, ROT90, "V-System Co.", "Super Formula (Japan, set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // No Japan warning, but Japanese version +GAME( 1989, tail2nos, 0, tail2nos, tail2nos, tail2nos_state, 0, ROT90, "V-System Co.", "Tail to Nose - Great Championship", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, sformula, tail2nos, tail2nos, tail2nos, tail2nos_state, 0, ROT90, "V-System Co.", "Super Formula (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, sformulaa, tail2nos, tail2nos, tail2nos, tail2nos_state, 0, ROT90, "V-System Co.", "Super Formula (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) // No Japan warning, but Japanese version diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h index 3bf2cc0203d..133610376d2 100644 --- a/src/mame/includes/tail2nos.h +++ b/src/mame/includes/tail2nos.h @@ -33,7 +33,8 @@ public: tilemap_t *m_tx_tilemap; int m_txbank; int m_txpalette; - int m_video_enable; + bool m_video_enable; + bool m_flip_screen; uint8_t m_pending_command; /* devices */ @@ -47,7 +48,7 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(analog_in_r); DECLARE_WRITE16_MEMBER(tail2nos_txvideoram_w); DECLARE_WRITE16_MEMBER(tail2nos_zoomdata_w); - DECLARE_WRITE16_MEMBER(tail2nos_gfxbank_w); + DECLARE_WRITE8_MEMBER(tail2nos_gfxbank_w); DECLARE_WRITE8_MEMBER(sound_command_w); DECLARE_WRITE8_MEMBER(sound_bankswitch_w); DECLARE_WRITE8_MEMBER(sound_semaphore_w); diff --git a/src/mame/video/tail2nos.cpp b/src/mame/video/tail2nos.cpp index 46210eddee8..b8191e93382 100644 --- a/src/mame/video/tail2nos.cpp +++ b/src/mame/video/tail2nos.cpp @@ -79,43 +79,43 @@ WRITE16_MEMBER(tail2nos_state::tail2nos_zoomdata_w) m_k051316->mark_gfx_dirty(offset * 2); } -WRITE16_MEMBER(tail2nos_state::tail2nos_gfxbank_w) +WRITE8_MEMBER(tail2nos_state::tail2nos_gfxbank_w) { // -------- --pe-b-b // p = palette bank // b = tile bank // e = video enable - if (ACCESSING_BITS_0_7) - { - int bank; - bank = 0; - /* bits 0 and 2 select char bank */ - if (data & 0x04) bank |= 2; - if (data & 0x01) bank |= 1; + // bits 0 and 2 select char bank + int bank = 0; + if (data & 0x04) bank |= 2; + if (data & 0x01) bank |= 1; + if (m_txbank != bank) + { + m_txbank = bank; + m_tx_tilemap->mark_all_dirty(); + } - if (m_txbank != bank) - { - m_txbank = bank; - m_tx_tilemap->mark_all_dirty(); - } + // bit 5 seems to select palette bank (used on startup) + if (data & 0x20) + bank = 7; + else + bank = 3; - /* bit 5 seems to select palette bank (used on startup) */ - if (data & 0x20) - bank = 7; - else - bank = 3; + if (m_txpalette != bank) + { + m_txpalette = bank; + m_tx_tilemap->mark_all_dirty(); + } - if (m_txpalette != bank) - { - m_txpalette = bank; - m_tx_tilemap->mark_all_dirty(); - } + // bit 4 seems to be video enable + m_video_enable = BIT(data, 4); - /* bit 4 seems to be video enable */ - m_video_enable = data & 0x10; - } + // bit 7 is flip screen + m_flip_screen = BIT(data, 7); + m_tx_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); + m_tx_tilemap->set_scrolly(m_flip_screen ? -8 : 0); } @@ -145,6 +145,13 @@ void tail2nos_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre color = (spriteram[offs + 2] & 0xe000) >> 13; flipx = spriteram[offs + 2] & 0x1000; flipy = spriteram[offs + 2] & 0x0800; + if (m_flip_screen) + { + flipx = !flipx; + flipy = !flipy; + sx = 302 - sx; + sy = 216 - sy; + } m_gfxdecode->gfx(1)->transpen(bitmap,/* placement relative to zoom layer verified on the real thing */ cliprect, -- cgit v1.2.3