<commit_before>

; --------- TEXT FLAGS ----------
	enum_start
	enum_elem TEXT_0_FLAG
	enum_elem TEXT_1_FLAG
	enum_elem TEXT_2_FLAG
	enum_elem TEXT_PIC_FLAG
	enum_elem TEXT_ZERO_FLAG
	enum_elem TEXT_PARITY_FLAG
	enum_elem TEXT_SIGN_FLAG
	enum_elem TEXT_CARRY_FLAG

; ------- TEXT COMMANDS ---------
	enum_start
	enum_elem END_TEXT
	enum_elem CLEAR_TEXT
	enum_elem PRINT_PIC
	enum_elem PRINT_NAME_AND_DISP
	enum_elem WAIT_FOR_BUTTON
	enum_elem WAIT_FOR_BUTTON_NO_SFX
	enum_elem PRINT_STRING
	enum_elem EMPTY_LINE
	enum_elem DELAY_FRAMES
	enum_elem SET_COUNTER
	enum_elem COPY_COUNTER
	enum_elem DECREMENT_AND_JUMP
	enum_elem DISPLAY_NUMBER
	enum_elem INSTANT_DISPLAY
	enum_elem INSTANT_CLOSE
	enum_elem DISP_WITHOUT_WAIT
	enum_elem CLOSE_WITHOUT_WAIT
	enum_elem MAKE_NPC_WALK
	enum_elem MAKE_NPC_WALK_TO
	enum_elem MAKE_PLAYER_WALK
	enum_elem MAKE_PLAYER_WALK_TO
	enum_elem MAKE_CHOICE
	enum_elem MAKE_B_CHOICE
	enum_elem SET_FADE_SPEED
	enum_elem GFX_FADE_IN
	enum_elem GFX_FADE_OUT
	enum_elem RELOAD_PALETTES
	enum_elem LDA_TEXT
	enum_elem LDAIMM_TEXT
	enum_elem STA_TEXT
	enum_elem CMP_TEXT
	enum_elem DEC_TEXT
	enum_elem INC_TEXT
	enum_elem ADD_TEXT
	enum_elem ADC_TEXT
	enum_elem ADDMEM_TEXT
	enum_elem SBC_TEXT
	enum_elem SUBMEM_TEXT
	enum_elem SET_TEXT_FLAGS
	enum_elem TOGGLE_TEXT_FLAGS
	enum_elem TEXT_CALL_FUNCTION
	enum_elem INSTANT_PRINT_STRS
	enum_elem UPDATE_TEXT_FLAGS
	enum_elem TEXT_JR
	enum_elem TEXT_JR_NC
	enum_elem TEXT_JR_C
	enum_elem TEXT_JR_P
	enum_elem TEXT_JR_N
	enum_elem TEXT_JR_PE
	enum_elem TEXT_JR_PO
	enum_elem TEXT_JR_NZ
	enum_elem TEXT_JR_Z
	enum_elem TEXT_RAM_BANKSWITCH
	enum_elem TEXT_AND
	enum_elem TEXT_OR
	enum_elem TEXT_XOR
	enum_elem TEXT_BIT
	enum_elem END_TEXT_LEAVE_BOX
	enum_elem TEXT_MUSIC_FADE
	enum_elem TEXT_MUSIC_PLAY
	enum_elem TEXT_MUSIC_STOP
	enum_elem TEXT_SFX_WAIT
	enum_elem TEXT_SFX_PLAY
	enum_elem TEXT_SFX_STOP
	enum_elem OVERRIDE_TEXBOX_PAL
	enum_elem CLOSE_TEXTBOX
	enum_elem TEXT_GET_FLAG
	enum_elem TEXT_SET_FLAG
	enum_elem TEXT_RESET_FLAG
	enum_elem TEXT_TOGGLE_FLAG
	enum_elem TEXT_LOAD_MAP
	enum_elem TEXT_START_ANIM
	enum_elem TEXT_END_ANIM
	
	enum_elem INVALID_TXT_COMMAND ; WARNING : TEXT COMMAND PROCESSOR MUST BE UPDATED IF IDS 128+ ARE USED!!!


; -------- TEXT COMMAND MACROS ----------

; Closes the textbox and ends all operations
done: MACRO
	db END_TEXT
ENDM


; Clears the textbox's contents
clear_box: MACRO
	db CLEAR_TEXT
ENDM


; print_pic ptr_to_pic
; Prints a picture on the left of the textbox,
; and sets the corresponding text flag (so text doesn't occupy its space).
; ptr_to_pic : Pointer to 9 tiles that will form the pic, in this order :
; 1 4 7
; 2 5 8
; 3 6 9
; WARNING : Do not use if text is already on-screen ! (Otherwise enjoy your overwrites)
; WARNING : May cause graphical issues if the textbox is already displayed
print_pic: MACRO
	db PRINT_PIC
	db BANK(\1)
	dw \1
ENDM


; print_name ptr_to_name
; Prints a name on the textbox top border and displays the textbox
; ptr_to_name : Pointer to the string to be printed
; WARNING : Printing more than 16 characters will cause some overwrites !
; Alternate syntax : Giving no argument will use the default name instead
;   (done using `set_text_prefix` and `dname`)
print_name: MACRO
IF _NARG == 0
	print_name name_prefix
ELSE
	db PRINT_NAME_AND_DISP
	db BANK(\1)
	dw \1
ENDC
ENDM

; Simply displays the textbox
disp_box: MACRO
	print_name NULL
ENDM


; Waits until the user PRESSES the A or B button
wait_user: MACRO
	db WAIT_FOR_BUTTON
ENDM

<commit_msg>Add macro to use noew command<commit_after>

; --------- TEXT FLAGS ----------
	enum_start
	enum_elem TEXT_0_FLAG
	enum_elem TEXT_1_FLAG
	enum_elem TEXT_2_FLAG
	enum_elem TEXT_PIC_FLAG
	enum_elem TEXT_ZERO_FLAG
	enum_elem TEXT_PARITY_FLAG
	enum_elem TEXT_SIGN_FLAG
	enum_elem TEXT_CARRY_FLAG

; ------- TEXT COMMANDS ---------
	enum_start
	enum_elem END_TEXT
	enum_elem CLEAR_TEXT
	enum_elem PRINT_PIC
	enum_elem PRINT_NAME_AND_DISP
	enum_elem WAIT_FOR_BUTTON
	enum_elem WAIT_FOR_BUTTON_NO_SFX
	enum_elem PRINT_STRING
	enum_elem EMPTY_LINE
	enum_elem DELAY_FRAMES
	enum_elem SET_COUNTER
	enum_elem COPY_COUNTER
	enum_elem DECREMENT_AND_JUMP
	enum_elem DISPLAY_NUMBER
	enum_elem INSTANT_DISPLAY
	enum_elem INSTANT_CLOSE
	enum_elem DISP_WITHOUT_WAIT
	enum_elem CLOSE_WITHOUT_WAIT
	enum_elem MAKE_NPC_WALK
	enum_elem MAKE_NPC_WALK_TO
	enum_elem MAKE_PLAYER_WALK
	enum_elem MAKE_PLAYER_WALK_TO
	enum_elem MAKE_CHOICE
	enum_elem MAKE_B_CHOICE
	enum_elem SET_FADE_SPEED
	enum_elem GFX_FADE_IN
	enum_elem GFX_FADE_OUT
	enum_elem RELOAD_PALETTES
	enum_elem LDA_TEXT
	enum_elem LDAIMM_TEXT
	enum_elem STA_TEXT
	enum_elem CMP_TEXT
	enum_elem DEC_TEXT
	enum_elem INC_TEXT
	enum_elem ADD_TEXT
	enum_elem ADC_TEXT
	enum_elem ADDMEM_TEXT
	enum_elem SBC_TEXT
	enum_elem SUBMEM_TEXT
	enum_elem SET_TEXT_FLAGS
	enum_elem TOGGLE_TEXT_FLAGS
	enum_elem TEXT_CALL_FUNCTION
	enum_elem INSTANT_PRINT_STRS
	enum_elem UPDATE_TEXT_FLAGS
	enum_elem TEXT_JR
	enum_elem TEXT_JR_NC
	enum_elem TEXT_JR_C
	enum_elem TEXT_JR_P
	enum_elem TEXT_JR_N
	enum_elem TEXT_JR_PE
	enum_elem TEXT_JR_PO
	enum_elem TEXT_JR_NZ
	enum_elem TEXT_JR_Z
	enum_elem TEXT_RAM_BANKSWITCH
	enum_elem TEXT_AND
	enum_elem TEXT_OR
	enum_elem TEXT_XOR
	enum_elem TEXT_BIT
	enum_elem END_TEXT_LEAVE_BOX
	enum_elem TEXT_MUSIC_FADE
	enum_elem TEXT_MUSIC_PLAY
	enum_elem TEXT_MUSIC_STOP
	enum_elem TEXT_SFX_WAIT
	enum_elem TEXT_SFX_PLAY
	enum_elem TEXT_SFX_STOP
	enum_elem OVERRIDE_TEXBOX_PAL
	enum_elem CLOSE_TEXTBOX
	enum_elem TEXT_GET_FLAG
	enum_elem TEXT_SET_FLAG
	enum_elem TEXT_RESET_FLAG
	enum_elem TEXT_TOGGLE_FLAG
	enum_elem TEXT_LOAD_MAP
	enum_elem TEXT_START_ANIM
	enum_elem TEXT_END_ANIM
	
	enum_elem INVALID_TXT_COMMAND ; WARNING : TEXT COMMAND PROCESSOR MUST BE UPDATED IF IDS 128+ ARE USED!!!


; -------- TEXT COMMAND MACROS ----------

; Closes the textbox and ends all operations
done: MACRO
	db END_TEXT
ENDM


; Clears the textbox's contents
clear_box: MACRO
	db CLEAR_TEXT
ENDM


; print_pic ptr_to_pic
; Prints a picture on the left of the textbox,
; and sets the corresponding text flag (so text doesn't occupy its space).
; ptr_to_pic : Pointer to 9 tiles that will form the pic, in this order :
; 1 4 7
; 2 5 8
; 3 6 9
; WARNING : Do not use if text is already on-screen ! (Otherwise enjoy your overwrites)
; WARNING : May cause graphical issues if the textbox is already displayed
print_pic: MACRO
	db PRINT_PIC
	db BANK(\1)
	dw \1
ENDM


; print_name ptr_to_name
; Prints a name on the textbox top border and displays the textbox
; ptr_to_name : Pointer to the string to be printed
; WARNING : Printing more than 16 characters will cause some overwrites !
; Alternate syntax : Giving no argument will use the default name instead
;   (done using `set_text_prefix` and `dname`)
print_name: MACRO
IF _NARG == 0
	print_name name_prefix
ELSE
	db PRINT_NAME_AND_DISP
	db BANK(\1)
	dw \1
ENDC
ENDM

; Simply displays the textbox
disp_box: MACRO
	print_name NULL
ENDM


; Waits until the user PRESSES the A or B button
wait_user: MACRO
	db WAIT_FOR_BUTTON
ENDM

wait_user_no_sfx: MACRO
	db WAIT_FOR_BUTTON_NO_SFX
ENDM


{'fraction_non_alphanumeric': 0.03546700579341529, 'fraction_numerical': 0.006499929348594037, 'mean_word_length': 4.9729957805907175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4508778', 'n_tokens_mistral': 2899, 'n_tokens_neox': 2764, 'n_words': 756}