Raster split and $9002

Basic and Machine Language

Moderator: Moderators

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

Raster split and $9002

Postby beamrider » Sat Aug 05, 2017 11:40 am

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 Nerd
Posts: 813
Joined: Tue Apr 27, 2010 5:32 pm
Location: Germany

Re: Raster split and $9002

Postby tokra » Sat Aug 05, 2017 1:28 pm

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

viewtopic.php?f=2&t=7225&p=80464#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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sun Aug 06, 2017 3:22 am

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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 5:55 am

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: 2993
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Raster split and $9002

Postby Mike » Sat Aug 19, 2017 6:43 am

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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 8:23 am

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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 9:28 am

: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 9 times
Last edited by beamrider on Sat Aug 19, 2017 10:53 am, edited 3 times in total.

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

Re: Raster split and $9002

Postby Mike » Sat Aug 19, 2017 10:30 am

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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

Postby beamrider » Sat Aug 19, 2017 10:50 am

think our posts overlapped (answered above)

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

Re: Raster split and $9002

Postby tokra » Sat Aug 19, 2017 11:02 am

IMG_1351.jpg
Real VIC20 PAL


IMG_1352.jpg
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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

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

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 Nerd
Posts: 825
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Raster split and $9002

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

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 Nerd
Posts: 813
Joined: Tue Apr 27, 2010 5:32 pm
Location: Germany

Re: Raster split and $9002

Postby tokra » Sat Aug 19, 2017 11:21 am

beamrider wrote:try moving left and right.... :D

How?

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

Re: Raster split and $9002

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

joystick

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

Re: Raster split and $9002

Postby tokra » Sat Aug 19, 2017 11:32 am

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.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests