Previous 15994 Revisions Next

r2164 Sunday 30th March, 2008 at 15:24:24 UTC by Cowering
[Genesis] Add handler for 'Red Cliff' cart
[src/mess/drivers]genesis.c

src/mess/drivers/genesis.c
r2163r2164
5555#include "../../mame/drivers/megadriv.h"
5656
5757static int is_ssf2 = 0;
58static int is_redcliff = 0;
5859
5960static UINT8 *genesis_sram;
6061static int genesis_sram_start;
r2163r2164
181182   unsigned char *ROM;
182183
183184   genesis_sram = NULL;
184   genesis_sram_start = genesis_sram_len = genesis_sram_active = genesis_sram_readonly = is_ssf2 = 0;
185   genesis_sram_start = genesis_sram_len = genesis_sram_active = genesis_sram_readonly = is_ssf2 = is_redcliff = 0;
185186
186187   rawROM = memory_region(REGION_CPU1);
187188        ROM = rawROM /*+ 512 */;
r2163r2164
242243      {
243244         is_ssf2 = 1;
244245      }
246      // detect the 'Romance of the Three Kingdoms - Red Cliff' rom, already decoded from useless .mdx format
247      if (length == 0x200000) {
248          static unsigned char redcliffsig[] = { 0x10, 0x39, 0x00, 0x40, 0x00, 0x04}; // move.b  ($400004).l,d0
249          if (!memcmp(&ROM[0xce560+relocate],&redcliffsig[0],sizeof(redcliffsig))) {
250            is_redcliff = 1;
251         }
252      }
245253   }
246254
247255   ROM = memory_region(REGION_CPU1);   /* 68000 ROM region */
r2163r2164
380388   }
381389}
382390
391// Red Cliff handler borrowed from HazeMD
392
393READ16_HANDLER( redclif_prot_r )
394{
395   return -0x56 << 8;
396}
397
398READ16_HANDLER( redclif_prot2_r )
399{
400   return 0x55 << 8;
401}
402
383403static WRITE16_HANDLER( genesis_TMSS_bank_w )
384404{
385405   /* this probably should do more, like make Genesis V2 'die' if the SEGA string is not written promptly */
r2163r2164
406426   {
407427      memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA130F0, 0xA130FF, 0, 0, genesis_ssf2_bank_w);
408428   }
429   if (is_redcliff) {
430      memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400000, 0x400001, 0, 0, redclif_prot2_r );
431      memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x400004, 0x400005, 0, 0, redclif_prot_r );
432   }
433
409434   /* install NOP handler for TMSS */
410435
411436   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xA14000, 0xA14003, 0, 0, genesis_TMSS_bank_w);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team