getkadr.s
9.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/******************************
* KANJI-READ v2 1997/07/15 *
* Programmed By Melody-Yoshi *
******************************/
.align 2
.text
.globl LeoGetKAdr
.ent LeoGetKAdr
/* ====== KANJIOFFSET ====== [IN:R4=S-JIS] */
LeoGetKAdr:
blt $4, 0x8140, kanchg4
bgt $4, 0x9872, kanchg4
li $6,0xBC
blt $4,0x8800,kanchg2
srl $5,$4,8
sub $5,0x88
mul $6,$5 ##BC*HIGH
and $7,$4,0xFF
sub $7,0x40
blt $7,0x40,kanchg1
sub $7,1
kanchg1: mflo $6
add $7,0x30A
add $7,$6
sll $2,$7,7
jr $31
kanchg2: srl $5,$4,8
sub $5,0x81
mul $6,$5
and $7,$4,0xFF
sub $7,0x40
blt $7,0x40,kanchg3
sub $7,1
kanchg3: mflo $6
add $7,$6
sll $7,1
la $6,kantbl
add $7,$6
lh $6,($7)
sll $2,$6,7
jr $31
kanchg4:
li $2, -1
jr $31
kantbl: .half 0x000,0x001,0x002,0x003,0x004,0x005,0x006,0x007
.half 0x008,0x009,0x00A,0x00B,0x00C,0x00D,0x00E,0x00F
.half 0x010,0x011,0x012,0x013,0x014,0x015,0x016,0x017
.half 0x018,0x019,0x01A,0x01B,0x01C,0x01D,0x01E,0x01F
.half 0x020,0x021,0x022,0x023,0x024,0x025,0x026,0x027
.half 0x028,0x029,0x02A,0x02B,0x02C,0x02D,0x02E,0x02F
.half 0x030,0x031,0x032,0x033,0x034,0x035,0x036,0x037
.half 0x038,0x039,0x03A,0x03B,0x03C,0x03D,0x03E,0x03F
.half 0x040,0x041,0x042,0x043,0x044,0x045,0x046,0x047
.half 0x048,0x049,0x04A,0x04B,0x04C,0x04D,0x04E,0x04F
.half 0x050,0x051,0x052,0x053,0x054,0x055,0x056,0x057
.half 0x058,0x059,0x05A,0x05B,0x05C,0x05D,0x05E,0x05F
.half 0x060,0x061,0x062,0x063,0x064,0x065,0x066,0x067
.half 0x068,0x069,0x06A,0x06B,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x06C
.half 0x06D,0x06E,0x06F,0x070,0x071,0x072,0x073,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x074
.half 0x075,0x076,0x077,0x078,0x079,0x07A,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x07B,0x07C,0x07D,0x07E,0x07F,0x080
.half 0x081,0x082,0x083,0x084,0x085,0x086,0x087,0x088
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x089
.half 0x08A,0x08B,0x08C,0x08D,0x08E,0x08F,0x090,0x000
.half 0x000,0x000,0x000,0x091,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x092,0x093,0x094,0x095,0x096
.half 0x097,0x098,0x099,0x09A,0x09B,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x09C,0x09D,0x09E,0x09F
.half 0x0A0,0x0A1,0x0A2,0x0A3,0x0A4,0x0A5,0x0A6,0x0A7
.half 0x0A8,0x0A9,0x0AA,0x0AB,0x0AC,0x0AD,0x0AE,0x0AF
.half 0x0B0,0x0B1,0x0B2,0x0B3,0x0B4,0x0B5,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x0B6,0x0B7,0x0B8,0x0B9
.half 0x0BA,0x0BB,0x0BC,0x0BD,0x0BE,0x0BF,0x0C0,0x0C1
.half 0x0C2,0x0C3,0x0C4,0x0C5,0x0C6,0x0C7,0x0C8,0x0C9
.half 0x0CA,0x0CB,0x0CC,0x0CD,0x0CE,0x0CF,0x000,0x000
.half 0x000,0x000,0x0D0,0x0D1,0x0D2,0x0D3,0x0D4,0x0D5
.half 0x0D6,0x0D7,0x0D8,0x0D9,0x0DA,0x0DB,0x0DC,0x0DD
.half 0x0DE,0x0DF,0x0E0,0x0E1,0x0E2,0x0E3,0x0E4,0x0E5
.half 0x0E6,0x0E7,0x0E8,0x0E9,0x0EA,0x0EB,0x0EC,0x0ED
.half 0x0EE,0x0EF,0x0F0,0x0F1,0x0F2,0x0F3,0x0F4,0x0F5
.half 0x0F6,0x0F7,0x0F8,0x0F9,0x0FA,0x0FB,0x0FC,0x0FD
.half 0x0FE,0x0FF,0x100,0x101,0x102,0x103,0x104,0x105
.half 0x106,0x107,0x108,0x109,0x10A,0x10B,0x10C,0x10D
.half 0x10E,0x10F,0x110,0x111,0x112,0x113,0x114,0x115
.half 0x116,0x117,0x118,0x119,0x11A,0x11B,0x11C,0x11D
.half 0x11E,0x11F,0x120,0x121,0x122,0x123,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x124,0x125,0x126,0x127,0x128,0x129,0x12A,0x12B
.half 0x12C,0x12D,0x12E,0x12F,0x130,0x131,0x132,0x133
.half 0x134,0x135,0x136,0x137,0x138,0x139,0x13A,0x13B
.half 0x13C,0x13D,0x13E,0x13F,0x140,0x141,0x142,0x143
.half 0x144,0x145,0x146,0x147,0x148,0x149,0x14A,0x14B
.half 0x14C,0x14D,0x14E,0x14F,0x150,0x151,0x152,0x153
.half 0x154,0x155,0x156,0x157,0x158,0x159,0x15A,0x15B
.half 0x15C,0x15D,0x15E,0x15F,0x160,0x161,0x162,0x163
.half 0x164,0x165,0x166,0x167,0x168,0x169,0x16A,0x16B
.half 0x16C,0x16D,0x16E,0x16F,0x170,0x171,0x172,0x173
.half 0x174,0x175,0x176,0x177,0x178,0x179,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x17A,0x17B
.half 0x17C,0x17D,0x17E,0x17F,0x180,0x181,0x182,0x183
.half 0x184,0x185,0x186,0x187,0x188,0x189,0x18A,0x18B
.half 0x18C,0x18D,0x18E,0x18F,0x190,0x191,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x192,0x193
.half 0x194,0x195,0x196,0x197,0x198,0x199,0x19A,0x19B
.half 0x19C,0x19D,0x19E,0x19F,0x1A0,0x1A1,0x1A2,0x1A3
.half 0x1A4,0x1A5,0x1A6,0x1A7,0x1A8,0x1A9,0x1AA,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x1AB,0x1AC,0x1AD,0x1AE
.half 0x1AF,0x1B0,0x1B1,0x1B2,0x1B3,0x1B4,0x1B5,0x1B6
.half 0x1B7,0x1B8,0x1B9,0x1BA,0x1BB,0x1BC,0x1BD,0x1BE
.half 0x1BF,0x1C0,0x1C1,0x1C2,0x1C3,0x1C4,0x1C5,0x1C6
.half 0x1C7,0x1C8,0x1C9,0x1CA,0x1CB,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x1CC,0x1CD,0x1CE,0x1CF
.half 0x1D0,0x1D1,0x1D2,0x1D3,0x1D4,0x1D5,0x1D6,0x1D7
.half 0x1D8,0x1D9,0x1DA,0x1DB,0x1DC,0x1DD,0x1DE,0x1DF
.half 0x1E0,0x1E1,0x1E2,0x1E3,0x1E4,0x1E5,0x1E6,0x1E7
.half 0x1E8,0x1E9,0x1EA,0x1EB,0x1EC,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x1ED,0x1EE,0x1EF,0x1F0,0x1F1,0x1F2
.half 0x1F3,0x1F4,0x1F5,0x1F6,0x1F7,0x1F8,0x1F9,0x1FA
.half 0x1FB,0x1FC,0x1FD,0x1FE,0x1FF,0x200,0x201,0x202
.half 0x203,0x204,0x205,0x206,0x207,0x208,0x209,0x20A
.half 0x20B,0x20C,0x20D,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x20E,0x20F,0x210,0x211,0x212,0x213,0x214,0x215
.half 0x216,0x217,0x218,0x219,0x21A,0x21B,0x21C,0x21D
.half 0x21E,0x21F,0x220,0x221,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x222,0x223
.half 0x224,0x225,0x226,0x227,0x228,0x229,0x22A,0x22B
.half 0x22C,0x22D,0x22E,0x22F,0x230,0x231,0x232,0x233
.half 0x234,0x235,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x236,0x237,0x238,0x239
.half 0x23A,0x23B,0x23C,0x23D,0x23E,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x23F,0x240,0x241,0x242,0x243,0x244,0x245,0x246
.half 0x247,0x248,0x000,0x000,0x000,0x000,0x249,0x24A
.half 0x24B,0x24C,0x24D,0x24E,0x24F,0x250,0x251,0x252
.half 0x253,0x254,0x255,0x256,0x257,0x000,0x000,0x000
.half 0x000,0x000,0x258,0x259,0x25A,0x25B,0x25C,0x25D
.half 0x25E,0x25F,0x260,0x261,0x262,0x263,0x264,0x265
.half 0x266,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x267,0x268,0x269,0x26A,0x26B,0x26C
.half 0x26D,0x26E,0x26F,0x270,0x271,0x272,0x273,0x274
.half 0x275,0x276,0x277,0x278,0x279,0x27A,0x27B,0x27C
.half 0x27D,0x27E,0x27F,0x280,0x281,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x282,0x283,0x284,0x285
.half 0x286,0x287,0x288,0x289,0x28A,0x28B,0x28C,0x28D
.half 0x28E,0x28F,0x290,0x291,0x292,0x293,0x294,0x295
.half 0x296,0x297,0x298,0x299,0x29A,0x29B,0x29C,0x29D
.half 0x29E,0x29F,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x2A0,0x2A1
.half 0x2A2,0x2A3,0x2A4,0x2A5,0x2A6,0x2A7,0x2A8,0x2A9
.half 0x2AA,0x2AB,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x2AC,0x2AD
.half 0x2AE,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x2AF,0x2B0,0x2B1,0x2B2,0x2B3,0x2B4
.half 0x2B5,0x2B6,0x2B7,0x2B8,0x2B9,0x2BA,0x2BB,0x2BC
.half 0x2BD,0x2BE,0x2BF,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x2C0,0x2C1,0x2C2,0x2C3,0x2C4,0x2C5,0x2C6,0x2C7
.half 0x2C8,0x2C9,0x2CA,0x2CB,0x2CC,0x2CD,0x2CE,0x2CF
.half 0x2D0,0x2D1,0x2D2,0x2D3,0x2D4,0x2D5,0x2D6,0x2D7
.half 0x2D8,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x2D9,0x2DA,0x2DB,0x2DC,0x2DD,0x2DE,0x2DF,0x2E0
.half 0x2E1,0x2E2,0x2E3,0x2E4,0x2E5,0x2E6,0x2E7,0x2E8
.half 0x2E9,0x2EA,0x2EB,0x2EC,0x2ED,0x2EE,0x2EF,0x2F0
.half 0x2F1,0x2F2,0x2F3,0x2F4,0x2F5,0x2F6,0x2F7,0x2F8
.half 0x2F9,0x2FA,0x2FB,0x2FC,0x2FD,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x2FE,0x2FF,0x300,0x301
.half 0x302,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x303,0x304,0x305,0x306
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000
.half 0x000,0x307,0x308,0x309
.end