Jump to content

Photo

The Titlescreen Kernel


256 replies to this topic

#226 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 282 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 ONLINE  

kdgarris

    Moonsweeper

  • 320 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

  • 282 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

  • 282 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 ONLINE  

kdgarris

    Moonsweeper

  • 320 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

  • 282 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

  • 282 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 ONLINE  

kdgarris

    Moonsweeper

  • 320 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   54 downloads



#234 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 282 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

  • 282 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 ONLINE  

kdgarris

    Moonsweeper

  • 320 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

  • 282 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,796 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

  • 282 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,796 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.



#241 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 679 posts
  • Location:Philadelphia, PA

Posted Mon Jan 1, 2018 3:44 PM

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, Mon Jan 1, 2018 3:46 PM.


#242 RevEng OFFLINE  

RevEng

    River Patroller

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

Posted Tue Jan 2, 2018 3:00 PM

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.

#243 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 679 posts
  • Location:Philadelphia, PA

Posted Tue Jan 2, 2018 3:22 PM

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.

#244 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,682 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Jan 2, 2018 5:51 PM

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?

#245 RevEng OFFLINE  

RevEng

    River Patroller

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

Posted Tue Jan 2, 2018 7:53 PM

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

#246 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 679 posts
  • Location:Philadelphia, PA

Posted Tue Jan 2, 2018 7:58 PM

I am. I'm running several loops that use NUSIZ



#247 RevEng OFFLINE  

RevEng

    River Patroller

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

Posted Tue Jan 2, 2018 10:10 PM

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.

#248 kdgarris ONLINE  

kdgarris

    Moonsweeper

  • 320 posts

Posted Mon Apr 23, 2018 9:09 AM

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?

 

31154101_10215815678014731_4588835838929928192_n.jpg

 

Attached File  titlescore.bas.bin   16KB   8 downloads

 

Attached File  titlescore.zip   97.63KB   2 downloads

 



#249 kdgarris ONLINE  

kdgarris

    Moonsweeper

  • 320 posts

Posted Tue Apr 24, 2018 9:29 AM

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).

 

31237478_10215824357231706_4885136209522720768_n.jpg

 

Attached File  titlescore.bas.bin   16KB   5 downloads

 

Attached File  score_kernel.asm   2.54KB   5 downloads



#250 RevEng OFFLINE  

RevEng

    River Patroller

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

Posted Tue Apr 24, 2018 10:11 AM

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.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users