Upper And Lowercase Text In Version 4.5

Bucket Mouse

Active member
The script I wrote to enable upper and lowercase text shifting works in version 4.5 with a few alterations. Here's how to make it happen.

First you want to pick a spot on your graphics bank for the extra set of characters, and remember to keep it in the same spot on every screen. A good method is to store them in the Path area, as I've done here. Make a note of what address those characters begin at. For paths it begins at #$80. The default text characters are stored beginning at #$C0.

Next, make two new User Variables: capslock and shift (with no capitalization).

Now open doDrawText.asm and find these two lines of code:

CMP #$FF
BNE notEndOfText

Directly above them (and below LDA Temp), paste this in:

Code:
	;; THIS IS THE PART WE ADD TO CHECK THE CHARACTERS TO TURN ON CAPS
	
	CMP #_USER_0
	BNE notchar1
	INC capslock
	JMP skipthischaracter
notchar1:
	CMP #_USER_1
	BNE notchar2
	DEC capslock
	JMP skipthischaracter
notchar2:
	CMP #_USER_2
	BNE notchar3
	INC shift
skipthischaracter:
LDA textPointer
	CLC
	ADC #$01
	STA textPointer
	LDA textPointer+1
	ADC #$00
	STA textPointer+1
	JMP doneWithText
notchar3:

	;; END OF ADDED MATERIAL

Now scroll to the bottom of doDrawText. You'll see a part that says "updateNormalTextCharacter." Directly below that, paste this:

Code:
		;;;;;;;;;;;; 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:
	LDA temp
	CLC
	ADC #$80
	LDX #$00 ;; this line and the one below it resets the caps flag
	STX shift
	JMP capsOn

skipCaps:

The final step: add "capsOn" below the next three lines, like this:

Code:
		LDA temp
		CLC
		ADC #$C0
		
capsOn:

You should be good to go. Except for finding a satisfying font.

gruntgrunt.jpg
 

dale_coop

Moderator
Staff member
Interesting, thank you...
I see just a small problem, what if I don't use path for certain screens of my game:

2020-06-15-10-11-47-NES-MAKER-4-5-2-Version-0x175-Tutorial-Project-MST.png


You should really be specific that your script will work only if your screens use PATH tilesets.
 

drexegar

Member
Thanks for the lesson, I study the code and made a simple shift up to one tile to take advantage of top line HUD symbols to squeeze in Japanese into the HUD. Ill post my results when I finish.
 

BITVADER

Member
I use Japanese in the game, so I'm happy to have more characters that can be used in the text box.
However, I was unable to implement the techniques provided in this thread.
Because I couldn't find the line to add "capsOn" in "doDrawText.asm".

Apart from that, I would like to do something about the disturbance that appears after closing the text box.
View: https://youtu.be/KzJczVxmpvE

I also have a problem with the animation stopping while the text is displayed.
I refer to this thread, but the problem is not resolved.
 
Top Bottom