src/mess/drivers/genesis.c
| r2207 | r2208 | |
| 57 | 57 | static int is_ssf2 = 0; |
| 58 | 58 | static int is_redcliff = 0; |
| 59 | 59 | static int is_radica = 0; |
| 60 | static int is_kof99 = 0; |
| 60 | 61 | |
| 61 | 62 | static UINT8 *genesis_sram; |
| 62 | 63 | static int genesis_sram_start; |
| r2207 | r2208 | |
| 183 | 184 | unsigned char *ROM; |
| 184 | 185 | |
| 185 | 186 | genesis_sram = NULL; |
| 186 | | genesis_sram_start = genesis_sram_len = genesis_sram_active = genesis_sram_readonly = is_ssf2 = is_redcliff = is_radica = 0; |
| 187 | genesis_sram_start = genesis_sram_len = genesis_sram_active = genesis_sram_readonly = is_ssf2 = is_redcliff = is_radica = is_kof99 = 0; |
| 187 | 188 | |
| 188 | 189 | rawROM = memory_region(REGION_CPU1); |
| 189 | 190 | ROM = rawROM /*+ 512 */; |
| r2207 | r2208 | |
| 244 | 245 | { |
| 245 | 246 | is_ssf2 = 1; |
| 246 | 247 | } |
| 247 | | // detect the 'Romance of the Three Kingdoms - Red Cliff' rom, already decoded from useless .mdx format |
| 248 | // detect the 'Romance of the Three Kingdoms - Red Cliff' rom, already decoded from .mdx format |
| 248 | 249 | if (length == 0x200000) |
| 249 | 250 | { |
| 250 | 251 | static unsigned char redcliffsig[] = { 0x10, 0x39, 0x00, 0x40, 0x00, 0x04}; // move.b ($400004).l,d0 |
| r2207 | r2208 | |
| 268 | 269 | } |
| 269 | 270 | |
| 270 | 271 | } |
| 272 | is_kof99 = 1; |
| 271 | 273 | |
| 274 | // detect the King of Fighters '99 unlicensed game |
| 275 | if (length == 0x300000) |
| 276 | { |
| 277 | static unsigned char kof99sig[] = { 0x20, 0x3c, 0x30, 0x00, 0x00, 0xa1}; // move.l #$300000A1,d0 |
| 278 | |
| 279 | if (!memcmp(&ROM[0x1fd0d2+relocate],&kof99sig[0],sizeof(kof99sig))) |
| 280 | { |
| 281 | is_kof99 = 1; |
| 282 | } |
| 283 | } |
| 284 | |
| 272 | 285 | } |
| 273 | 286 | |
| 274 | 287 | ROM = memory_region(REGION_CPU1); /* 68000 ROM region */ |
| r2207 | r2208 | |
| 427 | 440 | } |
| 428 | 441 | } |
| 429 | 442 | |
| 430 | | // Radica handler borrowed from HazeMD |
| 443 | // KOF99 handler from HazeMD |
| 444 | READ16_HANDLER( kof99_0xA13002_r ) |
| 445 | { |
| 446 | // write 02 to a13002.. shift right 1? |
| 447 | return 0x01; |
| 448 | } |
| 431 | 449 | |
| 450 | READ16_HANDLER( kof99_00A1303E_r ) |
| 451 | { |
| 452 | // write 3e to a1303e.. shift right 1? |
| 453 | return 0x1f; |
| 454 | } |
| 455 | |
| 456 | READ16_HANDLER( kof99_0xA13000_r ) |
| 457 | { |
| 458 | // no write, startup check, chinese message if != 0 |
| 459 | return 0x0; |
| 460 | } |
| 461 | |
| 462 | // Radica handler from HazeMD |
| 463 | |
| 432 | 464 | READ16_HANDLER( radica_bank_select ) |
| 433 | 465 | { |
| 434 | 466 | int bank = offset&0x3f; |
| r2207 | r2208 | |
| 477 | 509 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa13000, 0xa1307f, 0, 0, radica_bank_select ); |
| 478 | 510 | } |
| 479 | 511 | |
| 512 | if (is_kof99) { |
| 513 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13000, 0xA13001, 0, 0, kof99_0xA13000_r ); |
| 514 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA13002, 0xA13003, 0, 0, kof99_0xA13002_r ); |
| 515 | memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA1303e, 0xA1303f, 0, 0, kof99_00A1303E_r ); |
| 516 | } |
| 480 | 517 | |
| 481 | 518 | if (is_redcliff) |
| 482 | 519 | { |