diff options
Diffstat (limited to 'src/mame/video/konamiic.c')
-rw-r--r-- | src/mame/video/konamiic.c | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c index 2b27cac1a61..8b98d262317 100644 --- a/src/mame/video/konamiic.c +++ b/src/mame/video/konamiic.c @@ -1186,16 +1186,16 @@ static void shuffle(UINT16 *buf,int len) /* helper function to join two 16-bit ROMs and form a 32-bit data stream */ void konami_rom_deinterleave_2(const char *mem_region) { - shuffle((UINT16 *)memory_region(Machine, RGNCLASS_GFX, mem_region),memory_region_length(Machine, RGNCLASS_GFX, mem_region)/2); + shuffle((UINT16 *)memory_region(Machine, mem_region),memory_region_length(Machine, mem_region)/2); } /* hacked version of rom_deinterleave_2_half for Lethal Enforcers */ void konami_rom_deinterleave_2_half(const char *mem_region) { - UINT8 *rgn = memory_region(Machine, RGNCLASS_GFX, mem_region); + UINT8 *rgn = memory_region(Machine, mem_region); - shuffle((UINT16 *)rgn,memory_region_length(Machine, RGNCLASS_GFX, mem_region)/4); - shuffle((UINT16 *)(rgn+memory_region_length(Machine, RGNCLASS_GFX, mem_region)/2),memory_region_length(Machine, RGNCLASS_GFX, mem_region)/4); + shuffle((UINT16 *)rgn,memory_region_length(Machine, mem_region)/4); + shuffle((UINT16 *)(rgn+memory_region_length(Machine, mem_region)/2),memory_region_length(Machine, mem_region)/4); } /* helper function to join four 16-bit ROMs and form a 64-bit data stream */ @@ -2020,13 +2020,13 @@ void K052109_vh_start(running_machine *machine,const char *gfx_memory_region,int switch (plane_order) { case NORMAL_PLANE_ORDER: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 32; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout, 4); + total = memory_region_length(machine, gfx_memory_region) / 32; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout, 4); break; case GRADIUS3_PLANE_ORDER: total = 0x1000; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout_gradius3, 4); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout_gradius3, 4); break; default: @@ -2120,11 +2120,11 @@ else (*K052109_callback)(0,bank,&code,&color,&flags,&priority); addr = (code << 5) + (offset & 0x1f); - addr &= memory_region_length(machine, RGNCLASS_GFX, K052109_memory_region)-1; + addr &= memory_region_length(machine, K052109_memory_region)-1; // logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n",activecpu_get_pc(),offset,K052109_romsubbank,bank,addr); - return memory_region(machine, RGNCLASS_GFX, K052109_memory_region)[addr]; + return memory_region(machine, K052109_memory_region)[addr]; } } @@ -2527,18 +2527,18 @@ void K051960_vh_start(running_machine *machine,const char *gfx_memory_region,int switch (plane_order) { case NORMAL_PLANE_ORDER: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 128; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &spritelayout, 4); + total = memory_region_length(machine, gfx_memory_region) / 128; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &spritelayout, 4); break; case REVERSE_PLANE_ORDER: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 128; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &spritelayout_reverse, 4); + total = memory_region_length(machine, gfx_memory_region) / 128; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &spritelayout_reverse, 4); break; case GRADIUS3_PLANE_ORDER: total = 0x4000; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &spritelayout_gradius3, 4); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &spritelayout_gradius3, 4); break; default: @@ -2587,11 +2587,11 @@ static int K051960_fetchromdata(running_machine *machine, int byte) (*K051960_callback)(&code,&color,&pri,&shadow); addr = (code << 7) | (off1 << 2) | byte; - addr &= memory_region_length(machine, RGNCLASS_GFX, K051960_memory_region)-1; + addr &= memory_region_length(machine, K051960_memory_region)-1; // popmessage("%04x: addr %06x",activecpu_get_pc(),addr); - return memory_region(machine, RGNCLASS_GFX, K051960_memory_region)[addr]; + return memory_region(machine, K051960_memory_region)[addr]; } READ8_HANDLER( K051960_r ) @@ -3030,8 +3030,8 @@ void K053245_vh_start(running_machine *machine,int chip, const char *gfx_memory_ switch (plane_order) { case NORMAL_PLANE_ORDER: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 128; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &spritelayout, 4); + total = memory_region_length(machine, gfx_memory_region) / 128; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &spritelayout, 4); break; default: @@ -3133,11 +3133,11 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset) addr = (K053244_rombank[chip] << 19) | ((K053244_regs[chip][11] & 0x7) << 18) | (K053244_regs[chip][8] << 10) | (K053244_regs[chip][9] << 2) | ((offset & 3) ^ 1); - addr &= memory_region_length(machine, RGNCLASS_GFX, K053245_memory_region[chip])-1; + addr &= memory_region_length(machine, K053245_memory_region[chip])-1; // popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset&3,addr); - return memory_region(machine, RGNCLASS_GFX, K053245_memory_region[chip])[addr]; + return memory_region(machine, K053245_memory_region[chip])[addr]; } else if (offset == 0x06) { @@ -3773,8 +3773,8 @@ void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, i switch (plane_order) { case NORMAL_PLANE_ORDER: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 128; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &spritelayout, 4); + total = memory_region_length(machine, gfx_memory_region) / 128; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &spritelayout, 4); break; default: @@ -3881,19 +3881,19 @@ void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, i break; assert(gfx_index != MAX_GFX_ELEMENTS); - K055673_rom = (UINT16 *)memory_region(machine, RGNCLASS_GFX, gfx_memory_region); + K055673_rom = (UINT16 *)memory_region(machine, gfx_memory_region); /* decode the graphics */ switch(layout) { case K055673_LAYOUT_GX: - size4 = (memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region)/(1024*1024))/5; + size4 = (memory_region_length(machine, gfx_memory_region)/(1024*1024))/5; size4 *= 4*1024*1024; /* set the # of tiles based on the 4bpp section */ K055673_rom = auto_malloc(size4 * 5); d = (UINT8 *)K055673_rom; // now combine the graphics together to form 5bpp - s1 = memory_region(machine, RGNCLASS_GFX, gfx_memory_region); // 4bpp area + s1 = memory_region(machine, gfx_memory_region); // 4bpp area s2 = s1 + (size4); // 1bpp area for (i = 0; i < size4; i+= 4) { @@ -3909,17 +3909,17 @@ void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, i break; case K055673_LAYOUT_RNG: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (16*16/2); + total = memory_region_length(machine, gfx_memory_region) / (16*16/2); decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout2, 4); break; case K055673_LAYOUT_LE2: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (16*16); + total = memory_region_length(machine, gfx_memory_region) / (16*16); decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout3, 4); break; case K055673_LAYOUT_GX6: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (16*16*6/8); + total = memory_region_length(machine, gfx_memory_region) / (16*16*6/8); decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout4, 4); break; @@ -4021,9 +4021,9 @@ WRITE8_HANDLER( K053247_w ) // in this window, +0 = 32 bits from one set of ROMs, and +8 = 32 bits from another set READ16_HANDLER( K055673_rom_word_r ) // 5bpp { - UINT8 *ROM8 = (UINT8 *)memory_region(machine, RGNCLASS_GFX, K053247_memory_region); - UINT16 *ROM = (UINT16 *)memory_region(machine, RGNCLASS_GFX, K053247_memory_region); - int size4 = (memory_region_length(machine, RGNCLASS_GFX, K053247_memory_region)/(1024*1024))/5; + UINT8 *ROM8 = (UINT8 *)memory_region(machine, K053247_memory_region); + UINT16 *ROM = (UINT16 *)memory_region(machine, K053247_memory_region); + int size4 = (memory_region_length(machine, K053247_memory_region)/(1024*1024))/5; int romofs; size4 *= 4*1024*1024; // get offset to 5th bit @@ -4065,7 +4065,7 @@ READ16_HANDLER( K055673_rom_word_r ) // 5bpp READ16_HANDLER( K055673_GX6bpp_rom_word_r ) { - UINT16 *ROM = (UINT16 *)memory_region(machine, RGNCLASS_GFX, K053247_memory_region); + UINT16 *ROM = (UINT16 *)memory_region(machine, K053247_memory_region); int romofs; romofs = K053246_regs[6]<<16 | K053246_regs[7]<<8 | K053246_regs[4]; @@ -4110,10 +4110,10 @@ READ8_HANDLER( K053246_r ) int addr; addr = (K053246_regs[6] << 17) | (K053246_regs[7] << 9) | (K053246_regs[4] << 1) | ((offset & 1) ^ 1); - addr &= memory_region_length(machine, RGNCLASS_GFX, K053247_memory_region)-1; + addr &= memory_region_length(machine, K053247_memory_region)-1; if (VERBOSE) popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset,addr); - return memory_region(machine, RGNCLASS_GFX, K053247_memory_region)[addr]; + return memory_region(machine, K053247_memory_region)[addr]; } else { @@ -4674,22 +4674,22 @@ static void K051316_vh_start(running_machine *machine,int chip, const char *gfx_ case -4: total = 0x400; bpp = 4; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout_tail2nos, 4); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout_tail2nos, 4); break; case 4: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 128; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout4, 4); + total = memory_region_length(machine, gfx_memory_region) / 128; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout4, 4); break; case 7: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 256; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout7, 7); + total = memory_region_length(machine, gfx_memory_region) / 256; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout7, 7); break; case 8: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 256; - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout8, 8); + total = memory_region_length(machine, gfx_memory_region) / 256; + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout8, 8); break; default: @@ -4796,11 +4796,11 @@ static int K051316_rom_r(running_machine *machine, int chip, int offset) addr = offset + (K051316_ctrlram[chip][0x0c] << 11) + (K051316_ctrlram[chip][0x0d] << 19); if (K051316_bpp[chip] <= 4) addr /= 2; - addr &= memory_region_length(machine, RGNCLASS_GFX, K051316_memory_region[chip])-1; + addr &= memory_region_length(machine, K051316_memory_region[chip])-1; // popmessage("%04x: offset %04x addr %04x",activecpu_get_pc(),offset,addr); - return memory_region(machine, RGNCLASS_GFX, K051316_memory_region[chip])[addr]; + return memory_region(machine, K051316_memory_region[chip])[addr]; } else { @@ -5710,33 +5710,33 @@ void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, i switch (bpp) { case K056832_BPP_4: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (i*4); - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout4, 4); + total = memory_region_length(machine, gfx_memory_region) / (i*4); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout4, 4); break; case K056832_BPP_5: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (i*5); - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout5, 4); + total = memory_region_length(machine, gfx_memory_region) / (i*5); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout5, 4); break; case K056832_BPP_6: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (i*6); - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout6, 4); + total = memory_region_length(machine, gfx_memory_region) / (i*6); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout6, 4); break; case K056832_BPP_8: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (i*8); - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout8, 4); + total = memory_region_length(machine, gfx_memory_region) / (i*8); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout8, 4); break; case K056832_BPP_8LE: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (i*8); - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout8le, 4); + total = memory_region_length(machine, gfx_memory_region) / (i*8); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout8le, 4); break; case K056832_BPP_4dj: - total = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / (i*4); - decode_gfx(machine, gfx_index, memory_region(machine, RGNCLASS_GFX, gfx_memory_region), total, &charlayout4dj, 4); + total = memory_region_length(machine, gfx_memory_region) / (i*4); + decode_gfx(machine, gfx_index, memory_region(machine, gfx_memory_region), total, &charlayout4dj, 4); break; default: @@ -5749,8 +5749,8 @@ void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, i K056832_gfxnum = gfx_index; K056832_callback = callback; - K056832_rombase = memory_region(machine, RGNCLASS_GFX, gfx_memory_region); - K056832_NumGfxBanks = memory_region_length(machine, RGNCLASS_GFX, gfx_memory_region) / 0x2000; + K056832_rombase = memory_region(machine, gfx_memory_region); + K056832_NumGfxBanks = memory_region_length(machine, gfx_memory_region) / 0x2000; K056832_CurGfxBank = 0; K056832_use_ext_linescroll = 0; K056832_uses_tile_banks = 0; @@ -5848,7 +5848,7 @@ static int K056832_rom_read_b(running_machine *machine, int offset, int blksize, UINT8 *rombase; int base, ret; - rombase = (UINT8 *)memory_region(machine, RGNCLASS_GFX, K056832_memory_region); + rombase = (UINT8 *)memory_region(machine, K056832_memory_region); if ((K056832_rom_half) && (zerosec)) { @@ -5958,7 +5958,7 @@ READ16_HANDLER( K056832_rom_word_r ) if (!K056832_rombase) { - K056832_rombase = memory_region(machine, RGNCLASS_GFX, K056832_memory_region); + K056832_rombase = memory_region(machine, K056832_memory_region); } rombase = (UINT8 *)K056832_rombase; @@ -5984,7 +5984,7 @@ READ16_HANDLER( K056832_mw_rom_word_r ) if (!K056832_rombase) { - K056832_rombase = memory_region(machine, RGNCLASS_GFX, K056832_memory_region); + K056832_rombase = memory_region(machine, K056832_memory_region); } if (K056832_regsb[2] & 0x8) @@ -6048,7 +6048,7 @@ READ16_HANDLER( K056832_bishi_rom_word_r ) if (!K056832_rombase) { - K056832_rombase = memory_region(machine, RGNCLASS_GFX, K056832_memory_region); + K056832_rombase = memory_region(machine, K056832_memory_region); } return K056832_rombase[addr+2] | (K056832_rombase[addr] << 8); @@ -6060,7 +6060,7 @@ READ16_HANDLER( K056832_rom_word_8000_r ) if (!K056832_rombase) { - K056832_rombase = memory_region(machine, RGNCLASS_GFX, K056832_memory_region); + K056832_rombase = memory_region(machine, K056832_memory_region); } return K056832_rombase[addr+2] | (K056832_rombase[addr] << 8); @@ -6072,7 +6072,7 @@ READ16_HANDLER( K056832_old_rom_word_r ) if (!K056832_rombase) { - K056832_rombase = memory_region(machine, RGNCLASS_GFX, K056832_memory_region); + K056832_rombase = memory_region(machine, K056832_memory_region); } return K056832_rombase[addr+1] | (K056832_rombase[addr] << 8); @@ -7510,8 +7510,8 @@ void K053250_unpack_pixels(const char *region) UINT8 *src_ptr, *dst_ptr; int hi_nibble, lo_nibble, offset; - dst_ptr = src_ptr = memory_region(Machine, RGNCLASS_GFX, region); - offset = memory_region_length(Machine, RGNCLASS_GFX, region) / 2 - 1; + dst_ptr = src_ptr = memory_region(Machine, region); + offset = memory_region_length(Machine, region) / 2 - 1; do { @@ -7533,14 +7533,14 @@ void K053250_vh_start(int chips, const char **region) for(chip=0; chip<chips; chip++) { - K053250_info.chip[chip].base = memory_region(Machine, RGNCLASS_GFX, region[chip]); + K053250_info.chip[chip].base = memory_region(Machine, region[chip]); ram = auto_malloc(0x6000); K053250_info.chip[chip].ram = ram; K053250_info.chip[chip].rammax = ram + 0x800; K053250_info.chip[chip].buffer[0] = ram + 0x2000; K053250_info.chip[chip].buffer[1] = ram + 0x2800; memset(ram+0x2000, 0, 0x2000); - K053250_info.chip[chip].rommask = memory_region_length(Machine, RGNCLASS_GFX, region[chip]); + K053250_info.chip[chip].rommask = memory_region_length(Machine, region[chip]); K053250_info.chip[chip].page[1] = K053250_info.chip[chip].page[0] = 0; K053250_info.chip[chip].offsy = K053250_info.chip[chip].offsx = 0; K053250_info.chip[chip].frame = -1; |