diff --git a/source/arm11/acf.c b/source/arm11/acf.c index a2ea37d..1fe9100 100644 --- a/source/arm11/acf.c +++ b/source/arm11/acf.c @@ -292,11 +292,12 @@ static int render_unicode(FHandle fd, int *x, unsigned width, unsigned height, u { for (int j = 0; j < bbx[0]; ++j) { - if( 0 <= i && i < (int)height && 0 <= j && j < (int)width ) + int tx = cx+j, ty = cy-i; + if( 0 <= ty && ty < (int)height && 0 <= tx && tx < (int)width ) { if( BIT_AT_POS(glyph, bbx[0] * i + j) ) { - SET_AT_POS( ram, PIX_IN_LINE(cx+j, cy-i, width) ); + SET_AT_POS( ram, PIX_IN_LINE(tx, ty, width) ); } } }