English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. AMOS (https://eab.abime.net/forumdisplay.php?f=119)
-   -   Fine scrolling glitching (https://eab.abime.net/showthread.php?t=102933)

Brick Nash 01 July 2020 10:20

Fine scrolling glitching
 
EDIT: It turns out I didn't have Double Buffer activated on the screen so that's why. I was sure I did as well, but hey ho.


Hi all!

I'm trying to learn how to do map based fine scrolling by using TOME in AMOS right now, and I'm almost there, but when I scroll through my map the colours glitch really badly and it feels like it's struggling, as you can see from the video below (BTW the tiles and map are just random garbage for the moment and this isn't an actual game).

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

I'm still very new to this, and I'm pretty sure I'm missing something out as I don't quite understand screen manipulation just yet, so any advice on the matter would be appreciated.

Thank you!

Here's what I'm doing code wise:

Code:

IX=0
IY=0
TILEMAPX=0
TILEMAPY=0
STX=0
STY=0
SCRLLSP=2

Screen Open 1,800,192,16,Lowres
Screen Hide 1
Tile Size 16,16
TX=0 : TY=0 : BX=800 : BY=192
Map View TX,TY To BX,BY
Load "Assets/icons.abk"
Reserve as Data 6,50*12+4
BLoad "Assets/garbage.map"
Map Do TILEMAPX,TILEMAPY
Get Icon Palette

Screen Open 2,320,192,16,Lowres
Flash off : Curs off
Screen Display 2,128,74,320,192

Do

Screen Copy 1,IX,0,IX+320,192 to Logic(2),STX,STY
Screen Swap 2 : Wait Vbl

if Jright(1)=-1 : Add IX,SCRLLSP : End If
if Jleft(1)=-1 and IX>0 : ADD IX,-SCRLLSP : End If

Loop


gyagyagyerek 12 July 2020 17:35

Advice

The glitch coused by the screen copy+single buffer, Use double buffer.
You do not have to screen copy all the frames... use HW scroll on the same screen, I think It will be faster :)


IX=0
IY=0
TILEMAPX=0
TILEMAPY=0
STX=0
STY=0
SCRLLSP=2

Screen Open 1,800,192,16,Lowres
Screen Display 1,128,74,320,192
Autoback 0
Double Buffer
Tile Size 16,16
TX=0 : TY=0 : BX=800 : BY=192
Map View TX,TY To BX,BY
Load "Assets/icons.abk"
Get Icon Palette
Reserve as Data 6,50*12+4
BLoad "Assets/garbage.map"
Map Do TILEMAPX,TILEMAPY
Screen Swap
Map Do TILEMAPX,TILEMAPY
Screen Swap



Do

Screen Offset 1,IX,IX
Screen Swap
Wait Vbl

if Jright(1)=-1 : Add IX,SCRLLSP : End If
if Jleft(1)=-1 and IX>0 : ADD IX,-SCRLLSP : End If

Loop


All times are GMT +2. The time now is 02:26.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04024 seconds with 10 queries