// license:BSD-3-Clause // copyright-holders:Luca Elia /*************************************************************************** -= Power Instinct =- (C) 1993 Atlus driver by Luca Elia (l.elia@tin.it) Set 1 CPU: MC68000, Z80 (for sound) Sound: 2x OKI6295 + 1x YM2203 Bootleg Set 1 CPU: MC68000 Sound: OKIM6295 Bootleg Set 2 CPU: MC68000, Z80 (for sound) Sound: 2x OKI6295 (Sound code supports an additional YM2203, but it's not fitted) Note: - To enter test mode press F2 (Test) Use 9 (Service Coin) to change page. - In powerinsa there is a hidden test mode screen because it's a bootleg without a sound CPU. Set 18ff08 to 4 during test mode that calls the data written to $10001e "sound code". TODO: - sprites flip y (not used by the game) - graphic system and PCB design is similar as macross2 era hardwares in nmk16.cpp; it's mergeable? ***************************************************************************/ #include "emu.h" #include "includes/powerins.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" #include "machine/gen_latch.h" #include "machine/nmk112.h" #include "sound/okim6295.h" #include "sound/ymopn.h" #include "speaker.h" /*************************************************************************** Memory Maps ***************************************************************************/ void powerins_state::powerinsa_okibank_w(u8 data) { m_okibank[0]->set_entry(data & 7); } u8 powerins_state::powerinsb_fake_ym2203_r() { return 0x01; } void powerins_state::powerins_map(address_map &map) { map(0x000000, 0x0fffff).rom(); map(0x100000, 0x100001).portr("SYSTEM"); map(0x100002, 0x100003).portr("P1_P2"); map(0x100008, 0x100009).portr("DSW1"); map(0x10000a, 0x10000b).portr("DSW2"); map(0x100015, 0x100015).w(FUNC(powerins_state::flipscreen_w)); map(0x100016, 0x100017).nopw(); /* IRQ enable or z80 sound reset like in Macross 2? */ map(0x100019, 0x100019).w(FUNC(powerins_state::tilebank_w)); map(0x10001f, 0x10001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x120000, 0x120fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x130000, 0x130007).ram().w(FUNC(powerins_state::scroll_w<0>)).umask16(0x00ff); map(0x140000, 0x143fff).ram().w(FUNC(powerins_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(powerins_state::txvideoram_w)).share("txvideoram"); map(0x180000, 0x18ffff).ram().share("mainram"); } /* powerinsa: same as the original one but without the sound cpu (and inferior sound HW) */ void powerins_state::powerinsa_map(address_map &map) { powerins_map(map); map(0x100031, 0x100031).w(FUNC(powerins_state::powerinsa_okibank_w)); map(0x10003f, 0x10003f).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } void powerins_state::powerins_sound_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xdfff).ram(); map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); // map(0xe000, 0xe000).nopw(); // ? written only once ? // map(0xe001, 0xe001).nopw(); // ? } void powerins_state::powerinsb_sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).r(FUNC(powerins_state::powerinsb_fake_ym2203_r)).nopw(); map(0x01, 0x01).noprw(); map(0x80, 0x80).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x88, 0x88).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x90, 0x97).w("nmk112", FUNC(nmk112_device::okibank_w)); } void powerins_state::powerinsa_oki_map(address_map &map) { map(0x00000, 0x2ffff).rom().region("oki1", 0); map(0x30000, 0x3ffff).bankr("okibank1"); } /*************************************************************************** Input Ports ***************************************************************************/ static INPUT_PORTS_START( powerins ) PORT_START("SYSTEM") /* $100000 */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 ) PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("P1_P2") /* $100002 */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT
#include "pugixml.hpp"
#include <iostream>
int main()
{
// get a test document
pugi::xml_document doc;
doc.load_string("<foo bar='baz'><call>hey</call></foo>");
// tag::code[]
// save document to standard output
std::cout << "Document:\n";
doc.save(std::cout);
// end::code[]
}
// vim:et