-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.asm
111 lines (91 loc) · 1.48 KB
/
setup.asm
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
di
ld hl,12000
bcall(_EnoughMem)
jr nc,$+5
bjump(_JForceCmdNoChar) ;chau!
ex de,hl ;hl = RAM to insert
ld de,$9D95
bcall(_InsertMem)
ld h,d
ld l,e
inc de
ld (hl),0
ld bc,11999
ldir
ld hl,salirDelPrograma
push hl ;el último ret nos mandará a salirDelPrograma
;cargar rutinas en RAM
ld hl,copy_to_ram
ld de,ramRoutines
ld bc,copy_to_ram_end-copy_to_ram_start
ldir
;vaciar inventorio
ld hl,playerInventory
ld (hl),$FF
ld de,playerInventory+1
ld bc,184
ldir
ld hl,playerInventory
ld a,8
ld (hl),a ;4 items
inc hl
ld (hl),0
inc hl
ld (hl),99
inc hl
ld (hl),1
inc hl
ld (hl),4
inc hl
ld (hl),2
inc hl
ld (hl),40
inc hl
ld (hl),3
inc hl
ld (hl),50
inc hl
ld (hl),4
inc hl
ld (hl),5
inc hl
ld (hl),5
inc hl
ld (hl),7
inc hl
ld (hl),6
inc hl
ld (hl),19
inc hl
ld (hl),7
inc hl
ld (hl),2
ld a,$3
ld (playerGold),a
ld hl,$FF70
ld (playerGold+1),hl ;playerGold = $3FFFF
;default values
xor a
ld b,6
ld hl,bigNumberString
ld (hl),a
inc hl
djnz $-2
ld (hl),a ;0 terminate the string
ld (playerDir),a
;default stats
xor a
call loadPlayer ;load player ID 0 (franci)
xor a
ld hl,playerAnimation
ld (hl),a
ld hl,mapOverDraw ;variable to know which pass through the mapper we're at (si hay que dibujar el suelo o las mascaras)
ld (hl),1
ld hl,animationCounter
ld (hl),32
inc hl ;animation frame
ld (hl),a ;frame 0
ld (secondPulsado),a
ld a,MAP_START
ld de,(PLAY_Y_START*256)+PLAY_X_START
call changeMap