konamigx: small cleanup to spacing

This commit is contained in:
hap 2025-04-01 13:49:41 +02:00
parent 7feaa6968d
commit 90b86c79b6
5 changed files with 319 additions and 323 deletions

View File

@ -187,7 +187,8 @@
- Tokimeki Memorial: wrong horizontal flip for mode select arrows;
*/
static struct sprite_entry {
static struct sprite_entry
{
int pri;
uint32_t adr;
} sprites[0x100];
@ -197,14 +198,16 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
int scount = 0;
int ecount = 0;
for(int i=0; i<count; i++) {
for (int i = 0; i < count; i++)
{
uint32_t adr = src + 0x100*i;
int pri;
if(!space.read_word(adr+2))
if (!space.read_word(adr+2))
continue;
pri = space.read_word(adr+28);
if(pri < 256) {
if (pri < 256)
{
sprites[ecount].pri = pri;
sprites[ecount].adr = adr;
ecount++;
@ -212,9 +215,11 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
}
//qsort(sprites, ecount, sizeof(struct sprite_entry), pri_comp);
for(int i=0; i<ecount; i++) {
for (int i = 0; i < ecount; i++)
{
uint32_t adr = sprites[i].adr;
if(adr) {
if (adr)
{
uint32_t set =(space.read_word(adr) << 16)|space.read_word(adr+2);
uint16_t glob_x = space.read_word(adr+4);
uint16_t glob_y = space.read_word(adr+8);
@ -230,77 +235,82 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
uint16_t v;
v = space.read_word(adr+24);
if(v & 0x8000) {
if (v & 0x8000)
{
color_mask = 0xf3ff;
color_val |= (v & 3) << 10;
}
v = space.read_word(adr+26);
if(v & 0x8000) {
if (v & 0x8000)
{
color_mask &= 0xfcff;
color_val |= (v & 3) << 8;
}
v = space.read_word(adr+18);
if(v & 0x8000) {
if (v & 0x8000)
{
color_mask &= 0xff1f;
color_val |= v & 0xe0;
}
v = space.read_word(adr+16);
if(v & 0x8000)
if (v & 0x8000)
color_set = v & 0x1f;
if(v & 0x4000)
if (v & 0x4000)
color_rotate = v & 0x1f;
if(!zoom_x)
if (!zoom_x)
zoom_x = 0x40;
if(!zoom_y)
if (!zoom_y)
zoom_y = 0x40;
if(set >= 0x200000 && set < 0xd00000)
if (set >= 0x200000 && set < 0xd00000)
{
uint16_t count2 = space.read_word(set);
set += 2;
while(count2) {
while(count2)
{
uint16_t idx = space.read_word(set);
uint16_t flip = space.read_word(set+2);
uint16_t col = space.read_word(set+4);
short y = space.read_word(set+6);
short x = space.read_word(set+8);
if(idx == 0xffff) {
if (idx == 0xffff)
{
set = (flip<<16) | col;
if(set >= 0x200000 && set < 0xd00000)
if (set >= 0x200000 && set < 0xd00000)
continue;
else
break;
}
if(zoom_y != 0x40)
if (zoom_y != 0x40)
y = y*0x40/zoom_y;
if(zoom_x != 0x40)
if (zoom_x != 0x40)
x = x*0x40/zoom_x;
if(flip_x)
if (flip_x)
x = glob_x - x;
else
x = glob_x + x;
if(x < -256 || x > 512+32)
if (x < -256 || x > 512+32)
goto next;
if(flip_y)
if (flip_y)
y = glob_y - y;
else
y = glob_y + y;
if(y < -256 || y > 512)
if (y < -256 || y > 512)
goto next;
col = (col & color_mask) | color_val;
if(color_set)
if (color_set)
col = (col & 0xffe0) | color_set;
if(color_rotate)
if (color_rotate)
col = (col & 0xffe0) | ((col + color_rotate) & 0x1f);
space.write_word(spr , (flip ^ glob_f) | sprites[i].pri);
@ -312,7 +322,7 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
space.write_word(spr+12, col);
spr += 16;
scount++;
if(scount == 256)
if (scount == 256)
return;
next:
count2--;
@ -321,7 +331,8 @@ void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32
}
}
}
while(scount < 256) {
while(scount < 256)
{
space.write_word(spr, scount);
scount++;
spr += 16;
@ -384,7 +395,7 @@ void konamigx_state::esc_w(address_space &space, uint32_t data)
}
/* the master opcode can be at an unaligned address, so get it "safely" */
opcode = (space.read_word(data+2))|(space.read_word(data)<<16);
opcode = (space.read_word(data+2)) | (space.read_word(data) << 16);
/* if there's an OBJECT_MAGIC_ID, that means
there is a valid ESC command packet. */
@ -395,11 +406,12 @@ void konamigx_state::esc_w(address_space &space, uint32_t data)
opcode = space.read_byte(data+8);
params = (space.read_word(data+12) << 16) | space.read_word(data+14);
switch(opcode) {
switch (opcode)
{
case 5: // Reset
break;
case 2: // Load program
for(i=0; i<4096; i++)
for (i = 0; i < 4096; i++)
m_esc_program[i] = space.read_byte(params+i);
/*
{
@ -414,7 +426,8 @@ void konamigx_state::esc_w(address_space &space, uint32_t data)
*/
break;
case 1: // Run program
if(m_esc_cb) {
if (m_esc_cb)
{
uint32_t p1 = (space.read_word(params+0)<<16) | space.read_word(params+2);
uint32_t p2 = (space.read_word(params+4)<<16) | space.read_word(params+6);
uint32_t p3 = (space.read_word(params+8)<<16) | space.read_word(params+10);
@ -547,7 +560,7 @@ void konamigx_state::control_w(offs_t offset, uint32_t data, uint32_t mem_mask)
m_gx_wrport2 = (data>>16)&0xff;
if(m_prev_pixel_clock != (m_gx_wrport2 & 3))
if (m_prev_pixel_clock != (m_gx_wrport2 & 3))
{
m_k053252->set_unscaled_clock(pixclock[m_gx_wrport2 & 3]);
m_prev_pixel_clock = m_gx_wrport2 & 3;
@ -613,7 +626,7 @@ void konamigx_state::dmastart_callback(int data)
// simulate DMA delay
// TODO: Rushing Heroes doesn't like reported sprite timings, probably due of sprite protection being issued istantly or requires the double buffering ...
if(m_gx_rushingheroes_hack == 1)
if (m_gx_rushingheroes_hack == 1)
sprite_timing = 64;
else
sprite_timing = m_gx_wrport2 & 1 ? (256+32) : (342+42);
@ -650,7 +663,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_type2_scanline)
{
int scanline = param;
if(scanline == 48)
if (scanline == 48)
{
if (m_gx_syncen & 0x40)
{
@ -686,7 +699,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_type4_scanline)
// maybe this interrupt should only be every 30fps, or maybe there are flags to prevent the game running too fast
// the real hardware should output the display for each screen on alternate frames
// if(device->m_screen->frame_number() & 1)
// if (device->m_screen->frame_number() & 1)
if (1) // m_gx_syncen & 0x20)
{
m_gx_syncen &= ~0x20;
@ -701,7 +714,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_type4_scanline)
dmastart_callback(0);
}
else if(scanline < 240) // hblank
else if (scanline < 240) // hblank
{
// IRQ 2 is a programmable interrupt with scanline resolution
if (m_gx_syncen & 0x40)
@ -740,22 +753,22 @@ double konamigx_state::adc0834_callback(uint8_t input)
uint32_t konamigx_state::le2_gun_H_r()
{
int p1x = m_light0_x->read()*290/0xff+20;
int p2x = m_light1_x->read()*290/0xff+20;
int p1x = m_light0_x->read()* 290 /0xff + 20;
int p2x = m_light1_x->read()* 290 /0xff + 20;
return (p1x<<16)|p2x;
return (p1x << 16) | p2x;
}
uint32_t konamigx_state::le2_gun_V_r()
{
int p1y = m_light0_y->read()*224/0xff;
int p2y = m_light1_y->read()*224/0xff;
int p1y = m_light0_y->read() * 224 / 0xff;
int p2y = m_light1_y->read() * 224 / 0xff;
// make "off the bottom" reload too
if (p1y >= 0xdf) p1y = 0;
if (p2y >= 0xdf) p2y = 0;
return (p1y<<16)|p2y;
return (p1y << 16) | p2y;
}
/**********************************************************************************/
@ -779,10 +792,10 @@ uint32_t konamigx_state::type1_roz_r2(offs_t offset)
uint32_t konamigx_state::type3_sync_r()
{
if(m_konamigx_current_frame==0)
return -1; // return 0xfffffffe | 1;
if (m_konamigx_current_frame == 0)
return -1; // return 0xfffffffe | 1;
else
return 0;// return 0xfffffffe | 0;
return 0; // return 0xfffffffe | 0;
}
@ -900,7 +913,7 @@ void konamigx_state::type4_prot_w(address_space &space, offs_t offset, uint32_t
space.write_word(0xc01400+i, space.read_word(0xc01000+i));
}
}
else if(m_last_prot_op == 0x57a) // winspike
else if (m_last_prot_op == 0x57a) // winspike
{
/* player 1 input buffer protection */
space.write_dword(0xc10f00, space.read_dword(0xc00f10));
@ -912,7 +925,7 @@ void konamigx_state::type4_prot_w(address_space &space, offs_t offset, uint32_t
space.write_dword(0xc0fe00, space.read_dword(0xc00f30));
space.write_dword(0xc0fe04, space.read_dword(0xc00f34));
}
else if(m_last_prot_op == 0xd97) // rushhero
else if (m_last_prot_op == 0xd97) // rushhero
{
u32 src = 0xc09ff0;
u32 dst = 0xd20000;
@ -952,7 +965,7 @@ void konamigx_state::type4_prot_w(address_space &space, offs_t offset, uint32_t
space.write_byte(0xc11cc0 + 5, ~space.read_byte(0xc00507 + 0x60));
}
else if(m_last_prot_op == 0xb16) // slamdnk2
else if (m_last_prot_op == 0xb16) // slamdnk2
{
int src = 0xc01000;
int dst = 0xd20000;
@ -981,14 +994,14 @@ void konamigx_state::type4_prot_w(address_space &space, offs_t offset, uint32_t
dst += 2;
}
}
else if(m_last_prot_op == 0x515) // vsnetscr screen 1
else if (m_last_prot_op == 0x515) // vsnetscr screen 1
{
int adr;
//printf("GXT4: command %x %d (PC=%x)\n", m_last_prot_op, cc++, m_maincpu->pc());
for (adr = 0; adr < 0x400; adr += 2)
space.write_word(0xc01c00+adr, space.read_word(0xc01800+adr));
}
else if(m_last_prot_op == 0x115d) // vsnetscr screen 2
else if (m_last_prot_op == 0x115d) // vsnetscr screen 2
{
int adr;
//printf("GXT4: command %x %d (PC=%x)\n", m_last_prot_op, cc++, m_maincpu->pc());
@ -2104,7 +2117,7 @@ ROM_START(konamigx)
ROM_END
#define SPR_WOR_DROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(5))
#define SPR_5TH_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(5))
#define SPR_5TH_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(5))
#define TILE_WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPDWORD | ROM_SKIP(1))
#define TILE_BYTE_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(4))
@ -2115,7 +2128,7 @@ ROM_END
#define T1_PSAC6_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(2))
#define T1_PSAC8_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPBYTE | ROM_SKIP(3))
#define _48_WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(4))
#define _48_WORD_ROM_LOAD(name,offset,length,crc) ROMX_LOAD(name, offset, length, crc, ROM_GROUPWORD | ROM_SKIP(4))
/* Gokujou Parodius version JAD (Japan) */

View File

@ -255,7 +255,6 @@ protected:
u8 m_current_brightness = 0xff;
u8 m_brightness[3]{};
u8 m_last_alpha_tile_mix_code = 0;
// mirrored K054338 settings

View File

@ -98,19 +98,19 @@ void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_m
// gameplay. It refers to a 32x8-word list at 0x210e00 and seems to
// be tied with another 13x128-byte table at 0x205080.
// Both tables appear "check-only" and have little effect on gameplay.
count =(m_prot_data[0] & 0xff) + 1; // unknown ( byte 0x00)
i = m_prot_data[1]; // unknown ( byte 0x1f)
adr = m_prot_data[7]<<16 | m_prot_data[8]; // address (dword 0x210e00)
lim = m_prot_data[9]; // unknown ( word 0x0010)
src = m_prot_data[10]<<16 | m_prot_data[11]; // unknown (dword zero)
tgt = m_prot_data[12]<<16 | m_prot_data[13]; // unknown (dword zero)
count =(m_prot_data[0] & 0xff) + 1; // unknown ( byte 0x00)
i = m_prot_data[1]; // unknown ( byte 0x1f)
adr = m_prot_data[7] << 16 | m_prot_data[8]; // address (dword 0x210e00)
lim = m_prot_data[9]; // unknown ( word 0x0010)
src = m_prot_data[10] << 16 | m_prot_data[11]; // unknown (dword zero)
tgt = m_prot_data[12] << 16 | m_prot_data[13]; // unknown (dword zero)
break;
case 0xa0: // update collision detection table (Violent Storm at 0x018b42)
count = m_prot_data[0] & 0xff; // number of objects - 1
skip = m_prot_data[1]>>(8-1); // words to skip in each entry to reach the "hit list"
adr = m_prot_data[2]<<16 | m_prot_data[3]; // where the table is located
bsize = m_prot_data[5]<<16 | m_prot_data[6]; // object entry size in bytes
count = m_prot_data[0] & 0xff; // number of objects - 1
skip = m_prot_data[1] >> (8 - 1); // words to skip in each entry to reach the "hit list"
adr = m_prot_data[2] << 16 | m_prot_data[3]; // where the table is located
bsize = m_prot_data[5] << 16 | m_prot_data[6]; // object entry size in bytes
srcend = adr + bsize * count;
tgtend = srcend + bsize;
@ -185,7 +185,7 @@ void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_m
break;
default:
// logerror("%06x: unknown K055550 command %02x\n", m_maincpu->pc(), data);
//logerror("%06x: unknown K055550 command %02x\n", m_maincpu->pc(), data);
break;
}
}
@ -204,7 +204,7 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1
if (offset == 0x0c && ACCESSING_BITS_8_15)
{
mode = (m_prot_data[0x0d]<<8 & 0xff00) | (m_prot_data[0x0f] & 0xff);
mode = (m_prot_data[0x0d] << 8 & 0xff00) | (m_prot_data[0x0f] & 0xff);
switch (mode)
{
@ -213,11 +213,11 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1
[[fallthrough]];
case 0xff00: // byte copy
src_addr = m_prot_data[0x0];
src_addr |= m_prot_data[0x1]<<16 & 0xff0000;
src_addr |= m_prot_data[0x1] << 16 & 0xff0000;
dst_addr = m_prot_data[0x2];
dst_addr |= m_prot_data[0x3]<<16 & 0xff0000;
src_count = m_prot_data[0x8]>>8;
//dst_count = m_prot_data[0x9]>>8;
dst_addr |= m_prot_data[0x3] << 16 & 0xff0000;
src_count = m_prot_data[0x8] >> 8;
//dst_count = m_prot_data[0x9] >> 8;
src_skip = m_prot_data[0xa] & 0xff;
dst_skip = m_prot_data[0xb] & 0xff;
@ -242,14 +242,14 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1
case 0x00ff: // sprite list modifier
src_addr = m_prot_data[0x0];
src_addr |= m_prot_data[0x1]<<16 & 0xff0000;
src_skip = m_prot_data[0x1]>>8;
src_addr |= m_prot_data[0x1] << 16 & 0xff0000;
src_skip = m_prot_data[0x1] >> 8;
dst_addr = m_prot_data[0x2];
dst_addr |= m_prot_data[0x3]<<16 & 0xff0000;
dst_skip = m_prot_data[0x3]>>8;
dst_addr |= m_prot_data[0x3] << 16 & 0xff0000;
dst_skip = m_prot_data[0x3] >> 8;
mod_addr = m_prot_data[0x4];
mod_addr |= m_prot_data[0x5]<<16 & 0xff0000;
mod_skip = m_prot_data[0x5]>>8;
mod_addr |= m_prot_data[0x5] << 16 & 0xff0000;
mod_skip = m_prot_data[0x5] >> 8;
mod_offs = m_prot_data[0x8] & 0xff;
mod_offs<<= 1;
mod_count = 0x100;
@ -257,7 +257,7 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1
src_addr += mod_offs;
dst_addr += mod_offs;
for (i=mod_count; i; i--)
for (i = mod_count; i; i--)
{
mod_val = mspace.read_word(mod_addr);
mod_addr += mod_skip;
@ -287,30 +287,30 @@ void konamigx_state::konamigx_esc_alert(uint32_t *srcbase, int srcoffs, int coun
// hand-filled but should be close
static const uint8_t ztable[7][8] =
{
{5,4,3,2,1,7,6,0},
{4,3,2,1,0,7,6,5},
{4,3,2,1,0,7,6,5},
{3,2,1,0,5,7,4,6},
{6,5,1,4,3,7,0,2},
{5,4,3,2,1,7,6,0},
{5,4,3,2,1,7,6,0}
{ 5, 4, 3, 2, 1, 7, 6, 0 },
{ 4, 3, 2, 1, 0, 7, 6, 5 },
{ 4, 3, 2, 1, 0, 7, 6, 5 },
{ 3, 2, 1, 0, 5, 7, 4, 6 },
{ 6, 5, 1, 4, 3, 7, 0, 2 },
{ 5, 4, 3, 2, 1, 7, 6, 0 },
{ 5, 4, 3, 2, 1, 7, 6, 0 }
};
static const uint8_t ptable[7][8] =
{
{0x00,0x00,0x00,0x10,0x20,0x00,0x00,0x30},
{0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x20},
{0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00},
{0x10,0x10,0x10,0x20,0x00,0x00,0x10,0x00},
{0x00,0x00,0x20,0x00,0x10,0x00,0x20,0x20},
{0x00,0x00,0x00,0x10,0x10,0x00,0x00,0x10},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10}
{ 0x00, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x30 },
{ 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x20, 0x20 },
{ 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00 },
{ 0x10, 0x10, 0x10, 0x20, 0x00, 0x00, 0x10, 0x00 },
{ 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x20, 0x20 },
{ 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 }
};
int32_t data1, data2, i, j, vpos, hpos, voffs, hoffs, vcorr, hcorr, vmask, magicid;
uint32_t *src, *srcend, *obj, *objend;
uint16_t *dst;
const uint8_t *zcode, *pcode;
const uint8_t *zcode, *pcode;
if (!count || !srcbase) return;
@ -318,8 +318,8 @@ static const uint8_t ptable[7][8] =
{
src = srcbase + srcoffs;
dst = k053247_ram;
data1 = count<<2;
data2 = count<<3;
data1 = count << 2;
data2 = count << 3;
src += data1; dst += data2; i = -data1; j = -data2;
do
{
@ -337,34 +337,35 @@ static const uint8_t ptable[7][8] =
}
else
{
#define EXTRACT_ODD \
if((data1=obj[0])&0x8000) \
{ \
i = data1 & 7; \
data1 &= 0xff00; \
dst[0] = data1 | zcode[i];\
data1 = obj[1]; \
dst[1] = data1>>16; \
vpos = data1 & 0xffff; \
data1 = obj[2]; \
vpos += voffs; \
dst[4] = data1; \
vpos &= vmask; \
hpos = data1>>16; \
data1 = obj[3]; \
hpos += hoffs; \
dst[2] = vpos; \
dst[3] = hpos; \
dst[5] = data1>>16; \
i = pcode[i]; \
dst[6] = data1| i<<4; \
dst += 8; \
if (!(--j)) return; \
#define EXTRACT_ODD \
if ((data1 = obj[0]) & 0x8000) \
{ \
i = data1 & 7; \
data1 &= 0xff00; \
dst[0] = data1 | zcode[i]; \
data1 = obj[1]; \
dst[1] = data1 >> 16; \
vpos = data1 & 0xffff; \
data1 = obj[2]; \
vpos += voffs; \
dst[4] = data1; \
vpos &= vmask; \
hpos = data1>>16; \
data1 = obj[3]; \
hpos += hoffs; \
dst[2] = vpos; \
dst[3] = hpos; \
dst[5] = data1 >> 16; \
i = pcode[i]; \
dst[6] = data1 | i << 4; \
dst += 8; \
if (!(--j)) return; \
}
#define EXTRACT_EVEN \
if((data1=obj[0])&0x80000000)\
{ \
#define EXTRACT_EVEN \
if((data1 = obj[0]) & 0x80000000) \
{ \
dst[1] = data1; \
data1>>= 16; \
i = data1 & 7; \
@ -372,7 +373,7 @@ if((data1=obj[0])&0x80000000)\
dst[0] = data1 | zcode[i]; \
data1 = obj[1]; \
hpos = data1 & 0xffff; \
vpos = data1>>16; \
vpos = data1 >> 16; \
hpos += hoffs; \
vpos += voffs; \
data1 = obj[2]; \
@ -380,10 +381,10 @@ if((data1=obj[0])&0x80000000)\
dst[3] = hpos; \
dst[2] = vpos; \
dst[5] = data1; \
dst[4] = data1>>16; \
data1 = obj[3]>>16; \
dst[4] = data1 >> 16; \
data1 = obj[3] >> 16; \
i = pcode[i]; \
dst[6] = data1 | i<<4; \
dst[6] = data1 | i << 4; \
dst += 8; \
if (!(--j)) return; \
}
@ -402,7 +403,7 @@ if((data1=obj[0])&0x80000000)\
case 0x11010010: i = 5; vmask = 0x1ff; break;
case 0x01111018: i = 4; break;
case 0x10010011: i = 3;
if ((srcbase[0x1c75] & 0xff) == 32) m_k055555->K055555_write_reg(K55_BLEND_ENABLES,36); // (TEMPORARY)
if ((srcbase[0x1c75] & 0xff) == 32) m_k055555->K055555_write_reg(K55_BLEND_ENABLES, 36); // (TEMPORARY)
break;
case 0x11010811: i = 2; break;
case 0x10000010: i = 1; break;
@ -495,23 +496,25 @@ void konamigx_state::fantjour_dma_w(offs_t offset, uint32_t data, uint32_t mem_m
{
auto &mspace = m_maincpu->space(AS_PROGRAM);
COMBINE_DATA(m_fantjour_dma + offset);
if (!offset && ACCESSING_BITS_24_31) {
if (!offset && ACCESSING_BITS_24_31)
{
uint32_t sa = m_fantjour_dma[1];
// uint16_t ss = (m_fantjour_dma[2] & 0xffff0000) >> 16;
// uint32_t sb = ((m_fantjour_dma[2] & 0xffff) << 16) | ((m_fantjour_dma[3] & 0xffff0000) >> 16);
// uint16_t ss = (m_fantjour_dma[2] & 0xffff0000) >> 16;
// uint32_t sb = ((m_fantjour_dma[2] & 0xffff) << 16) | ((m_fantjour_dma[3] & 0xffff0000) >> 16);
uint32_t da = ((m_fantjour_dma[3] & 0xffff) << 16) | ((m_fantjour_dma[4] & 0xffff0000) >> 16);
// uint16_t ds = m_fantjour_dma[4] & 0xffff;
// uint16_t ds = m_fantjour_dma[4] & 0xffff;
uint32_t db = m_fantjour_dma[5];
// uint8_t sz1 = m_fantjour_dma[0] >> 8;
// uint8_t sz1 = m_fantjour_dma[0] >> 8;
uint8_t sz2 = m_fantjour_dma[0] >> 16;
uint8_t mode = m_fantjour_dma[0] >> 24;
uint32_t x = m_fantjour_dma[6];
uint32_t x = m_fantjour_dma[6];
uint32_t i1, i2;
if (mode == 0x93)
{
for (i1 = 0; i1 <= sz2; i1++)
for (i2 = 0; i2 < db; i2 += 4)
{
@ -519,12 +522,15 @@ void konamigx_state::fantjour_dma_w(offs_t offset, uint32_t data, uint32_t mem_m
da += 4;
sa += 4;
}
}
else if (mode == 0x8f)
{
for (i1 = 0; i1 <= sz2; i1++)
for (i2 = 0; i2 < db; i2 += 4)
{
mspace.write_dword(da, x);
da += 4;
}
}
}
}

View File

@ -20,8 +20,8 @@ static inline void set_color_555(palette_device &palette, pen_t color, int rshif
void konamigx_state::konamigx_precache_registers(void)
{
// (see sprite color coding scheme on p.46 & 47)
static const int coregmasks[5] = {0xf,0xe,0xc,0x8,0x0};
static const int coregshifts[5]= {4,5,6,7,8};
static const int coregmasks[5] = { 0xf, 0xe, 0xc, 0x8, 0x0 };
static const int coregshifts[5]= { 4, 5, 6, 7, 8 };
int i;
i = m_k055673->k053247_read_register(0x8/2);
@ -36,7 +36,7 @@ void konamigx_state::konamigx_precache_registers(void)
i = m_k053247_opset & 7; if (i > 4) i = 4;
m_k053247_coreg = m_k055673->k053247_read_register(0xc/2)>>8 & 0xf;
m_k053247_coreg = m_k055673->k053247_read_register(0xc/2) >> 8 & 0xf;
m_k053247_coreg =(m_k053247_coreg & coregmasks[i]) << 12;
m_k053247_coregshift = coregshifts[i];
@ -64,10 +64,10 @@ inline int konamigx_state::K053247GX_combine_c18(int attrib) // (see p.46)
{
int c18;
c18 = (attrib & 0xff)<<m_k053247_coregshift | m_k053247_coreg;
c18 = (attrib & 0xff) << m_k053247_coregshift | m_k053247_coreg;
if (m_gx_wrport2 & 4) c18 &= 0x3fff; else
if (!(m_gx_wrport2 & 8)) c18 = (c18 & 0x3fff) | (attrib<<6 & 0xc000);
if (!(m_gx_wrport2 & 8)) c18 = (c18 & 0x3fff) | (attrib << 6 & 0xc000);
return(c18);
}
@ -76,12 +76,12 @@ inline int konamigx_state::K055555GX_decode_objcolor(int c18) // (see p.59 7.2.2
{
int ocb, opon;
opon = m_oinprion<<8 | 0xff;
opon = m_oinprion << 8 | 0xff;
ocb = (m_ocblk & 7) << 10;
c18 &= opon;
ocb &=~opon;
return((ocb | c18) >> m_k053247_coregshift);
return (ocb | c18) >> m_k053247_coregshift;
}
inline int konamigx_state::K055555GX_decode_inpri(int c18) // (see p.59 7.2.2)
@ -92,7 +92,7 @@ inline int konamigx_state::K055555GX_decode_inpri(int c18) // (see p.59 7.2.2)
op &= m_oinprion;
c18 &=~m_oinprion;
return(c18 | op);
return c18 | op;
}
K055673_CB_MEMBER(konamigx_state::type2_sprite_callback)
@ -100,7 +100,7 @@ K055673_CB_MEMBER(konamigx_state::type2_sprite_callback)
int num = *code;
int c18 = *color;
*code = m_k053247_vrcbk[num>>14] | (num & 0x3fff);
*code = m_k053247_vrcbk[num >> 14] | (num & 0x3fff);
c18 = K053247GX_combine_c18(c18);
*color = K055555GX_decode_objcolor(c18);
*priority_mask = K055555GX_decode_inpri(c18);
@ -111,11 +111,11 @@ K055673_CB_MEMBER(konamigx_state::dragoonj_sprite_callback)
int num, op, pri, c18;
num = *code;
*code = m_k053247_vrcbk[num>>14] | (num & 0x3fff);
*code = m_k053247_vrcbk[num >> 14] | (num & 0x3fff);
c18 = pri = *color;
op = m_opri;
pri = (pri & 0x200) ? 4 : pri>>4 & 0xf;
pri = (pri & 0x200) ? 4 : pri >> 4 & 0xf;
op &= m_oinprion;
pri &=~m_oinprion;
*priority_mask = pri | op;
@ -129,11 +129,11 @@ K055673_CB_MEMBER(konamigx_state::salmndr2_sprite_callback)
int num, op, pri, c18;
num = *code;
*code = m_k053247_vrcbk[num>>14] | (num & 0x3fff);
*code = m_k053247_vrcbk[num >> 14] | (num & 0x3fff);
c18 = pri = *color;
op = m_opri;
pri = pri>>4 & 0x3f;
pri = pri >> 4 & 0x3f;
op &= m_oinprion;
pri &=~m_oinprion;
*priority_mask = pri | op;
@ -147,7 +147,7 @@ K055673_CB_MEMBER(konamigx_state::le2_sprite_callback)
int num, op, pri;
num = *code;
*code = m_k053247_vrcbk[num>>14] | (num & 0x3fff);
*code = m_k053247_vrcbk[num >> 14] | (num & 0x3fff);
pri = *color;
*color &= 0x1f;
@ -163,12 +163,12 @@ int konamigx_state::K055555GX_decode_vmixcolor(int layer, int *color) // (see p.
{
int vcb, shift, pal, vmx, von, pl45, emx;
vcb = m_vcblk[layer]<<6;
shift = layer<<1;
vcb = m_vcblk[layer] << 6;
shift = layer << 1;
pal = *color;
vmx = m_vinmix>>shift & 3;
von = m_vmixon>>shift & 3;
emx = pl45 = pal>>4 & 3;
vmx = m_vinmix >> shift & 3;
von = m_vmixon >> shift & 3;
emx = pl45 = pal >> 4 & 3;
pal &= 0xf;
pl45 &= von;
vmx &= von;
@ -179,29 +179,29 @@ int konamigx_state::K055555GX_decode_vmixcolor(int layer, int *color) // (see p.
pal |= vcb;
//if (m_gx_le2_textcolour_hack)
// if (layer==0)
// if (layer == 0)
// pal |= 0x1c0;
if (von == 3) emx = -1; // invalidate external mix code if all bits are from internal
*color = pal;
return(emx);
return emx;
}
int konamigx_state::K055555GX_decode_osmixcolor(int layer, int *color) // (see p.63, p.49-50 and p.27 3.3)
{
int scb, shift, pal, osmx, oson, pl45, emx;
shift = layer<<1;
shift = layer << 1;
pal = *color;
osmx = m_osinmix>>shift & 3;
oson = m_osmixon>>shift & 3;
osmx = m_osinmix >> shift & 3;
oson = m_osmixon >> shift & 3;
if (layer)
{
// layer 1-3 are external tile layers
scb = m_vcblk[layer+3]<<6;
emx = pl45 = pal>>4 & 3;
scb = m_vcblk[layer + 3] << 6;
emx = pl45 = pal >> 4 & 3;
pal &= 0xf;
pl45 &= oson;
osmx &= oson;
@ -217,7 +217,7 @@ int konamigx_state::K055555GX_decode_osmixcolor(int layer, int *color) // (see p
else
{
// layer 0 is the sprite layer with different attributes decode; detail on p.49 (missing)
emx = 0; // k053247_read_register(??)>>? & 3;
emx = 0; // k053247_read_register(??) >> ? & 3;
osmx &= oson;
emx &=~oson;
emx |= osmx;
@ -243,14 +243,13 @@ void konamigx_state::wipezbuf(int noshadow)
zptr = m_gx_shdzbuf.get();
w <<= 1;
ecx = h;
do { memset(zptr, -1, w); zptr += (GX_ZBUFW<<1); } while (--ecx);
do { memset(zptr, -1, w); zptr += (GX_ZBUFW << 1); } while (--ecx);
}
}
void konamigx_state::set_brightness(int layer)
{
const uint8_t bri_mode = (m_k055555->K055555_read_register(K55_VBRI) >> layer * 2) & 0b11;
const uint8_t new_brightness = bri_mode ? m_brightness[bri_mode - 1] : 0xff;
if (m_current_brightness != new_brightness)
@ -314,7 +313,7 @@ void konamigx_state::konamigx_mixer_init(screen_device &screen, int objdma)
else
m_k055673->k053247_get_ram(&m_gx_spriteram);
m_palette->set_shadow_dRGB32(3,-80,-80,-80, 0);
m_palette->set_shadow_dRGB32(3, -80, -80, -80, 0);
m_k054338->invert_alpha(1);
}
@ -336,8 +335,6 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
tilemap_t *sub2, int sub2flags,
int mixerflags, bitmap_ind16 *extra_bitmap, int rushingheroes_hack)
{
// int prflp;
// buffer can move when it's resized, so refresh the pointer
m_gx_objzbuf = &screen.priority().pix(0);
@ -355,13 +352,12 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
if (!disp) return;
uint16_t cltc_shdpri = m_k054338->register_r(K338_REG_CONTROL);
if (!rushingheroes_hack) // Slam Dunk 2 never sets this. It's either part of the protection, or type4 doesn't use it
// Slam Dunk 2 never sets this. It's either part of the protection, or type4 doesn't use it
if (!rushingheroes_hack)
{
if (!(cltc_shdpri & K338_CTL_KILL)) return;
}
// demote shadows by one layer when this bit is set??? (see p.73 8.6)
cltc_shdpri &= K338_CTL_SHDPRI;
@ -375,11 +371,10 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
konamigx_precache_registers();
// init OBJSET2 and mixer parameters (see p.51 and chapter 7)
uint8_t layerid[6] = {0, 1, 2, 3, 4, 5};
uint8_t layerid[6] = { 0, 1, 2, 3, 4, 5 };
// invert layer priority when this flag is set (not used by any GX game?)
//prflp = K055555_read_register(K55_CONTROL) & K55_CTL_FLIPPRI;
//int prflp = K055555_read_register(K55_CONTROL) & K55_CTL_FLIPPRI;
uint8_t layerpri[6];
layerpri[0] = m_k055555->K055555_read_register(K55_PRIINP_0);
@ -420,9 +415,8 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
int k = 0;
if (!(mixerflags & GXMIX_NOSHADOW))
{
int i,j;
// only enable shadows beyond a +/-7 RGB threshold
for (j=0,i=0; i<3; j+=3,i++)
for (int j = 0, i = 0; i < 3; j += 3, i++)
{
k = m_K054338_shdRGB[j ]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; }
k = m_K054338_shdRGB[j+1]; if (k < -7 || k > 7) { shadowon[i] = 1; continue; }
@ -431,16 +425,16 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
// SHDON specifies layers on which shadows can be projected (see detail on p.65 7.2.8)
int temp = m_k055555->K055555_read_register(K55_SHD_ON);
for (i=0; i<4; i++) if (!(temp>>i & 1) && spri_min < layerpri[i]) spri_min = layerpri[i]; // HACK
for (int i = 0; i < 4; i++) if (!BIT(temp, i) && spri_min < layerpri[i]) spri_min = layerpri[i]; // HACK
// update shadows status
m_k054338->update_all_shadows(rushingheroes_hack, *m_palette);
}
// pre-sort layers
for (int j=0; j<5; j++)
for (int j = 0; j < 5; j++)
{
for (int i=j+1; i<6; i++)
for (int i = j + 1; i < 6; i++)
{
if (layerpri[j] <= layerpri[i])
{
@ -453,7 +447,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
// build object database and create indices
std::vector<GX_OBJ> objpool; // max size: 6 layers + 256 sprites + 256 shadows
for (int i=5; i>=0; i--)
for (int i = 5; i >= 0; i--)
{
int offs;
@ -470,11 +464,11 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
-4 : K053250 LVC layer 1
-5 : K053250 LVC layer 2
*/
case 4 :
case 4:
offs = -128;
if (sub1flags & 0xf) { if (sub1flags & GXSUB_K053250) offs = -4; else if (sub1) offs = -2; }
break;
case 5 :
case 5:
offs = -128;
if (sub2flags & 0xf) { if (sub2flags & GXSUB_K053250) offs = -5; else if (sub2) offs = -3; }
if (extra_bitmap) offs = -3;
@ -526,7 +520,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
}
else
{
shadow = k>>10 & 3;
shadow = k >> 10 & 3;
if (shadow) // object has shadow?
{
int k053246_objset1 = m_k055673->k053246_read_register(5);
@ -559,7 +553,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
if (add_solid)
{
// tag sprite for alpha blending
if (color>>K055555_MIXSHIFT & 3) solid_draw_mode |= 2;
if (color >> K055555_MIXSHIFT & 3) solid_draw_mode |= 2;
}
if (add_shadow)
@ -572,17 +566,17 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
switch (m_gx_primode & 0xf)
{
// Dadandarn zcode suppression
case 1:
case 1:
zcode = 0;
break;
// Daisukiss bad shadow filter
case 4:
case 4:
if (k & 0x3000 || k == 0x0800) continue;
[[fallthrough]];
// Tokkae shadow masking (INACCURATE)
case 5:
case 5:
if (spri < spri_min) spri = spri_min;
break;
}
@ -599,14 +593,14 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
if (add_solid)
{
// add objects with solid or alpha pens
uint32_t order = pri<<24 | zcode<<16 | offs<<(8-3) | solid_draw_mode<<4;
uint32_t order = pri << 24 | zcode << 16 | offs << (8 - 3) | solid_draw_mode << 4;
objpool.push_back(GX_OBJ{order, offs, code, color});
}
if (add_shadow && !(color & K055555_SKIPSHADOW) && !(mixerflags & GXMIX_NOSHADOW))
{
// add objects with shadows if enabled
uint32_t order = spri<<24 | zcode<<16 | offs<<(8-3) | shadow_draw_mode<<4 | shadow;
uint32_t order = spri << 24 | zcode << 16 | offs << (8 - 3) | shadow_draw_mode << 4 | shadow;
objpool.push_back(GX_OBJ{ order, offs, code, color});
}
}
@ -618,9 +612,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap,
return a.order > b.order;
});
konamigx_mixer_draw(screen,bitmap,cliprect,sub1,sub1flags,sub2,sub2flags,mixerflags,extra_bitmap,rushingheroes_hack,
objpool
);
konamigx_mixer_draw(screen, bitmap, cliprect, sub1, sub1flags, sub2, sub2flags, mixerflags, extra_bitmap, rushingheroes_hack, objpool);
}
void konamigx_state::konamigx_mixer_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect,
@ -635,7 +627,7 @@ void konamigx_state::konamigx_mixer_draw(screen_device &screen, bitmap_rgb32 &bi
// traverse draw list
const uint8_t disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES);
for (int count=0; count<objpool.size(); count++)
for (int count = 0; count < objpool.size(); count++)
{
const uint32_t order = objpool[count].order;
const int offs = objpool[count].offs;
@ -647,7 +639,7 @@ void konamigx_state::konamigx_mixer_draw(screen_device &screen, bitmap_rgb32 &bi
{
if (!(disp & K55_INP_OBJ)) continue;
int drawmode = order>>4 & 0xf;
int drawmode = order >> 4 & 0xf;
int alpha = 255;
int pri = 0;
@ -655,7 +647,7 @@ void konamigx_state::konamigx_mixer_draw(screen_device &screen, bitmap_rgb32 &bi
if (drawmode & 2)
{
alpha = color>>K055555_MIXSHIFT & 3;
alpha = color >> K055555_MIXSHIFT & 3;
if (alpha) alpha = m_k054338->set_alpha_level(alpha);
if (alpha <= 0) continue;
}
@ -665,15 +657,15 @@ void konamigx_state::konamigx_mixer_draw(screen_device &screen, bitmap_rgb32 &bi
if (!(mixerflags & GXMIX_NOZBUF))
{
zcode = order>>16 & 0xff;
pri = order>>24 & 0xff;
zcode = order >> 16 & 0xff;
pri = order >> 24 & 0xff;
}
m_k055673->k053247_draw_single_sprite_gxcore(bitmap, cliprect,
m_gx_objzbuf, m_gx_shdzbuf.get(), code, m_gx_spriteram, offs,
color, alpha, drawmode, zcode, pri,
/* non-gx only */
0,0,nullptr,nullptr,0
0, 0, nullptr, nullptr, 0
);
}
/* the rest are tilemaps of various kinda */
@ -766,9 +758,9 @@ void konamigx_state::gx_draw_basic_tilemaps(screen_device &screen, bitmap_rgb32
void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int mixerflags, int code, tilemap_t *sub1, int sub1flags, int rushingheroes_hack, int offs)
{
int temp1,temp2,temp3,temp4;
int i = code<<1;
int j = mixerflags>>i & 3;
int temp1, temp2, temp3, temp4;
int i = code << 1;
int j = mixerflags >> i & 3;
int k = 0;
int disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES);
@ -777,15 +769,15 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bi
int alpha = 255;
if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else
if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags>>24; temp3 = 3; }
if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags >> 24; temp3 = 3; }
else
{
temp1 = m_osinmix;
temp2 = m_osinmix>>2 & 3;
temp3 = m_osmixon>>2 & 3;
temp2 = m_osinmix >> 2 & 3;
temp3 = m_osmixon >> 2 & 3;
}
if (temp1!=0xff && temp2 /*&& temp3==3*/)
if (temp1 != 0xff && temp2 /*&& temp3 == 3*/)
{
alpha = temp4 = m_k054338->set_alpha_level(temp2) & 0xff;
@ -801,14 +793,14 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bi
const rectangle &visarea = screen.visible_area();
int width = visarea.width();
if (width>512) // vsnetscr case
if (width > 512) // vsnetscr case
pixeldouble_output = 1;
K053936GP_0_zoom_draw(machine(), bitmap, cliprect, sub1, l, k, alpha, pixeldouble_output, m_k053936_0_ctrl_16, m_k053936_0_linectrl_16, m_k053936_0_ctrl, m_k053936_0_linectrl, *m_palette);
}
else
{
m_k053250_1->draw(bitmap, cliprect, m_vcblk[4]<<l, 0, screen.priority(), 0);
m_k053250_1->draw(bitmap, cliprect, m_vcblk[4] << l, 0, screen.priority(), 0);
}
}
}
@ -816,23 +808,23 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_1(screen_device &screen, bi
void konamigx_state::gx_draw_basic_extended_tilemaps_2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int mixerflags, int code, tilemap_t *sub2, int sub2flags, bitmap_ind16 *extra_bitmap, int offs)
{
int temp1,temp2,temp3,temp4;
int i = code<<1;
int j = mixerflags>>i & 3;
int i = code << 1;
int j = mixerflags >> i & 3;
int disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES);
if (disp & K55_INP_SUB2)
{
//int alpha = 255;
if (j == GXMIX_BLEND_NONE) { temp1 = 0xff; temp2 = temp3 = 0; } else
if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags>>26; temp3 = 3; }
if (j == GXMIX_BLEND_FORCE) { temp1 = 0x00; temp2 = mixerflags >> 26; temp3 = 3; }
else
{
temp1 = m_osinmix;
temp2 = m_osinmix>>4 & 3;
temp3 = m_osmixon>>4 & 3;
temp2 = m_osinmix >> 4 & 3;
temp3 = m_osmixon >> 4 & 3;
}
if (temp1!=0xff && temp2 /*&& temp3==3*/)
if (temp1 != 0xff && temp2 /*&& temp3==3*/)
{
//alpha =
temp4 = m_k054338->set_alpha_level(temp2) & 0xff;
@ -856,27 +848,27 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_2(screen_device &screen, bi
// to be done as a post-processing / mixing step effect
//
// - todo, use the pixeldouble_output I just added for vsnet instead?
for (int yy=0;yy<height;yy++)
for (int yy = 0; yy < height; yy++)
{
uint16_t const *const src = &extra_bitmap->pix(yy);
uint32_t *const dst = &bitmap.pix(yy);
int shiftpos = 0;
for (int xx=0;xx<width;xx+=2)
for (int xx = 0; xx < width; xx += 2)
{
uint16_t dat = src[(((xx/2)+shiftpos))%width];
if (dat&0xff)
dst[xx+1] = dst[xx] = paldata[dat];
uint16_t dat = src[(((xx / 2) + shiftpos)) % width];
if (dat & 0xff)
dst[xx + 1] = dst[xx] = paldata[dat];
}
}
}
else
{
// int pixeldouble_output = 0;
// K053936GP_1_zoom_draw(machine, bitmap, cliprect, sub2, l, k, alpha, pixeldouble_output);
// int pixeldouble_output = 0;
// K053936GP_1_zoom_draw(machine, bitmap, cliprect, sub2, l, k, alpha, pixeldouble_output);
}
}
else
m_k053250_2->draw(bitmap, cliprect, m_vcblk[5]<<l, 0, screen.priority(), 0);
m_k053250_2->draw(bitmap, cliprect, m_vcblk[5] << l, 0, screen.priority(), 0);
}
}
@ -884,18 +876,18 @@ void konamigx_state::gx_draw_basic_extended_tilemaps_2(screen_device &screen, bi
TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac_tile_info)
{
int tileno, colour, col, flip = 0;
if (tile_index&1)
if (tile_index & 1)
{
tileno = m_psacram[tile_index/2] & 0x00001fff;
col =(m_psacram[tile_index/2] & 0x00002000)>>13;
col =(m_psacram[tile_index/2] & 0x00002000) >> 13;
if (m_psacram[tile_index/2] & 0x00004000) flip |= TILE_FLIPX;
if (m_psacram[tile_index/2] & 0x00008000) flip |= TILE_FLIPY;
}
else
{
tileno = (m_psacram[tile_index/2] & 0x1fff0000)>>16;
col = (m_psacram[tile_index/2] & 0x20000000)>>29;
tileno = (m_psacram[tile_index/2] & 0x1fff0000) >> 16;
col = (m_psacram[tile_index/2] & 0x20000000) >> 29;
if (m_psacram[tile_index/2] & 0x40000000) flip |= TILE_FLIPX;
if (m_psacram[tile_index/2] & 0x80000000) flip |= TILE_FLIPY;
@ -945,13 +937,12 @@ TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac3_tile_info)
// if (m_konamigx_type3_psac2_actual_bank)
// base_index+=0x20000/2;
tileno = tmap[base_index*2] | ((tmap[(base_index*2)+1] & 0x0f)<<8);
colour = (tmap[(base_index*2)+1]&0xc0)>>6;
tileno = tmap[base_index*2] | ((tmap[(base_index*2) + 1] & 0x0f) << 8);
colour = (tmap[(base_index*2) + 1] & 0xc0) >> 6;
flip = 0;
if (tmap[(base_index*2)+1] & 0x20) flip |= TILE_FLIPY;
if (tmap[(base_index*2)+1] & 0x10) flip |= TILE_FLIPX;
if (tmap[(base_index*2) + 1] & 0x20) flip |= TILE_FLIPY;
if (tmap[(base_index*2) + 1] & 0x10) flip |= TILE_FLIPX;
tileinfo.set(0, tileno, colour, flip);
}
@ -959,16 +950,15 @@ TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac3_tile_info)
TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac3_alt_tile_info)
{
int tileno, colour, flip;
uint8_t *tmap = memregion("gfx4")->base()+0x20000;
uint8_t *tmap = memregion("gfx4")->base() + 0x20000;
int base_index = tile_index;
// if (m_konamigx_type3_psac2_actual_bank)
// base_index+=0x20000/2;
tileno = tmap[base_index*2] | ((tmap[(base_index*2)+1] & 0x0f)<<8);
colour = (tmap[(base_index*2)+1]&0xc0)>>6;
tileno = tmap[base_index*2] | ((tmap[(base_index*2) + 1] & 0x0f) << 8);
colour = (tmap[(base_index*2) + 1] & 0xc0) >> 6;
flip = 0;
if (tmap[(base_index*2)+1] & 0x20) flip |= TILE_FLIPY;
@ -996,18 +986,18 @@ TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac3_alt_tile_info)
doesn't really look like it should be displayed? - it's height data */
TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac1a_tile_info)
{
int tileno, colour, flipx,flipy;
int tileno, colour, flipx, flipy;
int flip = 0;
colour = 0;
tileno = (m_psacram[tile_index*2] & 0x00003fff)>>0;
tileno = (m_psacram[tile_index*2] & 0x00003fff) >> 0;
// scanrows
//flipx = (m_psacram[tile_index*2+1] & 0x00800000)>>23;
//flipy = (m_psacram[tile_index*2+1] & 0x00400000)>>22;
//flipx = (m_psacram[tile_index*2+1] & 0x00800000) >> 23;
//flipy = (m_psacram[tile_index*2+1] & 0x00400000) >> 22;
// scancols
flipy = (m_psacram[tile_index*2+1] & 0x00800000)>>23;
flipx = (m_psacram[tile_index*2+1] & 0x00400000)>>22;
flipy = (m_psacram[tile_index*2+1] & 0x00800000) >> 23;
flipx = (m_psacram[tile_index*2+1] & 0x00400000) >> 22;
if (flipx) flip |= TILE_FLIPX;
if (flipy) flip |= TILE_FLIPY;
@ -1043,34 +1033,36 @@ K056832_CB_MEMBER(konamigx_state::type2_tile_callback)
{
int d = *code;
*code = (m_gx_tilebanks[(d & 0xe000)>>13]<<13) + (d & 0x1fff);
*code = (m_gx_tilebanks[(d & 0xe000) >> 13] << 13) + (d & 0x1fff);
K055555GX_decode_vmixcolor(layer, color);
}
K056832_CB_MEMBER(konamigx_state::salmndr2_tile_callback)
{
const uint8_t mix_code = attr >> 4 & 0b11;
if (mix_code) {
if (mix_code)
{
*priority = 1;
m_last_alpha_tile_mix_code = mix_code;
}
int d = *code;
*code = (m_gx_tilebanks[(d & 0xe000)>>13]<<13) + (d & 0x1fff);
*code = (m_gx_tilebanks[(d & 0xe000) >> 13] << 13) + (d & 0x1fff);
K055555GX_decode_vmixcolor(layer, color);
}
K056832_CB_MEMBER(konamigx_state::alpha_tile_callback)
{
const uint8_t mix_code = attr >> 6 & 0b11;
if (mix_code) {
if (mix_code)
{
*priority = 1;
m_last_alpha_tile_mix_code = mix_code;
}
int d = *code;
*code = (m_gx_tilebanks[(d & 0xe000)>>13]<<13) + (d & 0x1fff);
*code = (m_gx_tilebanks[(d & 0xe000) >> 13] << 13) + (d & 0x1fff);
K055555GX_decode_vmixcolor(layer, color);
}
@ -1129,6 +1121,7 @@ void konamigx_state::common_init()
save_item(NAME(m_osmixon));
save_item(NAME(m_current_brightness));
save_item(NAME(m_brightness));
save_item(NAME(m_last_alpha_tile_mix_code));
m_gx_tilemode = 0;
@ -1155,11 +1148,11 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_5bpp)
{
common_init();
if (!strcmp(machine().system().name,"tbyahhoo"))
if (!strcmp(machine().system().name, "tbyahhoo") || !strcmp(machine().system().name, "mtwinbee"))
m_gx_tilemode = 1;
else if (!strcmp(machine().system().name,"crzcross") || !strcmp(machine().system().name,"puzldama"))
else if (!strcmp(machine().system().name, "crzcross") || !strcmp(machine().system().name, "puzldama"))
konamigx_mixer_primode(5);
else if (!strcmp(machine().system().name,"daiskiss"))
else if (!strcmp(machine().system().name, "daiskiss"))
konamigx_mixer_primode(4);
}
@ -1191,32 +1184,30 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type3)
int width = m_screen->width();
int height = m_screen->height();
m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>(width, height);
m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>(width, height);
common_init();
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac3_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
m_gx_psac_tilemap_alt = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac3_alt_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac3_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
m_gx_psac_tilemap_alt = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac3_alt_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 256, 256);
m_gx_rozenable = 0;
m_gx_specialrozenable = 2;
/* set up tile layers */
m_type3_roz_temp_bitmap = std::make_unique<bitmap_ind16>(width, height);
//m_gx_psac_tilemap->set_flip(TILEMAP_FLIPX| TILEMAP_FLIPY);
K053936_wraparound_enable(0, 1);
// K053936GP_set_offset(0, -30, -1);
K053936_set_offset(0, -30, +1);
m_k056832->set_layer_offs(0, -52, 0);
m_k056832->set_layer_offs(1, -48, 0);
m_k056832->set_layer_offs(2, -48, 0);
m_k056832->set_layer_offs(3, -48, 0);
m_k056832->set_layer_offs(0, -52, 0);
m_k056832->set_layer_offs(1, -48, 0);
m_k056832->set_layer_offs(2, -48, 0);
m_k056832->set_layer_offs(3, -48, 0);
m_konamigx_has_dual_screen = 1;
m_konamigx_palformat = 1;
@ -1227,19 +1218,19 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type4)
int width = m_screen->width();
int height = m_screen->height();
m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>( width, height);
m_dualscreen_left_tempbitmap = std::make_unique<bitmap_rgb32>(width, height);
m_dualscreen_right_tempbitmap = std::make_unique<bitmap_rgb32>(width, height);
common_init();
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
m_gx_rozenable = 0;
m_gx_specialrozenable = 3;
m_k056832->set_layer_offs(0, -27, 0);
m_k056832->set_layer_offs(1, -25, 0);
m_k056832->set_layer_offs(2, -24, 0);
m_k056832->set_layer_offs(3, -22, 0);
m_k056832->set_layer_offs(0, -27, 0);
m_k056832->set_layer_offs(1, -25, 0);
m_k056832->set_layer_offs(2, -24, 0);
m_k056832->set_layer_offs(3, -22, 0);
K053936_wraparound_enable(0, 0);
K053936GP_set_offset(0, -36, 1);
@ -1260,14 +1251,14 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type4_vsn)
common_init();
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
m_gx_rozenable = 0;
m_gx_specialrozenable = 3;
m_k056832->set_layer_offs(0, -52, 0);
m_k056832->set_layer_offs(1, -48, 0);
m_k056832->set_layer_offs(2, -48, 0);
m_k056832->set_layer_offs(3, -48, 0);
m_k056832->set_layer_offs(0, -52, 0);
m_k056832->set_layer_offs(1, -48, 0);
m_k056832->set_layer_offs(2, -48, 0);
m_k056832->set_layer_offs(3, -48, 0);
K053936_wraparound_enable(0, 1); // wraparound doesn't work properly with the custom drawing function anyway, see the crowd in vsnet and rushhero
K053936GP_set_offset(0, -30, 0);
@ -1287,16 +1278,14 @@ VIDEO_START_MEMBER(konamigx_state, konamigx_type4_sd2)
common_init();
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
m_gx_psac_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(konamigx_state::get_gx_psac_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 128, 128);
m_gx_rozenable = 0;
m_gx_specialrozenable = 3;
m_k056832->set_layer_offs(0, -29, -1);
m_k056832->set_layer_offs(1, -27, -1);
m_k056832->set_layer_offs(2, -26, -1);
m_k056832->set_layer_offs(3, -24, -1);
m_k056832->set_layer_offs(0, -29, -1);
m_k056832->set_layer_offs(1, -27, -1);
m_k056832->set_layer_offs(2, -26, -1);
m_k056832->set_layer_offs(3, -24, -1);
K053936_wraparound_enable(0, 0);
K053936GP_set_offset(0, -36, -1);
@ -1326,19 +1315,17 @@ VIDEO_START_MEMBER(konamigx_state, opengolf)
m_gx_rozenable = 0;
m_gx_specialrozenable = 1;
m_gxtype1_roz_dstbitmap = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmap2 = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmap = std::make_unique<bitmap_ind16>(512, 512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmap2 = std::make_unique<bitmap_ind16>(512, 512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmapclip.set(0, 512-1, 0, 512-1);
K053936_wraparound_enable(0, 1);
K053936GP_set_offset(0, 0, 0);
// urgh.. the priority bitmap is global, and because our temp bitmaps are bigger than the screen, this causes issues.. so just allocate something huge
// until there is a better solution, or priority bitmap can be specified manually.
m_screen->priority().allocate(2048,2048);
m_screen->priority().allocate(2048, 2048);
}
@ -1361,19 +1348,17 @@ VIDEO_START_MEMBER(konamigx_state, racinfrc)
m_gx_rozenable = 0;
m_gx_specialrozenable = 1;
m_gxtype1_roz_dstbitmap = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmap2 = std::make_unique<bitmap_ind16>(512,512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmap = std::make_unique<bitmap_ind16>(512, 512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmap2 = std::make_unique<bitmap_ind16>(512, 512); // BITMAP_FORMAT_IND16 because we NEED the raw pen data for post-processing
m_gxtype1_roz_dstbitmapclip.set(0, 512-1, 0, 512-1);
K053936_wraparound_enable(0, 1);
K053936GP_set_offset(0, 0, 0);
// urgh.. the priority bitmap is global, and because our temp bitmaps are bigger than the screen, this causes issues.. so just allocate something huge
// until there is a better solution, or priority bitmap can be specified manually.
m_screen->priority().allocate(2048,2048);
m_screen->priority().allocate(2048, 2048);
}
@ -1393,9 +1378,9 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg
{
// driver approximates tile update in mode 0 for speed
unchained = m_k056832->get_layer_association();
for (i=0; i<4; i++)
for (i = 0; i < 4; i++)
{
newbase = m_k055555->K055555_get_palette_index(i)<<6;
newbase = m_k055555->K055555_get_palette_index(i) << 6;
if (m_layer_colorbase[i] != newbase)
{
m_layer_colorbase[i] = newbase;
@ -1433,13 +1418,11 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg
// Type-1
if (m_gx_specialrozenable == 1)
{
//K053936_0_zoom_draw(screen, *m_gxtype1_roz_dstbitmap, m_gxtype1_roz_dstbitmapclip,m_gx_psac_tilemap, 0,0,0); // height data
K053936_0_zoom_draw(screen, *m_gxtype1_roz_dstbitmap2,m_gxtype1_roz_dstbitmapclip,m_gx_psac_tilemap2,0,0,0); // colour data (+ some voxel height data?)
//K053936_0_zoom_draw(screen, *m_gxtype1_roz_dstbitmap, m_gxtype1_roz_dstbitmapclip,m_gx_psac_tilemap, 0, 0, 0); // height data
K053936_0_zoom_draw(screen, *m_gxtype1_roz_dstbitmap2,m_gxtype1_roz_dstbitmapclip,m_gx_psac_tilemap2, 0, 0, 0); // colour data (+ some voxel height data?)
}
if (m_gx_specialrozenable==3)
if (m_gx_specialrozenable == 3)
{
konamigx_mixer(screen, bitmap, cliprect, m_gx_psac_tilemap, GXSUB_8BPP,nullptr,0, 0, nullptr, m_gx_rushingheroes_hack);
}
@ -1449,10 +1432,10 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg
// we're going to throw half of this away anyway in post-process, so only render what's needed
rectangle temprect;
temprect = cliprect;
temprect.max_x = cliprect.min_x+320;
temprect.max_x = cliprect.min_x + 320;
if (m_type3_psac2_bank == 1) K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap_alt, 0,0,0); // soccerss playfield
else K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap, 0,0,0); // soccerss playfield
if (m_type3_psac2_bank == 1) K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap_alt, 0, 0, 0); // soccerss playfield
else K053936_0_zoom_draw(screen, *m_type3_roz_temp_bitmap, temprect,m_gx_psac_tilemap, 0, 0, 0); // soccerss playfield
konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, 0, m_type3_roz_temp_bitmap.get(), m_gx_rushingheroes_hack);
@ -1482,9 +1465,9 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg
uint16_t const *const src = &m_gxtype1_roz_dstbitmap2->pix(y);
//uint16_t const *const src = &m_gxtype1_roz_dstbitmap->pix(y);
uint32_t *const dst = &bitmap.pix((256+16)-y);
uint32_t *const dst = &bitmap.pix((256 + 16) - y);
for (int x = cliprect.min_x; x <= cliprect.max_x;x++)
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
uint16_t const dat = src[x];
dst[x] = paldata[dat];
@ -1502,15 +1485,15 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg
uint32_t konamigx_state::screen_update_konamigx_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
/* the video gets demuxed by a board which plugs into the jamma connector */
m_konamigx_current_frame^=1;
m_konamigx_current_frame ^= 1;
if (m_konamigx_current_frame==1)
if (m_konamigx_current_frame == 1)
{
int offset=0;
if (m_konamigx_palformat==1)
if (m_konamigx_palformat == 1)
{
for (offset=0;offset<0x4000/4;offset++)
for (offset = 0; offset < 0x4000/4; offset++)
{
uint32_t coldat = m_generic_paletteram_32[offset];
@ -1520,13 +1503,11 @@ uint32_t konamigx_state::screen_update_konamigx_left(screen_device &screen, bitm
}
else
{
for (offset=0;offset<0x8000/4;offset++)
for (offset = 0; offset < 0x8000/4; offset++)
{
int r,g,b;
r = (m_generic_paletteram_32[offset] >>16) & 0xff;
g = (m_generic_paletteram_32[offset] >> 8) & 0xff;
b = (m_generic_paletteram_32[offset] >> 0) & 0xff;
int r = (m_generic_paletteram_32[offset] >>16) & 0xff;
int g = (m_generic_paletteram_32[offset] >> 8) & 0xff;
int b = (m_generic_paletteram_32[offset] >> 0) & 0xff;
m_palette->set_pen_color(offset,rgb_t(r,g,b));
}
@ -1545,7 +1526,7 @@ uint32_t konamigx_state::screen_update_konamigx_left(screen_device &screen, bitm
uint32_t konamigx_state::screen_update_konamigx_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
if (m_konamigx_current_frame==1)
if (m_konamigx_current_frame == 1)
{
copybitmap(bitmap, *m_dualscreen_right_tempbitmap, 0, 0, 0, 0, cliprect);
}
@ -1553,9 +1534,9 @@ uint32_t konamigx_state::screen_update_konamigx_right(screen_device &screen, bit
{
int offset=0;
if (m_konamigx_palformat==1)
if (m_konamigx_palformat == 1)
{
for (offset=0;offset<0x4000/4;offset++)
for (offset = 0; offset < 0x4000/4; offset++)
{
uint32_t coldat = m_subpaletteram32[offset];
@ -1565,13 +1546,11 @@ uint32_t konamigx_state::screen_update_konamigx_right(screen_device &screen, bit
}
else
{
for (offset=0;offset<0x8000/4;offset++)
for (offset = 0; offset < 0x8000/4; offset++)
{
int r,g,b;
r = (m_subpaletteram32[offset] >>16) & 0xff;
g = (m_subpaletteram32[offset] >> 8) & 0xff;
b = (m_subpaletteram32[offset] >> 0) & 0xff;
int r = (m_subpaletteram32[offset] >>16) & 0xff;
int g = (m_subpaletteram32[offset] >> 8) & 0xff;
int b = (m_subpaletteram32[offset] >> 0) & 0xff;
m_palette->set_pen_color(offset,rgb_t(r,g,b));
}
@ -1597,8 +1576,8 @@ void konamigx_state::konamigx_555_palette_w(offs_t offset, uint32_t data, uint32
coldat = m_generic_paletteram_32[offset];
set_color_555(*m_palette, offset*2, 0, 5, 10,coldat >> 16);
set_color_555(*m_palette, offset*2+1, 0, 5, 10,coldat & 0xffff);
set_color_555(*m_palette, offset*2, 0, 5, 10, coldat >> 16);
set_color_555(*m_palette, offset*2 + 1, 0, 5, 10, coldat & 0xffff);
}
// sub monitor for type 3
@ -1610,20 +1589,20 @@ void konamigx_state::konamigx_555_palette2_w(offs_t offset, uint32_t data, uint3
offset += (0x4000/4);
set_color_555(*m_palette, offset*2, 0, 5, 10,coldat >> 16);
set_color_555(*m_palette, offset*2+1, 0, 5, 10,coldat & 0xffff);
set_color_555(*m_palette, offset*2, 0, 5, 10, coldat >> 16);
set_color_555(*m_palette, offset*2 + 1, 0, 5, 10, coldat & 0xffff);
}
void konamigx_state::konamigx_tilebank_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (ACCESSING_BITS_24_31)
m_gx_tilebanks[offset*4] = (data>>24)&0xff;
m_gx_tilebanks[offset*4] = (data >> 24) & 0xff;
if (ACCESSING_BITS_16_23)
m_gx_tilebanks[offset*4+1] = (data>>16)&0xff;
m_gx_tilebanks[offset*4 + 1] = (data >> 16) & 0xff;
if (ACCESSING_BITS_8_15)
m_gx_tilebanks[offset*4+2] = (data>>8)&0xff;
m_gx_tilebanks[offset*4 + 2] = (data >> 8) & 0xff;
if (ACCESSING_BITS_0_7)
m_gx_tilebanks[offset*4+3] = data&0xff;
m_gx_tilebanks[offset*4 + 3] = data & 0xff;
}
// type 1 RAM-based PSAC tilemap
@ -1640,5 +1619,5 @@ void konamigx_state::konamigx_t4_psacmap_w(offs_t offset, uint32_t data, uint32_
COMBINE_DATA(&m_psacram[offset]);
m_gx_psac_tilemap->mark_tile_dirty(offset*2);
m_gx_psac_tilemap->mark_tile_dirty((offset*2)+1);
m_gx_psac_tilemap->mark_tile_dirty((offset*2) + 1);
}

View File

@ -51,12 +51,11 @@ private:
int m_roz_rombank = 0;
tilemap_t *m_ult_936_tilemap = nullptr;
uint16_t m_clip = 0;
uint8_t m_last_alpha_tile_mix_code = 0;
uint8_t m_sound_ctrl = 0;
uint8_t m_sound_nmi_clk = 0;
uint8_t m_last_alpha_tile_mix_code = 0;
uint16_t eeprom_r(offs_t offset, uint16_t mem_mask = ~0);
void mweeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t dddeeprom_r(offs_t offset, uint16_t mem_mask = ~0);