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 > Useless coding riddle: Stable raster without I/O
2014-11-12 08:59
lft

Registered: Jul 2007
Posts: 369
Useless coding riddle: Stable raster without I/O

Hi!

I came up with a technique to synchronise code to the raster position without accessing any I/O registers. It is not very efficient, and hence not very useful, but it was a nice intellectual exercise.

This is the premise: Provide a small piece of code (less than a page) that may start executing at any time. When execution reaches the end of the code, the current rasterline and cycle will be known. You may assume that sprites and interrupts are off, and that d011 has its default value (9b).

See if you can figure out how it's done!
 
... 14 posts hidden. Click here to view all posts....
 
2014-11-12 12:50
chatGPZ

Registered: Dec 2001
Posts: 11386
err, did you understand what the point of lfts post was? o_O
2014-11-12 13:53
Zyron

Registered: Jan 2002
Posts: 2381
Obviously not. ;)
2014-11-12 14:13
Flavioweb

Registered: Nov 2011
Posts: 463
Ok.
Forgot my previous post.
'Without access I/O regs'.
2014-11-12 19:04
Slammer

Registered: Feb 2004
Posts: 416
Seams like the solution is combining Pex’s hint with actual code and some kind of induction proof that ensures it always ends in the desired end state instead of an endless drift.
2014-11-12 19:15
algorithm

Registered: May 2002
Posts: 705
I assume its probably using rmw instructions near/on badlines perhaps to remove jitter in stages?
2014-11-12 19:23
Danzig

Registered: Jun 2002
Posts: 440
cli jsr *
worx ;) proof: One Year Crest
2014-11-12 21:59
Slammer

Registered: Feb 2004
Posts: 416
My guess is that you could do it like this. Haven't tried it out, so there might be flaws...

Jevgr n ybbc jvgu rknpgyl bar ezj bcrengvba gung gnxrf gur rknpg nzbhag bs gvzr bs n senzr jura gur ezj bcrengvba fgrnyf na rkgen plpyr. Eha vg sbe rabhtu ahzore bs gvzrf gvy vg fgbcf va n fgnoyr pbaqvgvba. Jr abj xabj gur cbfvgvba bs gur ezj bcrengvba gb or bar bs 25 cbffvoyr cbfvgvbaf. Yrgf pnyy guvf cebprqher sbe 'Pnyvoengr'.

Abj nqq n qrynl sbe gur jubyr senzr zvahf 9 yvarf naq ercrng pnyvoengr ntnva. Jr ner abj ba bar bs gur svefg 24 cbffvoyr cbfvgvbaf. Ercrng guvf 25 gvzrf gb or fher gb or va cbfvgvba 1. Ceboyrz fbyirq.

Gb bcgvzvmr gur nobir lbh pbhyq bspnhfr fhogenpg zber guna avar yvarf.
2014-11-13 07:51
Peiselulli

Registered: Oct 2006
Posts: 81
I think it can be done like Algorithm said before: Make a loop the fullfills the 19656 Cycles (PAL) for a frame with 25 stores to memory in it.
Program it in that way that this is only the case if these stores are just before of the bad lines. If this loop does not hit all 25 stores at right position, then is will last longer and will run over again until it is in sync.

But I'm too lazy to program it, because it is useless, sorry ...
2014-11-13 17:27
Slammer

Registered: Feb 2004
Posts: 416
Peiselulli: Oh yeah and it will reach the stable condition faster. Didn't read Algos post like that though and you have to convince yourself that the possibly 25 extra cycles taken doesn't makes you miss the stable point, but I think you are right.
2014-11-13 20:44
Fresh

Registered: Jan 2005
Posts: 101
Well, looks like I'm a bit late... anyway:
http://pastebin.com/PeP4BfU1

64 bytes long, probably shrinkable.
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
ptoing
Guests online: 105
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 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (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 Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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