Raster split and $9002

Basic and Machine Language

Moderator: Moderators

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 11:36 am

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)...

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 11:52 am

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...

User avatar
tokra
Vic 20 Nerd
Posts: 799
Joined: Tue Apr 27, 2010 5:32 pm
Location: Germany

Re: Raster split and $9002

Postby tokra » Sat Aug 19, 2017 12:00 pm

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.

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 12:10 pm

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?
Last edited by beamrider on Mon Aug 21, 2017 5:51 am, edited 1 time in total.

User avatar
pixel
Vic 20 Nerd
Posts: 867
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/pixel/
Location: various
Occupation: Pan–galactic shaman

Re: Raster split and $9002

Postby pixel » Sat Aug 19, 2017 8:41 pm

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?
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sun Aug 20, 2017 2:03 am

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.
Attachments
ex4.zip
(2.01 KiB) Downloaded 7 times

User avatar
Mike
Herr VC
Posts: 2925
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Postby Mike » Sun Aug 20, 2017 2:47 am

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? ;)

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sun Aug 20, 2017 3:14 am

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.

User avatar
Mike
Herr VC
Posts: 2925
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Postby Mike » Sun Aug 20, 2017 3:39 am

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.

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sun Aug 20, 2017 5:18 am

Thanks, PM sent!

User avatar
beamrider
Vic 20 Nerd
Posts: 802
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sun Aug 20, 2017 8:38 am

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.

User avatar
tokra
Vic 20 Nerd
Posts: 799
Joined: Tue Apr 27, 2010 5:32 pm
Location: Germany

Re: Raster split and $9002

Postby tokra » Sun Aug 20, 2017 3:39 pm

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.

User avatar
Mike
Herr VC
Posts: 2925
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Postby Mike » Sun Aug 20, 2017 11:13 pm

tokra wrote:[...] I would suggest you do a follow-up-paper [...]

I'll have a go at it in the next days.

User avatar
pixel
Vic 20 Nerd
Posts: 867
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/pixel/
Location: various
Occupation: Pan–galactic shaman

Re: Raster split and $9002

Postby pixel » Mon Aug 21, 2017 2:08 am

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...
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose

User avatar
Mike
Herr VC
Posts: 2925
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Postby Mike » Mon Aug 21, 2017 2:38 am

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.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest