Autor
| Reading the control registers of the VDP
|
Metalion msx freak Mensajes: 241 | Publicado: Septiembre 09 2007, 17:20   |
Hi everyone,
How do you read the values of the control registers of the VDP in ASM ?
Everywhere they are labeled as "write only" registers ...
But let's say you want to change only 1 or 2 bits in one of them. You would do something like VDP(x)=VDP(x) OR 64 in BASIC. But in ASM, it seems that you can only write a full register at once, without being able to read the value first.
Am I missing something ?
|
|
GhostwriterP msx addict Mensajes: 320 | Publicado: Septiembre 09 2007, 17:52   |
Basic keeps the vdp values somewhere in ram?
|
|
ARTRAG msx master Mensajes: 1802 | Publicado: Septiembre 09 2007, 17:54   |
yes, basic keeps VDP values in ram, so you can "read" them.
In ASM there is no way to read the VDP register
Store their values in ram and use that for your purposes
|
|
Metalion msx freak Mensajes: 241 | Publicado: Septiembre 09 2007, 18:06   |
OK, thanks for the info, I think I've seen the RAM address of those mirror values somewhere in the MAP website. I do have another question.
I am writing a program in ROM format. When the BIOS jumps to the start of the ROM, are those mirror values of VDP registers already initialized in RAM ?
|
|
Jipe msx freak Mensajes: 214 | Publicado: Septiembre 09 2007, 18:35   |
test it on blue msx with debbugger
|
|
Metalion msx freak Mensajes: 241 | Publicado: Septiembre 09 2007, 20:12   |
Quote:
| test it on blue msx with debbugger
|
Thanks for the tip, Jipe.
I just did it and yes they are initialized before the BIOS jumps to the ROM start.
A quick reminder of the mirror values in RAM for those who will search this topic later :
#F3DF - #F3E6: registers 0-7
#FFE7 - #FFF6: registers 8-23
#FFFA - #FFFC: registers 25-27
Thanks to the MSX Assembly Page for those RAM addresses.
|
|
ro msx guru Mensajes: 2353 | Publicado: Septiembre 10 2007, 08:02   |
A good practise is to write VDP data not only to VDP ports but also to these RAM addresses. just so you can "read" them at anytime.
(it ain't nut'n but a savekeeping area)
|
|
|
|
|