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.

#26 2022-09-14 06:54:21

Registered: 2021-11-03
Posts: 16

Re: GB WLA-DX (WLA-GB) correct configuration of MBC1/MBC3 banks (128KB).

I'm having trouble turning my screen off and on. Writing to Bit7 rLCDC pops up error (BGB) "disabling screen outside vblank" - so I made a buffer to which it writes changes in rLCDC, which transfers it in VBLANK:

    LD A,%00010011            ; disable screen (off bit7)
    LD [rLCDC_Buffer],A

    LD A,%10010011            ; enable screen (on bit7)
    LD [rLCDC_Buffer],A

in VBlank_Handler:

    LD A,[rLCDC_Buffer]
    LDH [rLCDC],A

Unfortunately, I still have this error (BGB "disabling screen outside vblank") when I write to the buffer, and yet it is transferred to rLCDC in the VBLANK interrupt, where do I make a mistake?

Another question, does GB allow writing to VRAM outside of VBLANK and when the LCD screen is ON? The VRAM memory is mapped to the WRAM CPU, when I tried to write it did not cause errors, but I prefer to ask to be sure.

I also changed the assembler from WLA-GB to RGBDS.

Last edited by siudym (2022-09-14 13:30:53)



Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson