Open top border

All 680x0 related coding posts in this section please.

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

Zamuel_a
Atari God
Atari God
Posts: 1234
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Open top border

Postby Zamuel_a » Fri Nov 23, 2012 7:58 am

I want to open the top border, but have no luck doing it. I tried the simple "wait around 15000 cycles" routine and it almost works. I can't get it stable, even that I disable all interrupts and don't do anything else. Don't know why, but anyway I don't want to spend so many cycles for waiting. I have read that you can use the HBL or timer a to do it so I tried the following code:

Code: Select all

timer_a   
   move.w   #$2100,sr   ;enable HBL
   stop   #$2100      ;wait for hbl
   move.w   #$2700,sr   ;disable interrupts
   clr.b   $fffffa19.w   ;stop timer A
   dcb.w   84,$4e71   ;wait abit
   move.b   #0,$ffff820a.w   ;60 Hz
   dcb.w   9,$4e71
   move.b   #2,$ffff820a.w   ;50 Hz   
   move.w   #$2300,sr
   bclr   #5,$fffffa0f.w
   rte


In the VBL I used this code (as suggested in a thread I found)

Code: Select all

vbl
   clr.b   $fffffa19.w      ;stop timer a
   move.b   #194,$fffffa1f.w   ;number of counts
   move.l   #timer_a,$134.w
   move.b   #1,$fffffa19.w      ;set Timer A to divide by 4

   bset   #5,$fffffa07.w      ;Timer A enable
   bset   #5,$fffffa13.w

   .
   .
   .


I know that the timer trigger as it should because if I change the timing I can make rather stable raster bars with it, but I can't remove the top border with it. I have tried all possible count values (had a loop that increased the value at some intervals), but nothing happens with the border so I must be missing something. Removing the bottom border with a similar routine, but with Timer B works without any problem.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe

Zamuel_a
Atari God
Atari God
Posts: 1234
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Re: Open top border

Postby Zamuel_a » Fri Nov 23, 2012 10:07 pm

I found the problems so now I got a stable top border removal! I had two problems. First the music in my game caused everything to be unstable and the second problem was that the suggested values I found on the web for the counters were totally wrong, so now it works!

Code: Select all

remove_top_border

   clr.b   $fffffa19.w      ;stop timer A
   move.w   #$2100,sr      ;enable HBL
   stop   #$2100         ;wait for hbl
   move.w   #$2700,sr      ;disable interrupts
   dcb.w   84,$4e71      ;wait a bit
   move.b   #0,$ffff820a.w      ;60 hz
   dcb.w   14,$4e71      ;wait a bit
   move.b   #2,$ffff820a.w      ;50 hz   
   move.w   #$2300,sr      ;turn on interrupts
   bclr   #5,$fffffa0f.w      ;timer finished
   rte

remove_bottom_border
   move.w   d0,-(sp)
   move.b   $fffffa21.w,d0
rlb_w   cmp.b   $fffffa21.w,d0      ;wait for right border
   beq.s   rlb_w
   clr.b   $fffff820a.w      ;60 hz
   dcb.w   17,$4e71      ;wait a bit
   move.b   #2,$fffff820a.w      ;50 hz
   move.w   (sp)+,d0
   bclr   #0,$fffffa0f.w      ;timer finished
   rte

my_hbl   rte
   
my_vbl   clr.b   $fffffa19.w      ;stop timer a
   move.b   #98,$fffa1f      ;number of counts
   move.l   #remove_top_border,$134.w
   move.b   #4,$fffffa19.w      ;set Timer A to divide by 50
   bset   #5,$fffffa07.w      ;Timer A enable
   bset   #5,$fffffa13.w

   clr.b   $ffffffa1b.w      ;stop timer b
   move.b   #199+29,$fffffa21.w   ;number of counts to last line
   move.b   #8,$fffffa1b.w   
   move.l   #remove_bottom_border,$120.w


Just put my_vbl in $70 and my_hbl in $68 and it should work.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe

!cube
Atari maniac
Atari maniac
Posts: 80
Joined: Thu Jun 14, 2007 6:37 am
Location: Vantaa, Finland
Contact:

Re: Open top border

Postby !cube » Sun Nov 25, 2012 8:44 am

That's weird. I used the same timings as you did in the first example and got it stable, and I think I got the timings from that article by Alien so they should be correct. Oh well.. *shrug*
Kludge power since 1976.

Zamuel_a
Atari God
Atari God
Posts: 1234
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Re: Open top border

Postby Zamuel_a » Sun Nov 25, 2012 11:11 am

The strange thing is that if you calculate the amount of cycles you are waiting with the first version, you are not near the 14900 ones that you are supposed to wait if you do the quick and dirty way to remove the top border in the VBL. When I looked into it abit more I took the 14900 cycles and tried to calculate what it would be if I translated it to the timer and that's how I got my values.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe

!cube
Atari maniac
Atari maniac
Posts: 80
Joined: Thu Jun 14, 2007 6:37 am
Location: Vantaa, Finland
Contact:

Re: Open top border

Postby !cube » Sun Nov 25, 2012 7:33 pm

I was referring to the "remove_top_border" routine NOP counts, not the Timer-A setup stuff.
Kludge power since 1976.

Zamuel_a
Atari God
Atari God
Posts: 1234
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Re: Open top border

Postby Zamuel_a » Sun Nov 25, 2012 7:50 pm

Aha ok, yes the wait loop routine worked. I just had some problems with the music interfering so I was out of sync. Using Timer A is better since you don't have to waste cycles, unless you have something usefull you can do here instead.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe

User avatar
Mug UK
Administrator
Administrator
Posts: 11367
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: Open top border

Postby Mug UK » Sun Nov 25, 2012 8:43 pm

As I mentioned earlier on - would you be better off using the SNDH version of the music as that might (no guarantees as I don't know Ben Daglish's music player inside out) have been patched to work better?
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
FedePede04
Atari God
Atari God
Posts: 1081
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Open top border

Postby FedePede04 » Tue May 19, 2015 8:42 pm

Hi Zamuel_a
thx for the example, i hope that you don't mind if i use it.

/Peter

Zamuel_a wrote:I found the problems so now I got a stable top border removal! I had two problems. First the music in my game caused everything to be unstable and the second problem was that the suggested values I found on the web for the counters were totally wrong, so now it works!

Code: Select all

remove_top_border

   clr.b   $fffffa19.w      ;stop timer A
   move.w   #$2100,sr      ;enable HBL
   stop   #$2100         ;wait for hbl
   move.w   #$2700,sr      ;disable interrupts
   dcb.w   84,$4e71      ;wait a bit
   move.b   #0,$ffff820a.w      ;60 hz
   dcb.w   14,$4e71      ;wait a bit
   move.b   #2,$ffff820a.w      ;50 hz   
   move.w   #$2300,sr      ;turn on interrupts
   bclr   #5,$fffffa0f.w      ;timer finished
   rte

remove_bottom_border
   move.w   d0,-(sp)
   move.b   $fffffa21.w,d0
rlb_w   cmp.b   $fffffa21.w,d0      ;wait for right border
   beq.s   rlb_w
   clr.b   $fffff820a.w      ;60 hz
   dcb.w   17,$4e71      ;wait a bit
   move.b   #2,$fffff820a.w      ;50 hz
   move.w   (sp)+,d0
   bclr   #0,$fffffa0f.w      ;timer finished
   rte

my_hbl   rte
   
my_vbl   clr.b   $fffffa19.w      ;stop timer a
   move.b   #98,$fffa1f      ;number of counts
   move.l   #remove_top_border,$134.w
   move.b   #4,$fffffa19.w      ;set Timer A to divide by 50
   bset   #5,$fffffa07.w      ;Timer A enable
   bset   #5,$fffffa13.w

   clr.b   $ffffffa1b.w      ;stop timer b
   move.b   #199+29,$fffffa21.w   ;number of counts to last line
   move.b   #8,$fffffa1b.w   
   move.l   #remove_bottom_border,$120.w


Just put my_vbl in $70 and my_hbl in $68 and it should work.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

Zamuel_a
Atari God
Atari God
Posts: 1234
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Re: Open top border

Postby Zamuel_a » Tue May 19, 2015 10:03 pm

FedePede04 wrote:Hi Zamuel_a
thx for the example, i hope that you don't mind if i use it.

/Peter

Zamuel_a wrote:I found the problems so now I got a stable top border removal! I had two problems. First the music in my game caused everything to be unstable and the second problem was that the suggested values I found on the web for the counters were totally wrong, so now it works!

Code: Select all

remove_top_border

   clr.b   $fffffa19.w      ;stop timer A
   move.w   #$2100,sr      ;enable HBL
   stop   #$2100         ;wait for hbl
   move.w   #$2700,sr      ;disable interrupts
   dcb.w   84,$4e71      ;wait a bit
   move.b   #0,$ffff820a.w      ;60 hz
   dcb.w   14,$4e71      ;wait a bit
   move.b   #2,$ffff820a.w      ;50 hz   
   move.w   #$2300,sr      ;turn on interrupts
   bclr   #5,$fffffa0f.w      ;timer finished
   rte

remove_bottom_border
   move.w   d0,-(sp)
   move.b   $fffffa21.w,d0
rlb_w   cmp.b   $fffffa21.w,d0      ;wait for right border
   beq.s   rlb_w
   clr.b   $fffff820a.w      ;60 hz
   dcb.w   17,$4e71      ;wait a bit
   move.b   #2,$fffff820a.w      ;50 hz
   move.w   (sp)+,d0
   bclr   #0,$fffffa0f.w      ;timer finished
   rte

my_hbl   rte
   
my_vbl   clr.b   $fffffa19.w      ;stop timer a
   move.b   #98,$fffa1f      ;number of counts
   move.l   #remove_top_border,$134.w
   move.b   #4,$fffffa19.w      ;set Timer A to divide by 50
   bset   #5,$fffffa07.w      ;Timer A enable
   bset   #5,$fffffa13.w

   clr.b   $ffffffa1b.w      ;stop timer b
   move.b   #199+29,$fffffa21.w   ;number of counts to last line
   move.b   #8,$fffffa1b.w   
   move.l   #remove_bottom_border,$120.w


Just put my_vbl in $70 and my_hbl in $68 and it should work.


No I don't mind that you use the code! Hope you can get some good use of it! :D
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe

User avatar
FedePede04
Atari God
Atari God
Posts: 1081
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Open top border

Postby FedePede04 » Wed May 20, 2015 9:29 pm

thx Zamuel_a
i will do my best to make some fun with it :)
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 112
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: Open top border

Postby thomas3 » Thu Mar 07, 2019 7:47 am

NECROBUMP!!!

I'm working on this stuff at the moment, and found this thread.

If anyone, like me, scratched their head around why the timings below are different from the "standard", it's because typically these assume that the first CLR.b should come *after* interrupts are disabled in line #4.

At least if anyone else discovers this thread again in the future, you now won't have to work this out :D


Zamuel_a wrote:I found the problems so now I got a stable top border removal! I had two problems. First the music in my game caused everything to be unstable and the second problem was that the suggested values I found on the web for the counters were totally wrong, so now it works!

Code: Select all

remove_top_border

   clr.b   $fffffa19.w      ;stop timer A
   move.w   #$2100,sr      ;enable HBL
   stop   #$2100         ;wait for hbl
   move.w   #$2700,sr      ;disable interrupts
   dcb.w   84,$4e71      ;wait a bit
   move.b   #0,$ffff820a.w      ;60 hz
   dcb.w   14,$4e71      ;wait a bit
   move.b   #2,$ffff820a.w      ;50 hz   
   move.w   #$2300,sr      ;turn on interrupts
   bclr   #5,$fffffa0f.w      ;timer finished
   rte

remove_bottom_border
   move.w   d0,-(sp)
   move.b   $fffffa21.w,d0
rlb_w   cmp.b   $fffffa21.w,d0      ;wait for right border
   beq.s   rlb_w
   clr.b   $fffff820a.w      ;60 hz
   dcb.w   17,$4e71      ;wait a bit
   move.b   #2,$fffff820a.w      ;50 hz
   move.w   (sp)+,d0
   bclr   #0,$fffffa0f.w      ;timer finished
   rte

my_hbl   rte
   
my_vbl   clr.b   $fffffa19.w      ;stop timer a
   move.b   #98,$fffa1f      ;number of counts
   move.l   #remove_top_border,$134.w
   move.b   #4,$fffffa19.w      ;set Timer A to divide by 50
   bset   #5,$fffffa07.w      ;Timer A enable
   bset   #5,$fffffa13.w

   clr.b   $ffffffa1b.w      ;stop timer b
   move.b   #199+29,$fffffa21.w   ;number of counts to last line
   move.b   #8,$fffffa1b.w   
   move.l   #remove_bottom_border,$120.w


Just put my_vbl in $70 and my_hbl in $68 and it should work.

User avatar
dhedberg
Atari Super Hero
Atari Super Hero
Posts: 915
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: Open top border

Postby dhedberg » Fri Mar 08, 2019 9:58 am

Ah, what are you working on?
Daniel, New Beat - http://newbeat.atari.org. Like demos? Have a look at our new Falcon030 demo MORE.

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 112
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: Open top border

Postby thomas3 » Sun Mar 10, 2019 5:30 pm

Some lameshit :) but all in assembly this time.

Currently: fullscreen disting rasters and big scroll :D

User avatar
dhedberg
Atari Super Hero
Atari Super Hero
Posts: 915
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: Open top border

Postby dhedberg » Sun Mar 10, 2019 5:33 pm

Nice! Why don't you send in a remote entry to the Sommarhack demo competition in July. See here for more information: http://www.dhs.nu/sommarhack/2019/
Daniel, New Beat - http://newbeat.atari.org. Like demos? Have a look at our new Falcon030 demo MORE.

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 112
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: Open top border

Postby thomas3 » Sun Mar 10, 2019 7:21 pm

I'm trying for it ;) had hoped to be there in person, but life has made that impossible!

My entry will be one for those of us who love scrolltexts. A lot. :D

User avatar
dhedberg
Atari Super Hero
Atari Super Hero
Posts: 915
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: Open top border

Postby dhedberg » Tue Mar 12, 2019 11:09 am

Great! Looking forward to it!
Daniel, New Beat - http://newbeat.atari.org. Like demos? Have a look at our new Falcon030 demo MORE.


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 1 guest