View Single Post
Old 26 January 2014, 17:18   #573
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 20,635
Originally Posted by amilo3438 View Post
Well, the demo is very short, but ok ... blank screen and only music play after 2nd part so it doesnt run till the end as it should. (also check how it runs on 2.7.0)
I asked because you also missed that if you reset repeatedly, it will crash in first part

Works again but this is will surely break again in future (unless everything is 100% cycle-exact), it is very "works only accidentally" demo..

vblank interrupt runs demo's "sequencer", when it is time to switch parts, it sets variable that tells what code to run next in main loop, also when it exists, it sets another variable that says "vblank done".

Second part has following main loop:

test mousebutton
if press -> exit
check if demo part number is non-zero
if yes -> exit
check if vblank done is set
if not -> loop

clear vblank done
<run part code>
clear demo part number change variable

jump loop

Can you see the problem?

If vblank interrupt runs (when it is time to switch parts) between "check if demo part number is non-zero" code and "check if vblank done is set" (quite probable because test loop is very small), it will run old code instead of exiting and then clears the change variable and demo gets stuck in current part..
Toni Wilen is online now  
Page generated in 0.05075 seconds with 9 queries