English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 05 March 2019, 02:57   #1
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
Screen Swap and Screen Offset stuttering

I was trying to make a simple scrolling routine today, employing double buffering to make the routine as simple as possible. The code basically looks like this:
Code:
BLOCKSIZE = 32
Screen Open 0,320,256+BLOCKSIZE,16,Lowres
(draw initial screen)
ROWOFFSET = SCREENHEIGHT_IN_BLOCKS - 1
VPOS = BLOCKSIZE
Double Buffer
AutoBack 0
Do
    Wait Vbl
    Dec VPOS
    If ROWOFFSET >= 0
        ROW=ROWOFFSET*BLOCKSIZE
        ' Copy stripes of screen to backbuffer, one row down
        Screen Copy Physic,0,ROW,320,ROW+BLOCKSIZE To Logic,0,ROW+BLOCKSIZE
        Dec ROWOFFSET
    EndIf
    If ROWOFFSET < 0
        (fill in top row)
    EndIf
    If VPOS < 0
        VPOS = BLOCKSIZE
        Screen Swap
    EndIf
    Screen Offset 0,0,VPOS
Loop
The screen scrolls as intended, but every Screen Swap results in a flashing motion as the screen contents are adjusted one block up by swapping to the back buffer, then down again by Screen Offset. These two operations are in absolute vicinity and shouldn't result in visible flashing.
idrougge is offline  
Old 05 March 2019, 12:56   #2
adrazar
Registered User

 
Join Date: Feb 2017
Location: Oslo
Posts: 48
Ha! I know this one

It's Auto View's fault; you'll have to turn it off with Auto View Off and add a View right after Screen Offset.
The command View reveals the effect of Screen Open, Screen To Front, Screen Display, Screen Offset and Rainbow.
adrazar is offline  
Old 06 March 2019, 01:21   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,928
That was indeed it! It's smooth like butter now. Tusen takk, Adrazar!
idrougge is offline  
Old 06 March 2019, 01:28   #4
adrazar
Registered User

 
Join Date: Feb 2017
Location: Oslo
Posts: 48
You're welcome
adrazar 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
fast mouse move loose offset values in P96 full HD screen bernd roesch support.WinUAE 2 24 April 2018 14:20
Agony - screen stuttering problem ! amilo3438 support.WinUAE 4 13 September 2017 00:54
Smooth H-scrolling platform game in AMOS, screen copy vs screen offset? Damiga Coders. AMOS 30 19 March 2015 19:06
[2.1.19dev] Stuttering screen and/or mouse cursor with this version nexusle support.FS-UAE 2 22 January 2013 00:11
WHDLoad - NTSC and screen offset Anubis project.WHDLoad 4 27 January 2010 22:20

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 23:56.


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