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

Re: Hardwarescrolling Control3.5a extension

Postby freddex73 » Tue May 08, 2018 7:47 pm

:D wow! :cheers: I works perfectly with my code! :D

Wondering about another thing? :shrug: that's an idea i have :contract:

I have an assambler Code for playing soundtracker music(MOD) for STE :D (By Paulo Simoes)

The idea is to load the code and module, then it writes the modulemusic into a memorybank (sampled in 12,5Khz or 25Khz) :coffe: instead of playing the music. :roll:

So you can play the module as one Big DMA sample in STOS from the memorybank.. :contract: With zero CPU time! :megaphone: :angel:

Of course, it may be a good idea to shorten the number of tracks in the Module, so the sample will not be too big! 8O :lol:

MODrout.zip
You do not have the required permissions to view the files attached to this post.
Atari STE 4096

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
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 08, 2018 9:02 pm

That's awesome!! But how are you drawing your tiles? I figured I'd have to make another routine for that :D. If you want, send me your code for tile drawing and I'll write in in ASM for you :).

I plan to do something with this too soon. Oh - one thing I forgot - make sure you call the background draw function for every sprite BEFORE you call the sprite draw function, and make sure you do it in the opposite order. In other words, say you have five sprites, your inner loop needs to work like this:

For I=1 to 5
Set current sprite as I (using a pointer to the right array)
Call background redraw function


For I=5 to 1
Set current sprite as I
Call sprite draw/background save function

Wait vbl
Call hardscroll function
Swap screens

Loop!

This makes sense if you think about it...!

As for the mod question... Dude, I know nothing about DMA or playing mods. But there are people here who do. Try one of the other forums! :)

User avatar
ljbk
Atari Super Hero
Atari Super Hero
Posts: 514
Joined: Thu Feb 19, 2004 4:37 pm
Location: Estoril, Portugal

Re: Hardwarescrolling Control3.5a extension

Postby ljbk » Wed May 09, 2018 6:50 am

Hello !

Sorry but i have no time for Atari ST stuff.
I have not touched any ST code for about 5 years.

Paulo.

joska
Hardware Guru
Hardware Guru
Posts: 4147
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby joska » Wed May 09, 2018 7:51 am

freddex73 wrote:I have an assambler Code for playing soundtracker music(MOD) for STE :D (By Paulo Simoes)

The idea is to load the code and module, then it writes the modulemusic into a memorybank (sampled in 12,5Khz or 25Khz) :coffe: instead of playing the music. :roll:

So you can play the module as one Big DMA sample in STOS from the memorybank.. :contract: With zero CPU time! :megaphone: :angel:


I'm not sure if this can be done with that routine. I have been playing around with this routine myself and it use the volume registers in addition to adjusting the samples. So if you generate one big sample volumes will not be correct when you play it back. You would have to generate a table with volumes too and change it dynamically during sample playback from the 200Hz timer.

There are other MOD playback routines that does not use the volume settings, they are probably better suited for this project. Also, I suggest you generate individual samples for each pattern, that should save a lot of memory as patterns are usually played multiple times in a song.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
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 May 09, 2018 3:59 pm

This sounds like another interesting problem to solve. What do you recommend as a MOD player that might fit this application? :)

joska
Hardware Guru
Hardware Guru
Posts: 4147
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby joska » Wed May 09, 2018 7:18 pm

Maybe the original Lance Protracker replay routine can be used as basis? Remove/disable the code that controls DMA playback, and move the "DMA buffer" address each time you call the player to create a continuous sample.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

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 May 09, 2018 7:32 pm

Hi, Thomas! :D
I use Control Extensions command to draw the blocks on screen. :wink:
Yes! you will get the code, I´ll just need to clean the code first.. :contract: :lol: :lol: then I´ll put it up here! :D

It had been a dream if it could be done!! :cheers: :D ( Make a samplebank of a Moduletrack) :P
Love the soundtracker music, but it takes to mutch CPU time.. :cry: 8O
Atari STE 4096

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
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 May 09, 2018 7:37 pm

joska wrote:Maybe the original Lance Protracker replay routine can be used as basis? Remove/disable the code that controls DMA playback, and move the "DMA buffer" address each time you call the player to create a continuous sample.


Cool. This sounds ^3 times easier than I was anticipating :).

Now watch as it makes STOS explode....!!

joska
Hardware Guru
Hardware Guru
Posts: 4147
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby joska » Wed May 09, 2018 7:50 pm

It's more complicated than that, this will only create one big sample. What if the song loops? You need to handle those sort of things. It would be better to study the sources of the player and modify it so you can "play" only selected patterns. Then create one sample per pattern, and play them in sequence according to the pattern table in the mod.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

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 May 09, 2018 8:09 pm

:D 'Yes, Joska! :)

Though, you can modify the module first in a Tracker. :roll:
But in the long run it would be great if you could "unpack" differents tracks, from the same Module file. :D :D
Atari STE 4096

joska
Hardware Guru
Hardware Guru
Posts: 4147
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby joska » Wed May 09, 2018 8:18 pm

To be really usable I think you must be able to create each track only once. The Lance player use ~30% CPU on an STE. Creating a 3 minute stereo sample would take one minute, creating a 25000*2*60*3 = 9Mb sample. Even in mono (not sure if the Lance player can do that, but you could probably mix the channels yourself which would use more time) at 12.5kHz you would end up with 750kB of samples per minute.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 122
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby metalages » Wed May 09, 2018 8:33 pm

I think it is easier to use wizzcat Ste protrack routine in this case, set it at 12.5khz and modify the mixing routine which is quite simple to get mono directly instead of stereo. Probably more efficient and lot simpler than Lance routine for that. Also as Lance routine uses microwire would be more complicated to replay.

In my BLITSnd routine (viewtopic.php?f=16&t=29097&start=25) I have implemented an asyncupdate routine to be able to mix full update and precomputed replay for critical parts... But as it runs at 100kb/sec, the idea is probably to precompute MOD pattern one by one...

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 122
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby metalages » Wed May 09, 2018 8:47 pm

(if I well remember playing at 12.5khz with Wizzcat routine should be around 25% CPU)

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
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 May 09, 2018 8:54 pm

But also...
Are you aiming for the game to be running in 50Hz?
Could we just use a standard MOD player and instead concentrate on super optimising the gfx routs?
As this is a STOS project, running at 25 fps would still be impressive...

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 May 09, 2018 9:54 pm

:lol: :lol: Thomas,
Yes!! Im aiming for 50Hz :lol:

But of course is 25Hz good too! :D

Here you have a video with your STE Hardware scrolling routine! :D :D

https://youtu.be/WprhxDjco4U


Regards Fredrik
Atari STE 4096

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 103
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 May 09, 2018 10:35 pm

That is looking awesome! Congrats!

Is the blue raster showing tile redraw? And is this compiled yet?

mlynn1974
Captain Atari
Captain Atari
Posts: 205
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby mlynn1974 » Thu May 10, 2018 12:36 am

Hi freddex73,
The hardware scrolling effect looks amazing in your demo. It's smoother than the Violent Death game Colin wrote with the Missing Link (STFM - no hardware scrolling). I wasn't aware of the Hardware Scrolling Control 3.5a extension. I think it's probably best to use Thomas's playfield system if you can't get a registered version to compile your program.

Hardware scrolling with minimal redraw is a very good way to implement this, but I'm not sure how you manage the wraparound at the end of the virtual screen without it pinging back or having to redraw large areas of the screen. How much CPU time does it take to redraw the tiles?
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

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

Re: Hardwarescrolling Control3.5a extension

Postby thomas3 » Thu May 10, 2018 6:34 am

Hey Michael,
I don't know if freddex did it this way, but one way to achieve an endless scroll effect is to draw your next row or column of tiles twice - once on the area that is about to be made visible, and once on the opposite side of the screen (e.g. at 320 pixels and -16 pixels if horizontally scrolling, relative to your display window). This then builds a duplicate screen behind where you've just scrolled from, which you can flip back to when at the end of your buffer. This means you can have a relatively small playfield.

Another option is to not do it with a playfield at all - dml talks about this in the agt threads. A 320x400 buffer would allow you 200 screen width scrolling if just adding to the logbase and redrawing your margins each time. This is then harder to manage multidirectional scrolling within versus a playfield. But you could do it on the stf, unlike playfield, and if you used sync scroll then performance would be v good.

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 May 10, 2018 11:22 am

:D The Registered version of CONTROL3.2 extensions. :D

:contract:

CONTROL32.zip

:cheers:
You do not have the required permissions to view the files attached to this post.
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 » Thu May 10, 2018 11:55 am

Hi, mlynn1974! :D

It uses maybe 10% (Draws 1,5 x 2 pcs 16x16 blocks each VBL),
but Thomas is working on a faster routine for drawing blocks. :D


I have 960pix x 256pix area. I draw 1,5 blocks ahead (16x16pix) per VBL.

There are 16 x 60 blocks = 960 blocks total.

So, 640 VBL x 1,5 blocks ahead = 960 blocks
( you move the window 640 pix, then go back and start all over.. ) :)

Don't know if this makes sense? :contract: :shrug:
Atari STE 4096

joska
Hardware Guru
Hardware Guru
Posts: 4147
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby joska » Thu May 10, 2018 8:52 pm

metalages wrote:I think it is easier to use wizzcat Ste protrack routine in this case, set it at 12.5khz and modify the mixing routine which is quite simple to get mono directly instead of stereo. Probably more efficient and lot simpler than Lance routine for that. Also as Lance routine uses microwire would be more complicated to replay.


Quite possibly, I have only played with the version from Paoulo and had the impression that the original player did not use the LMC.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 122
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby metalages » Thu May 10, 2018 9:01 pm

joska wrote:
metalages wrote:I think it is easier to use wizzcat Ste protrack routine in this case, set it at 12.5khz and modify the mixing routine which is quite simple to get mono directly instead of stereo. Probably more efficient and lot simpler than Lance routine for that. Also as Lance routine uses microwire would be more complicated to replay.


Quite possibly, I have only played with the version from Paoulo and had the impression that the original player did not use the LMC.


I think Lance version have also used LMC to speed up volume rendering.
Wizcat routine was simpler, but if the goal is to play mono at 12.5khz, it will be efficient enough while being easier to adapt (adapt directly the render loop instead of down sampling as a post pass)

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 May 11, 2018 9:13 am

:roll: How is a module structured?
Thinking if you can program your own code to convert modules Tracks to samples? :roll:

Thought to do it in stos. :lol: Then maybe get help with ASM to speed up some things.
Atari STE 4096

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 122
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Hardwarescrolling Control3.5a extension

Postby metalages » Fri May 11, 2018 11:52 am

Basically you have a score interpreted at some point that tells the render part executed each frame what to do with the samples.
The concept is not complicated but .MOD manages a lot of different effects that apply on the rendering.
Managing all effects cases correctly needs work in my opinion.

Wizzcat routine is here (for example) :
https://github.com/ggnkua/Atari_ST_Sour ... .FLD/STE.S
To adapt rendering to mono you would have to merge the two rendering loops you can find by looking for "REPT LEN"
Then remove all the interupt stuffs and call the routine in loop / full time.

MM41
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Sun Jun 28, 2015 2:36 pm
Location: France

Re: Hardwarescrolling Control3.5a extension

Postby MM41 » Sun May 13, 2018 1:36 pm

Really promising, good job Freddex73 :cheers:


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 3 guests