Jump to content
RevEng

The Titlescreen Kernel

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

 

titlemusic.zip

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

music1.bas

music1.bas.bin

Edited by STGraves

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Any idea why the score might not update on the title screen after finishing a game. I can't seem to figure out why? I am using the DPC+ kernal and the starfield effect.

Edited by Mountain King

Share this post


Link to post
Share on other sites

I don't see how the starfield effect would impact it... I tried this with a simple test, and the score displayed correctly after transitioning back and forth between the titlescreen kernel and the DPC+ kernel. Not sure where the problem is.

Share this post


Link to post
Share on other sites

Yeah I'm not sure either. My programming is clearing the score somewhere and I can't find it. I just took the score routine out of the title screen.

Are you sure you're not clearing a variable that is used to remember the score? Is the snow code using one of your memory variables?

  • Like 1

Share this post


Link to post
Share on other sites

The bB DPC+ score comes right after the virtual player NUSIZ# variables. Are you operating on those in a loop?

Share this post


Link to post
Share on other sites

I'd say those loops would be a good place to audit. If any of those loops are off by 1 or more, they'd overwrite the score.

Share this post


Link to post
Share on other sites

I believe I have found an issue with the score minikernel that shows up on real hardware, but not in Stella. Specifically, digit 3 (thousands) can corrupt the appearance of digit 1 (hundred thousands). I have modified one of the included demos (player and playfield) by setting a score at the beginning. You see the corrupted score digit from the titlescreen, but not within the fake "game".

 

Can anyone else reproduce this on real hardware?

 

post-48311-0-25602800-1524496117_thumb.jpg

 

titlescore.bas.bin

 

titlescore.zip

 

Share this post


Link to post
Share on other sites

The good news is that I was able to cobble together a fix for this. The score minikernel portion of the titlescreen kernel is an adapted version pf the score routine from bB itself. It occurred to me that the 48x1 minikernel is doing the same thing effectively, so I replaced some of the code in the score minikernel with code from the 48x1 minikernel, and it appears to be working fine. The only bad news is that I wasn't able to get the scorefade effect to work - I think I would need 10 cycles for that, and I could only find 8 that I could repurpose. Maybe someone with more experience could do better.

 

Anyway, in the meantime, in case it is useful to anyone else, here is my version of the score minikernel that eliminates the visual glitch that I discovered. To use, place this score_kernel.asm in your titescreen/asm directory (after making a backup copy of the original).

 

post-48311-0-11609000-1524583682.jpg

 

titlescore.bas.bin

 

score_kernel.asm

  • Like 1

Share this post


Link to post
Share on other sites

I'm thinking your TIA may be a bit unusual in terms of timing (some are) mostly because nobody has reported this until now. Anyway, waiting to see if anybody answers your call for reproducing it.

 

All of that said, it looks like it's a cycle short from working here. I'll dig into the code when I get a chance, and see if you can have the fixed score and the score fade.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...