diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 375bae3369b..dfcd352a012 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -3830,8 +3830,6 @@ files { MAME_DIR .. "src/mame/video/pin64.cpp", MAME_DIR .. "src/mame/video/pin64.h", MAME_DIR .. "src/mame/drivers/hanaawas.cpp", - MAME_DIR .. "src/mame/includes/hanaawas.h", - MAME_DIR .. "src/mame/video/hanaawas.cpp", MAME_DIR .. "src/mame/drivers/jclub2.cpp", MAME_DIR .. "src/mame/drivers/macs.cpp", MAME_DIR .. "src/mame/drivers/seta.cpp", diff --git a/src/mame/drivers/airraid.cpp b/src/mame/drivers/airraid.cpp index b262aca908d..2564f7618e5 100644 --- a/src/mame/drivers/airraid.cpp +++ b/src/mame/drivers/airraid.cpp @@ -59,8 +59,8 @@ Stephh's notes (based on the game Z80 code and some tests) : - Inputs notes : - * COINx don't work correctly : see "cshooter_coin_r" read handler. - * In game, bits 3 and 4 of 0xc202 ("START") are tested, + * COINx don't work correctly. + * In game, bits 3 and 4 of 0xc202 ("START") are tested, while bits 4 and 5 are tested in the "test mode". * Pressing STARTx while in game adds lives (depending on the "Lives" Dip Switch) for player x. @@ -172,54 +172,54 @@ public: , m_palette(*this, "palette") , m_decrypted_opcodes(*this, "decrypted_opcodes") , m_airraid_video(*this,"airraid_vid") + , m_mainbank(*this, "mainbank") { } void airraid(machine_config &config); - void airraid_crypt(machine_config &config); void init_cshootere(); void init_cshooter(); private: required_device m_maincpu; - optional_device m_seibu_sound; - optional_shared_ptr m_mainram; + required_device m_seibu_sound; + required_shared_ptr m_mainram; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; - + required_shared_ptr m_decrypted_opcodes; required_device m_airraid_video; + required_memory_bank m_mainbank; - void cshooter_c500_w(uint8_t data); - void cshooter_c700_w(uint8_t data); + void c500_w(uint8_t data); + void c700_w(uint8_t data); void bank_w(uint8_t data); - TIMER_DEVICE_CALLBACK_MEMBER(cshooter_scanline); + TIMER_DEVICE_CALLBACK_MEMBER(scanline); - void airraid_map(address_map &map); - void airraid_sound_decrypted_opcodes_map(address_map &map); - void airraid_sound_map(address_map &map); + void main_map(address_map &map); + void sound_decrypted_opcodes_map(address_map &map); + void sound_map(address_map &map); void decrypted_opcodes_map(address_map &map); }; -/* main cpu */ +// main CPU -TIMER_DEVICE_CALLBACK_MEMBER(airraid_state::cshooter_scanline) +TIMER_DEVICE_CALLBACK_MEMBER(airraid_state::scanline) { int scanline = param; - if(scanline == 240) // updates scroll resgiters - m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xd7); /* Z80 - RST 10h */ + if (scanline == 240) // updates scroll registers + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); // Z80 - RST 10h - if(scanline == 250) // vblank-out irq - m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0xcf); /* Z80 - RST 08h */ + if (scanline == 250) // vblank-out irq + m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); // Z80 - RST 08h } -void airraid_state::cshooter_c500_w(uint8_t data) +void airraid_state::c500_w(uint8_t data) { } -void airraid_state::cshooter_c700_w(uint8_t data) +void airraid_state::c700_w(uint8_t data) { } @@ -234,28 +234,27 @@ void airraid_state::bank_w(uint8_t data) // f = fg layer disable // s = sprite layer enable - membank("bank1")->set_entry((data>>4)&3); + m_mainbank->set_entry((data >> 4) & 3); m_airraid_video->layer_enable_w(data & 0xcf); - } -void airraid_state::airraid_map(address_map &map) +void airraid_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1").nopw(); // rld result write-back + map(0x8000, 0xbfff).bankr(m_mainbank).nopw(); // rld result write-back map(0xc000, 0xc000).portr("IN0"); map(0xc001, 0xc001).portr("IN1"); map(0xc002, 0xc002).portr("IN2"); map(0xc003, 0xc003).portr("DSW2"); map(0xc004, 0xc004).portr("DSW1"); - map(0xc500, 0xc500).w(FUNC(airraid_state::cshooter_c500_w)); -// map(0xc600, 0xc600).w(FUNC(airraid_state::cshooter_c600_w)); // see notes - map(0xc700, 0xc700).w(FUNC(airraid_state::cshooter_c700_w)); -// map(0xc801, 0xc801).w(FUNC(airraid_state::cshooter_c801_w)); // see notes + map(0xc500, 0xc500).w(FUNC(airraid_state::c500_w)); +// map(0xc600, 0xc600).w(FUNC(airraid_state::c600_w)); // see notes + map(0xc700, 0xc700).w(FUNC(airraid_state::c700_w)); +// map(0xc801, 0xc801).w(FUNC(airraid_state::c801_w)); // see notes map(0xd000, 0xd7ff).ram().w(m_airraid_video, FUNC(airraid_video_device::txram_w)).share("txram"); map(0xd800, 0xd8ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0xda00, 0xdaff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); @@ -266,16 +265,16 @@ void airraid_state::airraid_map(address_map &map) // map(0xdc1e, 0xdc1e).ram(); // map(0xdc1f, 0xdc1f).ram(); map(0xde00, 0xde0f).rw(m_seibu_sound, FUNC(seibu_sound_device::main_r), FUNC(seibu_sound_device::main_w)); - map(0xe000, 0xfdff).ram().share("mainram"); + map(0xe000, 0xfdff).ram().share(m_mainram); map(0xfe00, 0xffff).ram().share("sprite_ram"); } void airraid_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); + map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes); } -void airraid_state::airraid_sound_map(address_map &map) +void airraid_state::sound_map(address_map &map) { map(0x0000, 0x1fff).r("sei80bu", FUNC(sei80bu_device::data_r)); map(0x2000, 0x27ff).ram(); @@ -293,7 +292,7 @@ void airraid_state::airraid_sound_map(address_map &map) map(0x8000, 0xffff).rom(); } -void airraid_state::airraid_sound_decrypted_opcodes_map(address_map &map) +void airraid_state::sound_decrypted_opcodes_map(address_map &map) { map(0x0000, 0x1fff).r("sei80bu", FUNC(sei80bu_device::opcode_r)); map(0x8000, 0xffff).rom().region("audiocpu", 0x8000); @@ -301,7 +300,7 @@ void airraid_state::airraid_sound_decrypted_opcodes_map(address_map &map) static INPUT_PORTS_START( airraid ) - PORT_START("IN0") /* IN0 (0xc200) */ + PORT_START("IN0") // IN0 (0xc200) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY @@ -311,7 +310,7 @@ static INPUT_PORTS_START( airraid ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("IN1") /* IN1 (0xc201) */ + PORT_START("IN1") // IN1 (0xc201) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL @@ -321,7 +320,7 @@ static INPUT_PORTS_START( airraid ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("IN2") /* START (0xc202) */ + PORT_START("IN2") // START (0xc202) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -331,7 +330,7 @@ static INPUT_PORTS_START( airraid ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW2") /* DSW2 (0xc203) */ + PORT_START("DSW2") // DSW2 (0xc203) PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) @@ -350,7 +349,7 @@ static INPUT_PORTS_START( airraid ) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) - PORT_START("DSW1") /* DSW1 (0xc204) */ + PORT_START("DSW1") // DSW1 (0xc204) PORT_DIPNAME( 0x01, 0x01, "Coin Slots" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, "1" ) PORT_DIPSETTING( 0x00, "2" ) @@ -370,7 +369,7 @@ static INPUT_PORTS_START( airraid ) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" ) - PORT_START("COIN") /* COIN (0xc205) */ + PORT_START("COIN") // COIN (0xc205) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -385,14 +384,15 @@ INPUT_PORTS_END void airraid_state::airraid(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(12'000'000)/2); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &airraid_state::airraid_map); - TIMER(config, "scantimer").configure_scanline(FUNC(airraid_state::cshooter_scanline), "airraid_vid:screen", 0, 1); + // basic machine hardware + Z80(config, m_maincpu, XTAL(12'000'000) / 2); // verified on PCB + m_maincpu->set_addrmap(AS_PROGRAM, &airraid_state::main_map); + m_maincpu->set_addrmap(AS_OPCODES, &airraid_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(airraid_state::scanline), "airraid_vid:screen", 0, 1); - z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181)/4)); /* verified on pcb */ - audiocpu.set_addrmap(AS_PROGRAM, &airraid_state::airraid_sound_map); - audiocpu.set_addrmap(AS_OPCODES, &airraid_state::airraid_sound_decrypted_opcodes_map); + z80_device &audiocpu(Z80(config, "audiocpu", XTAL(14'318'181) / 4)); // verified on PCB + audiocpu.set_addrmap(AS_PROGRAM, &airraid_state::sound_map); + audiocpu.set_addrmap(AS_OPCODES, &airraid_state::sound_decrypted_opcodes_map); audiocpu.set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); config.set_perfect_quantum(m_maincpu); @@ -401,10 +401,10 @@ void airraid_state::airraid(machine_config &config) AIRRAID_VIDEO(config, m_airraid_video, 0); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181)/4)); + ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(14'318'181) / 4)); ymsnd.irq_handler().set(m_seibu_sound, FUNC(seibu_sound_device::fm_irqhandler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); @@ -419,16 +419,6 @@ void airraid_state::airraid(machine_config &config) } -void airraid_state::airraid_crypt(machine_config &config) -{ - airraid(config); - m_maincpu->set_addrmap(AS_OPCODES, &airraid_state::decrypted_opcodes_map); -} - - - - - /* Air Raid (Seibu 1987) @@ -462,7 +452,7 @@ ROM_START( airraid ) ROM_LOAD( "5.6f", 0x00000, 0x02000, CRC(30be398c) SHA1(6c61200ee8888d6270c8cec50423b3b5602c2027) ) ROM_LOAD( "4.7f", 0x08000, 0x08000, CRC(3cd715b4) SHA1(da735fb5d262908ddf7ed7dacdea68899f1723ff) ) - ROM_REGION( 0x0200, "proms", 0 ) // this PCB type has different proms when compared to the cshootert hardware PCB where they were dumped + ROM_REGION( 0x0200, "proms", 0 ) // this PCB type has different PROMs when compared to the cshootert hardware PCB where they were dumped ROM_LOAD( "pr.c19", 0x0000, 0x0200, NO_DUMP ) ROM_LOAD( "6308.a13", 0x0000, 0x0100, NO_DUMP ) @@ -472,7 +462,7 @@ ROM_START( airraid ) ROM_REGION( 0x100, "airraid_vid:tx_clut", 0 ) // taken from cshootert, not verified for this PCB ROM_LOAD( "63s281.d16", 0x0000, 0x0100, CRC(0b8b914b) SHA1(8cf4910b846de79661cc187887171ed8ebfd6719) ) // clut - /* ### MODULE 1 ### Background generation / graphics */ + // ### MODULE 1 ### Background generation / graphics ROM_REGION( 0x40000, "airraid_vid:bg_map", 0 ) ROM_LOAD16_BYTE( "bg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "bg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -482,7 +472,7 @@ ROM_START( airraid ) ROM_REGION( 0x100, "airraid_vid:bg_clut", 0 ) ROM_LOAD( "bg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 2 ### Foreground generation / graphics */ + // ### MODULE 2 ### Foreground generation / graphics ROM_REGION( 0x40000, "airraid_vid:fg_map", 0 ) ROM_LOAD16_BYTE( "fg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "fg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -492,7 +482,7 @@ ROM_START( airraid ) ROM_REGION( 0x100, "airraid_vid:fg_clut", 0 ) ROM_LOAD( "fg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 3 ### Sprite graphics */ + // ### MODULE 3 ### Sprite graphics ROM_REGION( 0x40000, "airraid_vid:spr_gfx", 0 ) ROM_LOAD16_BYTE( "sprite_tiles_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "sprite_tiles_odd", 0x00001, 0x20000, NO_DUMP ) @@ -535,17 +525,17 @@ Note, all ROMs have official sticker, "(C) SEIBU KAIHATSU INC." and a number. */ ROM_START( cshooter ) - ROM_REGION( 0x10000, "maincpu", 0 ) // Main CPU + ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "1.k19", 0x00000, 0x08000, CRC(71418952) SHA1(9745ca006576381c9e9595d8e42ab276bab80a41) ) - ROM_REGION( 0x10000, "maindata", 0 ) // cpu data + ROM_REGION( 0x10000, "maindata", 0 ) // CPU data ROM_LOAD( "2.k20", 0x00000, 0x10000, CRC(5812fe72) SHA1(3b28bff6b62a411d2195bb228952db62ad32ef3d) ) - ROM_REGION( 0x10000, "audiocpu", 0 ) // Sub/Sound CPU + ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "5.6f", 0x00000, 0x02000, CRC(30be398c) SHA1(6c61200ee8888d6270c8cec50423b3b5602c2027) ) // 5.g6 ROM_LOAD( "4.7f", 0x08000, 0x08000, CRC(3cd715b4) SHA1(da735fb5d262908ddf7ed7dacdea68899f1723ff) ) // 4.g8 - ROM_REGION( 0x0200, "proms", 0 ) // this PCB type has different proms when compared to the cshootert hardware PCB where they were dumped + ROM_REGION( 0x0200, "proms", 0 ) // this PCB type has different PROMs when compared to the cshootert hardware PCB where they were dumped ROM_LOAD( "pr.c19", 0x0000, 0x0200, NO_DUMP ) ROM_LOAD( "6308.a13", 0x0000, 0x0100, NO_DUMP ) @@ -556,7 +546,7 @@ ROM_START( cshooter ) ROM_REGION( 0x100, "airraid_vid:tx_clut", 0 ) // taken from cshootert, not verified for this PCB ROM_LOAD( "63s281.d16", 0x0000, 0x0100, CRC(0b8b914b) SHA1(8cf4910b846de79661cc187887171ed8ebfd6719) ) // clut - /* ### MODULE 1 ### Background generation / graphics */ + // ### MODULE 1 ### Background generation / graphics ROM_REGION( 0x40000, "airraid_vid:bg_map", 0 ) ROM_LOAD16_BYTE( "bg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "bg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -566,7 +556,7 @@ ROM_START( cshooter ) ROM_REGION( 0x100, "airraid_vid:bg_clut", 0 ) ROM_LOAD( "bg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 2 ### Foreground generation / graphics */ + // ### MODULE 2 ### Foreground generation / graphics ROM_REGION( 0x40000, "airraid_vid:fg_map", 0 ) ROM_LOAD16_BYTE( "fg_layouts_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "fg_layouts_odd", 0x00001, 0x20000, NO_DUMP ) @@ -576,7 +566,7 @@ ROM_START( cshooter ) ROM_REGION( 0x100, "airraid_vid:fg_clut", 0 ) ROM_LOAD( "fg_clut", 0x000, 0x100, NO_DUMP ) - /* ### MODULE 3 ### Sprite graphics */ + // ### MODULE 3 ### Sprite graphics ROM_REGION( 0x40000, "airraid_vid:spr_gfx", 0 ) ROM_LOAD16_BYTE( "sprite_tiles_even", 0x00000, 0x20000, NO_DUMP ) ROM_LOAD16_BYTE( "sprite_tiles_odd", 0x00001, 0x20000, NO_DUMP ) @@ -588,46 +578,44 @@ ROM_END void airraid_state::init_cshooter() { - membank("bank1")->configure_entries(0, 4, memregion("maindata")->base(), 0x4000); + m_mainbank->configure_entries(0, 4, memregion("maindata")->base(), 0x4000); } void airraid_state::init_cshootere() { uint8_t *rom = memregion("maincpu")->base(); - for (int A = 0x0000;A < 0x8000;A++) + for (int A = 0x0000; A < 0x8000; A++) { - /* decode the opcodes */ + // decode the opcodes m_decrypted_opcodes[A] = rom[A]; - if (BIT(A,5) && !BIT(A,3)) + if (BIT(A, 5) && !BIT(A, 3)) m_decrypted_opcodes[A] ^= 0x40; - if (BIT(A,10) && !BIT(A,9) && BIT(A,3)) + if (BIT(A, 10) && !BIT(A, 9) && BIT(A, 3)) m_decrypted_opcodes[A] ^= 0x20; - if ((BIT(A,10) ^ BIT(A,9)) && BIT(A,1)) + if ((BIT(A, 10) ^ BIT(A, 9)) && BIT(A, 1)) m_decrypted_opcodes[A] ^= 0x02; - if (BIT(A,9) || !BIT(A,5) || BIT(A,3)) - m_decrypted_opcodes[A] = bitswap<8>(m_decrypted_opcodes[A],7,6,1,4,3,2,5,0); + if (BIT(A, 9) || !BIT(A, 5) || BIT(A, 3)) + m_decrypted_opcodes[A] = bitswap<8>(m_decrypted_opcodes[A], 7, 6, 1, 4, 3, 2, 5, 0); - /* decode the data */ - if (BIT(A,5)) + // decode the data + if (BIT(A, 5)) rom[A] ^= 0x40; - if (BIT(A,9) || !BIT(A,5)) - rom[A] = bitswap<8>(rom[A],7,6,1,4,3,2,5,0); + if (BIT(A, 9) || !BIT(A,5)) + rom[A] = bitswap<8>(rom[A], 7, 6, 1, 4, 3, 2, 5, 0); } init_cshooter(); - } } // Anonymous namespace // There's also an undumped International Games version -GAME( 1987, cshooter, airraid, airraid_crypt, airraid, airraid_state, init_cshootere, ROT270, "Seibu Kaihatsu (J.K.H. license)", "Cross Shooter (Single PCB)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1987, airraid, 0, airraid_crypt, airraid, airraid_state, init_cshootere, ROT270, "Seibu Kaihatsu", "Air Raid (Single PCB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) - +GAME( 1987, cshooter, airraid, airraid, airraid, airraid_state, init_cshootere, ROT270, "Seibu Kaihatsu (J.K.H. license)", "Cross Shooter (Single PCB)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1987, airraid, 0, airraid, airraid, airraid_state, init_cshootere, ROT270, "Seibu Kaihatsu", "Air Raid (Single PCB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp index 929c580f122..5df8366853e 100644 --- a/src/mame/drivers/flstory.cpp +++ b/src/mame/drivers/flstory.cpp @@ -855,6 +855,7 @@ void flstory_state::rumba(machine_config &config) /* basic machine hardware */ m_maincpu->set_addrmap(AS_PROGRAM, &flstory_state::rumba_map); + m_maincpu->set_clock(XTAL(8'000'000) / 4); // verified on PCB TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); /* ? */ diff --git a/src/mame/drivers/hanaawas.cpp b/src/mame/drivers/hanaawas.cpp index 74ab2294409..41c4efb664c 100644 --- a/src/mame/drivers/hanaawas.cpp +++ b/src/mame/drivers/hanaawas.cpp @@ -28,50 +28,105 @@ ***************************************************************************/ #include "emu.h" -#include "includes/hanaawas.h" #include "cpu/z80/z80.h" #include "sound/ay8910.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" -uint8_t hanaawas_state::hanaawas_input_port_0_r() +namespace { + +class hanaawas_state : public driver_device { - int i, ordinal = 0; - uint16_t buttons = 0; +public: + hanaawas_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_colorram(*this, "colorram"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_coins(*this, "COINS"), + m_start(*this, "START"), + m_player(*this, "P%u", 1U) + { } + void hanaawas(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + + required_device m_maincpu; + required_device m_gfxdecode; + + required_ioport m_coins, m_start; + required_ioport_array<2> m_player; + + tilemap_t *m_bg_tilemap; + + uint8_t m_mux; + uint8_t m_coin_settings; + uint8_t m_coin_impulse; + + uint8_t input_port_0_r(); + void inputs_mux_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + void colorram_w(offs_t offset, uint8_t data); + void key_matrix_status_w(uint8_t data); + void irq_ack_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void portb_w(uint8_t data); + void prg_map(address_map &map); + void io_map(address_map &map); +}; + +uint8_t hanaawas_state::input_port_0_r() +{ // TODO: key matrix seems identical to speedatk.cpp, needs merging - if(m_coin_impulse > 0) + if (m_coin_impulse > 0) { m_coin_impulse--; return 0x80; } - if((ioport("COINS")->read() & 1) || (ioport("COINS")->read() & 2)) + if ((m_coins->read() & 1) || (m_coins->read() & 2)) { - m_coin_impulse = m_coin_settings*2; + m_coin_impulse = m_coin_settings * 2; m_coin_impulse--; return 0x80; } + uint16_t buttons = 0; + switch (m_mux) { - case 1: /* start buttons */ - buttons = ioport("START")->read(); + case 1: // start buttons + buttons = m_start->read(); break; - case 2: /* player 1 buttons */ - buttons = ioport("P1")->read(); + case 2: // player 1 buttons + buttons = m_player[0]->read(); break; - case 4: /* player 2 buttons */ - buttons = ioport("P2")->read(); + case 4: // player 2 buttons + buttons = m_player[1]->read(); break; } - /* map button pressed into 1-10 range */ + // map button pressed into 1-10 range - for (i = 0; i < 10; i++) + int ordinal = 0; + + for (int i = 0; i < 10; i++) { if (buttons & (1 << i)) { @@ -83,29 +138,123 @@ uint8_t hanaawas_state::hanaawas_input_port_0_r() return ordinal; } -void hanaawas_state::hanaawas_inputs_mux_w(uint8_t data) +void hanaawas_state::inputs_mux_w(uint8_t data) { m_mux = data; } void hanaawas_state::irq_ack_w(uint8_t data) { - m_maincpu->set_input_line(0,CLEAR_LINE); + m_maincpu->set_input_line(0, CLEAR_LINE); } void hanaawas_state::key_matrix_status_w(uint8_t data) { - if((data & 0xf0) == 0x40) //coinage setting command + if ((data & 0xf0) == 0x40) //coinage setting command m_coin_settings = data & 0xf; } -void hanaawas_state::hanaawas_map(address_map &map) +/*************************************************************************** + + Convert the color PROMs into a more useable format. + +***************************************************************************/ + +void hanaawas_state::palette(palette_device &palette) const +{ + uint8_t const *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x10; i++) + { + // red component + int bit0 = BIT(color_prom[i], 0); + int bit1 = BIT(color_prom[i], 1); + int bit2 = BIT(color_prom[i], 2); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = BIT(color_prom[i], 3); + bit1 = BIT(color_prom[i], 4); + bit2 = BIT(color_prom[i], 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = 0; + bit1 = BIT(color_prom[i], 6); + bit2 = BIT(color_prom[i], 7); + int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x20; + + // character lookup table. The 1bpp tiles really only use colors 0-0x0f and the 3bpp ones 0x10-0x1f + for (int i = 0; i < 0x100; i++) + { + int const swapped_i = bitswap<8>(i, 2,7,6,5,4,3,1,0); + uint8_t const ctabentry = color_prom[swapped_i] & 0x0f; + palette.set_pen_indirect(i, ctabentry); + } +} + +void hanaawas_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset); +} + +void hanaawas_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + + // dirty both current and next offsets + m_bg_tilemap->mark_tile_dirty(offset); + m_bg_tilemap->mark_tile_dirty((offset + (flip_screen() ? -1 : 1)) & 0x03ff); +} + +void hanaawas_state::portb_w(uint8_t data) +{ + // bit 7 is flip screen + if (flip_screen() != (~data & 0x80)) + { + flip_screen_set(~data & 0x80); + machine().tilemap().mark_all_dirty(); + } +} + +TILE_GET_INFO_MEMBER(hanaawas_state::get_bg_tile_info) +{ + // the color is determined by the current color byte, but the bank is via the previous one!!! + int offset = (tile_index + (flip_screen() ? 1 : -1)) & 0x3ff; + int attr = m_colorram[offset]; + int gfxbank = (attr & 0x40) >> 6; + int code = m_videoram[tile_index] + ((attr & 0x20) << 3); + int color = m_colorram[tile_index] & 0x1f; + + tileinfo.set(gfxbank, code, color, 0); +} + +void hanaawas_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hanaawas_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); +} + +uint32_t hanaawas_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + +void hanaawas_state::prg_map(address_map &map) { map(0x0000, 0x2fff).rom(); map(0x4000, 0x4fff).rom(); map(0x6000, 0x6fff).rom(); - map(0x8000, 0x83ff).ram().w(FUNC(hanaawas_state::hanaawas_videoram_w)).share("videoram"); - map(0x8400, 0x87ff).ram().w(FUNC(hanaawas_state::hanaawas_colorram_w)).share("colorram"); + map(0x8000, 0x83ff).ram().w(FUNC(hanaawas_state::videoram_w)).share(m_videoram); + map(0x8400, 0x87ff).ram().w(FUNC(hanaawas_state::colorram_w)).share(m_colorram); map(0x8800, 0x8bff).ram(); map(0xb000, 0xb000).w(FUNC(hanaawas_state::irq_ack_w)); } @@ -114,8 +263,8 @@ void hanaawas_state::hanaawas_map(address_map &map) void hanaawas_state::io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).rw(FUNC(hanaawas_state::hanaawas_input_port_0_r), FUNC(hanaawas_state::hanaawas_inputs_mux_w)); - map(0x01, 0x01).nopr().w(FUNC(hanaawas_state::key_matrix_status_w)); /* r bit 1: status ready, presumably of the input mux device / w = configure device? */ + map(0x00, 0x00).rw(FUNC(hanaawas_state::input_port_0_r), FUNC(hanaawas_state::inputs_mux_w)); + map(0x01, 0x01).nopr().w(FUNC(hanaawas_state::key_matrix_status_w)); // r bit 1: status ready, presumably of the input mux device / w = configure device? map(0x10, 0x10).r("aysnd", FUNC(ay8910_device::data_r)); map(0x10, 0x11).w("aysnd", FUNC(ay8910_device::address_data_w)); map(0xc0, 0xc0).nopw(); // watchdog @@ -150,7 +299,7 @@ static INPUT_PORTS_START( hanaawas ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) - /* fake port. The button depressed gets converted to an integer in the 1-10 range */ + // fake port. The button depressed gets converted to an integer in the 1-10 range PORT_START("P1") PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_HANAFUDA_A ) PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_HANAFUDA_B ) @@ -163,7 +312,7 @@ static INPUT_PORTS_START( hanaawas ) PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_HANAFUDA_YES ) PORT_BIT( 0x200, IP_ACTIVE_HIGH, IPT_HANAFUDA_NO ) - /* fake port. The button depressed gets converted to an integer in the 1-10 range */ + // fake port. The button depressed gets converted to an integer in the 1-10 range PORT_START("P2") PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_HANAFUDA_A ) PORT_PLAYER(2) PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_HANAFUDA_B ) PORT_PLAYER(2) @@ -198,8 +347,8 @@ GFX( charlayout_1bpp, 0x2000*8+4, 0x2000*8+4, 0x2000*8+4 ) GFX( charlayout_3bpp, 0x2000*8, 0, 4 ) static GFXDECODE_START( gfx_hanaawas ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout_1bpp, 0, 32 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout_3bpp, 0, 32 ) + GFXDECODE_ENTRY( "tiles", 0, charlayout_1bpp, 0, 32 ) + GFXDECODE_ENTRY( "tiles", 0, charlayout_3bpp, 0, 32 ) GFXDECODE_END @@ -218,31 +367,31 @@ void hanaawas_state::machine_reset() void hanaawas_state::hanaawas(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 18432000/6); /* 3.072 MHz ??? */ - m_maincpu->set_addrmap(AS_PROGRAM, &hanaawas_state::hanaawas_map); + // basic machine hardware + Z80(config, m_maincpu, 18432000 / 6); // 3.072 MHz ??? + m_maincpu->set_addrmap(AS_PROGRAM, &hanaawas_state::prg_map); m_maincpu->set_addrmap(AS_IO, &hanaawas_state::io_map); m_maincpu->set_vblank_int("screen", FUNC(hanaawas_state::irq0_line_assert)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 0*8, 32*8-1); - screen.set_screen_update(FUNC(hanaawas_state::screen_update_hanaawas)); + screen.set_screen_update(FUNC(hanaawas_state::screen_update)); screen.set_palette("palette"); GFXDECODE(config, m_gfxdecode, "palette", gfx_hanaawas); - PALETTE(config, "palette", FUNC(hanaawas_state::hanaawas_palette), 32 * 8, 16); + PALETTE(config, "palette", FUNC(hanaawas_state::palette), 32 * 8, 16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - ay8910_device &aysnd(AY8910(config, "aysnd", 18432000/12)); + ay8910_device &aysnd(AY8910(config, "aysnd", 18432000 / 12)); aysnd.port_a_read_callback().set_ioport("DSW"); - aysnd.port_b_write_callback().set(FUNC(hanaawas_state::hanaawas_portB_w)); + aysnd.port_b_write_callback().set(FUNC(hanaawas_state::portb_w)); aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -254,23 +403,25 @@ void hanaawas_state::hanaawas(machine_config &config) ***************************************************************************/ ROM_START( hanaawas ) - ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "1.1e", 0x0000, 0x2000, CRC(618dc1e3) SHA1(31817f256512352db0d27322998d9dcf95a993cf) ) ROM_LOAD( "2.3e", 0x2000, 0x1000, CRC(5091b67f) SHA1(5a66740b8829b9b4d3aea274f9ff36e0b9e8c151) ) ROM_LOAD( "3.4e", 0x4000, 0x1000, CRC(dcb65067) SHA1(37964ff4016bd927b9f13b4358b831bb667f993b) ) ROM_LOAD( "4.6e", 0x6000, 0x1000, CRC(24bee0dc) SHA1(a4237ad3611c923b563923462e79b0b3f66cc721) ) - ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_REGION( 0x4000, "tiles", 0 ) ROM_LOAD( "5.9a", 0x0000, 0x1000, CRC(304ae219) SHA1(c1eac4973a6aec9fd8e848c206870667a8bb0922) ) ROM_LOAD( "6.10a", 0x1000, 0x1000, CRC(765a4e5f) SHA1(b2f148c60cffb75d1a841be8b924a874bff22ce4) ) ROM_LOAD( "7.12a", 0x2000, 0x1000, CRC(5245af2d) SHA1(a1262fa5828a52de28cc953ab465cbc719c56c32) ) ROM_LOAD( "8.13a", 0x3000, 0x1000, CRC(3356ddce) SHA1(68818d0692fca548a49a74209bd0ef6f16484eba) ) ROM_REGION( 0x0220, "proms", 0 ) - ROM_LOAD( "13j.bpr", 0x0000, 0x0020, CRC(99300d85) SHA1(dd383db1f3c8c6d784121d32f20ffed3d83e2278) ) /* color PROM */ - ROM_LOAD( "2a.bpr", 0x0020, 0x0100, CRC(e26f21a2) SHA1(d0df06f833e0f97872d9d2ffeb7feef94aaaa02a) ) /* lookup table */ - ROM_LOAD( "6g.bpr", 0x0120, 0x0100, CRC(4d94fed5) SHA1(3ea8e6fb95d5677991dc90fe7435f91e5320bb16) ) /* I don't know what this is */ + ROM_LOAD( "13j.bpr", 0x0000, 0x0020, CRC(99300d85) SHA1(dd383db1f3c8c6d784121d32f20ffed3d83e2278) ) // color PROM + ROM_LOAD( "2a.bpr", 0x0020, 0x0100, CRC(e26f21a2) SHA1(d0df06f833e0f97872d9d2ffeb7feef94aaaa02a) ) // lookup table + ROM_LOAD( "6g.bpr", 0x0120, 0x0100, CRC(4d94fed5) SHA1(3ea8e6fb95d5677991dc90fe7435f91e5320bb16) ) // I don't know what this is ROM_END +} // Anonymous namespace + GAME( 1982, hanaawas, 0, hanaawas, hanaawas, hanaawas_state, empty_init, ROT0, "Seta Kikaku, Ltd.", "Hana Awase", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sbmjb.cpp b/src/mame/drivers/sbmjb.cpp index 39e21f4b0b6..9e7a26d32da 100644 --- a/src/mame/drivers/sbmjb.cpp +++ b/src/mame/drivers/sbmjb.cpp @@ -1,13 +1,18 @@ // license:BSD-3-Clause // copyright-holders: -/* - Sonic Blast Man's Janken Battle (c) 1998 Taito +/* + Sonic Blast Man's Janken Battle (ソニックブラストマンのジャンケンバトル) (c) 1998 Taito Redemption game based on Janken, a Japanese game similar to Rock Paper Scissors Video: https://www.youtube.com/watch?v=AFWLMHbpQz8 - A (possibly) one-off PCB design with the following main components: + Other undumped games believed to use the same hardware: + Bubblen Roulette (バブルンるーれっと) (c) 1997 Taito - video: https://www.youtube.com/watch?v=AaugRz3cqv0 + Harikiri Junior Baseball (はりきりジュニアベースボール) (c) 1998 Taito - video: https://www.youtube.com/watch?v=eRZctnd8whE + Packy's Treasure Slot (パッキイのトレジャースロット) (c) 1997 Taito - video: https://www.youtube.com/watch?v=IPse14eGiqM + + Main components: 2 x Z0840004PSC 1 x TC0091LVC (marked as TC0090LVC on PCB) 1 x YM2203C @@ -30,8 +35,9 @@ #include "emu.h" #include "cpu/z80/z80.h" -#include "machine/te7750.h" #include "machine/tc009xlvc.h" +#include "machine/te7750.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "sound/okim6295.h" #include "sound/ymopn.h" @@ -181,7 +187,7 @@ void sbmjb_state::sbmjb(machine_config &config) opn.irq_handler().set_inputline("audiocpu", 0); opn.add_route(ALL_OUTPUTS, "mono", 0.30); - OKIM6295(config, "oki", 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // pin not verified + OKIM6295(config, "oki", 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); // pin not verified } @@ -210,4 +216,4 @@ ROM_END } // Anonymous namespace -GAME( 1998, sbmjb, 0, sbmjb, sbmjb, sbmjb_state, empty_init, ROT0, "Taito", "Sonic Blast Man's Janken Battle (main ver. 1.1, video ver. 1.0)", MACHINE_NOT_WORKING ) +GAME( 1998, sbmjb, 0, sbmjb, sbmjb, sbmjb_state, empty_init, ROT0, "Taito Corporation", "Sonic Blast Man's Janken Battle (main ver. 1.1, video ver. 1.0)", MACHINE_NOT_WORKING ) diff --git a/src/mame/includes/hanaawas.h b/src/mame/includes/hanaawas.h deleted file mode 100644 index 8c5ca328efa..00000000000 --- a/src/mame/includes/hanaawas.h +++ /dev/null @@ -1,60 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/************************************************************************* - - Hana Awase - -*************************************************************************/ -#ifndef MAME_INCLUDES_HANAAWAS_H -#define MAME_INCLUDES_HANAAWAS_H - -#pragma once - -#include "emupal.h" -#include "tilemap.h" - -class hanaawas_state : public driver_device -{ -public: - hanaawas_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_colorram(*this, "colorram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode") - { } - - void hanaawas(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - - /* video-related */ - tilemap_t *m_bg_tilemap; - - /* misc */ - int m_mux; - uint8_t m_coin_settings; - uint8_t m_coin_impulse; - uint8_t hanaawas_input_port_0_r(); - void hanaawas_inputs_mux_w(uint8_t data); - void hanaawas_videoram_w(offs_t offset, uint8_t data); - void hanaawas_colorram_w(offs_t offset, uint8_t data); - void key_matrix_status_w(uint8_t data); - void irq_ack_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void hanaawas_palette(palette_device &palette) const; - uint32_t screen_update_hanaawas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void hanaawas_portB_w(uint8_t data); - required_device m_maincpu; - required_device m_gfxdecode; - void hanaawas_map(address_map &map); - void io_map(address_map &map); -}; - -#endif // MAME_INCLUDES_HANAAWAS_H diff --git a/src/mame/video/hanaawas.cpp b/src/mame/video/hanaawas.cpp deleted file mode 100644 index 3bb542efed1..00000000000 --- a/src/mame/video/hanaawas.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Zsolt Vasvari -/*************************************************************************** - - video.c - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "includes/hanaawas.h" - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - -***************************************************************************/ - -void hanaawas_state::hanaawas_palette(palette_device &palette) const -{ - uint8_t const *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x10; i++) - { - int bit0, bit1, bit2; - - /* red component */ - bit0 = BIT(color_prom[i], 0); - bit1 = BIT(color_prom[i], 1); - bit2 = BIT(color_prom[i], 2); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* green component */ - bit0 = BIT(color_prom[i], 3); - bit1 = BIT(color_prom[i], 4); - bit2 = BIT(color_prom[i], 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - /* blue component */ - bit0 = 0; - bit1 = BIT(color_prom[i], 6); - bit2 = BIT(color_prom[i], 7); - int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x20; - - // character lookup table. The 1bpp tiles really only use colors 0-0x0f and the 3bpp ones 0x10-0x1f - for (int i = 0; i < 0x100; i++) - { - int const swapped_i = bitswap<8>(i, 2,7,6,5,4,3,1,0); - uint8_t const ctabentry = color_prom[swapped_i] & 0x0f; - palette.set_pen_indirect(i, ctabentry); - } -} - -void hanaawas_state::hanaawas_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset); -} - -void hanaawas_state::hanaawas_colorram_w(offs_t offset, uint8_t data) -{ - m_colorram[offset] = data; - - /* dirty both current and next offsets */ - m_bg_tilemap->mark_tile_dirty(offset); - m_bg_tilemap->mark_tile_dirty((offset + (flip_screen() ? -1 : 1)) & 0x03ff); -} - -void hanaawas_state::hanaawas_portB_w(uint8_t data) -{ - /* bit 7 is flip screen */ - if (flip_screen() != (~data & 0x80)) - { - flip_screen_set(~data & 0x80); - machine().tilemap().mark_all_dirty(); - } -} - -TILE_GET_INFO_MEMBER(hanaawas_state::get_bg_tile_info) -{ - /* the color is determined by the current color byte, but the bank is via the previous one!!! */ - int offset = (tile_index + (flip_screen() ? 1 : -1)) & 0x3ff; - int attr = m_colorram[offset]; - int gfxbank = (attr & 0x40) >> 6; - int code = m_videoram[tile_index] + ((attr & 0x20) << 3); - int color = m_colorram[tile_index] & 0x1f; - - tileinfo.set(gfxbank, code, color, 0); -} - -void hanaawas_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(hanaawas_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); -} - -uint32_t hanaawas_state::screen_update_hanaawas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - return 0; -}