Jump to content

Photo

The Titlescreen Kernel


239 replies to this topic

#226 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sat Aug 5, 2017 5:25 PM

Is it posible to playback music simultaneously while the titlescreen is being displyed? I managed to do a rendition of a melody for a game I have in mind but I need it to play during the titlescreen, do I need to translate it to assembly? I thought on calling the subroutine directly from the subroutine oof the titlescreen but no luck, I think is also due to not knowing how bankswitching works properly



#227 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 129 posts

Posted Sat Aug 5, 2017 6:49 PM

This works with no issues for me. I just called my routine for playing music every cycle in the loop that displays the titlescreen. You can either do it within the same bank if you have room, or jump to another bank every cycle if that bank is too full. I can post some example code sometime when I get a chance if that would help.

#228 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sat Aug 5, 2017 6:52 PM

This works with no issues for me. I just called my routine for playing music every cycle in the loop that displays the titlescreen. You can either do it within the same bank if you have room, or jump to another bank every cycle if that bank is too full. I can post some example code sometime when I get a chance if that would help.


Yes please it would help massively thanks

#229 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sat Aug 5, 2017 6:54 PM

If I have the titlescreen asm in bank 5 and the music on bank 6 and my main code is in the first bank, do I call the subroutine for the titlescreen in bank 5 and directly from that same bank (5) I call the subroutine for the music on the bank 6?

I'm not sure if I understand correctly,
If not could you give me more details or explain me how please? Thanks

Edited by STGraves, Sat Aug 5, 2017 6:56 PM.


#230 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 129 posts

Posted Sat Aug 5, 2017 8:47 PM

If I have the titlescreen asm in bank 5 and the music on bank 6 and my main code is in the first bank, do I call the subroutine for the titlescreen in bank 5 and directly from that same bank (5) I call the subroutine for the music on the bank 6?

I'm not sure if I understand correctly,
If not could you give me more details or explain me how please? Thanks

 

There's more than one way to do it, but in this case, if I had the asm include for the titlescreen in bank 5, then I would also put loop that calls the titlescreen routine in the same bank.  I would jump to this titlescreen loop from bank 1 near the beginning.  In bank 6, I would have the data or sdata tables that contained the music, as well as the routines that initialized and updated the music.  From the titlescreen loop, I would then jump to the routine that initializes the music before starting the title loop, then I would call the routine that checks/updates the music from the title loop with every iteration.

 

Alternately, there is no real need to have the titlescreen loop in the same bank as the asm include, but in this case you would have to make sure your "gosub titledrawscreen" specifies the correct bank.

 

I'm not sure if that makes it any clearer, so I can still whip up an example when I get a chance.



#231 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sat Aug 5, 2017 9:53 PM

 

There's more than one way to do it, but in this case, if I had the asm include for the titlescreen in bank 5, then I would also put loop that calls the titlescreen routine in the same bank.  I would jump to this titlescreen loop from bank 1 near the beginning.  In bank 6, I would have the data or sdata tables that contained the music, as well as the routines that initialized and updated the music.  From the titlescreen loop, I would then jump to the routine that initializes the music before starting the title loop, then I would call the routine that checks/updates the music from the title loop with every iteration.

 

Alternately, there is no real need to have the titlescreen loop in the same bank as the asm include, but in this case you would have to make sure your "gosub titledrawscreen" specifies the correct bank.

 

I'm not sure if that makes it any clearer, so I can still whip up an example when I get a chance.

Yeah that was clearer, however I still would love to see a functional example if you can



#232 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sat Aug 5, 2017 10:01 PM

Is the titlescreen loop where you include the asm? Or is it the gosub to the titledrawscreen? And then how would you call the music loop before starting the title loop? And also, which is the start of the title loop? Sorry for all this questions, but those are the things that either I don't know or I don't quite understand yet.



#233 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 129 posts

Posted Sun Aug 6, 2017 8:07 AM

Here is a simple 16K example.  bank 1 has the main loop, bank 2 has the music routines and data, bank 3 has the titlescreen ASM and the title loop.  bB puts the display kernel and graphics in the last bank automatically.  Let me know if that helps, or if you would like more info on how I have things setup in this example.

 

Use the fire button to start the mock game screen from the titlescreen, and hit reset to return to the titlescreen.  The music itself comes from my WIP game, which I put in just as a placeholder for this example.

 

Attached File  titlemusic.zip   22.36KB   6 downloads



#234 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sun Aug 6, 2017 1:05 PM

Here is a simple 16K example.  bank 1 has the main loop, bank 2 has the music routines and data, bank 3 has the titlescreen ASM and the title loop.  bB puts the display kernel and graphics in the last bank automatically.  Let me know if that helps, or if you would like more info on how I have things setup in this example.

 

Use the fire button to start the mock game screen from the titlescreen, and hit reset to return to the titlescreen.  The music itself comes from my WIP game, which I put in just as a placeholder for this example.

 

attachicon.giftitlemusic.zip

OMG! Thanks dude, it helped massively, now I understand how it works, thanks a bunch man



#235 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sun Aug 6, 2017 1:32 PM

So if I understand your example, the main music would go in channel 1 rather than 0? And I have one more question, does the duration work as the tempo? And if so, how do I set up the duration if each note has it's own duration? I'll attach my files for the music to try to make my question clearer or if I'm confused, I'll upload the mono version of the tune, as well as the bin file. 

Attached Files


Edited by STGraves, Sun Aug 6, 2017 1:41 PM.


#236 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 129 posts

Posted Sun Aug 6, 2017 2:15 PM

You are welcome. If the question is about the music player part, go ahead and start a different topic, and I can reply there so as not to not clutter up the titlescreen kernel topic.

#237 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sat Aug 12, 2017 2:54 PM

I have a question about the titlescreen kernel, is it posible to flicker the color like the yoshi example but using a 48x2 kernel instead of a 48x1? I wnat the color flicker but not limiting to one color per frame and instead treat each frame like the 48x2 to color each line but flickering to mix the colors.


Edited by STGraves, Sat Aug 12, 2017 3:06 PM.


#238 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,637 posts
  • Bitnik
  • Location:Canada

Posted Sat Aug 12, 2017 6:07 PM

The 48x1 approach in the yoshi example does a jump scroll between the 2 stacked images, and changes the color after each scroll. You can jump scroll in 48x2 between 2 stacked images the same way, but you don't need to change the colors - just put your 2 sets of colors stacked, exactly like the images. The 48x2 kernel will scroll the colors with the image.



#239 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sun Aug 13, 2017 4:16 PM

You're right it is posible, but what size would you recomend me to make the image? Because I did it 48x156 to use the 48x2 but over one third of the image is not showing up.



#240 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,637 posts
  • Bitnik
  • Location:Canada

Posted Sun Aug 13, 2017 4:51 PM

156 double-height lines is way too many, so that's why it got cut off. Here's the relevant quote from the manual...

The data you display with the minikernels must not exceed the number of scanlines available on the
screen. (~85 double-lines, or ~170 single-lines). Also, you'll need to take into account that each
minikernel you choose will take a few lines to initialize itself.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users