Skip to content

Commit

Permalink
Small Gfx fixes for Rad Mobile / Rally
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadez2003 committed May 24, 2023
1 parent 48b7cd0 commit 756ccb7
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion src/vidhrdw/system32_vidhrdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,46 @@ VIDEO_UPDATE( system32 ) {

fillbitmap(bitmap, 0, 0);

/* Priority loop. Draw layers 1 and 3 on Multi32's Monitor B*/
/* Rad Rally (title screen) and Rad Mobile (Winners don't use drugs) use a bitmap ... */
/* i think this is wrong tho, rad rally enables it on the 2nd title screen when the
data isn't complete */

if (sys32_videoram[0x01FF00/2] & 0x0800) /* wrong? */
{
int xcnt, ycnt;
static UINT32 *destline;
struct GfxElement *gfx=Machine->gfx[0];

const pen_t *paldata = &gfx->colortable[0];
/*
if ( code_pressed_memory(KEYCODE_C) )
{
ppp++;
}
*/
for ( ycnt = 0 ; ycnt < 224 ; ycnt ++ )
{
destline = (UINT32 *)(bitmap->line[ycnt]);


for ( xcnt = 0 ; xcnt < 160 ; xcnt ++ )
{
int data2;

data2 = sys32_videoram[256*ycnt+xcnt];


destline[xcnt*2+1] = paldata[(data2 >> 8)+(0x100*0x1d)]; // 1d00
destline[xcnt*2] = paldata[(data2 &0xff)+(0x100*0x1d)];
}

}
}



/* Priority loop. Draw layers 1 and 3 on Multi32's Monitor B */
if (sys32_displayenable & 0x0002) {
for (priloop=0; priloop < 0x10; priloop++) {
if (priloop == priority0 && (!multi32 || (multi32 && (readinputport(0xf)&1)))) {
Expand All @@ -1570,4 +1609,37 @@ VIDEO_UPDATE( system32 ) {
}
}
system32_draw_text_layer (bitmap, cliprect);

#if 0
{

/* custom log */

static FILE *sys32_logfile;

/* provide errorlog from here on */
sys32_logfile = fopen("sys32vid.log","wa");

int x;

/* x = rand(); */

fprintf(sys32_logfile,"Video Regs 0x31ff00 - 0x31ffff\n");
for (x = 0x1ff00; x< 0x20000; x+=2)
{
fprintf(sys32_logfile, "%04x\n", sys32_videoram[x/2] ) ;

}
fprintf(sys32_logfile,"Mixer Regs 0x610000 - 0x6100ff\n");
for (x = 0x00; x< 0x100; x+=2)
{
fprintf(sys32_logfile, "%04x\n", system32_mixerregs[0][x/2] ) ;

}


fclose (sys32_logfile);
}
#endif

}

0 comments on commit 756ccb7

Please sign in to comment.