Jump to content
  • 0

Vera Color Registers


CursorKeys
 Share

Question

Hi!

 

The Vera has a palette that can be changed, which is awesome, a little like the Amiga in that way.

All is fine when I change the colors to writing to the Vera registers, but when I read, and try to restore later, it won't work.  It is like the values reading the color registers are not correct?

 

Am I doing something wrong, or is this a known bug, or a know issue, that you need to take special care to read the registers?

 

Cheer
CKs

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
14 minutes ago, CursorKeys said:

All is fine when I change the colors to writing to the Vera registers, but when I read, and try to restore later, it won't work.  It is like the values reading the color registers are not correct?

Am I doing something wrong, or is this a known bug, or a know issue, that you need to take special care to read the registers?

You should be able to read back the values once you've set them. That's the caveat though, you can't read them unless you've set them. Ie, you can't read the default palette. (Imho this should be set on startup by the kernel on startup...)

Just checked, and the following does return $0f for both 'lda's.

    lda #$11
    sta ADDRx_H
    lda #$fa
    sta ADDRx_M
    stz ADDRx_L
    lda #$0f
    sta DATA0
    sta DATA0
 
    lda #$11
    sta ADDRx_H
    lda #$fa
    sta ADDRx_M
    stz ADDRx_L
    stp
    lda DATA0
    lda DATA0
Edited by Yazwho
  • Like 1
Link to comment
Share on other sites

  • 0

>>You can't read them unless you've set them. Ie, you can't read the default palette

 

Ah ok.... I think you should though.  Now my code is including the original palette as data, just in order to restore the palette after I messed it up.  But if the default palette would be tweaked at some point, my code will be less accurate.  Ok, not a biggy, but at least then I am not going crazy.  And yes, if the Kernal would set the palette on startup, it would make sense you could read it later on. That sounds like a good solution.

 

Link to comment
Share on other sites

  • 0
  • Super Administrators
59 minutes ago, CursorKeys said:

Hi!

 

The Vera has a palette that can be changed, which is awesome, a little like the Amiga in that way.

All is fine when I change the colors to writing to the Vera registers, but when I read, and try to restore later, it won't work.  It is like the values reading the color registers are not correct?

 

Am I doing something wrong, or is this a known bug, or a know issue, that you need to take special care to read the registers?

 

Cheer
CKs

Right, the issue is that the VERA registers are read only. So when you read data back from the locations used for things like the palette, what you are actually reading is the RAM at those same locations. 

Once you have written your own palette data there, it's easy enough to read it back, but remember that you're always reading the cached information - not the actual register values. 

Having said all that... the palette is (or will be) documented in the VERA programmer's reference, so it should be possible to create a default state, so you can fall back to it. You'll have to create your initial palette by hand, but once you do, you can reload that at any time.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use