2023-10-31 18:06:39 +01:00
# include "./MultiSpacc.h"
2023-11-01 13:58:22 +01:00
void MultiSpacc_PrintText ( char Text [ ] , MultiSpacc_Surface * Surface , MultiSpacc_SurfaceConfig * WindowConfig , int x , int y , MultiSpacc_Surface * Tiles /*, int FontSize, int Color */ )
2023-10-31 18:06:39 +01:00
{
# ifdef MultiSpacc_Target_SDLCom
for ( int i = 0 ; i < strlen ( Text ) ; i + + )
{
MultiSpacc_Rect Offset = {
. x = ( x * 8 ) + ( 8 * i ) ,
. y = ( y * 8 ) ,
} ;
MultiSpacc_Rect Clip = {
. x = 8 * ( Text [ i ] % 16 ) ,
. y = 8 * ( Text [ i ] / 16 ) ,
. w = 8 ,
. h = 8 ,
} ;
SDL_BlitSurface ( Tiles , & Clip , Surface , & Offset ) ;
} ;
# endif
# ifdef MultiSpacc_Target_NDS
iprintf ( " %s " , Text ) ;
# endif
2023-11-01 13:58:22 +01:00
# ifdef MultiSpacc_Target_NES
ppu_off ( ) ;
vram_adr ( NTADR_A ( x , y ) ) ;
vram_write ( Text , strlen ( Text ) ) ;
ppu_on_all ( ) ;
# endif
2023-10-31 18:06:39 +01:00
}
void MultiSpacc_PrintDebug ( const char * format , . . . )
{
# ifdef MultiSpacc_Target_SDLCom
va_list args ;
va_start ( args , format ) ;
fprintf ( stderr , format , args ) ;
va_end ( args ) ;
# endif
}