Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Jerros on December 05, 2010, 10:00:36 am

Title: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: Jerros on December 05, 2010, 10:00:36 am
Might need to explain what I mean here;
what's a conveniet way to create big 'pictures' for a programm?
This is what we want in the case of a full 96x64 pic:
Code: [Select]
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11001111b, 11111111b, 11111111b, 10011111b, 11111111b
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10001111b, 11111111b, 11111111b, 10011111b, 11111111b
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10001111b, 11111111b, 11111110b, 00000111b, 11111111b
.db 11111111b, 11111110b, 11111111b, 11111111b, 11111111b, 11111111b, 11111110b, 00001111b, 11111111b, 00000000b, 00000000b, 00011111b
.db 11111111b, 11111100b, 11111111b, 11111111b, 11111111b, 11111111b, 11111100b, 00001111b, 11111111b, 00000000b, 00000000b, 00111111b
.db 11111000b, 00000000b, 00000000b, 01111111b, 11111110b, 00000111b, 11111000b, 00001111b, 11111111b, 00000000b, 11100000b, 01111111b
.db 11111000b, 00000000b, 00000000b, 11111111b, 11111110b, 00000011b, 11110000b, 00001111b, 11111111b, 00000000b, 11100000b, 01111111b
.db 11111000b, 00000000b, 00000001b, 11111111b, 11110000b, 00000001b, 11100000b, 00001111b, 11111111b, 00000001b, 11110000b, 11111111b
.db 11111000b, 00000111b, 00000011b, 11111111b, 10000000b, 00000001b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00000111b, 00000011b, 11111110b, 00000000b, 00000001b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11001111b, 11110000b, 00001110b, 00000011b, 11111000b, 00001111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11000000b, 00001110b, 00000001b, 11111000b, 00011111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 10000000b, 00111110b, 00000011b, 11111000b, 00001111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11111100b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11111100b, 00000001b, 11111111b, 11111111b
.db 11110000b, 00001111b, 11111111b, 11110000b, 00001110b, 00000011b, 11111000b, 00001111b, 11111110b, 00000001b, 11111111b, 11111111b
.db 11110000b, 00001111b, 11111111b, 11110000b, 00000000b, 00000011b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00110000b, 00000011b, 11111000b, 00001111b, 11111111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11000111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 10000111b, 00000001b, 11111111b, 11111111b
.db 11111000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 11000011b, 00000001b, 11100001b, 11111111b
.db 10011000b, 00001111b, 11111111b, 11110000b, 00111110b, 00000011b, 11111000b, 00001111b, 10000111b, 00000000b, 11100000b, 11111111b
.db 10101000b, 00001111b, 10001111b, 11000000b, 00001110b, 00000001b, 11111000b, 00000011b, 00000011b, 00000000b, 11000000b, 01111111b
.db 10011000b, 00001111b, 00000111b, 11111010b, 00001110b, 00000011b, 11111000b, 00000000b, 00000011b, 00000000b, 00000000b, 01111111b
.db 10101000b, 00000111b, 00000011b, 11111111b, 11111110b, 00000001b, 11110000b, 00000000b, 00000011b, 00000000b, 00000000b, 01111111b
.db 10011000b, 00000110b, 00000011b, 11111111b, 11111110b, 01101111b, 11100000b, 11111100b, 00110011b, 00000000b, 00100000b, 01111111b
.db 11111000b, 00000000b, 00000011b, 10111111b, 11111111b, 11111111b, 11001111b, 11111111b, 11111111b, 00000111b, 11110000b, 11111111b
.db 10101000b, 00000000b, 00000011b, 11000000b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 00000111b, 11111111b, 11111111b
.db 11011000b, 00000011b, 00000011b, 11000000b, 00111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000111b, 11111111b, 11111111b
.db 11011000b, 01111111b, 10000011b, 11000000b, 00111111b, 11111111b, 11111111b, 11111111b, 11111001b, 11000111b, 11111111b, 11111111b
.db 11111011b, 11111111b, 10001111b, 11000000b, 01111110b, 01111100b, 00000000b, 00111111b, 11100000b, 11100011b, 11111111b, 11111111b
.db 11111111b, 11111111b, 00001111b, 11000000b, 01111110b, 00111110b, 00000000b, 00011111b, 10000000b, 00111000b, 11111111b, 11111111b
.db 11111111b, 11111110b, 00011111b, 11000000b, 11000000b, 00000011b, 00000111b, 00001110b, 00000000b, 00001110b, 01111111b, 11111111b
.db 10011111b, 11111100b, 00111111b, 11000000b, 11000000b, 00000011b, 00000111b, 00001110b, 00000000b, 00000011b, 01111111b, 11111111b
.db 11011111b, 11111100b, 01111111b, 11000000b, 11000001b, 00000011b, 00000111b, 10001110b, 00000111b, 00000011b, 10111111b, 11111111b
.db 11011111b, 11110001b, 11100011b, 11000000b, 11000001b, 11100011b, 00000111b, 10001110b, 00000111b, 00000011b, 11111111b, 11111111b
.db 10011111b, 11100001b, 11100011b, 11000000b, 11000001b, 11000011b, 00000111b, 10001110b, 00000111b, 00000011b, 11111111b, 11111111b
.db 11111111b, 10011111b, 10000011b, 11000000b, 11000001b, 11000011b, 00000110b, 00000110b, 00000111b, 00000011b, 11111111b, 11111111b
.db 10011111b, 11111111b, 00000011b, 11000000b, 11000001b, 11000011b, 00000100b, 00001110b, 00000111b, 00000011b, 11011111b, 11111101b
.db 10111111b, 11111110b, 00000011b, 11000000b, 11000001b, 11000011b, 00000000b, 00011110b, 00000111b, 00000011b, 10001111b, 11111000b
.db 10011111b, 11111100b, 00000011b, 11000000b, 11000001b, 10000011b, 00000000b, 01111000b, 00000111b, 00000011b, 10001111b, 11111000b
.db 10111111b, 11111000b, 00000011b, 10000000b, 11000000b, 00000011b, 00000000b, 01111000b, 00000111b, 00000011b, 10001101b, 11011000b
.db 10011111b, 11111110b, 00000000b, 00000000b, 11000000b, 00011111b, 10000000b, 00111110b, 00000111b, 00000001b, 10001000b, 10001000b
.db 11111111b, 11111110b, 00000000b, 00000000b, 11000000b, 00111111b, 00000000b, 00111110b, 00000111b, 00000000b, 10001000b, 10001000b
.db 10011111b, 11111110b, 00000000b, 00000000b, 11000000b, 11111111b, 00000100b, 00111110b, 00000111b, 00000011b, 10001000b, 10001000b
.db 10101111b, 11111110b, 00000111b, 11000000b, 11000001b, 11111011b, 00000100b, 00011110b, 00000111b, 00000011b, 10001011b, 11001000b
.db 10011111b, 11111110b, 00000011b, 11000000b, 01000001b, 11100011b, 00000110b, 00011110b, 00000111b, 00000111b, 10001110b, 01001000b
.db 10101111b, 11111110b, 00000011b, 11000000b, 11000001b, 00000011b, 10000111b, 00001110b, 00000111b, 00000111b, 10001100b, 01001000b
.db 11111111b, 11111110b, 00000011b, 11000000b, 11000000b, 00000011b, 00000111b, 00001110b, 00000111b, 00000011b, 10011000b, 01001000b
.db 10011111b, 11111110b, 00000011b, 11000000b, 11111000b, 00011111b, 00000111b, 10001110b, 00000111b, 00000011b, 10110000b, 11001000b
.db 10101111b, 11111110b, 00000011b, 11000000b, 11111110b, 00011111b, 00000111b, 10001110b, 00000111b, 00000111b, 11100001b, 10001000b
.db 10011111b, 11111110b, 00000011b, 11000000b, 11111110b, 00111100b, 00000001b, 10001110b, 00000111b, 00000011b, 11000011b, 10001000b
.db 10101111b, 11111110b, 00000011b, 11000000b, 11111111b, 01111111b, 11111111b, 11000111b, 11000000b, 00000011b, 10000110b, 10001000b
.db 11111111b, 11111110b, 00000011b, 11000000b, 11111111b, 11111111b, 11111111b, 11000011b, 11100000b, 00000111b, 10001100b, 10001000b
.db 10001111b, 11111110b, 00000011b, 10000000b, 01111111b, 11111111b, 11111111b, 11110001b, 11110000b, 01111111b, 10011000b, 10001000b
.db 10101111b, 11111110b, 00000011b, 00000000b, 00111111b, 11111111b, 11111111b, 11111000b, 11111000b, 11111111b, 10011101b, 11011000b
.db 10001111b, 11111110b, 00000011b, 11111111b, 11111111b, 11111111b, 11111111b, 11111110b, 00111001b, 11111111b, 10011111b, 11110000b
.db 11111111b, 11111110b, 00000011b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10001110b, 00000000b
.db 10001111b, 11111100b, 00000001b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000011b, 00000000b
.db 10111111b, 11111000b, 00111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000001b, 00000000b
.db 10001111b, 11110011b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 10000001b, 00000001b
.db 11101111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11000011b, 00000011b
.db 10001111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11100110b, 00000111b
.db 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b, 11111111b
But after designing a screen of some sort, is there an easy way to quickly turn a .bmp file or something into something suitable for programming use, like the above example? I'm getting tired of manually typing this shit, it's a monk's job!

Thanks in advance!
Title: Re: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: JosJuice on December 05, 2010, 10:18:25 am
I believe SourceCoder can convert .bmps to binary data and/or hex.

http://www.cemetech.net/projects/basicelite/sourcecoder2.php (http://www.cemetech.net/projects/basicelite/sourcecoder2.php)
Title: Re: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: calc84maniac on December 05, 2010, 10:32:52 am
If you are using SPASM, you can import a .bmp directly by using #include "filename.bmp"
Title: Re: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: KermMartian on December 05, 2010, 10:43:06 am
I believe SourceCoder can convert .bmps to binary data and/or hex.

http://www.cemetech.net/projects/basicelite/sourcecoder2.php (http://www.cemetech.net/projects/basicelite/sourcecoder2.php)
SourceCoder 2.5 can indeed convert images into .8xi format as well as binary format for ASM, BASIC, and Axe in monochrome and 3- and 4-level grayscale.
Title: Re: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: Ashbad on December 05, 2010, 11:05:47 am
^ that's what I use many times to convert my ms-paint sprites to hex.
Title: Re: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: Deep Toaster on December 05, 2010, 11:19:04 am
Much longer discussion here: http://ourl.ca/8027

Basically, yeah, use SourceCoder. It shows whatever formats you need :) And 8xi's.
Title: Re: How to easely convert .bmp to a binary 'picture' so it can be used in a script?
Post by: Jerros on December 06, 2010, 10:10:01 am
Wow, thanks y'all! That should definitely save me some time. =^_^=