-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_memory.ras
98 lines (71 loc) · 3.61 KB
/
_memory.ras
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
// -------------------------------------------------------------------------------
// Variables: (for assignable/changing data, use these addresses)
// Address of bitmap (screen and characters)
@userdata $1000 $1FFF "Bitmap"
// ------------------------------
// Zero Page: $35 - $63
// game tick counter + 1 per FPS
ticks : byte at $35; // incremented 1 per frame
oldticks : byte at $3d;
// player variables
px, py: byte at $3e; // position
pd: byte at $40; // direction
i, j, k, m: byte at $41; // general counters
musTime : byte at $45; // music
musDelay : byte at $46;
musSustain : byte at $47;
// ------------------------------
// Cassette buffer: $033C-$03FB (828-1019)
// ------------------------------
// Working Zero Page pointers
p1: pointer; // general pointer
pa, pb: pointer; // player sprite
cm, m1: pointer; // Music pointer
// -------------------------------------------------------------------------------
// Data
// player sprites
@vbmexportchunk "spr/sprites.flf" "spr/sprRight.bin" 0 8 1 0 // S W H M
@vbmexportchunk "spr/sprites.flf" "spr/sprLeft.bin" 40 8 1 0 // S W H M
@vbmexportchunk "spr/sprites.flf" "spr/sprVert1.bin" 80 8 1 0 // S W H M
@vbmexportchunk "spr/sprites.flf" "spr/sprVert2.bin" 120 8 1 0 // S W H M
// forest graphics
@vbmexportchunk "chr/graphics.flf" "chr/tiles.bin" 86 9 1 0 // S W H M
// Title screen graphics (split into parts)
@vbmexportchunk "chr/titles.flf" "chr/titles-1.bin" 0 5 5 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-2.bin" 5 4 5 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-3.bin" 89 2 3 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-4.bin" 51 2 4 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-5.bin" 93 3 3 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-6.bin" 16 4 5 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-7.bin" 20 4 3 0 // S W H M
@vbmexportchunk "chr/titles.flf" "chr/titles-8.bin" 201 15 1 0 // S W H M
// memory - load addresses
const aBaseData: address = $3a00;
const aSprRight: address = aBaseData;
const aSprLeft: address = aSprRight + ( sprHeight*8 );
const aSprVert1: address = aSprLeft + ( sprHeight*8 );
const aSprVert2: address = aSprVert1 + ( sprHeight*8 );
const aChrTiles: address = aSprVert2 + ( sprHeight*8 );
const aChrTitle1: address = aChrTiles + ( 9*8 );
const aChrTitle2: address = aChrTitle1 + ( 5*5*8 );
const aChrTitle3: address = aChrTitle2 + ( 4*5*8 );
const aChrTitle4: address = aChrTitle3 + ( 2*3*8 );
const aChrTitle5: address = aChrTitle4 + ( 2*4*8 );
const aChrTitle6: address = aChrTitle5 + ( 3*3*8 );
const aChrTitle7: address = aChrTitle6 + ( 4*5*8 );
const aChrTitle8: address = aChrTitle7 + ( 4*3*8 );
// incbin data
sprRight: incbin( "spr/sprRight.bin", aSprRight );
sprLeft: incbin( "spr/sprLeft.bin", aSprLeft );
sprVert1: incbin( "spr/sprVert1.bin", aSprVert1 );
sprVert2: incbin( "spr/sprVert2.bin", aSprVert2 );
chrTiles: incbin( "chr/tiles.bin", aChrTiles );
// Title graphics
chrTitle1: incbin( "chr/titles-1.bin", aChrTitle1 ); // large first char
chrTitle2: incbin( "chr/titles-2.bin", aChrTitle2 ); // large second char
chrTitle3: incbin( "chr/titles-3.bin", aChrTitle3 ); // small tree 1
chrTitle4: incbin( "chr/titles-4.bin", aChrTitle4 ); // tall tree 1
chrTitle5: incbin( "chr/titles-5.bin", aChrTitle5 ); // small tree 2
chrTitle6: incbin( "chr/titles-6.bin", aChrTitle6 ); // tall tree 2
chrTitle7: incbin( "chr/titles-7.bin", aChrTitle7 ); // wide tree
chrTitle8: incbin( "chr/titles-8.bin", aChrTitle8 ); // Title in English