open bottom border possible in 60hz?
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
open bottom border possible in 60hz?
Been looking at code that opens the bottom border.
I see there are routines to open the bottom border in 50hz, but is it possible at 60hz?
I see there are routines to open the bottom border in 50hz, but is it possible at 60hz?
Re: open bottom border possible in 60hz?
It is possible, I don't have code at hand but Neochrome Master does it (in the full view it puts the magnifier in the bottom border).TheNameOfTheGame wrote: ↑Wed Aug 31, 2022 10:39 pm Been looking at code that opens the bottom border.
I see there are routines to open the bottom border in 50hz, but is it possible at 60hz?
I guess it wouldn't be all too hard to look at the code in a debugger.
https://demozoo.org/productions/95861/
Re: open bottom border possible in 60hz?
@evil I see only magnifier in a normal view. Is there a keyboard shortcut to see it i a full view?
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Just press 'ESC' key (well at least in Steem) at the normal screen and it opens the bottom border.
Nice, does anyone know how that is done in 60hz?
Nice, does anyone know how that is done in 60hz?
Re: open bottom border possible in 60hz?
You open the border in 60Hz by making sure you go to 50Hz at the location where the 60Hz end-of-screen check is made.

All these checks are done at cycle 502 (according to the historical way of counting cycles per line).

Code: Select all
Line:
16: 60Hz vBLANK = false;
25: 50Hz vBLANK = false;
34: 60Hz and mono screen start
47/63: 50Hz screen start (short/regular top border GLUE)
234: 60Hz screen end
247/263: 50Hz screen end
258: 60Hz BLANK
308: 50Hz BLANK
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Hmm, I assembled this code from https://github.com/miniupnp/AtariST/blo ... o/border.s and it seems to work in Steem whether I use a UK or USA TOS 1.62. I don't totally understand it, but I guess it is agnostic as to the starting refresh rate?
Code: Select all
* SOURCE CODE TO REMOVE BOTTOM BORDER, BY POWER MAN OF THE WILD BOYS *
* INTO SUPERVISOR MODE
CLR.L -(A7)
MOVE.W #32,-(A7)
TRAP #1
ADDQ.L #6,A7
MOVE.L D0,STACK
MOVE.L #MY,A7
* SAVE VECTORS AND OTHER poo
LEA STORAGE,A0
MOVE.L $70.W,(A0)+
MOVE.L $120.W,(A0)+
MOVE.B $FFFFFA1B.W,(A0)+
MOVE.B $FFFFFA21.W,(A0)+
MOVE.B $FFFFFA07.W,(A0)+
MOVE.B $FFFFFA09.W,(A0)+
MOVE.B $FFFFFA13.W,(A0)+
ADDQ.L #1,A0 MAKE ADDRESS EVEN
MOVE.W $FFFF8240.W,(A0)+
MOVE.W $FFFF8242.W,(A0)+
MOVE.W #2,-(A7)
TRAP #14
ADDQ.L #2,A7
MOVE.L D0,PHYSIC
MOVE.W #3,-(A7)
TRAP #14
ADDQ.L #2,A7
MOVE.L D0,LOGIC
MOVE.W #4,-(A7)
TRAP #14
ADDQ.L #2,A7
MOVE.W D0,RES
* HIDE MOUSE
DC.W $A000
DC.W $A00A
* SET SCREEN ADDRESS, LOW RES
CLR.W -(A7) LOW RES
PEA $70000 PHYSICAL SCREEN ADDRESS
PEA $70000 LOGICAL SCREEN ADDRESS
MOVE.W #5,-(A7)
TRAP #14
LEA 12(A7),A7
* FILL SCREEN WITH COLOUR 1 (VERTICAL LINE PATTERN)
LEA $70000,A0
MOVE.W #64000/8-1,D0 TWO SCREENS LENGTH
FILL MOVE.L #$F0F00000,(A0)+
MOVE.L #0,(A0)+
DBF D0,FILL
CLR.W $FFFF8240.W
MOVE.W #$777,$FFFF8242.W
* SET UP NEW VECTORS
MOVE.W #$2700,SR STOP INTERRUPTS
MOVE.L #VBL,$70.W NEW VBL VECTOR
MOVE.L #TIMER_B,$120.W NEW TIMER B INTERRUPT HANDLER
CLR.B $FFFFFA07.W MFP RESET
CLR.B $FFFFFA09.W
ORI.B #1,$FFFFFA07.W ENABLE TIMER B
ORI.B #1,$FFFFFA13.W
CLR.B $FFFFFA1B.W STOP TIMER B
MOVE.W #$2300,SR ENABLE INTERRUPTS
WAIT CMPI.B #57,$FFFFFC02.W SPACE BAR?
BNE WAIT
* RESTORE VECTORS AND poo
MOVE.W #$2700,SR
LEA STORAGE,A0
MOVE.L (A0)+,$70.W
MOVE.L (A0)+,$120.W
MOVE.B (A0)+,$FFFFFA1B.W
MOVE.B (A0)+,$FFFFFA21.W
MOVE.B (A0)+,$FFFFFA07.W
MOVE.B (A0)+,$FFFFFA09.W
MOVE.B (A0)+,$FFFFFA13.W
ADDQ.L #1,A0
MOVE.W (A0)+,$FFFF8240.W
MOVE.W (A0)+,$FFFF8242.W
* SHOW MOUSE
DC.W $A000
DC.W $A009
MOVE.W #$2300,SR
* SET SCREEN ADDRESS, INTO USER MODE AND EXIT
MOVE.W RES,-(A7)
MOVE.L PHYSIC,-(A7)
MOVE.L LOGIC,-(A7)
MOVE.W #5,-(A7)
TRAP #14
LEA 12(A7),A7
MOVE.L STACK,-(A7)
MOVE.W #32,-(A7)
TRAP #1
ADDQ.L #6,A7
CLR.L -(A7)
TRAP #1
* VBL INTERRUPT HANDLER
VBL CLR.B $FFFFFA1B.W STOP TIMER B
MOVE.B #199,$FFFFFA21 OCCUR ON LAST SCANLINE
MOVE.B #8,$FFFFFA1B.W START TIMER B
RTE PISS OFF
TIMER_B CLR.B $FFFFFA1B.W STOP TIMER
MOVEM.L D0/A0,-(A7)
MOVEA.W #$FA21,A0
MOVE.B #200,(A0)
MOVE.B #8,$FFFFFA1B.W START TIMER
MOVE.B (A0),D0
WAIT2 CMP.B (A0),D0
BEQ WAIT2
CLR.B $FFFF820A.W INTO 60 HZ
MOVEQ.L #2,D0
LOOP1 NOP
DBF D0,LOOP1
MOVE.B #2,$FFFF820A.W INTO 50 HZ
MOVEM.L (A7)+,D0/A0
BCLR #0,$FFFFFA0F.W ACKNOWLEDGE
RTE BUGGER OFF
STORAGE DS.B 18
DS.L 63
MY DS.L 1
RES DS.W 1
LOGIC DS.L 1
PHYSIC DS.L 1
STACK DS.L 1
Re: open bottom border possible in 60hz?
This looks convoluted 
Bet it won't work in 60hz on real hw

Bet it won't work in 60hz on real hw
Re: open bottom border possible in 60hz?
Maybe I'm doing something wrong but I've tried ESC and it just switch GUI/full screen, a screen resolution in both modes is the same - 320x200TheNameOfTheGame wrote: ↑Thu Sep 01, 2022 12:35 pm Just press 'ESC' key (well at least in Steem) at the normal screen and it opens the bottom border.
Nice, does anyone know how that is done in 60hz?
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Tried it on my real hardware 60hz STE and it worked. I guess this is universal open lower border code.
Re: open bottom border possible in 60hz?
Sort of. It goes into 50Hz, removes the regular 50Hz bottom border. It's not in 60Hz.TheNameOfTheGame wrote: ↑Thu Sep 01, 2022 4:41 pm Hmm, I assembled this code from https://github.com/miniupnp/AtariST/blo ... o/border.s and it seems to work in Steem whether I use a UK or USA TOS 1.62. I don't totally understand it, but I guess it is agnostic as to the starting refresh rate?
Re: open bottom border possible in 60hz?
Nice!
I'm surprised
That code seems unnecessarily messy though, because it sets timer B again with a count of 200 just before the border switch. I think there's a much cleaner implementation by Cerebral Vortex on DHS.nu...
I'm surprised

That code seems unnecessarily messy though, because it sets timer B again with a count of 200 just before the border switch. I think there's a much cleaner implementation by Cerebral Vortex on DHS.nu...
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Ah, I wonder if that is how Neochrome Master does it also?troed wrote: ↑Fri Sep 02, 2022 9:31 amSort of. It goes into 50Hz, removes the regular 50Hz bottom border. It's not in 60Hz.TheNameOfTheGame wrote: ↑Thu Sep 01, 2022 4:41 pm Hmm, I assembled this code from https://github.com/miniupnp/AtariST/blo ... o/border.s and it seems to work in Steem whether I use a UK or USA TOS 1.62. I don't totally understand it, but I guess it is agnostic as to the starting refresh rate?
My initial post should be rephrased to ask if there is code to open the lower border that works at 60hz that is not switching to 50hz before opening the border.
Re: open bottom border possible in 60hz?
No I'm sure Neo is running in 60Hz on 60Hz machines. US TVs could seldom sync to 50Hz.TheNameOfTheGame wrote: ↑Fri Sep 02, 2022 9:41 am Ah, I wonder if that is how Neochrome Master does it also?
My initial post should be rephrased to ask if there is code to open the lower border that works at 60hz that is not switching to 50hz before opening the border.
I posted everything you need to adapt 50Hz border opening code to instead work in 60Hz

- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Well, I have no idea how to adapt your suggestion into the code abovetroed wrote: ↑Fri Sep 02, 2022 11:49 amNo I'm sure Neo is running in 60Hz on 60Hz machines. US TVs could seldom sync to 50Hz.TheNameOfTheGame wrote: ↑Fri Sep 02, 2022 9:41 am Ah, I wonder if that is how Neochrome Master does it also?
My initial post should be rephrased to ask if there is code to open the lower border that works at 60hz that is not switching to 50hz before opening the border.
I posted everything you need to adapt 50Hz border opening code to instead work in 60Hz![]()

In the code I posted above, it looks like it is setting line 199 at the VBL and then setting #200 in the Timer_b service routine. I don't see those values in the table you posted. Of course I don't know what I am talking about so there ya go.troed wrote: ↑Thu Sep 01, 2022 1:06 pm You open the border in 60Hz by making sure you go to 50Hz at the location where the 60Hz end-of-screen check is made.
All these checks are done at cycle 502 (according to the historical way of counting cycles per line).Code: Select all
Line: 16: 60Hz vBLANK = false; 25: 50Hz vBLANK = false; 34: 60Hz and mono screen start 47/63: 50Hz screen start (short/regular top border GLUE) 234: 60Hz screen end 247/263: 50Hz screen end 258: 60Hz BLANK 308: 50Hz BLANK


Re: open bottom border possible in 60hz?
I hacked together a quick rout for you:TheNameOfTheGame wrote: ↑Fri Sep 02, 2022 2:12 pm In the code I posted above, it looks like it is setting line 199 at the VBL and then setting #200 in the Timer_b service routine. I don't see those values in the table you posted. Of course I don't know what I am talking about so there ya go.![]()
![]()
http://files.dhs.nu/files_source/low60v1.zip
That's just a normal low-border routine with inverse frequency switches (and running in 60 Hz of course).
In Hatari 2.4.1 it opens up 23 extra lines, which looks about right when comparing to my STe machine, I didn't do any measurements on real HW.
However, on both the Medusa and OSSC scandoublers the first three scanlines are offset/scrambled. So I thought my code was wrong and launched Neochrome Master to compare. But it's exactly the same there.
I don't know if this is due to the scandoublers, my STe or my code. I have no 15 kHz-able CRT to test with. But I can't remember this behaviour from back in the days.
Re: open bottom border possible in 60hz?
thanks, now it works
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
Re: open bottom border possible in 60hz?
ok, I've just checked under Steem 4.0.1 debugger and the timing for opening the lower border in 60Hz is the same as in 50Hz. Just a switch is opposite: 50Hz/60Hz vs 60Hz/50Hz.
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Nice, thanks, I'll check it out.evil wrote: ↑Fri Sep 02, 2022 3:56 pmI hacked together a quick rout for you:TheNameOfTheGame wrote: ↑Fri Sep 02, 2022 2:12 pm In the code I posted above, it looks like it is setting line 199 at the VBL and then setting #200 in the Timer_b service routine. I don't see those values in the table you posted. Of course I don't know what I am talking about so there ya go.![]()
![]()
http://files.dhs.nu/files_source/low60v1.zip
That's just a normal low-border routine with inverse frequency switches (and running in 60 Hz of course).

Oh, that's surprising, but good. I swapped the 50/60hz change lines in the source I posted early and reassembled it. It works on Steem 4.1.2 at least. Great!
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
Thanks, the code works good here on Steem.evil wrote: ↑Fri Sep 02, 2022 3:56 pm I hacked together a quick rout for you:
http://files.dhs.nu/files_source/low60v1.zip
That's just a normal low-border routine with inverse frequency switches (and running in 60 Hz of course).
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
I'm trying to adapt the original posted border routine from https://github.com/miniupnp/AtariST/blo ... o/border.s to a C program I'm working on. I have the assembler source code compiled in and can see the screen flashing from the new VBL routine (see below code snippet).
So after setting the new VBL routine it hangs at the C call Vsync() so I think it needs to execute the original VBL code after the new code.
What is the right way to do this? Currently, the new VBL is this:
The original VBL vector was saved in the setup routine:
Also, I need Timer C active as I am using the 200Hz tick. The border code does this:
Which clearing $FA09 turns off Timer C I assume. I tried to turn it back on with:
But it didn't seem to work. Did I do something wrong?
So after setting the new VBL routine it hangs at the C call Vsync() so I think it needs to execute the original VBL code after the new code.
What is the right way to do this? Currently, the new VBL is this:
Code: Select all
MYVBL:
|flash palette for testing
move.w 0xffff8240, d1
addq.w #1,d1
move.w d1,0xffff8240
CLR.B 0xFFFFFA1B.W |STOP TIMER B
MOVE.B #199,0xFFFFFA21 |OCCUR ON LAST SCANLINE
MOVE.B #8,0xFFFFFA1B.W |START TIMER B
RTE
Code: Select all
LEA STORAGE,A0
MOVE.L 0x70.W,(A0)+ |save vblank vector
Code: Select all
CLR.B 0xFFFFFA07.W |MFP RESET
CLR.B 0xFFFFFA09.W |turns off Timer C!
ORI.B #1,0xFFFFFA07.W |ENABLE TIMER B
ORI.B #1,0xFFFFFA13.W
CLR.B 0xFFFFFA1B.W |STOP TIMER B
Code: Select all
ORI.B #6,0xFFFFFA09.W |ENABLE TIMER C
Re: open bottom border possible in 60hz?
I'm confused by all the "just like regular lower border just with frequencies swapped" comments. You can read the table above top down:troed wrote: ↑Thu Sep 01, 2022 1:06 pmCode: Select all
Line: 16: 60Hz vBLANK = false; 25: 50Hz vBLANK = false; 34: 60Hz and mono screen start 47/63: 50Hz screen start (short/regular top border GLUE) 234: 60Hz screen end 247/263: 50Hz screen end 258: 60Hz BLANK 308: 50Hz BLANK
If you're in 60Hz at line 34 the screen will start to display. If you're in 60Hz at line 234 it will stop displaying.
= you must be in 50Hz at the correct position on line 234 to keep displaying a "bottom border".
A 60Hz screen stops displaying (blanks) at line 258. You can enable a few more extra lines by doing a 60-50-60 switch there.
If you're using timers instead of counting lines, you need to count 234 lines of 508 cycles instead of 263 lines of 512 cycles to get to the right place.
Always test on real hardware. I know when I released "Fullast Vinner" Steem SSE did not emulate 60Hz VBLANK.
Last edited by troed on Sun Sep 04, 2022 10:42 am, edited 1 time in total.
- TheNameOfTheGame
- Fuji Shaped Bastard
- Posts: 2203
- Joined: Mon Jul 23, 2012 8:57 pm
- Location: Almost Heaven, West Virginia
Re: open bottom border possible in 60hz?
I am with you. I thought the frequency shift had to happen at different lines for 50hz or 60hz machines. That is what I am trying to understand also because I don't have a CRT monitor to test on and the program I'm working on will be for both NTSC and PAL machines.troed wrote: ↑Sun Sep 04, 2022 7:07 amI'm confused by all the "just like regular lower border just with frequencies swapped" comments. You can read the table above top down:troed wrote: ↑Thu Sep 01, 2022 1:06 pmCode: Select all
Line: 16: 60Hz vBLANK = false; 25: 50Hz vBLANK = false; 34: 60Hz and mono screen start 47/63: 50Hz screen start (short/regular top border GLUE) 234: 60Hz screen end 247/263: 50Hz screen end 258: 60Hz BLANK 308: 50Hz BLANK
If you're in 60Hz at line 34 the screen will start to display. If you're in 60Hz at line 234 it will stop displaying.
= you must be in 50Hz at the correct position on line 234 to keep displaying a "bottom border".
A 60Hz screen stops displaying (blanks) at line 258. You can enable a few more extra lines by doing a 60-50-60 switch there.
If you're using timers instead of counting lines, you need to count 234 lines of 508 cycles instead of 263 lines of 512 cycles to get to the right place.
Always test on real hardware. I know when I released "Fullast Vinner" Steem SSE did not emulate 60Hz VBLANK.
Nice, that is what I needed. I couldn't think of that last night. I was thinking to JMP to the old routine. Anyway, thanks.thomas3 wrote: ↑Sun Sep 04, 2022 9:53 am To run the old VBL code, replace your rte with:
Code: Select all
Move.l storage,-(sp) Rts
For the MFP reset portion of the code, I kept Timer C on with:
Code: Select all
CLR.B 0xFFFFFA07.W |MFP RESET - disable TIMER A, B, etc
| CLR.B 0xFFFFFA09.W |disable TIMER C, D etc,
andi.b #0x20, 0xFFFFFA09.W |leave timer c on!!
ORI.B #1,0xFFFFFA07.W |ENABLE TIMER B

So changed the line to:
Code: Select all
andi.b #0x60, 0xFFFFFA09.W |leave timer c amd acia on!!