A tile-based graphics engine containing several layers allows for complex manipulations. The most comprehensive information on how this system works is found in the through comments of the mach_defines.h file of soc/ipl/gloss
Layers from Top to Bottom:
- Sprite layer
- Tile layer B
- Tile layer A
- Background Layer
Tileset Details:
The graphics engine is based on tile sets that are 256x512px in size, containing 16x16 pixel tiles which are indexed left-to-right beginning at the top. Tilesets are limited to a 16-bit color palette.
Writing to Tile Layers:
Each tile layer is 64x64 tiles in size, although the screen is 30x20 tiles in size. When a tile layer is enabled, any changes to that layer will be immediately viewable.
Moving Tile Layers:
As noted, tile layers are larger than the screen. These can be offset. Tile layers wrap around the screen so by filling all 64 slots and then offsetting the layer in that direction you effectively create infinite scrolling.
Scaling and Distorting Tile Layers:
More to come. See main.c of the IPL for working examples.
Working with the Sprite Layer:
The sprite layer is not yet fully available. See main.c in IPL and in the Flappy app for some working examples.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.