Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Raster X position.
2012-01-26 19:51
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....
 
2012-01-26 20:10
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?
2012-01-26 21:02
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.
2012-01-27 07:49
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?
2012-01-27 08:13
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 :)
2012-01-27 08:33
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?
2012-01-27 11:27
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

2012-01-27 16:12
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 =)
2012-01-27 19:01
Peiselulli

Registered: Oct 2006
Posts: 81
... and my favorite method, by the way (have a look into the code of jars revenge ;-) )
2012-01-28 00:40
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
2012-01-28 06:27
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Meikel aka ZUX/Sparks
Weetibix
kbs/Pht/Lxt
ΛΛdZ
Fungus/Nostalgia
katon/Lepsi De
Spinball/Excess
Guests online: 100
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.058 sec.