open bottom border possible in 60hz?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
TheNameOfTheGame
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2203
Joined: Mon Jul 23, 2012 8:57 pm
Location: Almost Heaven, West Virginia

open bottom border possible in 60hz?

Post by TheNameOfTheGame »

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?
evil
Captain Atari
Captain Atari
Posts: 232
Joined: Sun Nov 12, 2006 8:03 pm
Location: Devpac

Re: open bottom border possible in 60hz?

Post by evil »

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?
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).
I guess it wouldn't be all too hard to look at the code in a debugger.

https://demozoo.org/productions/95861/
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2727
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: open bottom border possible in 60hz?

Post by Cyprian »

@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
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

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?
User avatar
troed
Atari God
Atari God
Posts: 1635
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: open bottom border possible in 60hz?

Post by troed »

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.

;)

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 
All these checks are done at cycle 502 (according to the historical way of counting cycles per line).
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

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
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 279
Joined: Tue Apr 11, 2017 8:57 pm

Re: open bottom border possible in 60hz?

Post by thomas3 »

This looks convoluted :)

Bet it won't work in 60hz on real hw
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2727
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: open bottom border possible in 60hz?

Post by Cyprian »

TheNameOfTheGame 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?
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 - 320x200
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
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

thomas3 wrote: Thu Sep 01, 2022 5:44 pm This looks convoluted :)

Bet it won't work in 60hz on real hw
Tried it in hatari also with USA TOS and it works there also. Need to try it on my STE.
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

Tried it on my real hardware 60hz STE and it worked. I guess this is universal open lower border code.
User avatar
troed
Atari God
Atari God
Posts: 1635
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: open bottom border possible in 60hz?

Post by troed »

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?
Sort of. It goes into 50Hz, removes the regular 50Hz bottom border. It's not in 60Hz.
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 279
Joined: Tue Apr 11, 2017 8:57 pm

Re: open bottom border possible in 60hz?

Post by thomas3 »

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...
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

troed wrote: Fri Sep 02, 2022 9:31 am
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?
Sort of. It goes into 50Hz, removes the regular 50Hz bottom border. It's not in 60Hz.
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.
User avatar
troed
Atari God
Atari God
Posts: 1635
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: open bottom border possible in 60hz?

Post by troed »

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.
No I'm sure Neo is running in 60Hz on 60Hz machines. US TVs could seldom sync to 50Hz.

I posted everything you need to adapt 50Hz border opening code to instead work in 60Hz ;)
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

troed wrote: Fri Sep 02, 2022 11:49 am
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.
No I'm sure Neo is running in 60Hz on 60Hz machines. US TVs could seldom sync to 50Hz.

I posted everything you need to adapt 50Hz border opening code to instead work in 60Hz ;)
Well, I have no idea how to adapt your suggestion into the code above :lol:. I've never wrote code that does that before.
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.

;)

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 
All these checks are done at cycle 502 (according to the historical way of counting cycles per line).
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. :shrug: :lol:
evil
Captain Atari
Captain Atari
Posts: 232
Joined: Sun Nov 12, 2006 8:03 pm
Location: Devpac

Re: open bottom border possible in 60hz?

Post by evil »

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. :shrug: :lol:
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).

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.
evil
Captain Atari
Captain Atari
Posts: 232
Joined: Sun Nov 12, 2006 8:03 pm
Location: Devpac

Re: open bottom border possible in 60hz?

Post by evil »

Cyprian wrote: Thu Sep 01, 2022 11:58 am @evil I see only magnifier in a normal view. Is there a keyboard shortcut to see it i a full view?
Press the fill bucket tool and check the Magnify option. Then press esc to go to full view.
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2727
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: open bottom border possible in 60hz?

Post by Cyprian »

evil wrote: Fri Sep 02, 2022 3:58 pm
Cyprian wrote: Thu Sep 01, 2022 11:58 am @evil I see only magnifier in a normal view. Is there a keyboard shortcut to see it i a full view?
Press the fill bucket tool and check the Magnify option. Then press esc to go to full view.
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
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2727
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: open bottom border possible in 60hz?

Post by Cyprian »

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
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

evil wrote: Fri Sep 02, 2022 3:56 pm
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. :shrug: :lol:
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).
Nice, thanks, I'll check it out. :cheers:
Cyprian wrote: Sat Sep 03, 2022 9:48 am 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.
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!
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

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).
Thanks, the code works good here on Steem.
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

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:

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					
The original VBL vector was saved in the setup routine:

Code: Select all

	LEA STORAGE,A0
	MOVE.L 0x70.W,(A0)+		|save vblank vector
Also, I need Timer C active as I am using the 200Hz tick. The border code does this:

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
Which clearing $FA09 turns off Timer C I assume. I tried to turn it back on with:

Code: Select all

ORI.B #6,0xFFFFFA09.W		|ENABLE TIMER C
But it didn't seem to work. Did I do something wrong?
User avatar
troed
Atari God
Atari God
Posts: 1635
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: open bottom border possible in 60hz?

Post by troed »

troed wrote: Thu Sep 01, 2022 1:06 pm

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 
I'm confused by all the "just like regular lower border just with frequencies swapped" comments. You can read the table above top down:

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.
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 279
Joined: Tue Apr 11, 2017 8:57 pm

Re: open bottom border possible in 60hz?

Post by thomas3 »

To run the old VBL code, replace your rte with:

Code: Select all

Move.l storage,-(sp)
Rts
:)
User avatar
TheNameOfTheGame
Fuji Shaped Bastard
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?

Post by TheNameOfTheGame »

troed wrote: Sun Sep 04, 2022 7:07 am
troed wrote: Thu Sep 01, 2022 1:06 pm

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 
I'm confused by all the "just like regular lower border just with frequencies swapped" comments. You can read the table above top down:

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

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

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
Then the code worked somewhat but no keyboard. I realized I needed the ACIA interrupt on also. :lol:

So changed the line to:

Code: Select all

	andi.b #0x60, 0xFFFFFA09.W		|leave timer c amd acia on!!
So things are better now. The border is opened and I can use it for display.
Post Reply

Return to “Coding”