26 October 2021, 08:31 | #1 |
OctaMED Music Composer
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? |
26 October 2021, 08:54 | #2 |
Registered User
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? |
26 October 2021, 10:46 | #3 |
OctaMED Music Composer
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.
|
26 October 2021, 16:33 | #4 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,189
|
Quote:
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. |
|
26 October 2021, 22:44 | #5 |
OctaMED Music Composer
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 |
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 |
|
|