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
|
CorrectNickErrors:: ; 677e (1:677e)
push bc
push de
ld b, MON_NAME_LENGTH
.checkchar
ld a, [de]
cp "@"
jr z, .done
ld hl, .textcommands
dec hl
.loop
inc hl
ld a, [hl]
cp $ff
jr z, .next
ld a, [de]
cp [hl]
inc hl
jr c, .loop
cp [hl]
jr nc, .loop
ld a, "?"
ld [de], a
jr .loop
.next
inc de
dec b
jr nz, .checkchar
pop de
push de
ld a, "?"
ld [de], a
inc de
ld a, "@"
ld [de], a
.done
pop de
pop bc
ret
.textcommands
; table defining which characters are actually text commands
; format:
; ≥ <
db "<START>", $04 + 1
db "<PLAY_G>", $18 + 1
db $1d, "%" + 1
db $35, "<GREEN>" + 1
db "<ENEMY>", "<ENEMY>" + 1
db $49, "<TM>" + 1
db "<ROCKET>", "┘" + 1
db -1 ; end
|