From 73798121d0806ad5e28a17ab58c1cf6592ef4a60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Wed, 12 May 2010 20:00:14 +0000 Subject: [PATCH] pengadvb: Improved inputs, the game can now be coined up. It magically has sound too now. (hap) --- src/mame/drivers/forte2.c | 9 +++---- src/mame/drivers/pengadvb.c | 47 ++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c index bda67f5939f..91b87204e52 100644 --- a/src/mame/drivers/forte2.c +++ b/src/mame/drivers/forte2.c @@ -40,11 +40,8 @@ static ADDRESS_MAP_START( io_mem, ADDRESS_SPACE_IO, 8 ) AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("aysnd", ay8910_address_data_w) AM_RANGE(0xa2, 0xa2) AM_DEVREAD("aysnd", ay8910_r) -//Ports a8-ab are originally for communicating with the i8255 PPI on MSX. -//( http://map.tni.nl/resources/msx_io_ports.php#ppi ) -//Since this arcade board doesn't have one, those ports should be -//unmapped, so setting a8 to RAM is wrong. The ROM hasn't been hacked -//cleanly by removing all references to the PPI. PCB pics showing eg. lack +/* Ports a8-ab are originally for communicating with the i8255 PPI on MSX. +Since this arcade board doesn't have one, those ports should be unmapped. */ // AM_RANGE(0xa8, 0xa8) AM_RAM // AM_RANGE(0xa9, 0xab) AM_NOP ADDRESS_MAP_END @@ -171,4 +168,4 @@ ROM_START( pesadelo ) ROM_LOAD( "epr2764.15", 0x00000, 0x10000, CRC(1ae2f724) SHA1(12880dd7ad82acf04861843fb9d4f0f926d18f6b) ) ROM_END -GAME( 1989, pesadelo, 0, pesadelo, pesadelo, pesadelo, ROT0, "bootleg", "Pesadelo (Brazilian bootleg of Konami's Knightmare on MSX)", GAME_SUPPORTS_SAVE ) +GAME( 1989, pesadelo, 0, pesadelo, pesadelo, pesadelo, ROT0, "bootleg / Konami", "Pesadelo (bootleg of Knightmare on MSX)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c index e68e6d5dfbc..fbe2e1564c6 100644 --- a/src/mame/drivers/pengadvb.c +++ b/src/mame/drivers/pengadvb.c @@ -4,9 +4,7 @@ Penguin Adventure bootleg Driver by Mariusz Wojcieszek -Game is playable, but coin system is missing. - -This seems to be the console version possibly hacked +This seems to be the MSX version possibly hacked to run on cheap Korean bootleg hardware. Basic components include..... @@ -148,6 +146,7 @@ static WRITE8_HANDLER(mem_w) } } + static ADDRESS_MAP_START( program_mem, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank1") AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank21") @@ -170,19 +169,30 @@ ADDRESS_MAP_END static INPUT_PORTS_START( pengadvb ) PORT_START("IN0") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) - PORT_BIT(0x0e, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("IN1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1) PORT_IMPULSE(1) + PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED) INPUT_PORTS_END + +static READ8_DEVICE_HANDLER( pengadvb_psg_port_a_r ) +{ + return input_port_read(device->machine, "IN0"); +} + static const ay8910_interface pengadvb_ay8910_interface = { AY8910_LEGACY_OUTPUT, AY8910_DEFAULT_LOADS, - DEVCB_NULL, + DEVCB_HANDLER(pengadvb_psg_port_a_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL @@ -196,15 +206,10 @@ static WRITE8_DEVICE_HANDLER ( pengadvb_ppi_port_a_w ) static READ8_DEVICE_HANDLER( pengadvb_ppi_port_b_r ) { - UINT8 result = 0xff; - int row; + if ((i8255a_r(device, 2) & 0x0f) == 0) + return input_port_read(device->machine, "IN1"); - row = i8255a_r(device, 2) & 0x0f; - if (row == 8) - { - result = input_port_read(device->machine, "IN0"); - } - return result; + return 0xff; } static I8255A_INTERFACE(pengadvb_ppi8255_interface) @@ -233,6 +238,10 @@ static const TMS9928a_interface tms9928a_interface = static MACHINE_START( pengadvb ) { TMS9928A_configure(&tms9928a_interface); + + state_save_register_global_pointer(machine, main_mem, 0x4000); + state_save_register_global(machine, mem_map); + state_save_register_global_array(machine, mem_banks); } static MACHINE_RESET( pengadvb ) @@ -320,4 +329,4 @@ ROM_START( pengadvb ) ROM_END -GAME( 1988, pengadvb, 0, pengadvb, pengadvb, pengadvb, ROT0, "bootleg", "Penguin Adventure (bootleg)", GAME_NOT_WORKING ) +GAME( 1988, pengadvb, 0, pengadvb, pengadvb, pengadvb, ROT0, "bootleg / Konami", "Penguin Adventure (bootleg of MSX version)", GAME_SUPPORTS_SAVE )