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)
|
||||
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)
|
||||
{
|
||||
line += 3 - ((xoff&7)>>1);
|
||||
for(; x < xfin; )
|
||||
{
|
||||
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++;
|
||||
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++;
|
||||
for(; x < xfin; ) {
|
||||
// XXX
|
||||
RENDERL(((*line)>>4),0x10)
|
||||
RENDERL(((*line)&0xF),0x10)
|
||||
line--;
|
||||
}
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
line += ((xoff&7)>>1);
|
||||
for(; x < xfin; )
|
||||
{
|
||||
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++;
|
||||
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++;
|
||||
for(; x < xfin; ) {
|
||||
// XXX
|
||||
RENDERL(((*line)&0xF),0x10)
|
||||
RENDERL(((*line)>>4),0x10)
|
||||
line++;
|
||||
}
|
||||
}
|
||||
|
@ -733,21 +728,17 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * DST, u16 X, u16 Y, u16 LG)
|
|||
if((mapinfovalue)& 0x400)
|
||||
{
|
||||
line += (7 - (xoff&7));
|
||||
for(; x < xfin; ++x, ++xoff)
|
||||
for(; x < xfin; )
|
||||
{
|
||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, *line << 1)) ;
|
||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, *line << 1));
|
||||
dst += 2;
|
||||
RENDERL((*line),0)
|
||||
line--;
|
||||
}
|
||||
} else
|
||||
{
|
||||
line += (xoff&7);
|
||||
for(; x < xfin; ++x, ++xoff)
|
||||
for(; x < xfin; )
|
||||
{
|
||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, *line << 1)) ;
|
||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, *line << 1));
|
||||
dst += 2;
|
||||
RENDERL((*line),0)
|
||||
line++;
|
||||
}
|
||||
}
|
||||
|
@ -782,23 +773,19 @@ INLINE void renderline_textBG(GPU * gpu, u8 num, u8 * DST, u16 X, u16 Y, u16 LG)
|
|||
if((mapinfovalue)& 0x400)
|
||||
{
|
||||
line += (7 - (xoff&7));
|
||||
for(; x < xfin; ++x, ++xoff)
|
||||
for(; x < xfin;)
|
||||
{
|
||||
/* this is was adapted */
|
||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1)) ;
|
||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1));
|
||||
dst += 2;
|
||||
RENDERL((*line),0x100)
|
||||
line--;
|
||||
}
|
||||
} else
|
||||
{
|
||||
line += (xoff&7);
|
||||
for(; x < xfin; ++x, ++xoff)
|
||||
for(; x < xfin; )
|
||||
{
|
||||
/* this is was adapted */
|
||||
if(*line) renderline_setFinalColor(gpu,0,num,dst,T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1)) ;
|
||||
// was: T2WriteWord(dst, 0, T1ReadWord(pal, (*line + ((mapinfovalue>>12)&0xF)*0x100) << 1));
|
||||
dst += 2;
|
||||
RENDERL((*line),0x100)
|
||||
line++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue