Page 2 of 5

Re: Raster split and $9002

Posted: Sat Aug 19, 2017 11:36 am
by beamrider
tokra wrote:On a real VIC20 the text block skips position on up/down-movement 3 chars to the left and 1 char down and back again.
is that for rasterStable.prg or rasterStable2 or both?

rasterStable.prg is OK on my Vic apart from some flickering above the text.

The delays in the raster code are critical and inconsistent between VICE and real hardware.

Wondering if the inconsistency extends to different Vic20 models (or even individual units)...

Re: Raster split and $9002

Posted: Sat Aug 19, 2017 11:52 am
by beamrider
tokra wrote:Are you sure you do not rely on pre-set values for VIA-registers (timers e.g.)? This might cause such issues easily.
can you elaborate?

code is based on this...

http://www.antimon.org/dl/c64/code/stable.txt

rasterStable2 messes up on my real vic as well, but rasterStable is kind of OK...

Re: Raster split and $9002

Posted: Sat Aug 19, 2017 12:00 pm
by tokra
It would probably be best to try to create a test-case that does not rely on the joystick, but runs automatically. Also make sure everything is initialized correctly. Arukanoido had similar problems with some memory cells not initialized on startup.

Re: Raster split and $9002

Posted: Sat Aug 19, 2017 12:10 pm
by beamrider
Perhaps, but I can get similar effects in VICE by merely adjusting the delay of the black bar slightly. Suspect the timing differs slightly between VICE and real h/w and this kind of code is very sensitive to it?

Re: Raster split and $9002

Posted: Sat Aug 19, 2017 8:41 pm
by pixel
Wow! :shock: First had to make sure I'm not still dreaming. Am very excited.

I get that flicker with rasterStable.prg in VICE (latest respository on Linux) when not scrolling. Probably "just" a bug in your code?

EDIT: With ex3.prg the bottom text started to jump. "Normal" timing problems, I guess.

ANOTHER EDIT: Perhaps putting VICE into full border mode helps seeing more stuff you might be missing?

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 2:03 am
by beamrider
There was some constant flicker even in VICE that was down to a bug in my code and now eliminated in ex4 (attached).

ex4 displays perfectly (apart from the known issue of occasional 'judder' on direction change) in VICE (PAL), but on a real h/w, there is an extra line above the 'ADG' with some detritus in it and the lower part of the 'CFI' flickers with vertical scrolling.

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 2:47 am
by Mike
beamrider wrote:there is an extra line above the 'ADG' with some detritus in it
You should look what happens if you mimic the RAM pattern of your VIC-20 on start up with VICE.

Per default, VICE uses something like 64x$00 and 64x$FF which is not in any way similar to what I know from real hardware. I have changed the startup pattern in VICE to "$FF $00 $FF $00 ..." which matches that of my VIC-20 (except real h/w also had some irregularities at the end of each RAM page), which also helps to catch init errors where tools "forget" to set the byte before the BASIC start to zero, when the BASIC start is relocated.


Edit: OK, I just tried that in my VICE - no detritus above 'ADG' either ... will check against my VC-20 next week.

Edit 2: One question: will the engine - provided you get it working - also be able to support diagonal movements? ;)

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 3:14 am
by beamrider
Mike wrote:Edit 2: One question: will the engine - provided you get it working - also be able to support diagonal movements? ;)
I don't think this would be a huge problem, although the workload is obviously increased as two edges would need to be drawn on a full character shift.

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 3:39 am
by Mike
If you PM me your e-mail address, I can also provide you with an alternative implementation for a stable raster interrupt.

I don't know why Marko's 'paper' still is used as reference. His code takes *ages* to do the initial sync of the timer, with a linear search process; he uses two timers, where one is entirely sufficient; and finally the interrupt delay compensation is overly complicated yet it still doesn't work in all cases - the delays can span up to 10(!) different positions *) - Marko's code only handles 7 or 8 positions.

Ghislain uses my implementation for the top-left window in Realms of Quest 5.



*) provided the foreground process doesn't do any SEI [...] CLI blocks. Then all bets are off anyhow.

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 5:18 am
by beamrider
Thanks, PM sent!

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 8:38 am
by beamrider
well after most of the weekend fiddling, drawn a blank with this :(

I modified the code to allow the black bar raster delay to be increased/decreased at run time using the keyboard. VICE looks good (ex4) with some settings, but there were no settings that looked ok on real hardware.

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 3:39 pm
by tokra
Mike wrote:I don't know why Marko's 'paper' still is used as reference. His code takes *ages* to do the initial sync of the timer, with a linear search process; he uses two timers, where one is entirely sufficient; and finally the interrupt delay compensation is overly complicated yet it still doesn't work in all cases - the delays can span up to 10(!) different positions *) - Marko's code only handles 7 or 8 positions.
*) provided the foreground process doesn't do any SEI [...] CLI blocks. Then all bets are off anyhow.
I think most people will find Marko's paper on the net easily and that is why they use it. I would suggest you do a follow-up-paper pointing out the flaws in Marko's implementation and providing the better and shorter one with a detailed explanation of each step. This would help others understanding the raster-interrupt better.

Re: Raster split and $9002

Posted: Sun Aug 20, 2017 11:13 pm
by Mike
tokra wrote:[...] I would suggest you do a follow-up-paper [...]
I'll have a go at it in the next days.

Edit: see here.

Re: Raster split and $9002

Posted: Mon Aug 21, 2017 2:08 am
by pixel
Mike wrote:
tokra wrote:[...] I would suggest you do a follow-up-paper [...]
I'll have a go at it in the next days.
That would be lovely. Some raster split orgy idea is ticking away in the back of my head for some time now and life is short.

Am assuming that it's about reading the low timer value and doing a bunch of 'lsr/bc*'s...

Re: Raster split and $9002

Posted: Mon Aug 21, 2017 2:38 am
by Mike
pixel wrote:Am assuming that it's about reading the low timer value [...]
Essentially, yes.
[...] and doing a bunch of 'lsr/bc*'s...
No, I'm using a much simpler clock slide instead.

My paper will be self-contained anyhow, so everything can be followed without the necessity to refer to other articles.