Thread: Development: Cutscenes
View Single Post
Old June 5th, 2010 (10:25 PM). Edited June 12th, 2010 by colcolstyles.
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
  • Crystal Tier
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,590
Originally Posted by knizz View Post
How did you switch to script-level in every frame?
In my case that's not useful because I want to draw something entirely different onto the screen.
Instead of waiting for the next frame by continually checking the VCount register until it enters the VBlank in a callasm routine, you can just return to the script and the use "pause 0x1" in order to utilize the game's built-in "wait x frames" function. If you're animating something or need to move something over the course of multiple frames, you can use a loop in the script and at each pass, use callasm to call a routine that changes the location or graphic of a sprite or something.

I believe I used something like this:


setvar LOOP_COUNTER 0x0
call @loop


#org @loop    // Moves a sprite to the left 1px per frame over 30 frames (~0.5 sec)
callasm 0xXXXXXX    // Moves sprite 1 pixel to the left or whatever

addvar LOOP_COUNTER 0x1
pause 0x1    // Wait for next frame
compare LOOP_COUNTER 30
if B_< goto @loop
... where the routine called only changes something small before quickly returning to the script. If you really want to see an example of something that uses that idea, you can take a look at this video. It's pretty crude as it was just a test to see if I had the basic concept right for a project I was working on for this one guy's hack. However, things like the text fade-in and the expanding, semi-transparent bar use the above code more or less.

Also the DMA alone can't be responsible for the music to continue.
1) The DMA-Buffer only holds enough samples for maybe half a second.
2) New samples have to be created from the notes in the same interval.

Probably it's because of a timer... (what else does this timer trigger?)
Hm, interesting. I honestly haven't looked into sound hacking so I really wouldn't know. I'll take a look at it tomorrow but I'm gonna go to bed now, seeing how I've got final exams this upcoming week.

Brother of Vrai
Reply With Quote