RevEng Posted July 18, 2009 Share Posted July 18, 2009 (edited) I created and collected various fonts and stuck them all in a single score_graphics.asm file. The font is selectable from within your basic code by setting the the "fontstyle" constant. The stock font is the default, so this score_graphics.asm will function exactly as the stock score_graphics.asm that came with bB if you don't specify a custom font or custom characters. This file is a drop-in replacement for the official bB score_graphics.asm. You can either replace the official score_graphics.asm with this one, or just drop the file in your project directory: score_graphics.zip My fonts are public domain, though it would be nice if you mention them if you use of them in a project, to help spread the word. Plok is one of Ste's bitmap fonts and the license for it is basically Public Domain. The bB stock font is under the bB license. rem Example of enabling a custom font. Options are: NOFONT, STOCK, NEWCENTURY, rem WHIMSEY, ALARMCLOCK, HANDWRITTEN, INTERRUPTED, TINY, RETROPUTER, SNAKE, rem HUSKY, CURVES, or PLOK... const fontstyle = WHIMSEY rem Example of enabling a custom font and enabling hex characters... const fontstyle = HANDWRITTEN const fontcharsHEX = 1 rem Example of enabling custom characters. Custom chars are: fontcharSPACE, fontcharDOLLAR, rem fontcharPOUND, fontcharMRHAPPY, fontcharMRSAD, fontcharCOPYRIGHT, fontcharFUJI, rem fontcharHEART, fontcharDIAMOND, fontcharSPADE, fontcharCLUB, fontcharCOLON, rem fontcharBLOCK, fontcharUNDERLINE, fontcharARISIDE, fontcharARIFACE const fontcharSPACE = 1 const fontcharCOPYRIGHT = 1 rem You can only use 16 possible characters, so while the following is valid syntax, rem you'll never be able to access the custom characters... const fontcharsHEX = 1 const fontcharSPACE = 1 const fontcharMRHAPPY = 1 [edit: added in PLOK, and some new custom symbols.] Edited August 25, 2009 by RevEng 4 Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/ Share on other sites More sharing options...
Richi_S Posted July 19, 2009 Share Posted July 19, 2009 Thats Great, Thanks! Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796338 Share on other sites More sharing options...
RevEng Posted July 19, 2009 Author Share Posted July 19, 2009 No problem. Glad to give back a little! Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796471 Share on other sites More sharing options...
yuppicide Posted July 19, 2009 Share Posted July 19, 2009 Awesome work! I'm gonna make some more fonts for it. Is there a limit as to how large the score graphics file can be? Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796487 Share on other sites More sharing options...
RevEng Posted July 19, 2009 Author Share Posted July 19, 2009 (edited) Cool! The more the merrier! I've actually added a few new ones since I releaseed it this yesterday! In my defense, I find font work very relaxing and a productive way to procrastinate when I'm not working on my game. There's no practical limit to the size of the file, other than your filesystem's maximum file size or dasm's maximum file size, whichever is lesser. Either way it has a lot of room to grow! Edited July 19, 2009 by RevEng Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796520 Share on other sites More sharing options...
RevEng Posted July 19, 2009 Author Share Posted July 19, 2009 I added in my 3 new fonts to the first post and updated the zipfile. If anybody wants to add to the pack, just post your score_graphics here and I'll do the merge and preview graphics. All additions will be attributed, naturally. Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796551 Share on other sites More sharing options...
Gateway Posted July 19, 2009 Share Posted July 19, 2009 Thanks for posting this! Some questions: 1. How do you "use" the custom characters i.e. the dollar sign, blank space, etc. ? Are these in addition to the 6 hex values "A - F" or do they take the place of them to total 16 characters in all for each font? 2. This is great for testing the look of fonts in your game, however, once you choose the font you want, you don't need the other fonts taking up ROM in your .asm file. I assume you transfer the font you want to your game then you no longer need to include the constants: STOCK, NEW CENTURY, etc in your program? 3. Can you include more than one font in your game by switching between more than one font during the game loop ( in order to have access to more than 16 custom characters ) ? Thanks Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796709 Share on other sites More sharing options...
RevEng Posted July 19, 2009 Author Share Posted July 19, 2009 You're welcome. Glad you like the fonts! 1. How do you "use" the custom characters i.e. the dollar sign, blank space, etc. ? Are these in addition to the 6 hex values "A - F" or do they take the place of them to total 16 characters in all for each font? You need to use them in place of the hex characters. The bB score can only access 16 characters per digit. It's also possible to replace the regular digits with special characters by setting "const fontstyle=NOFONT". That may make more sense when there are a lot more characters and your game doesn't need numbers. (so the score can behave like an inventory list, or what have you) 2. This is great for testing the look of fonts in your game, however, once you choose the font you want, you don't need the other fonts taking up ROM in your .asm file. I assume you transfer the font you want to your game then you no longer need to include the constants: STOCK, NEW CENTURY, etc in your program? No need to do that; the fonts and characters that you don't select aren't compiled into the rom, so they don't take up any space. 3. Can you include more than one font in your game by switching between more than one font during the game loop ( in order to have access to more than 16 custom characters ) ? It would be cool to be able to do that, but that's not possible without some modifications to the bB score routine. Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796727 Share on other sites More sharing options...
+atari2600land Posted July 19, 2009 Share Posted July 19, 2009 (edited) 1. How do you "use" the custom characters i.e. the dollar sign, blank space, etc. ? Are these in addition to the 6 hex values "A - F" or do they take the place of them to total 16 characters in all for each font? You need to use them in place of the hex characters. The bB score can only access 16 characters per digit. OK, so I'm using the digits in Alarm Clock 0-9. Suppose I want to put spaces in. How would I do this? Edited July 19, 2009 by atari2600land Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796736 Share on other sites More sharing options...
RevEng Posted July 20, 2009 Author Share Posted July 20, 2009 (edited) OK, so I'm using the digits in Alarm Clock 0-9. Suppose I want to put spaces in. How would I do this? The special characters get put into the hex digit positions starting with $a, in the order that they're defined in score_graphics.asm. The following example puts a "©1983" with a space after it in the score. Be sure to add in the spaces that the AA forum eats from the margin, or download the bas at the end of the post... const fontstyle=ALARMCLOCK const fontcharSPACE=1 const fontcharCOPYRIGHT=1 dim sc0=score dim sc1=score+1 dim sc2=score+2 rem we update the score bytes individually... sc0=$b1 sc1=$98 sc2=$3a scorecolor=$0f gameloop drawscreen goto gameloop font.bas.bin font.bas Edited August 25, 2009 by RevEng Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796754 Share on other sites More sharing options...
yuppicide Posted July 20, 2009 Share Posted July 20, 2009 Relaxing might be a good word. When I'm doing a game and I can't get something to work, at least I know I can draw a font and it'll ALWAYS work. Cool! The more the merrier! I've actually added a few new ones since I releaseed it this yesterday! In my defense, I find font work very relaxing and a productive way to procrastinate when I'm not working on my game. There's no practical limit to the size of the file, other than your filesystem's maximum file size or dasm's maximum file size, whichever is lesser. Either way it has a lot of room to grow! Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1796821 Share on other sites More sharing options...
RevEng Posted August 25, 2009 Author Share Posted August 25, 2009 I updated the original post: I added one more font (Ste's, not my own) and some new symbols. I probably won't be updating this for a while, if at all... Consider it the final version. Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-1823421 Share on other sites More sharing options...
Philsan Posted December 17, 2010 Share Posted December 17, 2010 If I am not wrong, if you want to avoid a compilation error (it's only cosmethical, compiled files works perfectly), instead of const fontstyle=FONTNAME you should use const fontstyle=FONTNUMBER Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-2160181 Share on other sites More sharing options...
Coolcrab Posted August 25, 2018 Share Posted August 25, 2018 The special characters get put into the hex digit positions starting with $a, in the order that they're defined in score_graphics.asm. The following example puts a "©1983" with a space after it in the score. Be sure to add in the spaces that the AA forum eats from the margin, or download the bas at the end of the post... const fontstyle=ALARMCLOCK const fontcharSPACE=1 const fontcharCOPYRIGHT=1 dim sc0=score dim sc1=score+1 dim sc2=score+2 rem we update the score bytes individually... sc0=$b1 sc1=$98 sc2=$3a scorecolor=$0f gameloop drawscreen goto gameloop font.bas.bin font.bas I tried this out but for some reason it only works for up to 2 new characters. once I add a 3rd one it just refuses to compile. It should be possible get up to 6 new characters right? font.bas score_graphics.asm Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4099005 Share on other sites More sharing options...
RevEng Posted August 25, 2018 Author Share Posted August 25, 2018 A couple things... you replaced some of the original labels, but didn't replace the names in the "scorelength = " calculation at the top of the file. You also dropped an "endif" after one of the character definitions, and that basically made everything after it part of the condition. (in this case, conditionally off) Here's your fixed score_graphics.asm score_graphics.asm 1 Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4099063 Share on other sites More sharing options...
Coolcrab Posted August 26, 2018 Share Posted August 26, 2018 Ah I missed that endif! Thanks for that. I also noticed that the order of the characters matters in the ASM file, is that a feature? So if you do const fontcharSPACE=1 const fontcharBACK=1 const fontcharCROSS=1 while BACK is before SPACE in the asm then $a will be BACK and $b will be SPACE. Just wanted to put it down for future generations, as this took me some time to figure out. 1 Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4099266 Share on other sites More sharing options...
RevEng Posted August 26, 2018 Author Share Posted August 26, 2018 I also noticed that the order of the characters matters in the ASM file, is that a feature? Not an intentional one, but I guess that can be handy. Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4099333 Share on other sites More sharing options...
Coolcrab Posted October 16, 2018 Share Posted October 16, 2018 I stumbled across a strange effect with this .asm. If you move the font to be all the way on the left. e.g. .byte %00000000 ; TINY .byte %11100000 ; TINY .byte %10100000 ; TINY .byte %10100000 ; TINY .byte %10100000 ; TINY .byte %11100000 ; TINY .byte %00000000 ; TINY .byte %00000000 ; TINY Then it will give a strange error for the most right score digit, inserting an always active row of pixels. I'm using this in conjunction with KarlG's player_score kernel and he also thinks its probably some kind of glitch with the lefter most pixel not getting erased. Is this a known issue? I could really use the extra pixel to align my fonts with. score_graphics_broken.asm Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4135005 Share on other sites More sharing options...
Lillapojkenpåön Posted October 17, 2018 Share Posted October 17, 2018 What are the odds of two Swedish guys encountering this at the same time?? I moved my titlescreen font to the left so it would line up with the score in my game .byte %00111111 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00111111 ; STOCK That's suppose to be a one and doesn't happen all the time but every time with that number, allmost looks like the first row of the two is being duplicated there. I'm using the DPC+ Kernel option with the titlescreen if that matters. Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4135773 Share on other sites More sharing options...
+Muddyfunster Posted October 17, 2018 Share Posted October 17, 2018 Love the "Railslider" logo, reminds me of the big demoscene logos from the Atart ST and Amiga days. Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4135929 Share on other sites More sharing options...
+Gemintronic Posted October 17, 2018 Share Posted October 17, 2018 What are the odds of two Swedish guys encountering this at the same time?? I moved my titlescreen font to the left so it would line up with the score in my game .byte %00111111 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00100001 ; STOCK .byte %00111111 ; STOCK That's suppose to be a one and doesn't happen all the time but every time with that number, allmost looks like the first row of the two is being duplicated there. I'm using the DPC+ Kernel option with the titlescreen if that matters. I've learned to just not use the first and last column of pixels in score digits. Not really a bug but I bet it has to do with the tight timing needed to display the digits where they are. 2 Quote Link to comment https://forums.atariage.com/topic/147450-custom-fonts-for-bb-all-in-one-score_graphicsasm/#findComment-4135944 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.