diff options
author | davidhay <davidhay@localhost> | 2008-06-24 20:17:59 +0000 |
---|---|---|
committer | davidhay <davidhay@localhost> | 2008-06-24 20:17:59 +0000 |
commit | 1ab9a6bd4096d3caa9c58c4dcf2185996f858343 (patch) | |
tree | 28148e65300e3d570914ddc3c72e4d0f6f5a60f2 | |
parent | 88e208dce0c757effb56dbfa504ee7c225499893 (diff) |
Promoted to Working
-------------------
Survival [nuapete]
-rw-r--r-- | src/emu/cpu/i8085/8085dasm.c | 2 | ||||
-rw-r--r-- | src/mame/drivers/phoenix.c | 8 | ||||
-rw-r--r-- | src/mame/includes/phoenix.h | 2 | ||||
-rw-r--r-- | src/mame/video/phoenix.c | 87 |
4 files changed, 83 insertions, 16 deletions
diff --git a/src/emu/cpu/i8085/8085dasm.c b/src/emu/cpu/i8085/8085dasm.c index 7e431bd211f..73e3dfd7215 100644 --- a/src/emu/cpu/i8085/8085dasm.c +++ b/src/emu/cpu/i8085/8085dasm.c @@ -436,7 +436,7 @@ offs_t i8085_dasm(char *buff, offs_t pc, const UINT8 *oprom, const UINT8 *opram) case 0x73: sprintf (buff,"mov m,e"); break; case 0x74: sprintf (buff,"mov m,h"); break; case 0x75: sprintf (buff,"mov m,l"); break; - case 0x76: sprintf (buff,"mov m,m"); break; + case 0x76: sprintf (buff,"hlt"); break; case 0x77: sprintf (buff,"mov m,a"); break; case 0x78: sprintf (buff,"mov a,b"); break; case 0x79: sprintf (buff,"mov a,c"); break; diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c index 13a91c6601e..acf1072ce74 100644 --- a/src/mame/drivers/phoenix.c +++ b/src/mame/drivers/phoenix.c @@ -39,6 +39,7 @@ Pleiads: #include "driver.h" #include "sound/tms36xx.h" +#include "cpu/i8085/i8085.h" #include "sound/ay8910.h" #include "sound/custom.h" #include "phoenix.h" @@ -1027,10 +1028,7 @@ static DRIVER_INIT( condor ) static DRIVER_INIT( survival ) { - UINT8 *rom = memory_region(machine, REGION_CPU1); - - rom[0x0157] = 0x21; /* ROM check */ - rom[0x02e8] = 0x21; /* crash due to protection, it still locks up somewhere else */ + cpunum_set_info_fct(0, CPUINFO_PTR_I8085_SID_CALLBACK, (void*)survival_sid_callback); } @@ -1058,4 +1056,4 @@ GAME( 1981, pleiadbl, pleiads, pleiads, pleiads, 0, ROT90, "bootleg", GAME( 1981, pleiadce, pleiads, pleiads, pleiadce, 0, ROT90, "Tehkan (Centuri license)", "Pleiads (Centuri)", GAME_IMPERFECT_COLORS ) GAME( 1981, capitol, pleiads, phoenix, capitol, 0, ROT90, "Universal Video Spiel", "Capitol", GAME_IMPERFECT_COLORS ) -GAME( 1982, survival, 0, survival, survival, survival, ROT90, "Rock-ola", "Survival", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) +GAME( 1982, survival, 0, survival, survival, survival, ROT90, "Rock-ola", "Survival", GAME_IMPERFECT_COLORS ) diff --git a/src/mame/includes/phoenix.h b/src/mame/includes/phoenix.h index f908f72d738..acfeca15ca2 100644 --- a/src/mame/includes/phoenix.h +++ b/src/mame/includes/phoenix.h @@ -68,3 +68,5 @@ CUSTOM_INPUT( pleiads_protection_r ); READ8_HANDLER( survival_input_port_0_r ); READ8_HANDLER( survival_protection_r ); +UINT8 survival_sid_callback( void ); + diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c index a137ba3f8d4..121f30bf327 100644 --- a/src/mame/video/phoenix.c +++ b/src/mame/video/phoenix.c @@ -15,8 +15,10 @@ static UINT8 videoram_pg_index; static UINT8 palette_bank; static UINT8 cocktail_mode; static int pleiads_protection_question; -static int survival_protection_value; +static UINT8 survival_protection_value; +static UINT8 survival_sid_value; static tilemap *fg_tilemap, *bg_tilemap; +static UINT8 survival_input_latches[2]; /*************************************************************************** @@ -319,28 +321,93 @@ CUSTOM_INPUT( pleiads_protection_r ) } } +/* + Inputs are demangled at 0x1ae6-0x1b04 using the table at 0x1b26 + and bit 0 of the data from the AY8910 port B. The equation is: + input = map[input] + ay_data + b@437c + (b@437c is set and cleared elsewhere in the code, but is + always 0 during the demangling.) + + A routine at 0x2f31 checks for incorrect AY 8910 port B data. + Incorrect values increment an error counter at 0x4396 which + causes bad sprites and will kill the game after a specified + number of errors. For input & 0xf0 == 0 or 2 or 4, AY 8910 + must return 0. For all other joystick bits, it must return 1. + + Another routine at 0x02bc checks for bad SID data, and + increments the same error counter. +*/ + +#define REMAP_JS(js) ((ret & 0xf) | ( (js & 0xf) << 4)) READ8_HANDLER( survival_input_port_0_r ) { - int ret = input_port_read(machine, "IN0"); + UINT8 ret = ~input_port_read(machine, "IN0"); + + // Any value that remaps the joystick input to 0,2,4 must return + 0 through AY8910; + // All other remaps must return 1 through AY8910. - if (survival_protection_value) + survival_protection_value = 1; + survival_sid_value = 0; + + switch( ( ret >> 4) & 0xf ) { - ret ^= 0xf0; + case 0: // js_nop = 7 + 1 + ret = REMAP_JS( 7 ); + break; + case 1: // js_w = 4 + 0 + survival_sid_value = 0x80; + survival_protection_value = 0; + ret = REMAP_JS( 4 ); + break; + case 2: // js_e = 0 + 0 + survival_sid_value = 0x80; + survival_protection_value = 0; + ret = REMAP_JS( 2 ); + break; + case 4: // js_n = 1 + 1 + ret = REMAP_JS( 8 ); + break; + case 5: // js_nw = 2 + 1 + survival_sid_value = 0x80; + ret = REMAP_JS( 0xc ); + break; + case 6: // js_ne = 0 + 1; + survival_sid_value = 0x80; + ret = REMAP_JS( 0xa ); + break; + case 8: // js_s = 5 + 1 + ret = REMAP_JS( 1 ); + break; + case 9: // js_sw = 4 + 1 + survival_sid_value = 0x80; + ret = REMAP_JS( 5 ); + break; + case 0xa: // js_se = 6 + 1 + survival_sid_value = 0x80; + ret = REMAP_JS( 3 ); + break; + + default: + break; } - return ret; + survival_input_latches[0] = survival_input_latches[1]; + survival_input_latches[1] = ~ret; + + return survival_input_latches[0]; } READ8_HANDLER( survival_protection_r ) { - if (activecpu_get_pc() == 0x2017) - { - survival_protection_value ^= 1; - } - return survival_protection_value; } +UINT8 survival_sid_callback( void ) +{ + return survival_sid_value; +} + + /*************************************************************************** Display refresh |