Bitmap screen and Omega Race

Basic and Machine Language

Moderator: Moderators

User avatar
AndyH
Vic 20 Afficionado
Posts: 380
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Bitmap screen and Omega Race

Post by AndyH »

I’ve not done that myself, but I believe there is an example in the c64 tutorials. Also checkout the demos.
--
AndyH
HEWCO | Vic 20 blog
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Bitmap screen and Omega Race

Post by funkheld »

thanks for the information.
I can not find a load / save for the vic20.

greeting
User avatar
AndyH
Vic 20 Afficionado
Posts: 380
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Bitmap screen and Omega Race

Post by AndyH »

Thanks everyone for the advice at the start, to get me going in the right direction. I have now completed my Vic Bitmap Mode commandset for Turbo Rascal and I am now in the documentation/example/testing/bug fixing phase. :)

Mike, I realise now what you were saying about the memory layout - sorry I misunderstood what you meant when you said layout in columns, you were actually advising on what I was also thinking and implemented, to layout one complete column at a time before moving onto the next. I also didn't realise what MINIGRAFIK (and MAXIGRAFIK) was. I'd mistakenly picked up it was a paint program and tools to help manipulate that. I've found the documentation you posted and can see there are some cool BASIC commands also. Had a play with that and love it (wish I'd realised sooner).

My bitmap mode is the same, 160x192 and laid out the same in memory. There should hopefully be some compatibility and opportunity for cross over I will have to explore in the future.

For this version of VBM for Turbo Rascal, I have implemented the following:
  • vbmDebug - switch off the bitmap to reveal the ROM characters used to fill the screen
  • vbmSetColumn - set the built in screenmemory zero page pointer to the address for a column from 0 to 19. This is used for Tile commands and others.
  • vbmNextColumn - add 192 to the screenmemory pointer - effectively goes to the next column
  • vbmSetPosition1, vbmSetPosition2 and vbmSetPosition4 - used to set the position to draw a sprite
  • vbmClear - clear the bitmap memory with a byte value, usually 0
  • vbmClearColor - clear the color memory with a value
  • vbmDrawTile - Draw a single 8x8 tile character on the screen. Use with vbmSetColumn and manipulation of the screenmemory pointer
  • vbmDrawTileMap - Draws a tilemap of characters of any size to the screen
  • vbmTestPixel and vbmTestPixel2 - Test a pixel value at a position on the screen
  • vbmTestTilePixel and vbmTestTilePixel2 - Test a pixel value within an 8x8 tile. Can also be used with sprite slices
  • vbmDot and vbmBlot - draw dot pixels on the screen
  • vbmSrollLeft and vbmScrollRight - rearrange the characters on screen to quickly scroll 8 pixels left or right. Note that there are some restrictions when using this feature
  • vbmScreenShiftLeft and vbmScreenShiftRight - scroll an area of the screen 1 pixel at a time - slower than vbmScrollLeft/Right but no restrictions on use
  • vbmSpriteShiftL, vbmSpriteShiftR and vbmSpriteStitch - prepare pre-shifted characters for use with the sprite commands
  • vbmDrawSprite8 and vbmDrawSprite16 - simple sprite drawing commands
  • vbmDrawSpriteSlice - complex sprite command giving precise control and allowing for sprites of any size
  • vbmDrawText - draw text to the screen
  • vbmDrawBCD - draw numbers (eg: scores) to the screen. Use with the BCD commands
My focus has been to aid development of games. There are different modes for drawing, covering straight replace, OR, EOR and AND operations. Also, the way Turbo Rascal works the ASM code is only included for the commands you use, so memory usage is not bloated by commands you do not use in your program.

Some things I would really like to put in to VBM in the future are line, ellipse and fill routines. I can see Minigrafik and tools have that - wonder if you would mind if I could use those?
--
AndyH
HEWCO | Vic 20 blog
Post Reply