X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui.cpp;h=bf4c30e941d24d5e8a743c13dc1d04199999e9a3;hb=940d49408c1bedb340cf7d03b5f8fa6c23cdb9df;hp=17e522c9b7074ee6ed8ef272450c393f5ec42850;hpb=99461abfcbc562e740a5e0900167ece9a4a5a035;p=virtualjaguar diff --git a/src/gui.cpp b/src/gui.cpp index 17e522c..bf4c30e 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -5,8 +5,10 @@ // by James L. Hammons // +#include #include "types.h" #include "tom.h" +#include "font1.h" #include "gui.h" void InitGUI(void) @@ -17,7 +19,31 @@ void GUIDone(void) { } -void DrawText(uint16 * screen, uint32 x, uint32 y, const char * string) +void DrawText(int16 * screen, uint32 x, uint32 y, const char * text, ...) { - uint32 pitch = TOMGetSDLScreenPitch(); + char string[4096]; + va_list arg; + + va_start(arg, text); + vsprintf(string, text, arg); + va_end(arg); + + uint32 pitch = TOMGetSDLScreenPitch() / 2; // Returns pitch in bytes but we need words... + uint32 length = strlen(string), address = x + (y * pitch); + + for(uint32 i=0; i