[go: up one dir, main page]

Menu

[r132]: / psrp / asm / tx3.asm  Maximize  Restore  History

Download this file

44 lines (38 with data), 1.4 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
;
; 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 $42b5 ; $42b5-$42cb inclusive
WriteLetterToTileMapDataAndVRAM: ; $42b5
; Parameters:
; a = tile index (space = 0)
; de = where to write tiles to
; hl = cursor location (from GetCursorLocation)
call $429b ; CD 9B 42 ; WriteLetterIndexAToDE
; c,a are the tile indices for the chosen tile
ld b,a ; 47
ld a,h ; 7C ; get cursor location in TileMapData
sub $58 ; D6 58 ; reduce it by $5800 to make it the VRAM address
ld h,a ; 67
ex de,hl ; EB
rst 08h ; CF ; SetVRAMAddressToDE
; Original code:
; ld a,b ; 78 ; write tiles to VRAM
; out ($be),a ; D3 BE
; ld hl,-64 ; 21 C0 FF
; add hl,de ; 19
; ex de,hl ; EB
; rst 08h ; CF
; ld a,c ; 79
; out ($be),a ; D3 BE
; Patch:
ld a,c ; 79
out ($be),a ; D3 BE
ld a,b ; 78
out ($be),a ; D3 BE
; End patch
ret ; C9
.end ; tasm-only
; 6 bytes smaller