Jump to content



1

Mode 2 bitmap questions - ColecoVision


2 replies to this topic

#1 5-11under OFFLINE  

5-11under

    Stargunner

  • 1,339 posts
  • Location:Ontario, Canada

Posted Sun Jan 23, 2011 8:38 PM

Hi there,

In the past, I've always used the more simpler ColecoVision display modes, with 256 characters available for use for the whole screen (either 2 colors per character or 2 colors per line per character). Now, however, I'd like to use mode 2 bitmap, which is the one that has 3 character sets, one each for 8 rows of characters (256 x 3 characters).

For reference, I'm using Hi-Tech C, although I don't think using SDCC would make much of a difference. I'm also using Getput1, which looks to be from April 2003.

I used the BMP2PP and related program (to export to C) to create a compressed bitmap picture, which shows up on the screen all in basically one line of code. This image is used for the background. However, I've got a row on the top and a row on the bottom of the screen which will be used for showing the score of the game, as well as other status items. I could add this to the original bitmap file, but that's not ideal for control, and would be somewhat painful to implement. I have control over the characters in the upper 1/3 of the screen (just like using the simpler modes), but I'd like to be able to access and modify the character set related to the bottom 1/3 and possibly middle 1/3 of the screen. Is there an easy (or difficult) way to do this?

Thanks,
5-11under

Edited by 5-11under, Sun Jan 23, 2011 8:39 PM.


#2 Pixelboy OFFLINE  

Pixelboy

    River Patroller

  • 3,598 posts
  • Location:Montreal, Canada

Posted Sun Jan 23, 2011 9:28 PM

View Post5-11under, on Sun Jan 23, 2011 8:38 PM, said:

Hi there,

In the past, I've always used the more simpler ColecoVision display modes, with 256 characters available for use for the whole screen (either 2 colors per character or 2 colors per line per character). Now, however, I'd like to use mode 2 bitmap, which is the one that has 3 character sets, one each for 8 rows of characters (256 x 3 characters).

For reference, I'm using Hi-Tech C, although I don't think using SDCC would make much of a difference. I'm also using Getput1, which looks to be from April 2003.

I used the BMP2PP and related program (to export to C) to create a compressed bitmap picture, which shows up on the screen all in basically one line of code. This image is used for the background. However, I've got a row on the top and a row on the bottom of the screen which will be used for showing the score of the game, as well as other status items. I could add this to the original bitmap file, but that's not ideal for control, and would be somewhat painful to implement. I have control over the characters in the upper 1/3 of the screen (just like using the simpler modes), but I'd like to be able to access and modify the character set related to the bottom 1/3 and possibly middle 1/3 of the screen. Is there an easy (or difficult) way to do this?

Thanks,
5-11under
I think you just need to master the put_vram() function. With it, you can do whatever you want in VRAM, given that you know the exact address of the VRAM byte(s) you want to alter, and you can modify anything (patterns, colors, name tables, and sprites) that way.

#3 5-11under OFFLINE  

5-11under

    Stargunner

  • 1,339 posts
  • Location:Ontario, Canada

Posted Mon Jan 24, 2011 8:02 AM

Thanks Pixelboy. I found this from Daniel's documentation:

put_vram
NMI*
/* Upload RAM to VRAM. count should be a multiple of 256 */
void put_vram (unsigned offset,void *ptr,unsigned count);

This should work once I figure out how to use it. ;) The only problem is I'm getting data from two sources: a picture and from ICVGM. I could redraw the graphics using CVPAINT. I'm just now remembering there's a new version, CVPAINT2 (http://www.atariage....tool-cvpaint-2/ and/or http://www.atariage....aphics-toolkit/ - Thanks Daniel!), and it looks like that program has a couple of features that will be very useful, such as the zoom and grid. It'll be a bit tedious to move the ICVGM data into CVPAINT2 (fortunately there's not that much), but once that's done, it'll be easy to use when programming.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users