Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2021-10-29 04:21:12

M2m
Member
Registered: 2021-02-18
Posts: 27

Moving window to the left ?

I know typically you use the Window layer as a HUD and put it at the bottom or right.
With Hblank interrupts (and turning it off after a specific scan line) you might put it at the top.

Now Iím wondering if there is any trickery to put the HUD at the left ? Maybe only turn it on for certain columns ?

Using GBDK2020. But every tip is appreciated.

Offline

 

#2 2021-10-30 08:27:54

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 56
Website

Re: Moving window to the left ?

I don't remember how I implemented this, but I set aside this code in a separate .txt file after I switched to a vertical right-side HUD in case I ever wanted to reference it again for a future project.

    // STAT_REG = 0x45; // Unused interrupt code, no longer needed with the change to a vertical HUD. Keeping it on hand for future projects.
    // LYC_REG = 0x10; //LCD interrupt 16th scan line
    // disable_interrupts();
    // add_LCD(interruptLCD);
    // add_VBL(interruptVBL);
    // enable_interrupts();
    // set_interrupts(VBL_IFLAG | LCD_IFLAG); // Don't think I need these anymore with a vertical UI

This was the thread where I was getting help troubleshooting my own top-side HUD before I decided that I wanted a vertical HUD.
https://gbdev.gg8.se/forums/viewtopic.php?id=615

I hope something here helps with understanding interrupts as I forgot how they worked...

Last edited by Ardis (2021-10-30 08:30:39)


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

#3 2021-10-30 10:09:59

toxa
Member
Registered: 2020-02-13
Posts: 300

Re: Moving window to the left ?

The problem with disabling window in the middle of line which is being drawn, is that the timing is not constant, it depends on many things.

Offline

 

#4 2021-11-05 08:00:07

Jonas
Member
From: Frankfurt, Germany
Registered: 2016-06-06
Posts: 112
Website

Re: Moving window to the left ?

M2m wrote:

Now Iím wondering if there is any trickery to put the HUD at the left ?

To my knowledge, there isn't.

Depending on your game, you might think out of the box. If your main playfield only scrolls vertically (or doesn't scroll at all), you could paint the leftmost part of the screen in white (or some other color) and put sprites on it to draw the HUD. In some games it may be possible to put the main playfield on the window and use the background as a HUD. But both ideas won't fit for all games.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson