shoud look almost like this
I not using any type of compression on the tileset and map, just optimisation on the tileset to save some VRAM.
i even made a build aside that just loads the map and scroll using the controller input, the results were the same.
here is the code
Code: Select all
#include <genesis.h>
#include "res/maps.h"
const u16 paletaInterna2[16] = { 0x0EEE, 0x0222, 0x0000, 0x0666, 0x0444, 0x0002, 0x0006, 0x0009, 0x0004, 0x0024, 0x026A, 0x0048, 0x0046, 0x0022, 0x0041, 0x0261 };
const u16 paletaExterna2[16] = { 0x0000, 0x0223, 0x0445, 0x0667, 0x0840, 0x0A60, 0x0CA2, 0x0EE0, 0x0021, 0x0040, 0x0260, 0x0281, 0x0003, 0x0025, 0x0047, 0x0268 };
int main()
{
VDP_setPalette(PAL0, paletaInterna2);
VDP_setPalette(PAL1, paletaExterna2);
VDP_loadTileSet(&debug_tileset_B, TILE_USERINDEX, DMA);
SYS_doVBlankProcess();
DMA_setBufferSize(9600);
Map* map = MAP_create(&debug_map_B_P1, BG_B, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, TILE_USERINDEX));
u16 posX = 0, posY = 0;
SYS_doVBlankProcess();
while (1) {
u16 value = JOY_readJoypad(JOY_1);
if (value & BUTTON_UP) {
posY-=3;
}
if (value & BUTTON_DOWN) {
posY+=3;
}
if (value & BUTTON_RIGHT) {
posX +=3;
}
if (value & BUTTON_LEFT) {
posX -= 3;
}
MAP_scrollTo(map, posX, posY);
SYS_doVBlankProcess();
}
Code: Select all
TILESET debug_tileset_B "Maps/Debug Map/debugMap_B1.png" 0 ALL
MAP debug_map_B_P1 "Maps/Debug Map/debugMap_B1.png" debug_tileset_B 0