[go: up one dir, main page]

Menu

[r65]: / psrp / asm / tx2.asm  Maximize  Restore  History

Download this file

50 lines (44 with data), 1.2 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
;
; Name entry screen patch for code that writes to the in-RAM name table copy
;
; Written in TASM 3.0.1
;
#include "vars.asm"
.org $429b ; $429b-$42b4 inclusive
WriteLetterIndexAToDE: ; $429b
; parameters:
; de = where to write tile data (pointing to lower tile of pair)
; a = char number (space = 0)
; returns:
; c = low byte of name table value
; a = high byte
push hl
ex de,hl
ld hl,$ffff
ld (hl),$02
ld hl,$8000
ld c,a
ld b,$00
add hl,bc
add hl,bc
; Original code:
; ld c,(hl) ; 4E ; get value in c,a
; inc hl ; 23
; ld a,(hl) ; 7E
; ld (de),a ; 12 ; write to address passed in in de
; ld hl,-64 ; 21 C0 FF
; add hl,de ; 19 ; and 1 row above it
; ld (hl),c ; 71
; Patch:
ld a,(hl) ; 7E
ld (de),a ; 12
ld c,a ; 4F
inc hl ; 23
inc de ; 13
ld a,(hl) ; 7E
ld (de),a ; 12
; End patch
pop hl
ret
; 2 bytes smaller
.end ; tasm-only