Better fix for cuebrckj0102u5gre. At least it is plausible that this is the way the real hardware works.

This commit is contained in:
Zsolt Vasvari 2008-01-12 05:04:09 +00:00
parent d6166834f2
commit 9a17a5ba02
3 changed files with 17 additions and 18 deletions

View File

@ -2270,6 +2270,11 @@ void K052109_set_RMRD_line(int state)
K052109_RMRD_line = state;
}
int K052109_get_RMRD_line(void)
{
return K052109_RMRD_line;
}
void K052109_tilemap_update(void)
{

View File

@ -75,6 +75,7 @@ WRITE16_HANDLER( K052109_word_w );
READ16_HANDLER( K052109_lsb_r );
WRITE16_HANDLER( K052109_lsb_w );
void K052109_set_RMRD_line(int state);
int K052109_get_RMRD_line(void);
void K052109_tilemap_update(void);
int K052109_is_IRQ_enabled(void);
void K052109_set_layer_offsets(int layer, int dx, int dy);

View File

@ -10,6 +10,7 @@ static int prmrsocr_sprite_bank;
static int sorted_layer[3];
static int dim_c,dim_v; /* ssriders, tmnt2 */
static int lastdim,lasten;
static int priorityflag;
static tilemap *roz_tilemap;
@ -63,23 +64,15 @@ static void mia_tile_callback(int layer,int bank,int *code,int *color,int *flags
static void cuebrick_tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
{
/* HACK! - since konamiic.c calls here with layer=0 when reading the ROM, detect this
and return the proper value in 'code' */
if ((cpu_getactivecpu() == 0) && ((activecpu_get_pc() & 0xffff0) == 0x002630))
*code |= ((*color & 0xf) << 8);
/* normal access via the tilemap code */
else
{
if (layer == 0)
{
*code |= ((*color & 0x01) << 8);
*color = layer_colorbase[layer] + ((*color & 0x80) >> 5) + ((*color & 0x10) >> 1);
}
else
{
*code |= ((*color & 0xf) << 8);
*color = layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
if ((K052109_get_RMRD_line() == CLEAR_LINE) && (layer == 0))
{
*code |= ((*color & 0x01) << 8);
*color = layer_colorbase[layer] + ((*color & 0x80) >> 5) + ((*color & 0x10) >> 1);
}
else
{
*code |= ((*color & 0xf) << 8);
*color = layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
}
@ -355,7 +348,7 @@ WRITE16_HANDLER( tmnt_0a0000_w )
interrupt_enable_w(0,data & 0x20);
/* bit 7 = enable char ROM reading through the video RAM */
K052109_set_RMRD_line((data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
K052109_set_RMRD_line(data & 0x80 ? ASSERT_LINE : CLEAR_LINE);
/* other bits unused */
}