gskit bugs(minor)
Posted: Sat May 06, 2006 8:27 am
not sure if this is the right place to post, but here goes.
first off i really appreciate the work being put into gsKit, it is really nice to have.
anyways, the bugs i have found so far involve fontm support. first when using \n in a string the next line is always 26.0f, i think multiplying by scale would solve this problem maybe?
secondly, sometimes when using sprintf to put a number in a string, it instead displays a letter, like 4 shows a 'u'. i took some screenshots and also wrote a simple demo program to show what happens.
images:
http://ubergeek.awardspace.com/ps2dev/images/test1.bmp
http://ubergeek.awardspace.com/ps2dev/images/test2.bmp
http://ubergeek.awardspace.com/ps2dev/images/test3.bmp
http://ubergeek.awardspace.com/ps2dev/images/test4.bmp
first off i really appreciate the work being put into gsKit, it is really nice to have.
anyways, the bugs i have found so far involve fontm support. first when using \n in a string the next line is always 26.0f, i think multiplying by scale would solve this problem maybe?
secondly, sometimes when using sprintf to put a number in a string, it instead displays a letter, like 4 shows a 'u'. i took some screenshots and also wrote a simple demo program to show what happens.
Code: Select all
// this code created from a modified fontm.c file
#include "gsKit.h"
#include "dmaKit.h"
#include "malloc.h"
int main(void)
{
u64 White,BlackFont;
GSGLOBAL *gsGlobal = gsKit_init_global(GS_MODE_NTSC);
GSFONT *gsFont = gsKit_init_font(GSKIT_FTYPE_FONTM, NULL);
dmaKit_init(D_CTRL_RELE_OFF,D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC,
D_CTRL_STD_OFF, D_CTRL_RCYC_8);
// Initialize the DMAC
dmaKit_chan_init(DMA_CHANNEL_GIF);
dmaKit_chan_init(DMA_CHANNEL_FROMSPR);
dmaKit_chan_init(DMA_CHANNEL_TOSPR);
White = GS_SETREG_RGBAQ(0xFF,0xFF,0xFF,0x00,0x00);
BlackFont = GS_SETREG_RGBAQ(0x00,0x00,0x00,0x80,0x00);
gsGlobal->PrimAlphaEnable = GS_SETTING_ON;
gsKit_init_screen(gsGlobal);
gsKit_font_upload(gsGlobal, gsFont);
gsFont->FontM_Spacing = 0.95f;
gsKit_mode_switch(gsGlobal, GS_ONESHOT);
int x=0;
char tempstr[25];
while(1)
{
gsKit_clear(gsGlobal, White);
sprintf(tempstr, "test : %i", x);
gsKit_font_print_scaled(gsGlobal, gsFont, 50, 50, 3.0f, 2.f, BlackFont, tempstr);
gsKit_sync_flip(gsGlobal);
gsKit_queue_exec(gsGlobal);
// creates a delay, so the bug can be seen
double i=0;while(i<100000)i+=.1;
x++;
if (x==10000)
x=0;
}
return 0;
}
http://ubergeek.awardspace.com/ps2dev/images/test1.bmp
http://ubergeek.awardspace.com/ps2dev/images/test2.bmp
http://ubergeek.awardspace.com/ps2dev/images/test3.bmp
http://ubergeek.awardspace.com/ps2dev/images/test4.bmp