#108483 - chrissieboy - Thu Nov 09, 2006 11:13 am
Im busy with loading a 3d model binary file.
So right now i read out the hex values from the binary.
In the header of the binary file there is the name of the file, wich i want to read out.
I know a character is 4 bytes, so i must read 4 bytes from the binary i think?
In my hex viewer i see this hex values : F5 1B 00 00 4F 62 6A 65 63 74
these value i want to translate to chars.
I do this :
to print the hex value on the screen of the ds,
then it prints :
F5 1B 00 00 4F 62 6A 65 63 74
on my ds screen, but now i want it to print it as characters to display the name.
I did this but it crashes :
but all it did not work, does anyone know how to print characters out of an hex value??
(sorry for my bad english im from the netherlands)
So right now i read out the hex values from the binary.
In the header of the binary file there is the name of the file, wich i want to read out.
I know a character is 4 bytes, so i must read 4 bytes from the binary i think?
In my hex viewer i see this hex values : F5 1B 00 00 4F 62 6A 65 63 74
these value i want to translate to chars.
I do this :
Code: |
iprintf("%04x ", ((u16*)hovercraft_bin)[i]); |
to print the hex value on the screen of the ds,
then it prints :
F5 1B 00 00 4F 62 6A 65 63 74
on my ds screen, but now i want it to print it as characters to display the name.
I did this but it crashes :
Code: |
iprintf("%s ", ((u16*)hovercraft_bin)[i]); |
Code: |
iprintf("%c ", ((u16*)hovercraft_bin)[i]); |
but all it did not work, does anyone know how to print characters out of an hex value??
(sorry for my bad english im from the netherlands)