fork/training-mode-ce

git clone https://git.julia.blue/fork/training-mode-ce

AitchMerge pull request #242 from NickCondron/remove-asm96edbd1

master
2.4 KiB90 linesraw
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
12    backup
13
14    # Search custom symbol table
15    bl CustomSymbolDictionary
16    mflr Dictionary
17    li LoopCount, 0
18
19Loop:
20    mulli CurrentDictOffset, LoopCount, 0x3
21    add CurrentDictOffset, CurrentDictOffset, Dictionary
22    lbz r11, 0x0(CurrentDictOffset)
23    cmpwi r11, 0xFF
24    beq Exit
25    cmpw r10, r11
26    beq CharacterFound
27
28IncLoop:
29    addi LoopCount, LoopCount, 1
30    b Loop
31
32CharacterFound:
33    # If overriding 0xA
34    lbz r10, 0x0(CurrentDictOffset) # Check Matched Character
35    cmpwi r10, 0x0A
36    bne CharacterFound_Resume
37    # Store 0x3 to the menu text string
38    li r10, 0x03
39    stbx r10, r3, r9
40    # increment r9 by 1 to get next offset in menu text string
41    addi r9, r9, 1
42    # branch to 803a6b70, will increment r5 and r6 by 1 to get next offset in ASCII string and loop
43    restore
44    branch r12, 0x803a6b70
45
46CharacterFound_Resume:
47    lbz r10, 0x1(CurrentDictOffset) # Load Override Character
48    lbz r12, 0x2(CurrentDictOffset) # Load Override Character
49    restore
50    mr r31, r12
51    load r0, 0x8040c8c0
52    branch r12, 0x803a6b08
53
54CustomSymbolDictionary:
55    blrl
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:
76    restore
77    load r0, 0x8040c8c0
78    cmplwi r10, 32
79
80    /*
81    # Katagana code
82    cmpwi r10, 0x85
83    blt original
84
85    addi r31, r10, 0x2b
86    branch r12, 0x803a6b38
87
88original:
89    lbzu r31, 0x0001(r6)
90    */