English Amiga Board


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

 
 
Thread Tools
Old 26 October 2021, 08:31   #1
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 672
HELP with waiting raster at frame start

Hello!


I'm having trouble figuring out why WaitRaster is failing with a MOVE.W #$0FF0,$DFF180 always changing BG color only on bottom part of screen.


I'm using the usual Photon's startup, which works fine, but for some reason now on my code I managed to break something



This is a stripped down version of the code, at the end it's pretty much like the original. I even tried including the original wrapper file but the results are the same.



https://github.com/KONEY/octamed_pla...b/main/DEBUG.s



Any help from the experts?
KONEY is offline  
Old 26 October 2021, 08:54   #2
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,189
The copperlist sets the first 8 color registers: https://github.com/KONEY/octamed_pla...c/DEBUG.s#L165

So your change is undone at the start of each frame.

Or do you mean something different?
paraj is offline  
Old 26 October 2021, 10:46   #3
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 672
I think yes, only the last part of the screen is changed. Usually that command draws the screen accordingly to what is done in the mainloop, more instructions execute in the middle means the change takes effect lower and the start of frame is always what the copper sets. I think here WaitRaster fails somehow.
KONEY is offline  
Old 26 October 2021, 16:33   #4
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,189
Quote:
Originally Posted by KONEY View Post
I think yes, only the last part of the screen is changed. Usually that command draws the screen accordingly to what is done in the mainloop, more instructions execute in the middle means the change takes effect lower and the start of frame is always what the copper sets. I think here WaitRaster fails somehow.

Your code waits for raster line $12c (end of normal PAL screen) in lines 43-44:
Code:
    move.w    #$12C,D0        ;No buffering, so wait until raster
    bsr.w    WaitRaster    ;is below the Display Window.

Then you execute very few instructions and then change color0 (if LMB is pressed) and jump back to the mainloop and again wait for line $12c. Copper changes color back before visible area => Background color is only yellow from line $12c until end of visible frame ($138 or there about).


If you want to run unbuffered and do all your work outside the display area and still debug with background color, I'd suggest no changing it back with the copper or at least wait until line $2c (or where your display window starts) to change it back.
paraj is offline  
Old 26 October 2021, 22:44   #5
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 672
Not exactly, if $180 is not set in the copperlist the bg would change color and stay that way after first click. Indeed the original code worked and it also has colors set on copperlist.

So after many trials and errors I figured out what is maybe going on: Photons's startup triggers a clearscreen at the beginning of mainloop. Moving the poke above it I ended up with the same behaviour as my code. Looks like a minimum delay is needed before poking $180 in order to ensure we're on the next frame. Not a very precise sentence but now the remaining rastertime is correctly displayed:



Thanks
Attached Thumbnails
Click image for larger version

Name:	326.png
Views:	217
Size:	5.5 KB
ID:	73597  
KONEY 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
Step frame-by-frame? pushead support.WinUAE 2 06 June 2020 07:46
Pause emu and move frame by frame? hexaae support.WinUAE 3 27 October 2019 01:18
'Raster Time' with winuae? jimmy2x2x Coders. Asm / Hardware 3 02 December 2014 14:54
raster dma cycles Wepl Coders. Asm / Hardware 9 05 July 2014 16:21
Raster Line Palette System! h0ffman Coders. General 19 10 August 2011 16:46

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 09:29.

Top

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