MO5 raster position checking
Modérateurs : Papy.G, fneck, Carl
MO5 raster position checking
Back to MO5 coding.
I have my sprite engine virtually finished
How can I check for example if the raster is on line 168 on a MO5?
I have been using bit 7 of $A7E7 to check when the computer starts to paint the horizontal borders and it is there that I call my routine to paint 4 sprites. But saving the background, restoring it, masking data , and ORing sprite data takes a bit more than the borders(about 32 raster lines more) and thus I would like to know the answer to my question so I can call my sprite routine earlier. Of course sprites wont be painted on those 32 lines, but I can have my score board there.
Thanks
I have my sprite engine virtually finished
How can I check for example if the raster is on line 168 on a MO5?
I have been using bit 7 of $A7E7 to check when the computer starts to paint the horizontal borders and it is there that I call my routine to paint 4 sprites. But saving the background, restoring it, masking data , and ORing sprite data takes a bit more than the borders(about 32 raster lines more) and thus I would like to know the answer to my question so I can call my sprite routine earlier. Of course sprites wont be painted on those 32 lines, but I can have my score board there.
Thanks
MO5 - MO6 - TO8D - C64C - Timex TC2048 - Acorn Electron - Amiga 500
Re: MO5 raster position checking
This question was discussed many times by Thomson demo-makers. The only way they found is executing a precise number of processor cycles from the last VBL before painting the sprite. Every other way is too much time expensive.
Daniel
L'obstacle augmente mon ardeur.
L'obstacle augmente mon ardeur.
Re: MO5 raster position checking
Daniel, thank you for your answer.
MO5 - MO6 - TO8D - C64C - Timex TC2048 - Acorn Electron - Amiga 500
Re: MO5 raster position checking
I think you can use gate array register A7E4 (16bits) that is a screen clock used for optical pen...
Try this on real hardware since nearly no MO5 programs use this register (you may unassemble FIRQ routine to find a way to transform from this register to colums/lines)
Try this on real hardware since nearly no MO5 programs use this register (you may unassemble FIRQ routine to find a way to transform from this register to colums/lines)
Re: MO5 raster position checking
I tried to read the $A7E4 byte with a MO5 Basic program :
A real MO5 with ROM version 1.0 (without the gate array) returns all zeroes.
A real MO5 with ROM version 2.1 (the last version, with the gate array) returns all 255.
I'll try to investigate further with a binary program.
Code : Tout sélectionner
10 PRINTPEEK(&HA7E4);:GOTO10
A real MO5 with ROM version 2.1 (the last version, with the gate array) returns all 255.
I'll try to investigate further with a binary program.
Daniel
L'obstacle augmente mon ardeur.
L'obstacle augmente mon ardeur.
Re: MO5 raster position checking
ok so it's not a counter but a latch. It cannot be used in that context, sorry.
To test in basic you can just add a call to INPEN and use optical pen (I don't remember exactly, INPUTPEN is a blocking read, I think INPEN is the non blocking read)
To test in basic you can just add a call to INPEN and use optical pen (I don't remember exactly, INPUTPEN is a blocking read, I think INPEN is the non blocking read)
Re: MO5 raster position checking
I tried this program :
The $A7E4 value changes with the ligthpen position from 0 to 246 (may be 255, but I didn't succeed to get a value over 246).
$A7E4=0 for (X=0, Y=0)
$A7E4=246 for (X=319, Y=198)
Code : Tout sélectionner
10 INPENX,Y:PRINTX,Y,PEEK(&HA7E4):GOTO10
$A7E4=0 for (X=0, Y=0)
$A7E4=246 for (X=319, Y=198)
Daniel
L'obstacle augmente mon ardeur.
L'obstacle augmente mon ardeur.