cleaner code (using macros)
This commit is contained in:
parent
7476a02675
commit
fb586a2359
|
@ -677,30 +677,25 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * DST, u16 X, u16 Y, u16 LG)
|
||||||
if (xfin > LG)
|
if (xfin > LG)
|
||||||
xfin = LG;
|
xfin = LG;
|
||||||
|
|
||||||
|
#define RENDERL(c,m) \
|
||||||
|
if (c) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, ((c) + ((mapinfovalue>>12)&0xF) * m) << 1)) ; \
|
||||||
|
dst += 2; x++; xoff++;
|
||||||
|
|
||||||
if((mapinfovalue) & 0x400)
|
if((mapinfovalue) & 0x400)
|
||||||
{
|
{
|
||||||
line += 3 - ((xoff&7)>>1);
|
line += 3 - ((xoff&7)>>1);
|
||||||
for(; x < xfin; )
|
for(; x < xfin; ) {
|
||||||
{
|
// XXX
|
||||||
if((*line)>>4) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (((*line)>>4) + ((mapinfovalue>>12)&0xF) * 0x10) << 1)) ;
|
RENDERL(((*line)>>4),0x10)
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (((*line)>>4) + ((mapinfovalue>>12)&0xF) * 0x10) << 1));
|
RENDERL(((*line)&0xF),0x10)
|
||||||
dst += 2; x++; xoff++;
|
|
||||||
if((*line)&0xF) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (((*line)&0xF) + ((mapinfovalue>>12)&0xF) * 0x10) << 1)) ;
|
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (((*line)&0xF) + ((mapinfovalue>>12)&0xF) * 0x10) << 1));
|
|
||||||
dst += 2; x++; xoff++;
|
|
||||||
line--;
|
line--;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
line += ((xoff&7)>>1);
|
line += ((xoff&7)>>1);
|
||||||
for(; x < xfin; )
|
for(; x < xfin; ) {
|
||||||
{
|
// XXX
|
||||||
if((*line)&0xF) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (((*line)&0xF) + ((mapinfovalue>>12)&0xF) * 0x10) << 1)) ;
|
RENDERL(((*line)&0xF),0x10)
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (((*line)&0xF) + ((mapinfovalue>>12)&0xF) * 0x10) << 1));
|
RENDERL(((*line)>>4),0x10)
|
||||||
dst += 2; x++; xoff++;
|
|
||||||
if((*line)>>4) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (((*line)>>4) + ((mapinfovalue>>12)&0xF) * 0x10) << 1)) ;
|
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (((*line)>>4) + ((mapinfovalue>>12)&0xF) * 0x10) << 1));
|
|
||||||
dst += 2; x++; xoff++;
|
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -733,21 +728,17 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * DST, u16 X, u16 Y, u16 LG)
|
||||||
if((mapinfovalue)& 0x400)
|
if((mapinfovalue)& 0x400)
|
||||||
{
|
{
|
||||||
line += (7 - (xoff&7));
|
line += (7 - (xoff&7));
|
||||||
for(; x < xfin; ++x, ++xoff)
|
for(; x < xfin; )
|
||||||
{
|
{
|
||||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, *line << 1)) ;
|
RENDERL((*line),0)
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, *line << 1));
|
|
||||||
dst += 2;
|
|
||||||
line--;
|
line--;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
line += (xoff&7);
|
line += (xoff&7);
|
||||||
for(; x < xfin; ++x, ++xoff)
|
for(; x < xfin; )
|
||||||
{
|
{
|
||||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, *line << 1)) ;
|
RENDERL((*line),0)
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, *line << 1));
|
|
||||||
dst += 2;
|
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -782,23 +773,19 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * DST, u16 X, u16 Y, u16 LG)
|
||||||
if((mapinfovalue)& 0x400)
|
if((mapinfovalue)& 0x400)
|
||||||
{
|
{
|
||||||
line += (7 - (xoff&7));
|
line += (7 - (xoff&7));
|
||||||
for(; x < xfin; ++x, ++xoff)
|
for(; x < xfin;)
|
||||||
{
|
{
|
||||||
/* this is was adapted */
|
/* this is was adapted */
|
||||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1)) ;
|
RENDERL((*line),0x100)
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1));
|
|
||||||
dst += 2;
|
|
||||||
line--;
|
line--;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
line += (xoff&7);
|
line += (xoff&7);
|
||||||
for(; x < xfin; ++x, ++xoff)
|
for(; x < xfin; )
|
||||||
{
|
{
|
||||||
/* this is was adapted */
|
/* this is was adapted */
|
||||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1)) ;
|
RENDERL((*line),0x100)
|
||||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1));
|
|
||||||
dst += 2;
|
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue