(52 and 48 pixel Pac-Man logos by DEBRO)I have attached a tool that converts a 52-pixel wide BMP file to assembly code that can be plugged into a kernel. The BMP file should be set to 256 colors, but the program only reads it as monochrome. To set the colors for each line, you have to manually change the data in the C code. If you don't have a compiler, you can edit the assembly code too.You will see from the code that it uses a lot of ROM. The routine takes 56 bytes per line. However as most homebrews are less than 32K, you can probably fit in your image. Also the shape and colors of the bitmap are static due to immediate addressing. If you need to save space or want animation, you may be better off with a 51-pixel image.The maximum height within a single 4K bank is about 67 lines.Let me know if you have any questions, because there could be some detail I forgot to explain. Have fun!
Attached Files
-
52pixels.zip (8.9K)
downloads: 96



Create a custom theme








I like the idea of reading a bitmap, since I plan to do the same for use in a track editor, and I don't want to spend countless hours making a track editor utility (e.g. like the Indy 500 editor.)
The only issue I see with your code (and potentially mine) is it appears that you assume a fixed-size header. As I understand, this isn't always the case. Or am I wrong?
EDIT: just checked since I want to read BMP files too. The header is a fixed size but the image data doesn't necessarily start right after it - I think that palette data may be there instead. Anyway, offset $0A contains the offset to the start of image data, in case you get a weird BMP file.