Jump to content

Zach's Projects

  • entries
    53
  • comments
    535
  • views
    67,107

52-pixel bitmap tool

Sign in to follow this  
Guest

750 views

krokodile_commander.zip(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!2600tradelist.zip
Sign in to follow this  


16 Comments


Recommended Comments

Hello,

 

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.

Share this comment


Link to comment

I don't remember all the details, but I did study the BMP structure at one time. I remember that there is header data, pallette data, and finally graphics data. Clearly the pallette data will be longer for a 16 bit color image than an 8 bit one.

Share this comment


Link to comment

This is pretty cool. I'm not sure how much the extra 4 pixels is worth having to unroll the loops this way, though.

Share this comment


Link to comment
This is pretty cool.  I'm not sure how much the extra 4 pixels is worth having to unroll the loops this way, though.

It depends. I'm using it for my title screen so I can get a font similar to the one used in the 7800 Ms. Pacman. I may look similar to the 48-pixel one I did but I can tell the difference. Maybe I'll post a screen shot of both and let you decide.

 

Now that I used the tool and optimized the code that was produced, I might look into seeing if I can squeeze more pixels out of this like John suggested.

 

Good work Zach.

 

I hope the other [stella] members will know about this :)

Share this comment


Link to comment
This is pretty cool.  I'm not sure how much the extra 4 pixels is worth having to unroll the loops this way, though.

I consulted with Nathan about the worth of four extra pixels before doing the work. It's easy to appreciate the extra width the first time you see it on a TV. It'll be unlike anything you've seen before on a 2600. Furthermore, remember that an 8K and 32K game cost the same to publish, so in a sense, ROM is cheap.

Share this comment


Link to comment

I can see why Nathan would certainly clamor for more pixels - the artist who is creating the bitmap will always want and appreciate every last pixel you can squeeze out - but, IMO, 90% of the time most folks won't notice unless you tell them and show them a comparison.

 

I could be wrong. :)

Share this comment


Link to comment
I can see why Nathan would certainly clamor for more pixels - the artist who is creating the bitmap will always want and appreciate every last pixel you can squeeze out - but, IMO, 90% of the time most folks won't notice unless you tell them and show them a comparison.

Probably so. Since I've seen the comparison I don't know which I like better. Well, I do like the 52-pixel version but I might be satisfied with the 48 pixel version. The 52 pixel version does look better IMO and I might be able to squeeze more pixels into this too. It may come down to ROM space for me.

 

I was going to post a screen shot but I can't add an attachement to my post :)

Share this comment


Link to comment

As far as creativity with fonts, some creativity can be used in giving the illusion of more than 48 pixels already by shearing the graphic with HMOVE (think italics).

Share this comment


Link to comment
I was going to post a screen shot but I can't add an attachement to my post :)

Thanks for sending me the screen shot, Dennis. I added it to the top of the thread.

Share this comment


Link to comment

Hm... The big one is no real improvement IMO. Especially the Pac-C looks even better in the small one. It seems as if a 49 pixel bitmap to do a proper "P" would be good enough :)

Share this comment


Link to comment

How 'bout doing a tool for 56 pixels? The leftmost four and rightmost four pixels would have to fit one of these patterns:

XXXX
XXX-
XX-X
XX--
X-XX
X--X
X---   (with the next pixel also being blank)
-XXX
--XX
---X  (with the previous pixel also being blank)
----

and not these

X-X-
-XX-
-X-X
-X--
--X-

Code should be fairly straightforward.

Share this comment


Link to comment
How 'bout doing a tool for 56 pixels?  The leftmost four and rightmost four pixels would have to fit one of these patterns:

It's a good idea, but I've got a homebrew to finish. I going to stick with 52 pixels for the Four-Play title screen becuase Nathan's artwork doesn't work in 56. So far, you've only seen the text, but there is more.

 

I think Nathan's work will provide a better example of the advantages of 52 pixels.

Share this comment


Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...