| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Raster X position.
From VIC article:
Quote:
As the LP input of the VIC is connected to the keyboard matrix as are all
lines of the joystick ports, it can also be controlled by software. This is
done with bit 4 of port B of CIA A ($dc01/$dc03). This allows to determine
the current X position of the raster beam by triggering an LP edge and
reading from LPX afterwards (the VIC has no register that would allow
reading the X position directly). This can e.g. be used to synchronize
raster interrupt routines on exact cycles.
What means?
I can write some code to know exactly where raster is in his X position?
Something like: raster irq trigger -> irq routine -> wait for X raster position -> start do someting...
Is it possible?
There are some assembly examples somewhere? |
|
... 11 posts hidden. Click here to view all posts.... |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Quoting ready.it is possible:
$d013 sync ??
I tried it but after all the inverted CIA timer method is more handy and lets you use the keyboard.
Is possible but this read only 1 value per irq to calculate delay compensation.
I think something like "lda #$50 cmp $d012 bne *-3" but done in the X axis...
It's possible? |
| |
ready.
Registered: Feb 2003 Posts: 441 |
no that's not possible, since just checking the X-value will require too much processor time.
Maybe something like:
lda #$20
cmp $d013
bne *-3
I'd rather use NOPs with the inverted CIA timer method. But you could try and see what happens. |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
is not possible, in some tricky way, to fire an irq using lightpen x/y regs instead do it with d012? |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Yes, in some old issue of the german 64'er mag there was a method shown how to use CIAs to trigger lightpen irqs which then again reveal x/y positions on $D013/$D014. It failed when you pressed the space bar :) |
| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
this mean that if i use a real lightpen and meanwhile press space the pen don't work correctly? |
| |
algorithm
Registered: May 2002 Posts: 705 |
As mentioned previously. You can use timer methods which can be set up to assist in the x position, however would be easier to use stable raster and to delay to the required position
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
"You can use timer methods which can be set up to assist in the x position, however would be easier to use stable raster and to delay to the required position"
err what? the timer stuff is a way to implement stable raster =) |
| |
Peiselulli
Registered: Oct 2006 Posts: 81 |
... and my favorite method, by the way (have a look into the code of jars revenge ;-) )
|
| |
algorithm
Registered: May 2002 Posts: 705 |
Groepaz. Yes using timer interrupts is a way of getting a stable raster, but can also be used to give the offset of the x position |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
"Yes using timer interrupts is a way of getting a stable raster, but can also be used to give the offset of the x position"
just so that it makes some sense: what if not a raster stabilization routine would use that timer to find out the x position? |
Previous - 1 | 2 | 3 - Next |