Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3]   Go Down

Author Topic: No progress with scrolling! :(  (Read 4309 times)

ColdWarTom

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
  • Generic Amiga User
Re: No progress with scrolling! :(
« Reply #30 on: July 25, 2020, 06:11:22 PM »

It took me some time to arrive at negative numbers. But given that the visible area is between (hardware) 112 and 432 (specified in the manual) then in order to scroll 688-pixel-wide screen far enough to show the extreme right end of it in the visible area, I’m subtracting the left-most edge below Zero (136-368=-232). The left edge of the viewable are on my screen is 136(hwx). A screen that is 688px wide will show its last 320px on screen if the first 368px of it is shifted below 136. Sorry. I know I’m over explaining it, but I’m also double-checking my math as I type this, so it’s just as much for me as it is for you. I’m pretty sure it ads up, but I may still be doing this wrong, which is why I’m here.
Logged

adrazar

  • A600
  • *
  • Karma: 3
  • Offline Offline
  • Posts: 60
  • Generic Amiga User
Re: No progress with scrolling! :(
« Reply #31 on: July 25, 2020, 07:39:37 PM »

It appears to me that you try to move the bitmap to the left instead of the view-rectangle to the right, which results in the sign getting confused.

It works to think about it this way: Screen Open defines a bitmap, in this case 688x240 pixels. The bitmap contains a "view-rectangle" whose dimensions is given by the width and height parameter of Screen Display. You can move it around in the bitmap by using Screen Offset. Where the image in the view-rectangle will appear on the screen is determined by the hardware coordinates given to Screen Display.

The following example shows how to show the last 320 pixels in the bitmap correctly:

Code: [Select]
Screen Open 0,688,240,32,Lowres
Screen Display 0,50,136,320,240
Screen Offset 0,368,0
Logged

ColdWarTom

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
  • Generic Amiga User
Re: No progress with scrolling! :(
« Reply #32 on: July 30, 2020, 04:47:58 PM »

I can scroll with AMAL, but i would like to be able to vary the speed depending on how the player is moving and what they're doing. Is there a way to update AMAL variable values at runtime? Or perform comparisons with code outside of an AMAL routine?

BTW, the screen corruption appears to be a result of scrolling the blitted screen outside of the viewable area of the screen.
« Last Edit: July 30, 2020, 04:54:42 PM by ColdWarTom »
Logged

adrazar

  • A600
  • *
  • Karma: 3
  • Offline Offline
  • Posts: 60
  • Generic Amiga User
Re: No progress with scrolling! :(
« Reply #33 on: July 31, 2020, 06:10:39 PM »

Is there a way to update AMAL variable values at runtime?

Yes, you can read and set the AMAL registers from the main program by using Amreg() (a very important command to be aware of when using AMAL..)
Logged
Pages: 1 2 [3]   Go Up
 

TinyPortal 1.6.4 © 2005-2019