gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Announcements And Comments > posprintf

#12610 - poslundc - Wed Nov 19, 2003 4:29 pm

I've put together a variant of sprintf() targetted specifically towards GBA development. It has the following features:

- Very fast algorithm for printing 16-bit numbers plus sign (up to +/- 65535)
- Still pretty fast routine for printing larger numbers, up to about +/- 500 million (takes about twice as long)
- Can pad numbers with leading spaces or zeros
- Prints numbers in hex as well (useful for debugging stuff)
- Prints strings to strings
- Hand-coded entirely in Thumb assembler - should be very efficient overall

http://www.danposluns.com/gbadev/posprintf/

Full source is included.

Cheers,

Dan.