STGraves Posted August 5, 2017 Share Posted August 5, 2017 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 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted August 6, 2017 Share Posted August 6, 2017 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. 1 Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 6, 2017 Share Posted August 6, 2017 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 Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 6, 2017 Share Posted August 6, 2017 (edited) 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 August 6, 2017 by STGraves Quote Link to comment Share on other sites More sharing options...
+Karl G Posted August 6, 2017 Share Posted August 6, 2017 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. 1 Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 6, 2017 Share Posted August 6, 2017 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 Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 6, 2017 Share Posted August 6, 2017 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. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted August 6, 2017 Share Posted August 6, 2017 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 Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 6, 2017 Share Posted August 6, 2017 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 OMG! Thanks dude, it helped massively, now I understand how it works, thanks a bunch man Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 6, 2017 Share Posted August 6, 2017 (edited) 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 August 6, 2017 by STGraves Quote Link to comment Share on other sites More sharing options...
+Karl G Posted August 6, 2017 Share Posted August 6, 2017 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. Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 12, 2017 Share Posted August 12, 2017 (edited) 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 August 12, 2017 by STGraves Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 13, 2017 Author Share Posted August 13, 2017 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. Quote Link to comment Share on other sites More sharing options...
STGraves Posted August 13, 2017 Share Posted August 13, 2017 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. Quote Link to comment Share on other sites More sharing options...
RevEng Posted August 13, 2017 Author Share Posted August 13, 2017 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. Quote Link to comment Share on other sites More sharing options...
Mountain King Posted January 1, 2018 Share Posted January 1, 2018 (edited) 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 January 1, 2018 by Mountain King Quote Link to comment Share on other sites More sharing options...
RevEng Posted January 2, 2018 Author Share Posted January 2, 2018 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. Quote Link to comment Share on other sites More sharing options...
Mountain King Posted January 2, 2018 Share Posted January 2, 2018 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. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 2, 2018 Share Posted January 2, 2018 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? 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted January 3, 2018 Author Share Posted January 3, 2018 The bB DPC+ score comes right after the virtual player NUSIZ# variables. Are you operating on those in a loop? Quote Link to comment Share on other sites More sharing options...
Mountain King Posted January 3, 2018 Share Posted January 3, 2018 I am. I'm running several loops that use NUSIZ Quote Link to comment Share on other sites More sharing options...
RevEng Posted January 3, 2018 Author Share Posted January 3, 2018 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. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted April 23, 2018 Share Posted April 23, 2018 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? titlescore.bas.bin titlescore.zip Quote Link to comment Share on other sites More sharing options...
+Karl G Posted April 24, 2018 Share Posted April 24, 2018 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). titlescore.bas.bin score_kernel.asm 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted April 24, 2018 Author Share Posted April 24, 2018 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.