Re: Coop game development
Posted: Sun Jun 17, 2018 12:12 pm
I'm not sure how all this works, so I made a theoretical mode similar to gameboy color specs, so please tell me is this how uzebox works.
VRAM: 4096 bytes
Resolution:
160x144 px resolution
20x18 tile resolution (1 tile is 8x8px)
360 tiles on screen at once
Tiles:
1 byte per tile for palette, flipping, priority:
4 bits (16 palettes), 1 bit for inverting colors, 1 bit for horizontal invert, 1 bit for vertical invert, 1 bit (priority draw flag) = 1 byte for color, palette and draw priority
Draw priority is a flag that can be set so the tile is drawn over sprites.
2048 bytes for pixel data in the 256 tile tileset (256 tiles * 8 bytes)
360 bytes for each tile in the screen
Palette:
3 bytes per color (RGB values)
32 palettes in total = 96 bytes
16 palettes are for tiles and 16 for sprites
Sprites:
1 byte for palette, flipping and rotation:
4 bits (16 palettes), 1 bit for horizontal invert, 1 bit for vertical invert, 1 bit for rotate 90°cw, 1 bit for rotate 90°ccw
8 sprites is 8 bytes
Since sprites use 4 colors, they need 2 bits per pixel. One sprite is thus 16 bytes
1584 bytes for pixel data in the 99 tileset (99 * 16 bytes)
2048 + 360 + 96 + 8 + 1584 = 4096 bytes
What actually needs to be in the VRAM, how much can one swap from ram to vram per frame and what am I doing wrong here?
VRAM: 4096 bytes
Resolution:
160x144 px resolution
20x18 tile resolution (1 tile is 8x8px)
360 tiles on screen at once
Tiles:
1 byte per tile for palette, flipping, priority:
4 bits (16 palettes), 1 bit for inverting colors, 1 bit for horizontal invert, 1 bit for vertical invert, 1 bit (priority draw flag) = 1 byte for color, palette and draw priority
Draw priority is a flag that can be set so the tile is drawn over sprites.
2048 bytes for pixel data in the 256 tile tileset (256 tiles * 8 bytes)
360 bytes for each tile in the screen
Palette:
3 bytes per color (RGB values)
32 palettes in total = 96 bytes
16 palettes are for tiles and 16 for sprites
Sprites:
1 byte for palette, flipping and rotation:
4 bits (16 palettes), 1 bit for horizontal invert, 1 bit for vertical invert, 1 bit for rotate 90°cw, 1 bit for rotate 90°ccw
8 sprites is 8 bytes
Since sprites use 4 colors, they need 2 bits per pixel. One sprite is thus 16 bytes
1584 bytes for pixel data in the 99 tileset (99 * 16 bytes)
2048 + 360 + 96 + 8 + 1584 = 4096 bytes
What actually needs to be in the VRAM, how much can one swap from ram to vram per frame and what am I doing wrong here?