Page 1 of 1
Change window address -> text drawing breaks
Posted: Mon Feb 08, 2016 5:24 pm
by cero
In the following code, if I comment the setWindowAddress call, text draws fine. This is because the drawing expects the window to always be at the bottom of the top of VRAM. I think it should be changed to a draw at a static value.
Code: Select all
#include <genesis.h>
#define APLAN_DEFAULT 0xE000
int main() {
VDP_setWindowAddress(APLAN_DEFAULT);
VDP_setTextPlan(PLAN_B);
VDP_drawText("This goes to plane B.", 10, 13);
while (1);
return 0;
}
Re: Change window address -> text drawing breaks
Posted: Mon Feb 08, 2016 5:38 pm
by cero
I tried to work around this, keeping window the first one, by setting plane B to the same address as plane A. But apparently this isn't legal, it creates a black screen.
Is this a limitation of the Genesis, or of SGDK?
Re: Change window address -> text drawing breaks
Posted: Mon Feb 08, 2016 5:52 pm
by cero
OK, I found a bug.
In the setBPlaneAddress function, the bplan_adr variable is not updated, even though that's done in the setReg function. Will file this one to github.
Re: Change window address -> text drawing breaks
Posted: Mon Feb 08, 2016 6:01 pm
by cero
For my original issue: I found a working memory layout by putting plane A at 0x0000. Since I use a fullscreen window plane in this project, the garbage in plane A doesn't matter, and this way no memory is wasted, I even gain 128 more tiles.
Re: Change window address -> text drawing breaks
Posted: Mon Feb 08, 2016 7:49 pm
by Stef
cero wrote:OK, I found a bug.
In the setBPlaneAddress function, the bplan_adr variable is not updated, even though that's done in the setReg function. Will file this one to github.
Thanks for pointing this one ! Never noticed, will be fixed next version
