[A89] Re: printf?
[Prev][Next][Index][Thread]
[A89] Re: printf?
> It works fine, but I would like to know if there's a way to do a
> printf, without "simulating" it (with a sprintf and then a DrawStr).
Nope. TIGCC's implementation is just a wrapper around sprintf and DrawStr.
Observe:
#define printf_xy(x,y,f...) \
({char __s[200]; _rom_call(short,(char*,const char*,...),53)(__s ,##f); \
_rom_call(void,(short,short,const char*,short),1A9)(x,y,__s,4);})
It looks ugly, but what it's really doing is allocating a 200-byte buffer,
sprintf'ing to that buffer, and then DrawStr'ing the contents of the buffer.
It's quite simple -- why would you really need a separate printf rom call?
-Scott
Follow-Ups: