New clones added

----------------
Super Hang-On (Japan, FD1094 317-0038) [The Dumping Union]


From: David Haywood <neohaze@nildram.co.uk>
To: Philip Bennett <p.j.bennett@gmail.com>
CC: Charles MacDonald, Smitdogg
Subject: Re: Super Hang-On

Phil,

I guess I'm meant to be sending things to you now?  Aaron saying he's too busy or something.

Anyway, can this version be checked it, the game is working, although I still have to emulate the memory mapper, I have a feeling the bad scroll offset at the very start of the game might be due to that.

The main issue was that I was confusing it with taking the interrupt, and the cpu being reset.  When the CPU is reset we also need to reset the encryption state of the fd1094, otherwise it crashes, and because in the case of Super Hang On the encrypted CPU is the Sub Cpu, it gets reset by the main cpu.

anyway

new clones
------------
Super Hang-On (Japan, FD1094 317-0038) [Yasu + list of contributors]
This commit is contained in:
Phil Bennett 2009-10-22 10:57:03 +00:00
parent 102e50f9e9
commit e7a140b0b2
9 changed files with 47 additions and 28 deletions

View File

@ -117,6 +117,8 @@ static TIMER_CALLBACK( suspend_i8751 )
static MACHINE_RESET( hangon )
{
fd1094_machine_init(cputag_get_cpu(machine, "sub"));
/* reset misc components */
segaic16_tilemap_reset(machine, 0);
@ -316,6 +318,13 @@ static WRITE8_DEVICE_HANDLER( sub_control_adc_w )
/* D3-D2 : ADC_SELECT */
cputag_set_input_line(device->machine, "sub", 4, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
cputag_set_input_line(device->machine, "sub", INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
/* If the CPU is being Reset we also need to reset the fd1094 state */
if (data & 0x20)
{
fd1094_machine_init(cputag_get_cpu(device->machine, "sub"));
}
adc_select = (data >> 2) & 3;
}
@ -401,7 +410,6 @@ static ADDRESS_MAP_START( hangon_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xe00000, 0xffffff) AM_READWRITE(hangon_io_r, hangon_io_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sharrier_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x03ffff) AM_ROM
@ -423,6 +431,7 @@ ADDRESS_MAP_END
*
*************************************/
/* On Super Hang On there is a memory mapper, like the System16 one, todo: emulate it! */
static ADDRESS_MAP_START( sub_map, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0x7ffff)
@ -1192,15 +1201,6 @@ Bottom: 834-5668 (Label 837-6341)
ROM_START( shangonro )
ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_BYTE( "epr-10833.31", 0x000000, 0x10000, CRC(13ba98bc) SHA1(83710a7bb9d038f8663e6d42b184d4e4d937a26f) ) /* <-- These may not be in the correct order */
ROM_LOAD16_BYTE( "epr-10831.25", 0x000001, 0x10000, CRC(3a2de9eb) SHA1(20da548cd1fb466942ee45306cfd04766e5a4f50) )
ROM_LOAD16_BYTE( "epr-10832.30", 0x020000, 0x10000, CRC(543cd7bb) SHA1(124b426adc2d8dc51172ef94cb215bde3b8b42a7) )
ROM_LOAD16_BYTE( "epr-10830.24", 0x020001, 0x10000, CRC(2ae4e53a) SHA1(b15b5a8b36cbe5fe68b5e18ab3398ebc7214dbee) )
ROM_REGION( 0x2000, "user1", 0 ) /* decryption key */
ROM_LOAD( "317-0038.key", 0x0000, 0x2000, CRC(85943925) SHA1(76303b0aa79ca9d4a8d10d4e63ee2efe756a0a00) )
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU */
ROM_LOAD16_BYTE( "epr-10842.22", 0x00000, 0x08000, CRC(24289138) SHA1(700419bb8e4f97e128d85d0077e4aa39a1d2f167) )
ROM_LOAD16_BYTE( "epr-10839.8", 0x00001, 0x08000, CRC(70f92d5e) SHA1(3ca0e23d6bb44bbe7d21840c8d179c57f8cbfd20) )
ROM_LOAD16_BYTE( "epr-10841.20", 0x10000, 0x08000, CRC(3bb2186c) SHA1(755dbf5d37809ea1de2e96f9827cf373dc2d3f94) )
@ -1208,6 +1208,15 @@ ROM_START( shangonro )
ROM_LOAD16_BYTE( "epr-10840.18", 0x20000, 0x08000, CRC(12ee8716) SHA1(8e798d23d22f85cd046641184d104c17b27995b2) )
ROM_LOAD16_BYTE( "epr-10837.4", 0x20001, 0x08000, CRC(155e0cfd) SHA1(e51734351c887fe3920c881f57abdfbb7d075f57) )
ROM_REGION( 0x2000, "user1", 0 ) /* FD1094 decryption key */
ROM_LOAD( "317-0038.key", 0x0000, 0x2000, CRC(85943925) SHA1(76303b0aa79ca9d4a8d10d4e63ee2efe756a0a00) )
ROM_REGION( 0x40000, "sub", 0 ) /* second 68000 CPU (encrypted FD1094) */
ROM_LOAD16_BYTE( "epr-10833.31", 0x000001, 0x10000, CRC(13ba98bc) SHA1(83710a7bb9d038f8663e6d42b184d4e4d937a26f) )
ROM_LOAD16_BYTE( "epr-10831.25", 0x000000, 0x10000, CRC(3a2de9eb) SHA1(20da548cd1fb466942ee45306cfd04766e5a4f50) )
ROM_LOAD16_BYTE( "epr-10832.30", 0x020001, 0x10000, CRC(543cd7bb) SHA1(124b426adc2d8dc51172ef94cb215bde3b8b42a7) )
ROM_LOAD16_BYTE( "epr-10830.24", 0x020000, 0x10000, CRC(2ae4e53a) SHA1(b15b5a8b36cbe5fe68b5e18ab3398ebc7214dbee) )
ROM_REGION( 0x18000, "gfx1", 0 ) /* tiles */
ROM_LOAD( "epr-10652.38", 0x00000, 0x08000, CRC(260286f9) SHA1(dc7c8d2c6ef924a937328685eed19bda1c8b1819) )
ROM_LOAD( "epr-10651.23", 0x08000, 0x08000, CRC(c609ee7b) SHA1(c6dacf81cbfe7e5df1f9a967cf571be1dcf1c429) )
@ -1823,7 +1832,13 @@ static DRIVER_INIT( endurob2 )
memcpy(decrypt, rom, 0x30000);
/* missing data ROM */
}
static DRIVER_INIT( shangonro )
{
hangon_generic_init();
/* init the FD1094 */
fd1094_driver_init(machine, "sub", NULL);
}
/*************************************
@ -1834,7 +1849,7 @@ static DRIVER_INIT( endurob2 )
GAME( 1985, hangon, 0, hangon, hangon, hangon, ROT0, "Sega", "Hang-On (Rev A)", 0 )
GAME( 1985, hangon1, hangon, hangon, hangon, hangon, ROT0, "Sega", "Hang-On", 0 )
GAME( 1992, shangonro, shangon, shangupb, shangupb, hangon, ROT0, "Sega", "Super Hang-On (Japan, FD1094 317-0038)", GAME_NOT_WORKING )
GAME( 1992, shangonro, shangon, shangupb, shangupb, shangonro,ROT0, "Sega", "Super Hang-On (Japan, FD1094 317-0038)", 0 )
GAME( 1992, shangonrb, shangon, shangupb, shangupb, hangon, ROT0, "bootleg", "Super Hang-On (bootleg)", 0 )
GAME( 1985, sharrier, 0, sharrier, sharrier, sharrier, ROT0, "Sega", "Space Harrier (Rev A, 8751 315-5163A)", 0 )
GAME( 1985, sharrier1, sharrier, sharrier, sharrier, sharrier, ROT0, "Sega", "Space Harrier (8751 315-5163)", 0 )

View File

@ -154,7 +154,7 @@ static void outrun_generic_init(running_machine *machine)
segaic16_memory_mapper_init(cputag_get_cpu(machine, "maincpu"), outrun_info, sound_data_w, NULL);
/* init the FD1094 */
fd1094_driver_init(machine, segaic16_memory_mapper_set_decrypted);
fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
/* reset the custom handlers and other pointers */
custom_io_r = NULL;

View File

@ -222,7 +222,7 @@ static void system16a_generic_init(running_machine *machine)
MACHINE_RESET_CALL(sys16_onetime);
/* init the FD1094 */
fd1094_driver_init(machine, NULL);
fd1094_driver_init(machine, "maincpu", NULL);
/* reset the custom handlers and other pointers */
custom_io_r = NULL;

View File

@ -1062,7 +1062,7 @@ static void system16b_generic_init(running_machine *machine, int _rom_board)
segaic16_memory_mapper_init(cputag_get_cpu(machine, "maincpu"), region_info_list[rom_board], sound_w, NULL);
/* init the FD1094 */
fd1094_driver_init(machine, segaic16_memory_mapper_set_decrypted);
fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
/* reset the custom handlers and other pointers */
custom_io_r = NULL;

View File

@ -177,7 +177,7 @@ static void system18_generic_init(running_machine *machine, int _rom_board)
segaic16_memory_mapper_init(cputag_get_cpu(machine, "maincpu"), region_info_list[rom_board], sound_w, sound_r);
/* init the FD1094 */
fd1094_driver_init(machine, segaic16_memory_mapper_set_decrypted);
fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
/* reset the custom handlers and other pointers */
custom_io_r = NULL;

View File

@ -275,7 +275,7 @@ static UINT16 *backupram1, *backupram2;
static void xboard_generic_init(running_machine *machine)
{
/* init the FD1094 */
fd1094_driver_init(machine, NULL);
fd1094_driver_init(machine, "maincpu", NULL);
/* set the default road priority */
xboard_set_road_priority(1);

View File

@ -52,7 +52,7 @@ VIDEO_UPDATE( yboard );
void *fd1094_get_decrypted_base(void);
void fd1094_machine_init(const device_config *device);
void fd1094_driver_init(running_machine *machine, void (*set_decrypted)(running_machine *, UINT8 *));
void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *));
/*----------- defined in machine/system16.c -----------*/

View File

@ -29,6 +29,8 @@ static int fd1094_current_cacheposition; // current position in cache array
static int fd1094_state;
static int fd1094_selected_state;
static char fd1094_cputag[64];
static void (*fd1094_set_decrypted)(running_machine *, UINT8 *);
void *fd1094_get_decrypted_base(void)
@ -43,7 +45,7 @@ static void set_decrypted_region(running_machine *machine)
if (fd1094_set_decrypted != NULL)
(*fd1094_set_decrypted)(machine, (UINT8 *)fd1094_userregion);
else
memory_set_decrypted_region(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0, fd1094_cpuregionsize - 1, fd1094_userregion);
memory_set_decrypted_region(cputag_get_address_space(machine, fd1094_cputag, ADDRESS_SPACE_PROGRAM), 0, fd1094_cpuregionsize - 1, fd1094_userregion);
}
/* this function checks the cache to see if the current state is cached,
@ -65,7 +67,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
fd1094_state = state;
cpu_set_reg(cputag_get_cpu(machine, "maincpu"), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
cpu_set_reg(cputag_get_cpu(machine, fd1094_cputag), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
/* set the FD1094 state ready to decrypt.. */
state = fd1094_set_state(fd1094_key, state) & 0xff;
@ -78,7 +80,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
/* copy cached state */
fd1094_userregion = fd1094_cacheregion[i];
set_decrypted_region(machine);
m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, "maincpu"), 0, fd1094_cpuregionsize);
m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, fd1094_cputag), 0, fd1094_cpuregionsize);
return;
}
@ -97,7 +99,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
/* copy newly decrypted data to user region */
fd1094_userregion = fd1094_cacheregion[fd1094_current_cacheposition];
set_decrypted_region(machine);
m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, "maincpu"), 0, fd1094_cpuregionsize);
m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, fd1094_cputag), 0, fd1094_cpuregionsize);
fd1094_current_cacheposition++;
@ -164,7 +166,7 @@ static STATE_POSTLOAD( fd1094_postload )
int selected_state = fd1094_selected_state;
int state = fd1094_state;
fd1094_machine_init(cputag_get_cpu(machine, "maincpu"));
fd1094_machine_init(cputag_get_cpu(machine, fd1094_cputag));
fd1094_setstate_and_decrypt(machine, selected_state);
fd1094_setstate_and_decrypt(machine, state);
@ -190,17 +192,19 @@ static void key_changed(running_machine *machine)
fd1094_current_cacheposition = 1;
/* flush the prefetch queue */
cpu_set_reg(cputag_get_cpu(machine, "maincpu"), M68K_PREF_ADDR, 0x0010);
cpu_set_reg(cputag_get_cpu(machine, fd1094_cputag), M68K_PREF_ADDR, 0x0010);
}
/* startup function, to be called from DRIVER_INIT (once on startup) */
void fd1094_driver_init(running_machine *machine, void (*set_decrypted)(running_machine *, UINT8 *))
void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *))
{
int i;
fd1094_cpuregion = (UINT16*)memory_region(machine, "maincpu");
fd1094_cpuregionsize = memory_region_length(machine, "maincpu");
strcpy(fd1094_cputag, tag);
fd1094_cpuregion = (UINT16*)memory_region(machine, fd1094_cputag);
fd1094_cpuregionsize = memory_region_length(machine, fd1094_cputag);
fd1094_key = memory_region(machine, "user1");
fd1094_set_decrypted = set_decrypted;
@ -219,7 +223,7 @@ void fd1094_driver_init(running_machine *machine, void (*set_decrypted)(running_
/* key debugging */
if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0 && memory_region(machine, "user2") != NULL)
{
fd1094_init_debugging(machine, "maincpu", "user1", "user2", key_changed);
fd1094_init_debugging(machine, fd1094_cputag, "user1", "user2", key_changed);
}
state_save_register_global(machine, fd1094_selected_state);

View File

@ -3686,7 +3686,7 @@ DokiDoki Penguin Land *not confirmed
DRIVER( hangon1 ) /* (c) 1985 */
DRIVER( sharrier ) /* (c) 1985 */
DRIVER( sharrier1 ) /* (c) 1985 */
DRIVER( shangonro ) /* (c) 1992 (FD1094, decrypted) */
DRIVER( shangonro ) /* (c) 1987 (FD1094, decrypted) */
DRIVER( shangonrb ) /* (c) 1992 (but bootleg, hangon hw?) */
/* Pre-16 */