crazygrouptrio
Active member
TEXT_FREE has been a wonky portion of NESmaker, and others have struggled or come up with some pretty out there workarounds. But, I have cracked the code (as it were) to simplify it and make it actually usable without using tons of space, controlling it with a single variable. It's fairly simple, but requires some setting up, so let's get started!
1. Create this variable in User Variables. We will use it to control what text we are going to display.
2. Go to your DrawBox macro, and comment out these lines (48 to 55):
This is the portion that decides what TEXT_FREE to draw in Macro, but we don't want that. We want to decide elsewhere. So we remove it from the Macro.
3. Select a bank to store all of your text and all the code to write the text. We're using Bank #$1A as an example since it's empty from the start. It will be up to you how you summon the code, but it will require you switch to your text bank to use it.
4. Now stick this bit of code in your bank (in a subroutine or the bank itself):
This sets up the text box, tells it what bank we're using for text, then checks manualText for what text tables to load up, then jumps to a single instance of the macro that all free text will use. Replace the tables with your own labels, and add more at the end following the same format.
5. Finally, we need to actually put in the text we're writing. Below the last bit of code, under the RTS, put in your text in this format:
And that's it! To use, all you need to do is set up a method that loads a variable into manualText, then JMP to doManualText in your text bank, and it will display that text! Pretty simple right?
For an example, you can write an input code like this:
And it will display the 2nd free text!
Hope this helps you all who want to have text heavy games! Happy texting!
1. Create this variable in User Variables. We will use it to control what text we are going to display.
Code:
manualText
2. Go to your DrawBox macro, and comment out these lines (48 to 55):
Code:
CMP #TEXT_FREE
BNE notTextFree
; LDA textQueued
; AND #%00000001
; BNE skipSettingNewPointer3
; LDA #<arg5
; STA textPointer
; LDA #>arg5
; STA textPointer+1
; skipSettingNewPointer3:
JMP activateTextNow
3. Select a bank to store all of your text and all the code to write the text. We're using Bank #$1A as an example since it's empty from the start. It will be up to you how you summon the code, but it will require you switch to your text bank to use it.
4. Now stick this bit of code in your bank (in a subroutine or the bank itself):
Code:
doManualText:
;;;; This bit by Dale Coop to prevent multiple text inputs ;;;;;;;;;;;
;; checking if the text box is already displayed
LDA gameStatusByte
AND #%00000001
BEQ +continue:
;;; we also check if text box is about to be drawn / or currently drawing
LDA textQueued
AND #%00000011
BEQ +skip
JMP +continue
+skip:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+continue:
LDA #$1A ; YOUR BANK HERE
STA textBank
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDA manualText
CMP #$00
BNE +
LDA #<YourLabelHere1
STA textPointer
LDA #>YourLabelHere1
STA textPointer+1
JMP +doDrawManualText
+
CMP #$01
BNE +
LDA #<YourLabelHere2
STA textPointer
LDA #>YourLabelHere2
STA textPointer+1
JMP +doDrawManualText
+
;;; add more here
RTS
+doDrawManualText
DrawBox #5, #11, #10, #3, #TEXT_FREE, #$00 ;;; use your own values for the text box location and size, these are just examples
RTS
5. Finally, we need to actually put in the text we're writing. Below the last bit of code, under the RTS, put in your text in this format:
Code:
YourLabelHere1:
.db _Y,_O,_U,_R, _SPACE, _L,_A,_B,_E,_L, _SPACE, _H,_E,_R,_E, _SPACE, _O,_N,_E, _PERIOD, _END
YourLabelHere2:
.db _Y,_O,_U,_R, _SPACE, _L,_A,_B,_E,_L, _SPACE, _H,_E,_R,_E, _SPACE, _T,_W,_O, _PERIOD, _END
And that's it! To use, all you need to do is set up a method that loads a variable into manualText, then JMP to doManualText in your text bank, and it will display that text! Pretty simple right?
For an example, you can write an input code like this:
Code:
LDA #$01
STA manualText
SwitchBank #$1A
JSR doManualText
ReturnBank
RTS
Hope this helps you all who want to have text heavy games! Happy texting!