Dead Hackers Society
Other BBSes »
 
 

Silly Venture 2019
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: HBL on Falcon (follow up)
Posted by: Orion Apr,15.2019-14:39 


I did further studies and found the following:

I'm currently working on game adaptations for the Falcon, so I need to setup a ST-compatible configuration: 320x200 / 16 colors resolution, ST palette registers usage, no CPU cache.

I first switched the 68030 CPU to 8MHz (for maximum compatibility) but in this configuration the 68030 is slower than a mere 68000.
Thus it does not help for rasters on Falcon which require quick code as mentioned by Evil.
Switching the CPU back to 16MHz improved the situation drastically...

My HBL routine looks like this (pseudo-code):

Timer_B_HBL:
move.w #$700,$ffff8240.w
move.w #0,Timer_B_Hbl+2 ; OK because no CPU cache
[...] ; Stop timer-B after 2 invocations.
rte

I run a very simple example which triggers the above HBL routine twice, at two consecutive raster lines
- the first invocation sets the background color of line N to red
- the second invocation sets the background color of line N+1 to black

In addition, I draw a blue line segment (with pixels) at line N so that I can check if the red raster is drawn at the correct position on the screen.

This example just draws a single red raster on the screen and allows me to visualize "where/when" the color changes occur, using the static blue line segment as reference.

I used different display configurations (all configs are ST-compatible):
- XBIOS Vsetmode(ST-compatible, 4 planes, RGB)
- XBIOS Vsetmode(ST-compatible, 4 planes, VGA)
- Leonard RGB50 init
- Leonard VGA50 init
- ULS VGA60 init

What puzzles me is that the timer-B HBL interrupt seems to be triggered differently (color changes occur at different locations) according to the display configuration.

Typically, I was able to observe the following:

- XBIOS Vsetmode(ST-compatible, 4 planes, RGB)
HBL interrupt is triggered at the end of the previous raster line.
Therefore, on the screen I can see the color being changed earlier than expected, on the right side of the previous raster line.

- XBIOS Vsetmode(ST-compatible, 4 planes, VGA)
HBL interrupt is triggered at the middle of the previous raster line (because horizontal lines are doubled in this mode, it means it is triggered at the beginning of the previous horizontal line on the screen...).
On the screen, I can see the color being changed 1 horizontal line before the expected raster line.

- Leonard RGB50 init
HBL interrupt is triggered at the very beginning of the desired raster line (or at the very end of the previous one, not sure).
On the screen, I can see a perfect raster with no jitter, at the expected position.

- Leonard VGA50 init
HBL interrupt is triggered at the beginning of the desired raster line, but after few cycles so that I see the raster shaking on the left side.

- ULS VGA60 init
Same at VGA50.

We can therefore conclude that the HBL interrupt trigger depends on the display configuration:
the dummy HBL routine above will produce different results according to the selected display config.

I reverse-engineered the work done by Klapauzius on "Fire and Ice" and I found the trick mentioned by Mikro, that is the use of the vertical frequency counter ($ffff82a1) to wait for the start of desired raster line.

Klapauzius uses the XBIOS Vsetmode to setup the ST-Compatible VGA mode.
Therefore his tricks works because in that mode, the HBL interrupt is triggered during the previous raster line.
But this method is not universal as the HBL interrupt trigger depends on the display config, and in certain configurations it can occur too late (after the beginning of the desired raster line).

Question for the VIDEL experts: how can you explain the impact of the display config on the HBL interrupt trigger?
In particular, what can explain the difference between XBIOS Vsetmode config and VGA50/VGA60 config?

-- Orion








[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
HBL on Falcon (follow up) Orion Apr,11.2019-18:59
  Re: HBL on Falcon (follow up) Orion Apr,12.2019-00:30
    Re: HBL on Falcon (follow up) mikro Apr,12.2019-09:08
      Re: HBL on Falcon (follow up) Orion Apr,12.2019-11:50
        Re: HBL on Falcon (follow up) Daniel Apr,15.2019-00:09
          Re: HBL on Falcon (follow up) mikro Apr,15.2019-11:46
            Re: HBL on Falcon (follow up) Orion Apr,15.2019-15:12
        Re: HBL on Falcon (follow up) evil Apr,15.2019-11:46
          Re: HBL on Falcon (follow up) Orion Apr,15.2019-14:39
            Re: HBL on Falcon (follow up) mikro Apr,16.2019-07:43
              Re: HBL on Falcon (follow up) Orion Apr,16.2019-12:20
          Re: HBL on Falcon (follow up) Daniel Apr,16.2019-23:45
            Re: HBL on Falcon (follow up) mikro Jun,16.2019-14:26
              Re: HBL on Falcon (follow up) mikro Aug,30.2019-08:32


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2019 Dead Hackers Society Contact: Anders Eriksson