Raster split and $9002

Basic and Machine Language

Moderator: Moderators

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

Raster split and $9002

Post by beamrider »

Can someone elaborate on the effects of setting this register to zero from within an raster split IRQ as what I am observing isn't what I expected.

Within the IRQ handler, I set $9002 to zero, waste some CPU... then revert it.

I expected the lines to be skipped but it appears as though the rendering is being delayed instead (or at least some of it).

I tried setting $9000 to an off-screen location and reverting instead [which seems to be slightly better].

Any ideas?
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Raster split and $9002

Post by tokra »

This would be a good starting point for your investigations I think:

http://sleepingelephant.com/ipw-web/bul ... 464#p80464

Have a look at 4mat's demo-part and see what he does with VICE-breakpoints.

Also see my post further down that thread and Mike's explanation of my FLI104-mode. There might be something in there to help you as well.

Please let us know what you find out.
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

Thanks, that was interesting reading.

So it seems that the timing of adjustment of $9002 is crucial otherwise the character line gets repeated further down the screen. As mentioned I've had more success 'turning off' the display for a number of rasters by setting $9000 to a value just off the right edge of the screen.

It's taken me several weeks of experimentation to come up with a set of values that work, but I think this piece of the puzzle is solved at least. Thanks.
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

Image

Continuing my experiments, I have a raster split about 2/3 down the screen and wanted some stable status text in the area in red. I'm double buffering and smooth scrolling the top section so for various reasons I positioned the lower red screen area at $0000 in memory and rendered my text accordingly.

I already learned that the vertical position $9001 is only latched in the VBI therefore any text in the red area jumps around in tandem with the scrolling above, so I compensated by pixel offsetting the rendered characters with a converse shift.

I thought it was working [albeit with some unexplained flickering and occasional character corruption] as evident from the image above, but after testing on the real hardware I found that that the red status area is completely blank...

Any explanations..?
Last edited by beamrider on Sat Aug 19, 2017 9:29 am, edited 1 time in total.
User avatar
Mike
Herr VC
Posts: 4808
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Post by Mike »

If you can construct a minimal test case, which shows the difference between real h/w and current build of VICE, just file a bug report in the bug tracker of VICE.
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

see the attached demo [revised in later post]...

scroll around with joystick.

On a real Vic 20, the text is missing and there are a few flickery display artefacts just below the black line.

I'll maybe file a bug report later...

(n.b. the slight flickering/display corruption that occasionally occurs in the upper scroll region was introduced by rendering this static text, but this could well be my code).
Last edited by beamrider on Sat Aug 19, 2017 10:44 am, edited 1 time in total.
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

:oops:

arghhh, turns out the text was being rendered outside the CRT display area in VICE.. Good job I hung off on that bug report.

[edit]
not entirely blameless though, the revised attachment displays perfectly in VICE (PAL), but on a real Vic-20 there appears some artefacts just below the black line and the bottom of the text flickers (as you scroll vertically).

Seems this is a game of trial and error, but with my real Vic in the garage and my PC in the spare bedroom, at least it's keeping me fit :D
Attachments
rasterStable.zip
(2.04 KiB) Downloaded 271 times
Last edited by beamrider on Sat Aug 19, 2017 10:53 am, edited 3 times in total.
User avatar
Mike
Herr VC
Posts: 4808
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Post by Mike »

I'll only have the opportunity to test on my VIC-20 during next week.

Nonetheless, is there now a difference between VIC-20 and VICE, or did you just place the text so far in the overscan area that you just couldn't see it on real hardware with CRT?
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

think our posts overlapped (answered above)
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Raster split and $9002

Post by tokra »

Real VIC20 PAL
Real VIC20 PAL
VICE 33524
VICE 33524
No flicker on real VIC-20 here, although I use a TFT which just MIGHT delete the flicker... the other artifacts are harder to explain. What is displayed here? Could it be memory that is initialized differently on real machines and VICE?
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

try moving left and right.... :D

Image

it's just a prototype scrolling routine at the moment that displays some random tile data I generated from my screen designer...
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

how does this one look...?

[attachment removed - use ex4.zip in later post]

(have to move left/right and up/down to initialise everything properly - just proto code)
Last edited by beamrider on Mon Aug 21, 2017 5:52 am, edited 1 time in total.
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Raster split and $9002

Post by tokra »

beamrider wrote:try moving left and right.... :D
How?
User avatar
beamrider
Vic 20 Scientist
Posts: 1444
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Post by beamrider »

joystick
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Raster split and $9002

Post by tokra »

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.

Are you sure you do not rely on pre-set values for VIA-registers (timers e.g.)? This might cause such issues easily.
Last edited by tokra on Sat Aug 19, 2017 11:38 am, edited 1 time in total.
Post Reply