summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/neoboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/neoboot.c')
-rw-r--r--src/mame/machine/neoboot.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c
index 26a6940e17a..037f6581412 100644
--- a/src/mame/machine/neoboot.c
+++ b/src/mame/machine/neoboot.c
@@ -21,8 +21,8 @@
void neogeo_bootleg_cx_decrypt( running_machine *machine )
{
int i;
- int cx_size = memory_region_length( machine, RGNCLASS_GFX, "sprites" );
- UINT8 *rom = memory_region( machine, RGNCLASS_GFX, "sprites" );
+ int cx_size = memory_region_length( machine, "sprites" );
+ UINT8 *rom = memory_region( machine, "sprites" );
UINT8 *buf = malloc_or_die( cx_size );
memcpy( buf, rom, cx_size );
@@ -36,8 +36,8 @@ void neogeo_bootleg_cx_decrypt( running_machine *machine )
void neogeo_bootleg_sx_decrypt( running_machine *machine, int value )
{
- int sx_size = memory_region_length( machine, RGNCLASS_GFX, "fixed" );
- UINT8 *rom = memory_region( machine, RGNCLASS_GFX, "fixed" );
+ int sx_size = memory_region_length( machine, "fixed" );
+ UINT8 *rom = memory_region( machine, "fixed" );
int i;
if (value == 1)
@@ -69,9 +69,9 @@ void neogeo_bootleg_sx_decrypt( running_machine *machine, int value )
void kog_px_decrypt( running_machine *machine )
{
/* the protection chip does some *very* strange things to the rom */
- UINT8 *src = memory_region(machine, RGNCLASS_CPU, "main");
+ UINT8 *src = memory_region(machine, "main");
UINT8 *dst = malloc_or_die( 0x600000 );
- UINT16 *rom = (UINT16 *)memory_region(machine, RGNCLASS_CPU, "main");
+ UINT16 *rom = (UINT16 *)memory_region(machine, "main");
int i;
static const int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
@@ -151,10 +151,10 @@ static READ16_HANDLER( kof10th_RAMB_r )
static WRITE16_HANDLER( kof10th_custom_w )
{
if (!kof10thExtraRAMB[0xFFE]) { // Write to RAM bank A
- UINT16 *prom = (UINT16*)memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT16 *prom = (UINT16*)memory_region( machine, "main" );
COMBINE_DATA(&prom[(0xE0000/2) + (offset & 0xFFFF)]);
} else { // Write S data on-the-fly
- UINT8 *srom = memory_region( machine, RGNCLASS_GFX, "fixed" );
+ UINT8 *srom = memory_region( machine, "fixed" );
srom[offset] = BITSWAP8(data,7,6,0,4,3,2,1,5);
}
}
@@ -165,7 +165,7 @@ static WRITE16_HANDLER( kof10th_bankswitch_w )
if (offset == 0x5FFF8) { // Standard bankswitch
kof10thBankswitch(data);
} else if (offset == 0x5FFFC && kof10thExtraRAMB[0xFFC] != data) { // Special bankswitch
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT8 *src = memory_region( machine, "main" );
memcpy (src + 0x10000, src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff);
}
COMBINE_DATA(&kof10thExtraRAMB[offset & 0xFFF]);
@@ -183,7 +183,7 @@ void decrypt_kof10th(running_machine *machine)
{
int i, j;
UINT8 *dst = malloc_or_die(0x900000);
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT8 *src = memory_region( machine, "main" );
memcpy(dst + 0x000000, src + 0x700000, 0x100000); // Correct (Verified in Uni-bios)
memcpy(dst + 0x100000, src + 0x000000, 0x800000);
@@ -207,10 +207,10 @@ void decrypt_kof10th(running_machine *machine)
void decrypt_kf10thep(running_machine *machine)
{
int i;
- UINT16 *rom = (UINT16*)memory_region(machine, RGNCLASS_CPU, "main");
- UINT8 *src = memory_region(machine, RGNCLASS_CPU, "main");
- UINT16 *buf = (UINT16*)memory_region(machine, RGNCLASS_USER, "audioencrypted");
- UINT8 *srom = (UINT8*)memory_region(machine, RGNCLASS_GFX, "fixed");
+ UINT16 *rom = (UINT16*)memory_region(machine, "main");
+ UINT8 *src = memory_region(machine, "main");
+ UINT16 *buf = (UINT16*)memory_region(machine, "audioencrypted");
+ UINT8 *srom = (UINT8*)memory_region(machine, "fixed");
UINT8 *sbuf = malloc_or_die(0x20000);
UINT8 *dst = malloc_or_die(0x200000);
@@ -244,7 +244,7 @@ void decrypt_kf10thep(running_machine *machine)
static void kf2k5uni_px_decrypt( running_machine *machine )
{
int i, j, ofst;
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT8 *src = memory_region( machine, "main" );
UINT8 *dst = malloc_or_die(0x80);
for (i = 0; i < 0x800000; i+=0x80)
@@ -264,7 +264,7 @@ static void kf2k5uni_px_decrypt( running_machine *machine )
static void kf2k5uni_sx_decrypt( running_machine *machine )
{
int i;
- UINT8 *srom = memory_region( machine, RGNCLASS_GFX, "fixed" );
+ UINT8 *srom = memory_region( machine, "fixed" );
for (i = 0; i < 0x20000; i++)
srom[i] = BITSWAP8(srom[i], 4, 5, 6, 7, 0, 1, 2, 3);
@@ -273,7 +273,7 @@ static void kf2k5uni_sx_decrypt( running_machine *machine )
static void kf2k5uni_mx_decrypt( running_machine *machine )
{
int i;
- UINT8 *mrom = memory_region( machine, RGNCLASS_CPU, "audio" );
+ UINT8 *mrom = memory_region( machine, "audio" );
for (i = 0; i < 0x30000; i++)
mrom[i] = BITSWAP8(mrom[i], 4, 5, 6, 7, 0, 1, 2, 3);
@@ -292,7 +292,7 @@ void kf2k2mp_decrypt( running_machine *machine )
{
int i,j;
- UINT8 *src = memory_region(machine, RGNCLASS_CPU, "main");
+ UINT8 *src = memory_region(machine, "main");
UINT8 *dst = malloc_or_die(0x80);
memmove(src, src + 0x300000, 0x500000);
@@ -314,7 +314,7 @@ void kf2k2mp_decrypt( running_machine *machine )
void kof2km2_px_decrypt( running_machine *machine )
{
- UINT8 *src = memory_region(machine, RGNCLASS_CPU, "main");
+ UINT8 *src = memory_region(machine, "main");
UINT8 *dst = malloc_or_die(0x600000);
memcpy (dst + 0x000000, src + 0x1C0000, 0x040000);
@@ -335,7 +335,7 @@ static void cthd2003_neogeo_gfx_address_fix_do(running_machine *machine, int sta
int tilesize=128;
UINT8* rom = malloc_or_die(16*tilesize); // 16 tiles buffer
- UINT8* realrom = memory_region(machine, RGNCLASS_GFX, "sprites") + start*tilesize;
+ UINT8* realrom = memory_region(machine, "sprites") + start*tilesize;
for (i = 0; i < (end-start)/16; i++) {
for (j = 0; j < 16; j++) {
@@ -388,7 +388,7 @@ static void cthd2003_c(running_machine *machine, int pow)
void decrypt_cthd2003( running_machine *machine )
{
- UINT8 *romdata = memory_region(machine, RGNCLASS_GFX, "fixed");
+ UINT8 *romdata = memory_region(machine, "fixed");
UINT8 *tmp = malloc_or_die(8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
@@ -397,7 +397,7 @@ void decrypt_cthd2003( running_machine *machine )
memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128);
memcpy(romdata, tmp, 8*128*128);
- romdata = memory_region(machine, RGNCLASS_CPU, "audio")+0x10000;
+ romdata = memory_region(machine, "audio")+0x10000;
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128);
@@ -429,7 +429,7 @@ void patch_cthd2003( running_machine *machine )
{
/* patches thanks to razoola */
int i;
- UINT16 *mem16 = (UINT16 *)memory_region(machine, RGNCLASS_CPU, "main");
+ UINT16 *mem16 = (UINT16 *)memory_region(machine, "main");
/* special ROM banking handler */
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2fffff, 0, 0, cthd2003_bankswitch_w);
@@ -470,8 +470,8 @@ void patch_cthd2003( running_machine *machine )
static void ct2k3sp_sx_decrypt( running_machine *machine )
{
- int rom_size = memory_region_length( machine, RGNCLASS_GFX, "fixed" );
- UINT8 *rom = memory_region( machine, RGNCLASS_GFX, "fixed" );
+ int rom_size = memory_region_length( machine, "fixed" );
+ UINT8 *rom = memory_region( machine, "fixed" );
UINT8 *buf = malloc_or_die( rom_size );
int i;
int ofst;
@@ -500,7 +500,7 @@ static void ct2k3sp_sx_decrypt( running_machine *machine )
void decrypt_ct2k3sp( running_machine *machine )
{
- UINT8 *romdata = memory_region(machine, RGNCLASS_CPU, "audio")+0x10000;
+ UINT8 *romdata = memory_region(machine, "audio")+0x10000;
UINT8*tmp = malloc_or_die(8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
@@ -518,7 +518,7 @@ void decrypt_ct2k3sp( running_machine *machine )
void decrypt_ct2k3sa( running_machine *machine )
{
- UINT8 *romdata = memory_region(machine, RGNCLASS_CPU, "audio")+0x10000;
+ UINT8 *romdata = memory_region(machine, "audio")+0x10000;
UINT8*tmp = malloc_or_die(8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
@@ -535,7 +535,7 @@ void patch_ct2k3sa( running_machine *machine )
{
/* patches thanks to razoola - same as for cthd2003*/
int i;
- UINT16 *mem16 = (UINT16 *)memory_region(machine, RGNCLASS_CPU, "main");
+ UINT16 *mem16 = (UINT16 *)memory_region(machine, "main");
// theres still a problem on the character select screen but it seems to be related to cpu core timing issues,
// overclocking the 68k prevents it.
@@ -574,7 +574,7 @@ void patch_ct2k3sa( running_machine *machine )
void decrypt_kof2k4se_68k( running_machine *machine )
{
- UINT8 *src = memory_region(machine, RGNCLASS_CPU, "main")+0x100000;
+ UINT8 *src = memory_region(machine, "main")+0x100000;
UINT8 *dst = malloc_or_die(0x400000);
int i;
static const int sec[] = {0x300000,0x200000,0x100000,0x000000};
@@ -592,7 +592,7 @@ void decrypt_kof2k4se_68k( running_machine *machine )
void lans2004_vx_decrypt( running_machine *machine )
{
int i;
- UINT8 *rom = memory_region( machine, RGNCLASS_SOUND, "ym" );
+ UINT8 *rom = memory_region( machine, "ym" );
for (i = 0; i < 0xA00000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 5, 4, 3, 2, 6, 7);
}
@@ -601,8 +601,8 @@ void lans2004_decrypt_68k( running_machine *machine )
{
/* Descrambling P ROMs - Thanks to Razoola for the info */
int i;
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
- UINT16 *rom = (UINT16*)memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT8 *src = memory_region( machine, "main" );
+ UINT16 *rom = (UINT16*)memory_region( machine, "main" );
UINT8 *dst = malloc_or_die(0x600000);
{
@@ -674,8 +674,8 @@ void svcboot_px_decrypt( running_machine *machine )
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
int i;
- int size = memory_region_length( machine, RGNCLASS_CPU, "main" );
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ int size = memory_region_length( machine, "main" );
+ UINT8 *src = memory_region( machine, "main" );
UINT8 *dst = malloc_or_die( size );
int ofst;
for( i = 0; i < size / 0x100000; i++ ){
@@ -705,8 +705,8 @@ void svcboot_cx_decrypt( running_machine *machine )
{ 3, 0, 2, 1 },
};
int i;
- int size = memory_region_length( machine, RGNCLASS_GFX, "sprites" );
- UINT8 *src = memory_region( machine, RGNCLASS_GFX, "sprites" );
+ int size = memory_region_length( machine, "sprites" );
+ UINT8 *src = memory_region( machine, "sprites" );
UINT8 *dst = malloc_or_die( size );
int ofst;
memcpy( dst, src, size );
@@ -730,8 +730,8 @@ void svcplus_px_decrypt( running_machine *machine )
static const int sec[] = {
0x00, 0x03, 0x02, 0x05, 0x04, 0x01
};
- int size = memory_region_length( machine, RGNCLASS_CPU, "main" );
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ int size = memory_region_length( machine, "main" );
+ UINT8 *src = memory_region( machine, "main" );
UINT8 *dst = malloc_or_die( size );
int i;
int ofst;
@@ -756,7 +756,7 @@ void svcplus_px_decrypt( running_machine *machine )
void svcplus_px_hack( running_machine *machine )
{
/* patched by the protection chip? */
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT8 *src = memory_region( machine, "main" );
src[ 0x0f8010 ] = 0x40;
src[ 0x0f8011 ] = 0x04;
src[ 0x0f8012 ] = 0x00;
@@ -773,8 +773,8 @@ void svcplusa_px_decrypt( running_machine *machine )
static const int sec[] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
- int size = memory_region_length( machine, RGNCLASS_CPU, "main" );
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ int size = memory_region_length( machine, "main" );
+ UINT8 *src = memory_region( machine, "main" );
UINT8 *dst = malloc_or_die( size );
memcpy( dst, src, size );
for( i = 0; i < 6; i++ ){
@@ -790,8 +790,8 @@ void svcsplus_px_decrypt( running_machine *machine )
static const int sec[] = {
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
- int size = memory_region_length( machine, RGNCLASS_CPU, "main" );
- UINT8 *src = memory_region( machine, RGNCLASS_CPU, "main" );
+ int size = memory_region_length( machine, "main" );
+ UINT8 *src = memory_region( machine, "main" );
UINT8 *dst = malloc_or_die( size );
int i;
int ofst;
@@ -812,7 +812,7 @@ void svcsplus_px_decrypt( running_machine *machine )
void svcsplus_px_hack( running_machine *machine )
{
/* patched by the protection chip? */
- UINT16 *mem16 = (UINT16 *)memory_region(machine, RGNCLASS_CPU, "main");
+ UINT16 *mem16 = (UINT16 *)memory_region(machine, "main");
mem16[0x9e90/2] = 0x000f;
mem16[0x9e92/2] = 0xc9c0;
mem16[0xa10c/2] = 0x4eb9;
@@ -857,7 +857,7 @@ static WRITE16_HANDLER( kof2003_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff1)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)memory_region(machine, RGNCLASS_CPU, "main");
+ UINT8* mem = (UINT8 *)memory_region(machine, "main");
cr[BYTE_XOR_LE(0x1ff0)] = 0xa0;
cr[BYTE_XOR_LE(0x1ff1)] &= 0xfe;
@@ -875,7 +875,7 @@ static WRITE16_HANDLER( kof2003p_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff0)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)memory_region(machine, RGNCLASS_CPU, "main");
+ UINT8* mem = (UINT8 *)memory_region(machine, "main");
cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe;
cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
@@ -893,7 +893,7 @@ void kof2003b_px_decrypt( running_machine *machine )
};
int rom_size = 0x800000;
- UINT8 *rom = memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT8 *rom = memory_region( machine, "main" );
UINT8 *buf = malloc_or_die( rom_size );
memcpy( buf, rom, rom_size );
@@ -916,7 +916,7 @@ void kof2003b_install_protection(running_machine *machine)
void kof2k3pl_px_decrypt( running_machine *machine )
{
UINT16*tmp = malloc_or_die(0x100000);
- UINT16*rom = (UINT16*)memory_region( machine, RGNCLASS_CPU, "main" );
+ UINT16*rom = (UINT16*)memory_region( machine, "main" );
int j;
int i;
@@ -946,7 +946,7 @@ void kf2k3pl_install_protection(running_machine *machine)
void kof2k3up_px_decrypt( running_machine *machine )
{
{
- UINT8 *src = memory_region(machine, RGNCLASS_CPU, "main");
+ UINT8 *src = memory_region(machine, "main");
memmove(src+0x100000, src, 0x600000);
memmove(src, src+0x700000, 0x100000);
}
@@ -955,8 +955,8 @@ void kof2k3up_px_decrypt( running_machine *machine )
int ofst;
int i;
- UINT8 *rom = memory_region( machine, RGNCLASS_CPU, "main" ) + 0xfe000;
- UINT8 *buf = memory_region( machine, RGNCLASS_CPU, "main" ) + 0xd0610;
+ UINT8 *rom = memory_region( machine, "main" ) + 0xfe000;
+ UINT8 *buf = memory_region( machine, "main" ) + 0xd0610;
for( i = 0; i < 0x2000 / 2; i++ ){
ofst = (i & 0xff00) + BITSWAP8( (i & 0x00ff), 7, 6, 0, 4, 3, 2, 1, 5 );
@@ -974,8 +974,8 @@ void kof2k3up_install_protection(running_machine *machine)
void samsh5bl_px_decrypt( running_machine *machine )
{
- int px_size = memory_region_length( machine, RGNCLASS_CPU, "main" );
- UINT8 *rom = memory_region( machine, RGNCLASS_CPU, "main" );
+ int px_size = memory_region_length( machine, "main" );
+ UINT8 *rom = memory_region( machine, "main" );
UINT8 *buf = malloc_or_die( px_size );
int ofst;
int i;