Quest For The Lower-Case Text Plugin
- Bucket Mouse
- Posts: 344
- Joined: Wed Mar 07, 2018 2:25 am
Quest For The Lower-Case Text Plugin
IMPORTANT NOTE: The quest is over. Go to this post to find out how to use lower and upper case text at once:
http://www.nesmakers.com/viewtopic.php?f=36&t=3988&p=21762#p21762
Meeting up with Joe Granato at Portland Retro Gaming Expo, I got the confirmation: there are absolutely no plans to add lower-case text support to NESMaker 5.0, or possibly ever. This is something I really need in my text-heavy games, and I have told him this many times. But he insists my need is in the minority, and thus no time will ever be spent on it officially.
Noticing the look of despair on my face, he threw me a bone: he suggested the feature could be added through a plug-in, much like the sprite HUD was added through a plug-in. The problem with that is, I can't make plug-ins. I don't even know what language NESMaker is written in, let alone how to code plug-ins for it. So I'm hoping at least one of you readers do know, and would like to help me make this plug-in happen.
I'm thinking it would work the same way as the text form that's currently in the program now, it'd just draw from a wider area of the graphics bank, like two extra rows above normal. Better: the extra characters could be stored and pulled from the Path tiles, since I never use them.
Are any of you out there willing to help me make this plug-in happen? Please say yes; you're my only hope.
http://www.nesmakers.com/viewtopic.php?f=36&t=3988&p=21762#p21762
Meeting up with Joe Granato at Portland Retro Gaming Expo, I got the confirmation: there are absolutely no plans to add lower-case text support to NESMaker 5.0, or possibly ever. This is something I really need in my text-heavy games, and I have told him this many times. But he insists my need is in the minority, and thus no time will ever be spent on it officially.
Noticing the look of despair on my face, he threw me a bone: he suggested the feature could be added through a plug-in, much like the sprite HUD was added through a plug-in. The problem with that is, I can't make plug-ins. I don't even know what language NESMaker is written in, let alone how to code plug-ins for it. So I'm hoping at least one of you readers do know, and would like to help me make this plug-in happen.
I'm thinking it would work the same way as the text form that's currently in the program now, it'd just draw from a wider area of the graphics bank, like two extra rows above normal. Better: the extra characters could be stored and pulled from the Path tiles, since I never use them.
Are any of you out there willing to help me make this plug-in happen? Please say yes; you're my only hope.
Last edited by Bucket Mouse on Mon Dec 09, 2019 8:05 am, edited 1 time in total.
Re: Quest For The Lower-Case Text Plugin
Mugi just mentioned using lowercase in his game here: http://nesmakers.com/viewtopic.php?f=51&t=1820&start=330
- Bucket Mouse
- Posts: 344
- Joined: Wed Mar 07, 2018 2:25 am
Re: Quest For The Lower-Case Text Plugin
Mugi is using a completely different engine at this point; it's doubtful his solution would function outside of it.
Re: Quest For The Lower-Case Text Plugin
our engine at this point in time is also specifically meant for creating cutscenes, as such, the textbox it has will not function during gameplay without significant modifications.
IE: it has no function to print text over a gameplay screen and then restore it.
IE: it has no function to print text over a gameplay screen and then restore it.
"what are you up to?" "Oh, not much... just... Parallaxing"
- Raftronaut
- Raftronaut
- Bucket Mouse
- Posts: 344
- Joined: Wed Mar 07, 2018 2:25 am
Re: Quest For The Lower-Case Text Plugin
This is what Joe Granato suggested:
#$CA and #$CB being the addresses I assigned Special Characters 1 and 2 to.
Then where it says " ;;;;; The look up was a normal letter, number, or other hud value." I added below:
To me, this should work, but it doesn't -- it just results in a blank text box. What am I doing wrong?
So I feel I've written this. In HandleTextBox.asm, there's a part that says " ;; this is where we determine if this is a special character or a normal letter/number to update." Directly below that line, I inserted this:Use your “special characters” not to draw characters at all, but to act as a shift key. So make a variable called caps, make it zero at the start of the game.
When the text read script is happening, if it comes across that special character, it sets caps to 1 and increases index (not actually drawing anything).
Then on your text write, read caps. If it zero, draw from position offset A0 (the third path row) - where you’ll put your lowercase letters). If it is one, draw from position c0 like it does now.
You’ll lose 2 rows of paths to do it.
You won’t see caps and lowercase in the text editor but you’ll see your *shift* characters, so it should still be easy enough to construct and read.
It’ll also take up rom space of a byte for each *shift*.
Code: Select all
CMP #$CA
BNE notchar1
INC caps
notchar1:
CMP #$CB
BNE notchar2
DEC caps
notchar2:
Then where it says " ;;;;; The look up was a normal letter, number, or other hud value." I added below:
Code: Select all
LDA caps
CMP #$01
BNE skipCaps
CLC
ADC #$A0
JMP capsOn
skipCaps:
CLC
ADC #$C0
capsOn:
STA updateHUD_fire_Tile
Re: Quest For The Lower-Case Text Plugin
Be careful... if you do a LDA caps in the second part of your script, you corrupt the A register... the CLC ADC that come after that doesn’t work correctly because the A register value is no more what it should be.
You should check later... and subtract #40 to updateHUD_fire_Tile if/when caps is set.
You should check later... and subtract #40 to updateHUD_fire_Tile if/when caps is set.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
- Bucket Mouse
- Posts: 344
- Joined: Wed Mar 07, 2018 2:25 am
Re: Quest For The Lower-Case Text Plugin
I did catch that, and I changed it to an LDX because I didn't see X being used in the immediate vicinity.dale_coop wrote: ↑Sun Dec 08, 2019 10:46 pmBe careful... if you do a LDA caps in the second part of your script, you corrupt the A register... the CLC ADC that come after that doesn’t work correctly because the A register value is no more what it should be.
You should check later... and subtract #40 to updateHUD_fire_Tile if/when caps is set.
I don't know why I would need to subtract 40 though. The new tests seem to be working so far.
- Bucket Mouse
- Posts: 344
- Joined: Wed Mar 07, 2018 2:25 am
Re: Quest For The Lower-Case Text Plugin
Okay, I've figured it out at last. It hasn't gone through testing yet, but it definitely works for me. It feels very freeing to finally be able to put emphasis on certain words and have the text read the way it's supposed to. Special thanks to Joe Granato who pointed me in the direction of this solution.
There is a sacrifice, but I consider it worth it. It will cost you half your space for paths and three-fourths of your special characters. We're going to use the special characters as capslock and shift keys, and the upper four rows of paths as an extra set of text characters.
Step 1: Create two new user variables: "capslock" and "shift".
Step 2: Take what you currently have in HudTiles.bmp, and copy-paste it into the first four rows of every Paths image. Find or make a separate lowercase set of letters. Take those letters and paste them over the letters in HudTiles.bmp.
Alternate Step 2: If you're using a HUD and you don't want all the letters in it to be in lowercase, then leave HudTiles.bmp alone and paste your lowercase letters into Paths. If you do this you'll have to interpret the final step a little differently.
Step 3: Find HandleTextBox.asm in your System folder for the game you're working on. Open it up and go to line 261 (the first line shown below). Then add this stuff:
Scroll down a little further and find the notation "NORMAL VALUE". Paste in this stuff (after that, check to make sure that the last line, STA updateHUD_fire_Tile, isn't reproduced twice).
Step 4: Enter your text as desired. @ is your Capslock symbol; it switches to all caps. # turns off the Capslock and switches to lowercase again. $ is Shift and it capitalizes the letter that appears after it. None of these symbols will show up in your text box, but they WILL count toward your 256 character limit, which is why I had to go through the extra trouble of figuring out how to Shift -- otherwise you'd have to waste two characters instead of one.
Alternate Step 4 if you wanted a capitalized HUD: Symbols will do the reverse in your situation. @ turns OFF your caps -- in this case you don't even need Shift since it's unlikely you'll need to make one letter lowercase. Just put @ after the capitalized letter.
There is a sacrifice, but I consider it worth it. It will cost you half your space for paths and three-fourths of your special characters. We're going to use the special characters as capslock and shift keys, and the upper four rows of paths as an extra set of text characters.
Step 1: Create two new user variables: "capslock" and "shift".
Step 2: Take what you currently have in HudTiles.bmp, and copy-paste it into the first four rows of every Paths image. Find or make a separate lowercase set of letters. Take those letters and paste them over the letters in HudTiles.bmp.
Alternate Step 2: If you're using a HUD and you don't want all the letters in it to be in lowercase, then leave HudTiles.bmp alone and paste your lowercase letters into Paths. If you do this you'll have to interpret the final step a little differently.
Step 3: Find HandleTextBox.asm in your System folder for the game you're working on. Open it up and go to line 261 (the first line shown below). Then add this stuff:
Code: Select all
;; this is where we determine if this is a special character or a normal letter/number to update.
;; THIS IS THE PART WE ADD TO CHECK THE CHARACTERS TO TURN ON CAPS
CMP #_USER_0
BNE notchar1
INC textboxOffsetHold
INC capslock
JMP doneTextUpdate
notchar1:
CMP #_USER_1
BNE notchar2
INC textboxOffsetHold
DEC capslock
JMP doneTextUpdate
notchar2:
CMP #_USER_2
BNE notchar3
INC textboxOffsetHold
INC shift
JMP doneTextUpdate
notchar3:
;; END OF ADDED MATERIAL
Code: Select all
;;;; NORMAL VALUE
;;;;; The look up was a normal letter, number, or other hud value.
;;;;;;;;;;;; MORE CAPS MATERIAL STARTS HERE
LDX capslock ;; checks for capslock symbol
CPX #$01
BEQ capshappens ;; if it's on, it branches to caps letter bank
LDX shift ;; if there's no capslock symbol, it checks for the shift symbol
CPX #$01
BNE skipCaps ;; if it's not on, it branches to the lowercase letter bank
capshappens:
CLC
ADC #$80
LDX #$00 ;; this line and the one below it resets the caps flag
STX shift
JMP capsOn
skipCaps:
CLC
ADC #$C0
capsOn:
STA updateHUD_fire_Tile
Alternate Step 4 if you wanted a capitalized HUD: Symbols will do the reverse in your situation. @ turns OFF your caps -- in this case you don't even need Shift since it's unlikely you'll need to make one letter lowercase. Just put @ after the capitalized letter.
- TakuikaNinja
- Posts: 57
- Joined: Thu Feb 28, 2019 10:11 pm
- Location: Wellington, NZ
- Contact:
Re: Quest For The Lower-Case Text Plugin
Nice job! This will definitely come in handy for a lot of people.
Don't mind me, I was born on Friday the 13th.
Twitter: [url]https://twitter.com/TakuikaNinja[/url]
SoundCloud: [url]https://soundcloud.com/takuikaninja[/url]
YouTube: [url]https://www.youtube.com/channel/UCE07EMCyUwRoF1uRgQZ5LSQ[/url]
Twitter: [url]https://twitter.com/TakuikaNinja[/url]
SoundCloud: [url]https://soundcloud.com/takuikaninja[/url]
YouTube: [url]https://www.youtube.com/channel/UCE07EMCyUwRoF1uRgQZ5LSQ[/url]
Re: Quest For The Lower-Case Text Plugin
Great work!
Note: you could also save some special characters, using only 1 special character for that (during my tests last week, I did it with only one), when you have the special character, you switch to "caps on" for the next letter, and after that letter written, switchback to "caps off".
For example, using @ as my special character (but of course you can use any characters of the "hud tiles" tab)
So, if you want to display "this is MY TEST", you just need write it like "this is @M@Y @T@E@S@T".
And if you want "This Is My Test", just write "@This @Is @My @Test".
Note: you could also save some special characters, using only 1 special character for that (during my tests last week, I did it with only one), when you have the special character, you switch to "caps on" for the next letter, and after that letter written, switchback to "caps off".
For example, using @ as my special character (but of course you can use any characters of the "hud tiles" tab)
So, if you want to display "this is MY TEST", you just need write it like "this is @M@Y @T@E@S@T".
And if you want "This Is My Test", just write "@This @Is @My @Test".
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)