Previous 15994 Revisions Next

r2208 Wednesday 2nd April, 2008 at 10:35:08 UTC by Cowering
[Genesis] Add handler for 'King of Fighters 99'
[src/mess/drivers]genesis.c

src/mess/drivers/genesis.c
r2207r2208
5757static int is_ssf2 = 0;
5858static int is_redcliff = 0;
5959static int is_radica = 0;
60static int is_kof99 = 0;
6061
6162static UINT8 *genesis_sram;
6263static int genesis_sram_start;
r2207r2208
183184   unsigned char *ROM;
184185
185186   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;
187188
188189   rawROM = memory_region(REGION_CPU1);
189190        ROM = rawROM /*+ 512 */;
r2207r2208
244245      {
245246         is_ssf2 = 1;
246247      }
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
248249      if (length == 0x200000)
249250      {
250251          static unsigned char redcliffsig[] = { 0x10, 0x39, 0x00, 0x40, 0x00, 0x04}; // move.b  ($400004).l,d0
r2207r2208
268269         }
269270
270271      }
272      is_kof99 = 1;
271273
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
272285   }
273286
274287   ROM = memory_region(REGION_CPU1);   /* 68000 ROM region */
r2207r2208
427440   }
428441}
429442
430// Radica handler borrowed from HazeMD
443// KOF99 handler from HazeMD
444READ16_HANDLER( kof99_0xA13002_r )
445{
446   // write 02 to a13002.. shift right 1?
447   return 0x01;
448}
431449
450READ16_HANDLER( kof99_00A1303E_r )
451{
452   // write 3e to a1303e.. shift right 1?
453   return 0x1f;
454}
455
456READ16_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
432464READ16_HANDLER( radica_bank_select )
433465{
434466   int bank = offset&0x3f;
r2207r2208
477509      memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa13000, 0xa1307f, 0, 0, radica_bank_select );
478510   }
479511
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   }
480517
481518   if (is_redcliff)
482519   {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team