setPlanSize doesn't change the addresses

SGDK only sub forum

Moderator: Stef

Post Reply
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

setPlanSize doesn't change the addresses

Post by cero »

I see setPlanSize doesn't move the planes' starting addresses, essentially leaving lots of wasted VRAM. Would it be reasonable to do so? Surely anyone changing the size can expect the planes' contents to be invalidated?

Setting the planes to 32*32 or 64*32 would leave space for hundreds of tiles, no? I believe the hw can address up to 2048 tiles.
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: setPlanSize doesn't change the addresses

Post by Stef »

I think it's better to keep methods separated. setPlanSize(..) only define the hardware plan size and so the tilemap size, then free to the user to move the tilemap address where he want, i think SGDK shouldn't do it automatically... Imagine the user defined a specific address for both plan, SGDK can't guess how to move them.
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

Re: setPlanSize doesn't change the addresses

Post by cero »

Perhaps a separate function then? VDP_compactVRAM()? Would be friendlier than expecting manual register-banging.
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: setPlanSize doesn't change the addresses

Post by Stef »

Having a separate method could be a good idea, new issue about it :)
Post Reply