English Amiga Board


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

 
 
Thread Tools
Old 05 March 2019, 01:57   #1
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,357
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, 11:56   #2
adrazar
Registered User
 
Join Date: Feb 2017
Location: Oslo
Posts: 90
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, 00:21   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,357
That was indeed it! It's smooth like butter now. Tusen takk, Adrazar!
idrougge is offline  
Old 06 March 2019, 00:28   #4
adrazar
Registered User
 
Join Date: Feb 2017
Location: Oslo
Posts: 90
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
Smooth H-scrolling platform game in AMOS, screen copy vs screen offset? Damiga Coders. AMOS 32 24 October 2023 19:00
fast mouse move loose offset values in P96 full HD screen bernd roesch support.WinUAE 2 24 April 2018 13:20
Agony - screen stuttering problem ! amilo3438 support.WinUAE 4 12 September 2017 23:54
[2.1.19dev] Stuttering screen and/or mouse cursor with this version nexusle support.FS-UAE 2 21 January 2013 23:11
WHDLoad - NTSC and screen offset Anubis project.WHDLoad 4 27 January 2010 21: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 08:53.

Top

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