+Karl G Posted January 28, 2019 Share Posted January 28, 2019 This is an early version of what I'm calling my "Mark 1" text minikernel, created with extensive help from RevEng. This minikernel can display up to 12 characters of letters, numbers or special characters with no flicker. This version only requires the the user give up one variable. I have modified my "cannons" sample game to make use of it. Please see the attached user's guide on how to make use of this minikernel in you game: Text Minikernel.pdf Here are the current limitations: There is not enough room on the screen to display both the score and this minikernel at the same time without shrinking the screen. You either have to set "const noscore=1", or shrink the screen with some combination of pfres and/or pfrowheight, or a pfheights definition that equals 82 lines or less. If you are using the Multisprite kernel, then "const screenheight = 82" should work. Multisprite kernel does not currently work due to an issue with "noscore" with that kernel. No support for the DPC+ kernel yet The minikernel, along with all of the associated character data, weighs in at a whopping 1200 bytes, all in the kernel/graphics bank. The minikernel uses a black background. If your game uses COLUBK for a background color other than black, then it will need to be set inside the game loop. Planned future features: (DONE) Add support for placing most of the code in another bank to save space in the kernel/graphics bank (DONE) Include a score option within the minikernel that would fit without shrinking the screen (DONE) Support for more than 256 bytes of text data (21 messages) (DONE) DPC+ kernel support (DONE) Fix Multisprite kernel support Create a "Mark 2" text kernel to support 24 characters instead of 12. I plan to work on this once development and bug fixes are done on the current version. Version 1.0.2 (Updated 5/26/2021): text12.zip 17 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 28, 2019 Share Posted January 28, 2019 This is awesome! This definitely opens up a lot of possibilities! Quote Link to comment Share on other sites More sharing options...
+mksmith Posted January 29, 2019 Share Posted January 29, 2019 Awesome well done! No flicker batari Basic is in desperate need of text abilities. 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 29, 2019 Author Share Posted January 29, 2019 Would it be acceptable aesthetically to have the text be below the score instead of the other way around as shown in the screenshot? I believe that I can eliminate the need to shrink the rest of the screen if I turn off the built-in score routine and provide my own implementation of it within the minikernel instead. Do you think that it will look fine that way, or at least be an acceptable trade-off to make this more compact? 2 Quote Link to comment Share on other sites More sharing options...
Impaler_26 Posted January 29, 2019 Share Posted January 29, 2019 Would it be acceptable aesthetically to have the text be below the score instead of the other way around as shown in the screenshot? I believe that I can eliminate the need to shrink the rest of the screen if I turn off the built-in score routine and provide my own implementation of it within the minikernel instead. Do you think that it will look fine that way, or at least be an acceptable trade-off to make this more compact? I think displaying text below the score is just fine. Being able to use the full screen and text would be awesome. Thanks for making this minikernel, looking forward to see how this develops. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted January 29, 2019 Share Posted January 29, 2019 Merging score and text may mess with the multi kernel framework. I think the bankswitching code is in the score routine. Just looking for gotchas Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 29, 2019 Author Share Posted January 29, 2019 I will look into it. The way it would work would be setting noscore=1 internally to disable the built-in score routine, then do the score within the minikernel first (because part of the score pointer setup is done by then even if noscore is set). the text routine could use the same sprite positioning, etc, since both it and the score are 48-pixel routines. I haven't done anything with the multikernel framework, but I definitely want to ensure compatibility, as I can envision the text kernel being particularly useful for a game built with this framework. 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 29, 2019 Author Share Posted January 29, 2019 Also - could I get a volunteer to test this version with the Multisprite kernel, perchance? 1 Quote Link to comment Share on other sites More sharing options...
Trip2018 Posted January 30, 2019 Share Posted January 30, 2019 Finally someone picked up on this! I see a lot of great opportunities. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted January 30, 2019 Share Posted January 30, 2019 Also - could I get a volunteer to test this version with the Multisprite kernel, perchance? I will do this sometime between this week and next week. Hopefully we can get more people to test this. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 30, 2019 Share Posted January 30, 2019 Add support for placing most of the code in another bank to save space in the kernel/graphics bank Once you do that, I'll probably use this in every game I make from now on (if I'm using a compatible kernel). 1 Quote Link to comment Share on other sites More sharing options...
Lewis2907 Posted January 30, 2019 Share Posted January 30, 2019 I maybe jumping ahead, any chance for DPC? Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 30, 2019 Author Share Posted January 30, 2019 I maybe jumping ahead, any chance for DPC? I intend to do that after I get the other items done (I've added it to the list). It requires a fair amount of hackery, unfortunately, since there are some issues with the DPC+ kernel's support for minikernels. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 1, 2019 Author Share Posted February 1, 2019 Version 0.2 is up. Changes include: Score is displayed before text Both the score and text fit on the screen without shrinking the playfield area Text height reduced from 6 to 5 pixels (this only affected a few characters) 8 new special characters added with the extra space freed: _pl (plus sign) _pc (percent sign) _lp (left parenthesis) _rp (right parenthesis) _co (colon) _sl (slash) _eq (equal sign) _qt (quote) Optional separate background color for the score (as seen in the screenshot) Added a new score font "SQUISH" to the attached score_graphics.asm file. If selected, it reduces the score to 5 lines instead of 8 in the interests of shrinking the screen a bit more (which means more processing time for your game) 5 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 1, 2019 Author Share Posted February 1, 2019 One other note: a variable needs to be set aside for "TextIndex" as shown in the cannons example. I was using aux2 for this previously, but that gets used by the pfheights and pfcolors kernel options if those are in use. I'm going to have to update my other minikernel examples that use aux2, since I thought it was always available. 2 Quote Link to comment Share on other sites More sharing options...
+TwentySixHundred Posted February 2, 2019 Share Posted February 2, 2019 Looking good Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 2, 2019 Author Share Posted February 2, 2019 I forgot to include a way to turn off the score, so I've uploaded another update. Those responsible have been sacked. I use "noscore" internally to disable the built-in score routine since I do my own in the minikernel to save lines. To disable the score when using this minikernel, add the following line: const noscoretxt = 1 3 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted February 2, 2019 Share Posted February 2, 2019 This is really nice KarlG, looking forward / hoping for a DPC+ version! I was working on a project that I shelved (a recut of the BBC Micro game "Yellow River Kingdom") as text in bB without something like this was just too problematic. going to watch this with interest! 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 3, 2019 Author Share Posted February 3, 2019 I ended up doing some testing with the Multisprite kernel, and the current version of the text minikernel doesn't work with it. I had reported this before, but I had forgotten: the Multisprite kernel's timing gets thrown off when the "noscore" constant is set. The text minikernel sets this internally and draws its own score, so I think this is the cause of the issue. So - Multisprite kernel support for the text minikernel will probably remain broken until someone can identify the cause and fix the issue with the timing of the Multisprite kernel when "noscore" is set. Any assistance with this would be appreciated! 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 5, 2019 Author Share Posted February 5, 2019 Version 0.4 is up. No updates to the demo, since I've added a feature that it won't make use of. I will create a new demo that makes use of it later. Changes include: Added support for more than 21 messages if the "extendedtxt" constant is set. If not set, the minikernel acts as it has previously. If it is set, the following is different: TextIndex refers to the message number (in theory up to 255 if there were space) instead of the character position Processing takes one more scanline in this mode, so you will need to use the SQUISH score font or shrink the screen to make everything fit Due to data alignment issues, 2 out of 3 of every 21st line will have to be skipped in the data (so lines 21 and 42, but not 63, then 84 and 105, but not 126, etc). This is an ugly kludge, but I haven't found a better solution that doesn't take more scanlines or RAM. Percent _pc glyph removed in favor of apostrophe _ap (these are easily enough to customize in the minikernel as needed) A few bugfixes Note that I do plan on doing better documentation once this is closer to complete - I am just sharing it in its early form in the hopes of getting useful feedback, and to keep myself honest about finishing it. My next task will probably be support for switching most of the code to another bank to free up space in the graphics/kernel bank. This is also a prerequisite for my being able to add DPC+ kernel support. 6 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 5, 2019 Author Share Posted February 5, 2019 Technical question: is there a clever way to programmatically determine the current bank, or determine the bank number where the kernel resides? Quote Link to comment Share on other sites More sharing options...
Sprybug Posted February 6, 2019 Share Posted February 6, 2019 Ooooh. I can so use this in Zed. does it eat cycle time? 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 6, 2019 Author Share Posted February 6, 2019 Yeah, just like any minikernel the scan lines it uses aren't available for processing in overscan, and this one uses a lot of lines. Shrinking the screen a bit can make up for it in projects where that is feasible. Quote Link to comment Share on other sites More sharing options...
RevEng Posted February 6, 2019 Share Posted February 6, 2019 The banks are arranged sequentially in memory, so with a bit of DASM symbol math you can get the current and kernel banks. It's a bit kludgy when it comes to DPC+ and 64k... set romsize 32k bank 3 asm ifconst FASTFETCH ; usin DPC+ KERNELBANK = 1 else KERNELBANK = (bs_mask + 1) endif if bankswitch == 64 THISBANK = (((*) & $1F000))/8192 - 14 + bs_mask else THISBANK = (((*) & $1F000))/8192 - 6 + bs_mask endif echo "THISBANK =",(THISBANK)d echo "KERNELBANK = ",(KERNELBANK)d end 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted February 6, 2019 Author Share Posted February 6, 2019 Thanks! That is just what I needed. It looks like the DPC+ kernel turns off FASTFETCH right before going to the minikernel code, so perhaps checking for the DPC_BASE_ADDRESS constant would work for the check for DPC+ instead. 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.