-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
98 lines (79 loc) · 4.95 KB
/
index.js
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
header({prg: 1, chr: 1, map: 0, mir: 1})
reset()
vblankwait(1)
clrmem()
vblankwait(2)
loadPalettes()
setBgPalette([
0x3b, 0x15, 0x25, 0x27,
0x3b, 0x19, 0x29, 0x39,
0x3b, 0x11, 0x21, 0x31,
0x3b, 0x17, 0x27, 0x37
])
setSpritePalette([
0x3b, 0x15, 0x25, 0x27,
0x3b, 0x19, 0x29, 0x39,
0x3b, 0x11, 0x21, 0x31,
0x3b, 0x17, 0x27, 0x37
])
loadSprites()
loadBg()
loadAttribute()
enableBg()
asm('NMI:')
setLowHighBytes()
joyInit()
joyRead({label: 'ReadA'})
joyRead({label: 'ReadB'})
joyRead({label: 'ReadSel'})
joyRead({label: 'ReadStart'})
joyRead({label: 'ReadUp', cb: moveUp})
joyRead({label: 'ReadDown', cb: moveDown})
joyRead({label: 'ReadLeft', cb: moveLeft})
joyRead({label: 'ReadRight', cb: moveRight, done: enableBg})
asm('\trti')
asm('\t.bank 1')
asm('\t.org $E000')
PaletteData()
addData({x: '80', y: '80', tile: '$08', attr: '0'})
addData({x: '88', y: '80', tile: '$09', attr: '0'})
addData({x: '80', y: '88', tile: '$18', attr: '0'})
addData({x: '88', y: '88', tile: '$19', attr: '0'})
sData()
defineBg([
261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,261,257,257,261,261,261,261,261,261,261,261,261,261,261,261,261,261,
261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,257,261,257,261,261,257,261,261,261,261,261,261,261,261,261,261,261,
261,257,261,261,261,261,261,261,261,261,261,261,261,257,257,257,261,257,261,257,257,261,261,261,261,261,261,261,261,261,261,261,
261,257,261,261,261,261,261,261,261,261,261,257,257,261,257,261,261,257,257,257,261,261,261,261,261,261,261,261,261,261,261,261,
261,257,261,261,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,261,261,261,261,261,261,261,261,
261,261,257,261,257,257,257,261,261,257,261,261,257,261,261,261,257,257,257,261,257,261,257,257,257,261,261,261,261,261,261,261,
261,261,257,261,261,261,261,257,257,257,257,257,257,257,257,257,257,257,257,512,257,257,257,261,257,261,261,261,261,261,261,261,
261,261,257,261,261,261,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,261,261,261,261,261,261,261,
257,257,257,257,257,257,257,257,257,261,262,263,264,265,266,267,268,269,270,271,272,257,257,257,257,257,257,257,257,257,257,257,
257,257,257,257,261,261,261,257,257,277,278,279,280,281,282,283,284,285,286,287,288,257,257,257,257,257,257,257,257,257,257,257,
257,257,257,257,257,257,257,257,257,293,294,295,296,297,298,299,300,301,302,303,304,257,257,261,261,261,261,261,261,261,261,261,
261,261,261,257,257,257,257,257,257,309,310,311,312,313,314,315,316,317,318,319,320,261,257,261,261,261,261,261,261,261,261,261,
261,261,261,261,257,257,257,257,257,325,326,327,328,329,330,331,332,333,334,335,336,257,257,257,261,261,261,261,261,261,261,261,
261,261,257,257,257,257,257,257,257,341,342,343,344,345,346,347,348,349,350,351,352,257,257,257,257,261,261,261,261,261,261,261,
257,257,257,257,257,257,257,257,257,357,358,359,360,361,362,363,364,365,366,367,368,257,261,261,257,261,261,261,261,261,261,261,
257,257,257,257,257,257,257,257,257,373,374,375,376,377,378,379,380,381,382,383,384,257,257,257,257,257,261,261,261,261,261,261,
257,257,257,257,257,257,257,257,257,389,390,391,392,393,394,395,396,397,398,399,400,257,257,257,257,257,261,261,261,261,261,261,
257,257,257,257,257,257,257,257,257,405,406,407,408,409,410,411,412,413,414,415,416,257,257,257,257,257,257,261,261,261,261,261,
261,261,257,261,257,261,257,257,257,421,422,423,424,425,426,427,428,429,430,431,432,257,257,257,257,257,257,261,261,261,261,261,
261,261,257,261,261,261,257,257,257,437,438,439,440,441,442,443,444,445,446,447,448,257,261,261,261,261,261,261,261,261,261,261,
261,261,257,257,257,257,257,257,257,257,257,257,257,257,372,373,257,257,257,257,261,257,261,261,261,261,261,261,261,261,261,261,
261,257,257,257,257,257,257,257,257,257,257,257,257,387,388,389,257,257,257,257,257,257,261,261,261,261,261,261,261,261,261,261,
261,261,257,261,257,257,257,261,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,261,261,261,261,261,261,261,261,
261,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,261,261,261,261,261,261,
261,261,257,257,257,261,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,261,261,
261,261,257,261,261,261,261,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,
261,261,257,261,261,261,261,261,261,261,257,261,261,261,261,261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,
261,261,257,261,261,261,261,261,261,257,261,261,261,261,261,261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,
261,261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,
261,261,257,261,261,261,261,261,261,261,261,261,261,261,261,257,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261
])
loadNametable()
attributeTable()
asm('\t.org $FFFA')
vec()
setChrLocation('./tiles.chr')