fork/training-mode-ce
git clone https://git.julia.blue/fork/training-mode-ce
96edbd1
nix
1# To be inserted at 803a684c 2.include "../../../Globals.s" 3.include "../../../m-ex/Header.s" 4 5.set LoopCount , 31 6.set Dictionary , 30 7.set CurrentDictOffset , 12 8 9# Runs When the ASCII Value is 0x85 or Greater 10# Katagana Starts at Dictionary Offset 0xB0 11 12backup 13 14# Search custom symbol table 15bl CustomSymbolDictionary 16mflr Dictionary 17li LoopCount , 0 18 19Loop : 20mulli CurrentDictOffset , LoopCount , 0x3 21add CurrentDictOffset , CurrentDictOffset , Dictionary 22lbz r11 , 0x0 ( CurrentDictOffset ) 23cmpwi r11 , 0xFF 24beq Exit 25cmpw r10 , r11 26beq CharacterFound 27 28IncLoop : 29addi LoopCount , LoopCount , 1 30b Loop 31 32CharacterFound : 33# If overriding 0xA 34lbz r10 , 0x0 ( CurrentDictOffset ) # Check Matched Character 35cmpwi r10 , 0x0A 36bne CharacterFound_Resume 37# Store 0x3 to the menu text string 38li r10 , 0x03 39stbx r10 , r3 , r9 40# increment r9 by 1 to get next offset in menu text string 41addi r9 , r9 , 1 42# branch to 803a6b70, will increment r5 and r6 by 1 to get next offset in ASCII string and loop 43restore 44branch r12 , 0x803a6b70 45 46CharacterFound_Resume : 47lbz r10 , 0x1 ( CurrentDictOffset ) # Load Override Character 48lbz r12 , 0x2 ( CurrentDictOffset ) # Load Override Character 49restore 50mr r31 , r12 51load r0 , 0x8040c8c0 52branch r12 , 0x803a6b08 53 54CustomSymbolDictionary : 55blrl 56.byte 0x21 , 0x81 , 0x49 # Exclamation Point 57.byte 0x2f , 0x81 , 0x5E # Slash 58.byte 0x2e , 0x81 , 0x44 # Period 59.byte 0x3d , 0x81 , 0x81 # Equals Sign 60.byte 0x2b , 0x81 , 0x7B # Plus Sign 61.byte 0x25 , 0x81 , 0x93 # Percent Sign 62.byte 0x0A , 0x03 , 0x00 # New Line 63.byte 0x27 , 0x81 , 0x66 # Apostrophe 64.byte 0x3e , 0x81 , 0x84 # Greater than 65.byte 0x3c , 0x81 , 0x83 # Less than 66.byte 0x5F , 0x81 , 0x51 # Underscore 67.byte 0x5E , 0x81 , 0x4F # Carrot 68.byte 0x3F , 0x81 , 0x48 # Question mark 69.byte 0x7c , 0x81 , 0x62 # | symbol 70.byte 0x28 , 0x81 , 0x69 # Open Parenthesis 71.byte 0x29 , 0x81 , 0x6A # Close Parenthesis 72.byte 0xFF 73.align 2 74 75Exit : 76restore 77load r0 , 0x8040c8c0 78cmplwi r10 , 32 79 80/* 81# Katagana code 82cmpwi r10, 0x85 83blt original 84 85addi r31, r10, 0x2b 86branch r12, 0x803a6b38 87 88original: 89lbzu r31, 0x0001(r6) 90*/