Commodore 128 Alive!

Commodore 128 => 128 programmers => Assembly => Topic started by: MIRKOSOFT on January 24, 2010, 01:54 PM

Title: Shadow registers of VIC
Post by: MIRKOSOFT on January 24, 2010, 01:54 PM
Hi!

I want to ask how to disable shadow registers of VIC?

I want to use real registers at $D000...

I think it's st. about IRQ, but don't know how.

Thanks for every help.

Miro
Title: Re: Shadow registers of VIC
Post by: SmallCleverDinosaur on January 24, 2010, 07:17 PM
Have a look in "Mapping the C128", page 69, address 216/$D8. In order to be able to access the VIC's register directly you have to disable BASIC's screen editor IRQ routine and you do that by storing the value 255/$FF in this register.

From "Mapping the C128":

You can turn off the screen-setup portion of the screen editor IRQ routine by storing the value 255/$FF here. This gives you direct control over the VIC chip register settings, but disables BASIC'S ability to change display modes.
Title: Re: Shadow registers of VIC
Post by: Hydrophilic on January 26, 2010, 03:18 PM
SmallCleverDinosaur got part of the answer.  However you can't always take CBM at face value.  While it is true BASIC's GRAPHIC command won't work after putting 255 into 216($d8), this is indirect.

$d8 controls the KERNAL/Editor portion of VIC-II IRQ.  When you store 255 here, KERNAL/Editor will no longer update screen mode registers of VIC.  This means BASIC's GRAPHIC command will not work.

However, this do not stop BASIC portion of VIC-II IRQ!  You do this by clearing bit 1 of $A04.  For example, POKE 2564, PEEK(2564) AND 254.  Unless you do this, BASIC will continue to update SPRITE positions of VIC-II registers and also respond to COLLISIONs (both sprite and light-pen).  Unfortunately, when you do this, BASIC updates to SID also stop working, so SOUND and PLAY will not work either.
EhPortal 1.34 © 2025, WebDev