Exemple #1
0
static void load_puchicar(void)
{
   int ta,tb,tc;

   RAMSize=0x80000;

   if(!(RAM=AllocateMem(0x80000))) return;
   if(!(ROM=AllocateMem(0x200000))) return;
   if(!(GFX=AllocateMem(0xF17A00+0x3F0800))) return;

   GFX_BG0 = GFX+0xF17A00;
   GFX_SPR = GFX+0x000000;

   tb=0;
   if(!load_rom("e46.06", ROM, 0x200000)) return;       // 16x16 SPRITES ($8000)
   for(ta=0;ta<0x200000;ta++,tb+=4){
      WriteWord(&GFX_SPR[tb],((ROM[ta])|(ROM[ta]<<4))&0x0F0F);
   }
   tb=2;
   if(!load_rom("e46.04", ROM, 0x200000)) return;       // 16x16 SPRITES
   for(ta=0;ta<0x200000;ta++,tb+=4){
      WriteWord(&GFX_SPR[tb],((ROM[ta])|(ROM[ta]<<4))&0x0F0F);
   }
   tb=0;
   if(!load_rom("e46.02", ROM, 0x200000)) return;       // 16x16 SPRITES (MASK)
   for(ta=0;ta<0x200000;ta++){
      tc=ROM[ta];
      GFX[tb+3]|=((tc&0x40)>>6)<<4;
      GFX[tb+2]|=((tc&0x10)>>4)<<4;
      GFX[tb+1]|=((tc&0x04)>>2)<<4;
      GFX[tb+0]|=((tc&0x01)>>0)<<4;
      tb+=4;
   }
   tb=0x800000;
   if(!load_rom("e46.05", ROM, 0x1C5E80)) return;       // 16x16 SPRITES ($717A)
   for(ta=0;ta<0x1C5E80;ta++,tb+=4){
      WriteWord(&GFX_SPR[tb],((ROM[ta])|(ROM[ta]<<4))&0x0F0F);
   }
   tb=0x800002;
   if(!load_rom("e46.03", ROM, 0x1C5E80)) return;       // 16x16 SPRITES
   for(ta=0;ta<0x1C5E80;ta++,tb+=4){
      WriteWord(&GFX_SPR[tb],((ROM[ta])|(ROM[ta]<<4))&0x0F0F);
   }
   tb=0x800000;
   if(!load_rom("e46.01", ROM, 0x1C5E80)) return;       // 16x16 SPRITES (MASK)
   for(ta=0;ta<0x1C5E80;ta++){
      tc=ROM[ta];
      GFX[tb+3]|=((tc&0x40)>>6)<<4;
      GFX[tb+2]|=((tc&0x10)>>4)<<4;
      GFX[tb+1]|=((tc&0x04)>>2)<<4;
      GFX[tb+0]|=((tc&0x01)>>0)<<4;
      tb+=4;
   }

   tb=0;
   if(!load_rom("e46.12", ROM, 0xFC200)) return;                // 16x16 TILES ($3F08)
   for(ta=0;ta<0xFC200;ta+=2,tb+=8){
      WriteWord(&GFX_BG0[tb+0],((ROM[ta+0])|(ROM[ta+0]<<4))&0x0F0F);
      WriteWord(&GFX_BG0[tb+2],((ROM[ta+1])|(ROM[ta+1]<<4))&0x0F0F);
   }
   tb=4;
   if(!load_rom("e46.11", ROM, 0xFC200)) return;                // 16x16 TILES
   for(ta=0;ta<0xFC200;ta+=2,tb+=8){
      WriteWord(&GFX_BG0[tb+0],((ROM[ta+0])|(ROM[ta+0]<<4))&0x0F0F);
      WriteWord(&GFX_BG0[tb+2],((ROM[ta+1])|(ROM[ta+1]<<4))&0x0F0F);
   }
   tb=0;
   if(!load_rom("e46.10", ROM, 0xFC200)) return;                // 16x16 TILES (MASK)
   for(ta=0;ta<0xFC200;ta+=2){
      tc=ROM[ta];
      GFX_BG0[tb+7]|=((tc&0x80)>>7)<<4;
      GFX_BG0[tb+6]|=((tc&0x40)>>6)<<4;
      GFX_BG0[tb+5]|=((tc&0x20)>>5)<<4;
      GFX_BG0[tb+4]|=((tc&0x10)>>4)<<4;
      GFX_BG0[tb+3]|=((tc&0x08)>>3)<<4;
      GFX_BG0[tb+2]|=((tc&0x04)>>2)<<4;
      GFX_BG0[tb+1]|=((tc&0x02)>>1)<<4;
      GFX_BG0[tb+0]|=((tc&0x01)>>0)<<4;
      tc=ROM[ta+1];
      GFX_BG0[tb+7]|=((tc&0x80)>>7)<<5;
      GFX_BG0[tb+6]|=((tc&0x40)>>6)<<5;
      GFX_BG0[tb+5]|=((tc&0x20)>>5)<<5;
      GFX_BG0[tb+4]|=((tc&0x10)>>4)<<5;
      GFX_BG0[tb+3]|=((tc&0x08)>>3)<<5;
      GFX_BG0[tb+2]|=((tc&0x04)>>2)<<5;
      GFX_BG0[tb+1]|=((tc&0x02)>>1)<<5;
      GFX_BG0[tb+0]|=((tc&0x01)>>0)<<5;
      tb+=8;
   }

   GFX_BG0_SOLID = MakeSolidTileMap16x16(GFX_BG0, 0x3F08);
   GFX_SPR_SOLID = make_solid_mask_16x16(GFX_SPR, 0xF17A);

   FreeMem(ROM);
   ROM = load_region[REGION_CPU1];

   // Setup 68020 Memory Map
   // ----------------------

   AddF3MemoryMap(0x100000);

   RAM_BG0=RAM+0x30000;
   RAM_BG1=RAM+0x32000;
   RAM_BG2=RAM+0x34000;
   RAM_BG3=RAM+0x36000;

   RAM_SCR0=RAM+0x6A000;
   RAM_SCR1=RAM+0x6A002;
   RAM_SCR2=RAM+0x6A004;
   RAM_SCR3=RAM+0x6A006;

   SCR0_XOFS=0xF600;
   SCR1_XOFS=0xF700;
   SCR2_XOFS=0xF800;
   SCR3_XOFS=0xF900;

   SCR0_YOFS=0xFF80;
   SCR1_YOFS=0xFF80;
   SCR2_YOFS=0xFF80;
   SCR3_YOFS=0xFF80;

   // 68000 code
   M68000ROM = load_region[REGION_ROM2];
   if(!(PCMROM=AllocateMem(0xe00004))) return;
   load_be("e46.09",PCMROM,0x200000);
   load_be("e46.08",PCMROM+0x400000,0x200000);
   load_be("e46.07",PCMROM+0x800000,0x200000);
   max_banks_this_game=6; //=memory_region_length(REGION_SOUND1)/0x400000;

   memset(PCMROM+0xc00000,0x0,0x200003);
   memset(RAM+0x00000,0x00,0x80000);
   memset(RAM+0x69000,0xFF,0x01000);

   // EEPROM HACKS
   // ------------

   WriteWord68k(&ROM[0x0019C4],0x7F00); 	//	raine	#$00 <read/write eeprom>
   WriteWord68k(&ROM[0x0019C6],0x4ED6); 	//	jmp	(a6)

   // SPEED HACK#1
   // ------------

   // WriteWord68k(&ROM[0x009DC],0x7F02);		//	raine	#$02 <stop cpu>

   WriteWord68k(&ROM[0x009A4],0x7F02);		//	raine	#$02 <stop cpu>
   WriteWord68k(&ROM[0x009A6],0x4E71);		//	nop
   WriteWord68k(&ROM[0x009A8],0x4E71);		//	nop
   WriteWord68k(&ROM[0x009AA],0x4E71);		//	nop

   F3SystemEEPROMAccess=&F3SysEEPROMAccessMode2;


   set_colour_mapper(&col_map_xxxx_xxxx_rrrr_rrrr_gggg_gggg_bbbb_bbbb);
   InitPaletteMap(RAM+0x60000, 0x200, 0x40, 0x8000);

   // Init tc0003vcu emulation
   // ------------------------

   tc0003vcu.RAM	= RAM+0x20000;
// Mapper disabled
   tc0003vcu.bmp_x	= 64;
   tc0003vcu.bmp_y	= 64;
   tc0003vcu.bmp_w	= 320;
   tc0003vcu.bmp_h	= 232;
   tc0003vcu.scr_x	= 0;
   tc0003vcu.scr_y	= 0;

   // Init tc0200obj emulation
   // ------------------------

   tc0200obj.RAM	= RAM+0x20000;
   tc0200obj.RAM_B	= RAM+0x28000;
   tc0200obj.GFX	= GFX_SPR;
   tc0200obj.MASK	= GFX_SPR_SOLID;
   tc0200obj.bmp_x	= 64;
   tc0200obj.bmp_y	= 64;
   tc0200obj.bmp_w	= 320;
   tc0200obj.bmp_h	= 232;
// Mapper disabled
   tc0200obj.tile_mask	= 0xFFFF;
   tc0200obj.ofs_x	= 0-0x2E;
   tc0200obj.ofs_y	= 0-0x18;

   tc0200obj.cols	= 32;

   init_tc0200obj();

   init_f3_system_ioc(F3_IOC_2P_3BUTTON | F3_IOC_TRACKBALL);

   init_m68k();
   setup_sound_68000();
}
Exemple #2
0
static void load_pbobbl2x(void)
{
   int ta,tb,tc;

   RAMSize=0x80000;

   if(!(RAM=AllocateMem(0x80000))) return;
   if(!(ROM=AllocateMem(0x100000))) return;
   if(!(GFX=AllocateMem(0x3F5D00+0x3EC700))) return;

   GFX_BG0 = GFX+0x3F5D00;
   GFX_SPR = GFX+0x000000;

   tb=0;
   if(!load_rom("e10-02.rom", ROM, 0xFD740)) return;	// 16x16 SPRITES ($3F5D)
   for(ta=0;ta<0xFD740;ta++){
      GFX[tb++]=ROM[ta]&15;
      GFX[tb++]=ROM[ta]>>4;
      tb+=2;
   }
   tb=2;
   if(!load_rom("e10-01.rom", ROM, 0xFD740)) return;	// 16x16 SPRITES
   for(ta=0;ta<0xFD740;ta++){
      GFX[tb++]=ROM[ta]&15;
      GFX[tb++]=ROM[ta]>>4;
      tb+=2;
   }
   tb=0;
   if(!load_rom("e10-07.rom", ROM, 0xFB1C0)) return;	// 16x16 TILES ($3EC7)
   for(ta=0;ta<0xFB1C0;ta+=2){
      GFX_BG0[tb++]=ROM[ta]&15;
      GFX_BG0[tb++]=ROM[ta]>>4;
      GFX_BG0[tb++]=ROM[ta+1]&15;
      GFX_BG0[tb++]=ROM[ta+1]>>4;
      tb+=4;
   }
   tb=4;
   if(!load_rom("e10-06.rom", ROM, 0xFB1C0)) return;	// 16x16 TILES
   for(ta=0;ta<0xFB1C0;ta+=2){
      GFX_BG0[tb++]=ROM[ta]&15;
      GFX_BG0[tb++]=ROM[ta]>>4;
      GFX_BG0[tb++]=ROM[ta+1]&15;
      GFX_BG0[tb++]=ROM[ta+1]>>4;
      tb+=4;
   }
   tb=0;
   if(!load_rom("e10-05.rom", ROM, 0xFB1C0)) return;	// 16x16 TILES (MASK)
   for(ta=0;ta<0xFB1C0;ta+=2){
      tc=ROM[ta];
      GFX_BG0[tb+7]|=((tc&0x80)>>7)<<4;
      GFX_BG0[tb+6]|=((tc&0x40)>>6)<<4;
      GFX_BG0[tb+5]|=((tc&0x20)>>5)<<4;
      GFX_BG0[tb+4]|=((tc&0x10)>>4)<<4;
      GFX_BG0[tb+3]|=((tc&0x08)>>3)<<4;
      GFX_BG0[tb+2]|=((tc&0x04)>>2)<<4;
      GFX_BG0[tb+1]|=((tc&0x02)>>1)<<4;
      GFX_BG0[tb+0]|=((tc&0x01)>>0)<<4;
      tc=ROM[ta+1];
      GFX_BG0[tb+7]|=((tc&0x80)>>7)<<5;
      GFX_BG0[tb+6]|=((tc&0x40)>>6)<<5;
      GFX_BG0[tb+5]|=((tc&0x20)>>5)<<5;
      GFX_BG0[tb+4]|=((tc&0x10)>>4)<<5;
      GFX_BG0[tb+3]|=((tc&0x08)>>3)<<5;
      GFX_BG0[tb+2]|=((tc&0x04)>>2)<<5;
      GFX_BG0[tb+1]|=((tc&0x02)>>1)<<5;
      GFX_BG0[tb+0]|=((tc&0x01)>>0)<<5;
      tb+=8;
   }

   GFX_BG0_SOLID = make_solid_mask_16x16(GFX_BG0, 0x3EC7);
   GFX_SPR_SOLID = make_solid_mask_16x16(GFX_SPR, 0x3F5D);

   GFX_BG0_PENS = make_colour_count_16x16(GFX_BG0, 0x3EC7);

   // Setup 68020 Memory Map
   // ----------------------

   AddF3MemoryMap(0x100000);

   RAM_BG0=RAM+0x33000;
   RAM_BG1=RAM+0x32000;
   RAM_BG2=RAM+0x31000;
   RAM_BG3=RAM+0x30000;

   RAM_SCR0=RAM+0x6A006;
   RAM_SCR1=RAM+0x6A004;
   RAM_SCR2=RAM+0x6A002;
   RAM_SCR3=RAM+0x6A000;

   SCR3_XOFS=0xF640;
   SCR2_XOFS=0xF740;
   SCR1_XOFS=0xF840;
   SCR0_XOFS=0xF940;

   SCR3_YOFS=0xF400;
   SCR2_YOFS=0xF400;
   SCR1_YOFS=0xF400;
   SCR0_YOFS=0xF400;

   if(!load_rom("e10.29", RAM, 0x40000)) return;
   for(ta=0;ta<0x40000;ta++){
      ROM[(ta<<2)+0]=RAM[ta];
   }
   if(!load_rom("e10.28", RAM, 0x40000)) return;
   for(ta=0;ta<0x40000;ta++){
      ROM[(ta<<2)+1]=RAM[ta];
   }
   if(!load_rom("e10.27", RAM, 0x40000)) return;
   for(ta=0;ta<0x40000;ta++){
      ROM[(ta<<2)+2]=RAM[ta];
   }
   if(!load_rom("e10.26", RAM, 0x40000)) return;
   for(ta=0;ta<0x40000;ta++){
      ROM[(ta<<2)+3]=RAM[ta];
   }

   // 68000 code
   M68000ROM = load_region[REGION_ROM2];
   if(!(PCMROM=AllocateMem(0x800000))) return;
   load_be("e10-03.rom",PCMROM,0x200000);
   load_be("e10-04.rom",PCMROM+0x400000,0x200000);
   max_banks_this_game=3; //=memory_region_length(REGION_SOUND1)/0x400000;

   memset(RAM+0x00000,0x00,0x80000);
   memset(RAM+0x69000,0xFF,0x01000);

   // EEPROM ACCESS
   // -------------

   WriteWord68k(&ROM[0x0044D2],0x7F00);		//	raine	#$00 <eeprom access>
   WriteWord68k(&ROM[0x0044D4],0x4ED6);		//	jmp	(a6)

   // SPEED HACK
   // ----------

   WriteWord68k(&ROM[0x031D4],0x4EF9);		//	jmp	$F8000
   WriteLong68k(&ROM[0x031D6],0x000F8000);

   WriteWord68k(&ROM[0xF8000],0x4EB9);		//	jsr	$0291C <random gen>
   WriteLong68k(&ROM[0xF8002],0x0000291C);
   WriteWord68k(&ROM[0xF8006],0x7F02);		//	raine	#$02 <stop cpu>
   WriteWord68k(&ROM[0xF8008],0x6100-10);	//	bra.s	<loop>

   F3SystemEEPROMAccess=&F3SysEEPROMAccessMode2;


   set_colour_mapper(&col_map_xxxx_xxxx_rrrr_rrrr_gggg_gggg_bbbb_bbbb);
   InitPaletteMap(RAM+0x60000, 0x200, 0x40, 0x8000);


   // Init tc0003vcu emulation
   // ------------------------

   tc0003vcu.RAM	= RAM+0x20000;
   tc0003vcu.mapper	= &Map_24bit_xRGB;
   tc0003vcu.bmp_x	= 64;
   tc0003vcu.bmp_y	= 64;
   tc0003vcu.bmp_w	= 320;
   tc0003vcu.bmp_h	= 232;
   tc0003vcu.scr_x	= 0;
   tc0003vcu.scr_y	= 0;

   // Init tc0200obj emulation
   // ------------------------

   tc0200obj.RAM	= RAM+0x20000;
   tc0200obj.RAM_B	= RAM+0x28000;
   tc0200obj.GFX	= GFX_SPR;
   tc0200obj.MASK	= GFX_SPR_SOLID;
   tc0200obj.bmp_x	= 64;
   tc0200obj.bmp_y	= 64;
   tc0200obj.bmp_w	= 320;
   tc0200obj.bmp_h	= 232;
   tc0200obj.mapper	= &Map_24bit_xRGB;
   tc0200obj.tile_mask	= 0x3FFF;
   tc0200obj.ofs_x	= 0-0x2E;
   tc0200obj.ofs_y	= 0-0x18;

   tc0200obj.cols	= 16;

   init_tc0200obj();

   init_f3_system_ioc(F3_IOC_2P_3BUTTON);

   init_m68k();
   setup_sound_68000();
}
Exemple #3
0
static void load_gekirido(void)
{
    int ta,tb,tc;

    RAMSize=0x80000;

    if(!(GFX=AllocateMem(0x698900+0x544800))) return;
    if(!(RAM=AllocateMem(0x80000))) return;
    if(!(ROM=AllocateMem(0x1A6240))) return;

    GFX_BG0 = GFX+0x000000;
    GFX_SPR = GFX+0x698900;

    if(!load_rom("E11-03.bin", ROM, 0x151200)) return;	// 16x16 SPRITES ($5448)
    tb=0;
    for(ta=0; ta<0x151200; ta++,tb+=4) {
        WriteWord(&GFX_SPR[tb],((ROM[ta])|(ROM[ta]<<4))&0x0F0F);
    }
    if(!load_rom("E11-02.bin", ROM, 0x151200)) return;	// 16x16 SPRITES
    tb=2;
    for(ta=0; ta<0x151200; ta++,tb+=4) {
        WriteWord(&GFX_SPR[tb],((ROM[ta])|(ROM[ta]<<4))&0x0F0F);
    }
    tb=0;
    if(!load_rom("E11-01.bin", ROM, 0x151200)) return;	// 16x16 SPRITES (MASK)
    for(ta=0; ta<0x151200; ta++) {
        tc=ROM[ta];
        GFX_SPR[tb+3]|=((tc&0x40)>>6)<<4;
        GFX_SPR[tb+2]|=((tc&0x10)>>4)<<4;
        GFX_SPR[tb+1]|=((tc&0x04)>>2)<<4;
        GFX_SPR[tb+0]|=((tc&0x01)>>0)<<4;
        tb+=4;
    }

    tb=0;
    if(!load_rom("E11-08.bin", ROM, 0x1A6240)) return;	// 16x16 TILES ($6989)
    for(ta=0; ta<0x1A6240; ta+=2,tb+=8) {
        WriteWord(&GFX_BG0[tb+0],((ROM[ta+0])|(ROM[ta+0]<<4))&0x0F0F);
        WriteWord(&GFX_BG0[tb+2],((ROM[ta+1])|(ROM[ta+1]<<4))&0x0F0F);
    }
    tb=4;
    if(!load_rom("E11-07.bin", ROM, 0x1A6240)) return;	// 16x16 TILES
    for(ta=0; ta<0x1A6240; ta+=2,tb+=8) {
        WriteWord(&GFX_BG0[tb+0],((ROM[ta+0])|(ROM[ta+0]<<4))&0x0F0F);
        WriteWord(&GFX_BG0[tb+2],((ROM[ta+1])|(ROM[ta+1]<<4))&0x0F0F);
    }
    tb=0;
    if(!load_rom("E11-06.bin", ROM, 0x1A6240)) return;	// 16x16 TILES (MASK)
    for(ta=0; ta<0x1A6240; ta+=2) {
        tc=ROM[ta];
        GFX_BG0[tb+7]|=((tc&0x80)>>7)<<4;
        GFX_BG0[tb+6]|=((tc&0x40)>>6)<<4;
        GFX_BG0[tb+5]|=((tc&0x20)>>5)<<4;
        GFX_BG0[tb+4]|=((tc&0x10)>>4)<<4;
        GFX_BG0[tb+3]|=((tc&0x08)>>3)<<4;
        GFX_BG0[tb+2]|=((tc&0x04)>>2)<<4;
        GFX_BG0[tb+1]|=((tc&0x02)>>1)<<4;
        GFX_BG0[tb+0]|=((tc&0x01)>>0)<<4;
        tb+=8;
    }

    FreeMem(ROM);
    if(!(ROM=AllocateMem(0x100000))) return;

    Rotate16x16(GFX_BG0,0x6989);
    Flip16x16_X(GFX_BG0,0x6989);
    Rotate16x16(GFX_SPR,0x5448);
    Flip16x16_X(GFX_SPR,0x5448);

    GFX_BG0_SOLID = MakeSolidTileMap16x16(GFX_BG0, 0x6989);
    GFX_SPR_SOLID = make_solid_mask_16x16(GFX_SPR, 0x5448);

    // Setup 68020 Memory Map
    // ----------------------

    AddF3MemoryMap(0x100000);

    RAM_BG3=RAM+0x30000;
    RAM_BG2=RAM+0x31000;
    RAM_BG1=RAM+0x32000;
    RAM_BG0=RAM+0x33000;

    RAM_SCR3=RAM+0x6A000;
    RAM_SCR2=RAM+0x6A002;
    RAM_SCR1=RAM+0x6A004;
    RAM_SCR0=RAM+0x6A006;

    SCR3_XOFS=0xF900;
    SCR2_XOFS=0xF800;
    SCR1_XOFS=0xF700;
    SCR0_XOFS=0xF600;

    SCR3_YOFS=0xFF80;
    SCR2_YOFS=0xF400;
    SCR1_YOFS=0xF400;
    SCR0_YOFS=0xFF80;

    if(!load_rom("E11-12.bin", RAM, 0x40000)) return;
    for(ta=0; ta<0x40000; ta++) {
        ROM[(ta<<2)+0]=RAM[ta];
    }
    if(!load_rom("E11-11.bin", RAM, 0x40000)) return;
    for(ta=0; ta<0x40000; ta++) {
        ROM[(ta<<2)+1]=RAM[ta];
    }
    if(!load_rom("E11-10.bin", RAM, 0x40000)) return;
    for(ta=0; ta<0x40000; ta++) {
        ROM[(ta<<2)+2]=RAM[ta];
    }
    if(!load_rom("E11-09.bin", RAM, 0x40000)) return;
    for(ta=0; ta<0x40000; ta++) {
        ROM[(ta<<2)+3]=RAM[ta];
    }

    for(ta=0x104F4; ta<0x124F4; ta+=4) {			// swap words
        tb=ReadWord(&ROM[ta]);
        WriteWord(&ROM[ta],ReadWord(&ROM[ta+2]));
        WriteWord(&ROM[ta+2],tb);
    }

    Rotate8x8_4bpp(ROM+0x104F4,0x2000>>5);
    Flip8x8_4bpp_X(ROM+0x104F4,0x2000>>5);

    for(ta=0x104F4; ta<0x124F4; ta+=4) {			// swap words
        tb=ReadWord(&ROM[ta]);
        WriteWord(&ROM[ta],ReadWord(&ROM[ta+2]));
        WriteWord(&ROM[ta+2],tb);
    }

    for(ta=0x8EBD8; ta<0x8EC78; ta+=4) {			// swap words
        tb=ReadWord(&ROM[ta]);
        WriteWord(&ROM[ta],ReadWord(&ROM[ta+2]));
        WriteWord(&ROM[ta+2],tb);
    }

    Rotate8x8_4bpp(ROM+0x8EBD8,0x00A0>>5);
    Flip8x8_4bpp_X(ROM+0x8EBD8,0x00A0>>5);

    for(ta=0x8EBD8; ta<0x8EC78; ta+=4) {			// swap words
        tb=ReadWord(&ROM[ta]);
        WriteWord(&ROM[ta],ReadWord(&ROM[ta+2]));
        WriteWord(&ROM[ta+2],tb);
    }

    for(ta=0xF6820; ta<0xF6D60; ta+=4) {			// swap words
        tb=ReadWord(&ROM[ta]);
        WriteWord(&ROM[ta],ReadWord(&ROM[ta+2]));
        WriteWord(&ROM[ta+2],tb);
    }

    Rotate8x8_4bpp(ROM+0xF6820,0x0540>>5);
    Flip8x8_4bpp_X(ROM+0xF6820,0x0540>>5);

    for(ta=0xF6820; ta<0xF6D60; ta+=4) {			// swap words
        tb=ReadWord(&ROM[ta]);
        WriteWord(&ROM[ta],ReadWord(&ROM[ta+2]));
        WriteWord(&ROM[ta+2],tb);
    }

    // 68000 code
    M68000ROM = load_region[REGION_ROM2];
    if(!(PCMROM=AllocateMem(0x800000))) return;
    load_be("e11-04.bin",PCMROM,0x200000);
    load_be("e11-05.bin",PCMROM+0x400000,0x200000);
    max_banks_this_game=3; //=memory_region_length(REGION_SOUND1)/0x400000;

    memset(RAM+0x00000,0x00,0x80000);
    memset(RAM+0x69000,0xFF,0x01000);

    // EEPROM HACK
    // -----------

    WriteWord68k(&ROM[0x0044F8],0x7F00);		//	raine	#$00	<eeprom read/write>
    WriteWord68k(&ROM[0x0044FA],0x4ED6);		//	jmp	(a6)

    // SPEED HACKS
    // -----------

    WriteWord68k(&ROM[0x002340],0x7F02);		//	raine	#$02 <stop cpu>
    WriteWord68k(&ROM[0x002342],0x6100-10);	//	bra.s	<loop>

    F3SystemEEPROMAccess=&F3SysEEPROMAccessMode2;


    set_colour_mapper(&col_map_xxxx_xxxx_rrrr_rrrr_gggg_gggg_bbbb_bbbb);
    InitPaletteMap(RAM+0x60000, 0x200, 0x40, 0x8000);

    // Init tc0003vcu emulation
    // ------------------------

    tc0003vcu.RAM	= RAM+0x20000;
// Mapper disabled
    tc0003vcu.bmp_x	= 64;
    tc0003vcu.bmp_y	= 64;
    tc0003vcu.bmp_w	= 232;
    tc0003vcu.bmp_h	= 320;
    tc0003vcu.scr_x	= 0;
    tc0003vcu.scr_y	= 0;

    // Init tc0200obj emulation
    // ------------------------

    tc0200obj.RAM	= RAM+0x20000;
    tc0200obj.RAM_B	= RAM+0x28000;
    tc0200obj.GFX	= GFX_SPR;
    tc0200obj.MASK	= GFX_SPR_SOLID;
    tc0200obj.bmp_x	= 64;
    tc0200obj.bmp_y	= 64;
    tc0200obj.bmp_w	= 232;
    tc0200obj.bmp_h	= 320;
// Mapper disabled
    tc0200obj.tile_mask	= 0x7FFF;
    tc0200obj.ofs_x	= 0;	//-16;		//(0-0x0C)-16;		// 0x0C 0x1F
    tc0200obj.ofs_y	= 0;		//0-0x2E;	//(0-0x1F)+15;	// 0x1F 0x2E

    tc0200obj.cols	= 32;

    init_tc0200obj();

    init_f3_system_ioc(F3_IOC_2P_3BUTTON);

    init_m68k();
    setup_sound_68000();
}