Hardwarescrolling Control3.5a extension

STOS-related stuff in here please

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

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Hardwarescrolling Control3.5a extension

Postby freddex73 » Sat Apr 21, 2018 11:30 am

HI! :D :D :D

Im writing a new code for a game using the CONTROL3,5a extension (unreg)

Its using Hardwarescrolling and uses maybe 5% processortime for scrolling the screenarea X and Y.

the map i built up of 16x16 pix of blocks drawn in a editor.

(Sorry for my crappy English) :lol: :lol:



Now to the problem!! :? 8O

I CANT compile the code!! :x :cry: because I only have an unregistered version of CONTROL extension version 3.5a

Do any have the Registered version of the extension??!! :)

Of course I would like to register my copy! but I do not get in touch with L.J.Greenhalgh! :roll:


:megaphone: PLEASE HELP ME!! :megaphone:

https://www.youtube.com/watch?v=aLrU4Myb-NU
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Sun Apr 22, 2018 10:02 pm

Yo!

Is this an STE hardscroll?

If so I have a simple routine I wrote that generates some machine code to achieve this, and then uses CALL to execute it each vbl. It's super fast and compiles with no problems, AND needs no extensions.

Would this help?

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Mon Apr 23, 2018 2:37 pm

WOW! Yes please! :)

I like to try it out!

// Fredrik
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Mon Apr 23, 2018 9:43 pm

Ok, the routine is attached. I'm not sure what your set-up is with extensions etc, so this is written in pure STOS. I guess you'll need the newest STOS version off exxos' site though.

I've never used the Control extension so I don't know how high level the syntax of the hardscroll commands are. My routine is not high level at all :D - basically, it just dynamically adjusts the current screen address, really really fast, to whatever is in D0 (set using dreg(0)=... command). It does so using hex machine code instructions.

So (and apologies if this is obvious), to get the scroll effect you need to adjust the address in D0, e.g. by 160 bytes for a one line y-scroll, and then recall the routine... I've commented the attached.

What you potentially lose in neatness, you'll gain in speed. If the Control extension's commands really are using ~5% screen time, then this will beat that by a huge, huge factor. It actually only needs two ASM instructions (plus an rts) per vbl. So we're talking a few cycles here, not a few %!

Let me know how you get on and if you need me to explain anything further. And, *awesome* that you're working on a game project in STOS. Can you give any more details? :) I'm working on a game too at the moment - loving it!!
You do not have the required permissions to view the files attached to this post.

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Tue Apr 24, 2018 9:44 pm

Nice routine for the hardwarescroller!:) Works perfekt! But i need to use it for sidwayscrolling.
And the screensize need to be set to 676pix x256pix..
Any idea how to do it? :)

The 5% that I talked about is to predraw out the tiles in the background. :)

https://www.youtube.com/watch?v=sBV2fMqETLM

I have a small video of the game on youtube.
(I need to fix the items/sprites later.)
Right now, I focus on getting the background to work,

Would be fun and see what sort of game you programming? :)


Regards Fredrik
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Wed Apr 25, 2018 5:21 pm

Hey!

Your game looks GOOD for STOS - good work, dude. Are you using original gfx?

Right, as for side scrolling... this is surely doable, but I need to change the routine to handle playfields rather than just modify the current screen address.

Looking at this topic - http://www.atari-forum.com/viewtopic.php?f=16&t=32946 - whilst I've not ever tried much STE hardware stuff before, it looks possible to achieve the playfield size you need without doing anything trixy like using interrupts. I'm interested in trying this, if that would be helpful for you :). (or, of course, you can try yourself - would be interested in your results if you do).

My game is an insane mix of Pacman and Tetris. That's all I can say at the moment :D. I'm nearly at prototype stage!

Speak soon!

User avatar
MiggyMog
Atari Super Hero
Atari Super Hero
Posts: 833
Joined: Sun Oct 30, 2005 4:43 pm
Location: Scotland

Re: Hardwarescrolling Control3.5a extension

Postby MiggyMog » Wed Apr 25, 2018 7:10 pm

It may be useful to know that the STE extension also has support for hardware scrolling, it doesn't have mapping and sprite stuff though which would have been a nice addition. A screen split / border with status panel would have been awesome too.

Btw looking good so far!
('< o o o o |''| STM,2xSTFM,2xSTE+HD,C-Lab Falcon MK2+HD,Satandisk,Ultrasatandisk,Ethernat.

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Wed Apr 25, 2018 8:20 pm

MiggyMog wrote:It may be useful to know that the STE extension also has support for hardware scrolling, it doesn't have mapping and sprite stuff though which would have been a nice addition. A screen split / border with status panel would have been awesome too.


Mate, you're completely right. I'm getting tied up in low level solutions to problems that have already been solved at a high level!

So, OP: MiggyMog is right - you can probably just use the STE extension instead of Control, and your problems are sorted.

In saying that, I'm gonna have a play with the STE scroll registers and see what's possible :D

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Wed Apr 25, 2018 8:49 pm

That there is a bug in the STE extensions .. it jumps a pixel. 8O or am i wrong? 8)
i also need the other graphic commands from Control ext to draw the graphics correctly .. otherwise, everything looks compressed because I use the 678x255pix screen.

I need that resolution to draw the path in advance. And loop the screen. :?
:angel:
Atari STE 4096

User avatar
MiggyMog
Atari Super Hero
Atari Super Hero
Posts: 833
Joined: Sun Oct 30, 2005 4:43 pm
Location: Scotland

Re: Hardwarescrolling Control3.5a extension

Postby MiggyMog » Wed Apr 25, 2018 9:32 pm

There is nothing wrong with solving a problem your own way, that's the fun part and it's always nice to have an alternative. I am not sure about the 1 pixel jump issue, it's been a while. But yeah if the line width is longer , normal sprite routines are no use as they don't compensate for the new line length and likewise for the mapping stuff which was in missing link which would have been useful.

The routines in Doug's AGT may be a good place to look for a scrolling routine to pilfer though?
('< o o o o |''| STM,2xSTFM,2xSTE+HD,C-Lab Falcon MK2+HD,Satandisk,Ultrasatandisk,Ethernat.

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Wed Apr 25, 2018 9:39 pm

Well, just as a proof of concept, I've made my routine multi-directional and able to use playfields... But, as you've already pointed out, none of STOS's graphics commands will now work, because the routine messes with the line length register :D. Find it attached, just for the lolz and the amusing waste of time of it all. :lol:

So, this now leaves you with four options:

1) Try to get a registered copy of Control - which is where you started this :)

OR

2) Do this old school ST syncscroll style: don't use a playfield, have e.g. 4x horizontally preshifted 320 pixel width screens, draw tiles at screen margin each VBL as you have been doing, but use the original routine I posted above to handle y-scrolling and 16 pixel x-scrolling and switch between screens. (there's some really good threads about this on this forum from when dml was first developing AGT)...

OR

3) Use the above playfield approach, but with ASM sprite drawing routines that could handle the messed up lw register... this would also mean that you don't even have to redraw tiles each vbl, as you can draw the whole map in advance.

BUT:

4) It's about this point that STOS then completely goes in the bin, and we just switch to full on ASM!

Decisions, decisions :D
You do not have the required permissions to view the files attached to this post.

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Thu Apr 26, 2018 8:03 pm

Thomas3 Really nice routine! I have to play with ..
:cheers:
yes MiggyMog,. I totally agree with you. fun and find new ways .. :D I like all new ideas .. please come with more! :D
to this weekend I will have more time to program. :angel:
Atari STE 4096

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Fri Apr 27, 2018 9:38 am

I have contacted Les Greenhalg. 8)
Unfortunately, he did not have any Atari stuff left. Everything was gone :cry: . So it will be to reprogram the routines and build new ones to draw graphics correctly.
Hope, of course, anyone finds the registered version ?! :D
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Fri Apr 27, 2018 9:50 am

Well done for tracking him down! But that's a shame...

I was messing last night with 320 byte lines (=640 pixel wide playfields) to see if sprites organised in a way that skips every other line on a conventional 320 pixel width screen could then be copied to the playfield using Missing Link blit/m blit commands.

My conclusion was - nearly... I was able to draw a 16x16 (= actually 32 pixel height, stretched out with every other line blank) sprite to any y-axis and 16 pixel increments on the x-axis. For some reason, my x-preshifts didn't work though. I'll mess with it more later.

Alternatively, the oldschool sync scroll approach (which doesn't use the STE hardware scroll register) would be your best bet I think, although it would use much more processor time.

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Fri Apr 27, 2018 7:51 pm

HOLD THE FRONT PAGE - the x-preshifted sprite didn't work because I'd done something silly :D

It's fixed now. So, I'm now able to draw a sprite onto the playfield using conventional STOS graphics commands (you'll need the missing link extension). It's using a dirty and inefficient cheat which will ONLY work with 640 pixel width playfields... so I don't know how much use it'll be for your project. But I might do something with it now I've made it ;).

See attached - please ignore ugly palette. Next step is double buffering and cleaning up sprite trail... kids are in bed, wife is out for the evening, so why the hell not?!?!! :lol:
You do not have the required permissions to view the files attached to this post.

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Fri Apr 27, 2018 8:32 pm

Well, that was easier that expected. See attached :)
You do not have the required permissions to view the files attached to this post.

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Fri Apr 27, 2018 9:08 pm

:cheers: good job .. and it's no cheating :D .
pity just pulling out 32pix in y and just getting out 16pix. :?
but nice routine is really fast. like it.. :P :D
Atari STE 4096

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Fri Apr 27, 2018 9:31 pm

:) I wonder how hard it was to write an application in asambler that prints a graphics object 16x16 pixels from a memory adress. And prints a line in Y. Then skip 320 bytes. Or 460byte Depending on what resolution you have?

Hmmm. But I can hardly ever assembler. :oops:
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Fri Apr 27, 2018 9:52 pm

It's easy, seriously. See:
viewtopic.php?f=69&t=4603&p=30016&hilit=Sprite#p30016

Only thing would be to ensure that the destination buffer pointer is incremented by the custom line length.

Do you want me to try to make something?

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Fri Apr 27, 2018 10:05 pm

:D Oh, please .. :D

Just saw that I have 960pix x 256pix. So you have to jump 480bytes every line. 8O
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Sat Apr 28, 2018 9:45 am

Yo!

This is an interesting problem and I'm enjoying working on it, so I'm gonna make a new sprite system based on the above thread that we can use for this and other applications (e.g. overscan!!!). I'll make it so line length can be flexible - self-modifying code beckons ;)

Give me a few days! First job - I need to make something to create preshifted sprites and masks in an optimised format!

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Tue May 01, 2018 8:59 am

Ok, here's something to have a play with!

The attached provides a way of drawing 16x16 pre-shifted and masked sprites on screens of any width. It's all a bit rough around the edges so be careful with it ;)

I've included the application that creates the sprite/mask data, the machine code binary, the assembly source (based on the thread I gave you a link to above - so thanks simonsunnyboy and others for your past work, that I've used here!!) and an example prog. The example uses the left border STE-only overscan method and then draws a sprite on the resulting (336 pixel width) screen...

The next logical step would be to add a background redraw function to kill the sprite trail and enable you to use double buffering (if you were planning to do this?).

Also, I could change this to create generated code (it's merely doing some self-modifying stuff at the moment) to allow it to handle sprites of different sizes to 16x16!...

Let me know what you do with it and whether the above would be helpful. (the sprite/mask generator is in a germinal state, so please do develop it further!).
You do not have the required permissions to view the files attached to this post.

User avatar
freddex73
Atariator
Atariator
Posts: 19
Joined: Sun Mar 25, 2018 2:20 pm
Location: Sweden, Region Norrland

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Sun May 06, 2018 7:24 am

Good morning Thomas. :D I have not really understood how to change resolution? :shrug:

:cheers: Fredrik
Atari STE 4096

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Sun May 06, 2018 7:47 am

Yo!

Give me a couple more days on this and I'll have a new update that can handle double buffering and background redrawing. Then I'll explain :)

Plus, the version above has a bug in it... fixed now!

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Mon May 07, 2018 8:55 pm

OK - see attached! I've tried to comment this a bit better, but it might still not make much sense. Let me know if I need to explain anything further.

This version also has the hardscroll implemented in ASM... so this is now becoming a "playfield system"!!

I'm actually quite excited about some of the possibilities that this might open up :cheers:
You do not have the required permissions to view the files attached to this post.


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 2 guests