English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 02 April 2020, 14:30   #1
DanielAllsopp
Registered User
 
DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 272
Scrolling Milestone... one way!

Good afternoon! Hope you're all well!

So, I've managed to fudge my way through repeating my background sprites (they don't move yet though!) and started on trying to get the scrolling working, which seems to be working but only in one direction.

I'm following the instructions for Scroller_XLimited in this archive on Aminet by Georg Steger:

http://aminet.net/package/dev/src/ScrollingTrick

I'm smooth scrolling using BPLCON1, i.e. subtracting $11 and moving my bitplane pointers by 2 bytes after blitting into the hidden right hand column.

That seems to work.

In this example, after I've moved 5 columns and then I switch the scrolling in the opposite direction, by adding $11 to the value in BPLCON1 but something weird happens:



From looking at that weird effect, any immediate pointers as to why that would do that?

Anyway, I'm getting there with this ASM malarky and I'm extremely grateful for the help and encouragement that I get from this board. You're all marvellous and very patient individuals so thanks
DanielAllsopp is offline  
Old 02 April 2020, 16:55   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by DanielAllsopp View Post
Good afternoon! Hope you're all well!

So, I've managed to fudge my way through repeating my background sprites (they don't move yet though!) and started on trying to get the scrolling working, which seems to be working but only in one direction.

I'm following the instructions for Scroller_XLimited in this archive on Aminet by Georg Steger:

http://aminet.net/package/dev/src/ScrollingTrick

I'm smooth scrolling using BPLCON1, i.e. subtracting $11 and moving my bitplane pointers by 2 bytes after blitting into the hidden right hand column.

That seems to work.

In this example, after I've moved 5 columns and then I switch the scrolling in the opposite direction, by adding $11 to the value in BPLCON1 but something weird happens:



From looking at that weird effect, any immediate pointers as to why that would do that?

Anyway, I'm getting there with this ASM malarky and I'm extremely grateful for the help and encouragement that I get from this board. You're all marvellous and very patient individuals so thanks
Presumably you're now adding $11 to BPLCON1, and once you get to $ff or $00 (whichever is your default restart), you're then subtracting 2 from your bitplane pointers and restarting on BPLCON1?
Galahad/FLT is offline  
Old 02 April 2020, 19:15   #3
DanielAllsopp
Registered User
 
DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 272
Quote:
Originally Posted by Galahad/FLT View Post
Presumably you're now adding $11 to BPLCON1, and once you get to $ff or $00 (whichever is your default restart), you're then subtracting 2 from your bitplane pointers and restarting on BPLCON1?
Boom, that'll be it! How did I miss that God-damn it?! I'm not decreasing the bitplane pointers.

Code's getting a bit messy so I'm gonna tidy that up first and then put this change in. Thanks Galahad.
DanielAllsopp is offline  
Old 02 April 2020, 20:52   #4
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
Rather than adding/subtracting $11 from BPLCON1, it might be better to store your X scroll position in a variable.

Then you can calculate your BPLCON1 value and bitplane offsets from that value. It will allow you to scroll at different speeds etc... you just add and subtract from that variable, and then calculate the correct BPLCON1 and offset from that value
DanScott is online now  
Old 02 April 2020, 23:43   #5
DanielAllsopp
Registered User
 
DanielAllsopp's Avatar
 
Join Date: Feb 2018
Location: Northumberland, UK
Posts: 272
Quote:
Originally Posted by DanScott View Post
Rather than adding/subtracting $11 from BPLCON1, it might be better to store your X scroll position in a variable.

Then you can calculate your BPLCON1 value and bitplane offsets from that value. It will allow you to scroll at different speeds etc... you just add and subtract from that variable, and then calculate the correct BPLCON1 and offset from that value
That's a canny idea, I already have a scroll counter, but it counts up by the number 16 pixel blocks I've moved, i.e. it increments by one when the BPLCON1 value is reset.

I'll have a think how best to adjust my code. Might be easier to do with some sort of user input like a joystick or keypresses so I'll see if I can get something together to read that first.

Thanks for the tips!
DanielAllsopp is offline  
Old 03 April 2020, 00:22   #6
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by DanielAllsopp View Post
Boom, that'll be it! How did I miss that God-damn it?! I'm not decreasing the bitplane pointers.

Code's getting a bit messy so I'm gonna tidy that up first and then put this change in. Thanks Galahad.
Galahad/FLT is offline  
Old 03 April 2020, 11:10   #7
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Nice, always good seeing more game developers for OCS...

(or AGA, or whatever you are doing. Just please don't do a SHMUP.. )

Last edited by Tigerskunk; 03 April 2020 at 11:26.
Tigerskunk is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrolling Shoot'em'up??? K1ngArth3r Looking for a game name ? 35 05 February 2019 19:19
Amiga milestone demos - 30 years ago dissident Nostalgia & memories 57 25 April 2018 09:56
smooth scrolling sink support.WinUAE 3 20 July 2007 01:16
Aweb: New APL 3.5Beta AOS4 PPC code + Milestone: KHTML porting started Paul News 0 05 November 2004 11:21
Another milestone in the history of HOL Walker HOL news 5 24 February 2004 08:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:44.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.15050 seconds with 15 queries