Stephane-D / SGDK

SGDK - A free and open development kit for the Sega Mega Drive
https://www.patreon.com/SGDK
MIT License
1.73k stars 186 forks source link

Add user friendly setWindowxxx(..) methods #77

Open Stephane-D opened 7 years ago

Stephane-D commented 7 years ago

The current window setup methods :

void VDP_setWindowHPos(u16 right, u16 pos);
void VDP_setWindowVPos(u16 down, u16 pos);

are close to internals registers setup but not really user friendly.

Adding methods as :

VDP_setwnidowOff()
VDP_setWindowOnTop/Bottom/Left/Right(..)

would be much more easier to deal with.

Usage examples : want a 32px high HUD at the top? (think shmups) VDP_setWindowOnTop(4);

96px HUD at the side (don't forget width is in 16px steps, not 8px like height): VDP_setWindowOnRight(6);

Set up window for vertical split screen (i.e. the right half of the screen): VDP_setWindowOnRight(10);

etherton commented 1 year ago

Perhaps it makes sense to have the helper function units in pixels and >>3 or >>4 appropriately?