Shop OBEX P1 Docs P2 Docs Learn Events
Graphics Driver Improvement and Optimization — Parallax Forums

Graphics Driver Improvement and Optimization

Vega256Vega256 Posts: 197
edited 2012-06-23 17:48 in Propeller 1
Hey,

This is a follow-up from the thread
http://forums.parallax.com/showthread.php?140768-Prop-Code-Reduction-Tips.

So a while back, I happened upon someone's tile/sprite driver. I thought I could use it, so I tried it. It had what I needed, but there were some aspects that I went on to improve (TV picture quality etc.). In the end, I made a lot of mods.

What I wound up with was a graphics driver consisting of tile and sprite support:
  • NTSC (can be adjusted for PAL)
  • 256x224 resolution
  • 8x8 tiles
  • 16x16 sprites
The problem was that I wanted to add more capability but, at that time, there weren't enough resources; the code was clunky, unwieldy, bloated, so I ran out of cog space. I wanted to be able to scroll horizontally and vertically. What I did was split the driver into two pieces, both occupying their own space in two different cogs: a tile driver and a sprite drive. On the tile driver side, I managed to write up some routines that can scroll horizontally and vertically over four tilemaps, which is a large advancement for me. The problem now is that I can't seem to find a way to get the sprite routines working with the tile routines.

The original driver was made such that the sprite routine ran after the tile routine. Since in the original build, the tile and sprite drivers both occupied the same space, the sprites were just run after the tiles. I can't do that now because I have separated the code across two cogs.

This driver may be over-ambitious, but anyone who has any suggestions, or even wants to try their hand at improving this is welcome. This link is the one for the driver that I didn't split up. I thought that I documented the best way I could, but if there is any confusion, ask me.

Graphics_driver.spin
gfx_renderer_sprite_4.spin
tv_drv.spin

Thanks in advance, guys.
Sign In or Register to comment.