setPlanSize doesn't change the addresses

SGDK only sub forum

Moderator: Stef

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

setPlanSize doesn't change the addresses

Post by cero » Sat Dec 26, 2015 5:00 pm

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 » Sun Dec 27, 2015 10:25 pm

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: 339
Joined: Mon Nov 30, 2015 1:55 pm

Re: setPlanSize doesn't change the addresses

Post by cero » Mon Dec 28, 2015 9:08 am

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 » Mon Dec 28, 2015 11:20 am

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

Post Reply