-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetatile_scrolling.mfk
More file actions
713 lines (574 loc) · 24 KB
/
metatile_scrolling.mfk
File metadata and controls
713 lines (574 loc) · 24 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
// compile with -t nes_small_v
import nes_joy
const word ppu_nametable0 = $2000
const word ppu_nametable1 = $2400
const word ppu_nametable2 = $2800
const word ppu_nametable3 = $2C00
const word ppu_attrtable0 = $23C0
const word ppu_attrtable1 = $27C0
const word ppu_attrtable2 = $2BC0
const word ppu_attrtable3 = $2FC0
const word ppu_pallete_ram = $3F00
array oam_buffer [256] @$200 // sprite buffer
byte nametable
byte current_column
byte next_column
byte next_screen
pointer screen_pointer
byte xscroll
bool scrolling_right
bool scrolling_left
byte previous_scroll
byte draw_counter
void main() {
init_sprites()
load_palletes()
clear_status_bar()
xscroll = 0
nametable = 0
current_column = 0
draw_counter = 0
previous_scroll = 0
next_screen = 0
scrolling_right = false
scrolling_left = false
screen_pointer = screen_metatiles.addr
//screen 1
draw_full_screen(0,0)
load_attr_column(0,0,0)
load_attr_column(1,0,1)
load_attr_column(2,0,2)
load_attr_column(3,0,3)
load_attr_column(4,0,4)
load_attr_column(5,0,5)
load_attr_column(6,0,6)
load_attr_column(7,0,7)
//screen 2
//draw_full_screen(1,16)
ppu_set_scroll(0,0)
ppu_wait_vblank()
ppu_ctrl = %10010000 // enable NMI, sprites from Pattern Table 0, background from Pattern Table 1
ppu_mask = %00011110 // enable sprites, enable background, no clipping on left side
while(true) {}
}
void nmi() {
ppu_oam_dma_write(oam_buffer.addr.hi)
read_joy1()
if input_dx > 0 {
scrolling_right = true
scrolling_left = false
}
else if input_dx < 0 {
//TODO: left scrolling
scrolling_right = false
scrolling_left = true
}
else {
scrolling_left = false
scrolling_right = false
}
//either scrolling right or have a column to finish drawing
if scrolling_right || (previous_scroll == 0 && draw_counter > 0) {
right_metatile_scroll()
//update the scroll variable
if scrolling_right {
update_scroll_right()
}
previous_scroll = 0
}
//either scrolling left or have a column to finish drawing
else if scrolling_left || (previous_scroll == 1 && draw_counter > 0) {
//left scroll logic
if scrolling_left {
update_scroll_left()
}
left_metatile_scroll()
previous_scroll = 1
}
ppu_set_scroll(xscroll,0)
ppu_ctrl = %10010000 | nametable
ppu_mask = %00011100
//game logic goes here
}
void irq() {
}
inline void update_scroll_left() {
xscroll -= 2
if xscroll >= $FE {
next_screen -= 1
if next_screen >= 4 {
next_screen = 3
}
nametable ^= %00000001
}
if (xscroll+2) & %00000111 == 0 {
current_column = next_screen * $20
current_column += xscroll/8
}
}
inline void left_metatile_scroll() {
if draw_counter == 0 && (xscroll & %00011111 == 0 || xscroll == $FE){
// about to enter a 32 pixel boundary, so
// draw the attributes
next_column = current_column
if xscroll == $FE {
//if xscroll = $FE then that means we haven't moved the screen yet,
//so the next column still needs to be drawn
draw_counter = 1
load_attr_column($07,nametable,next_column/4)
}
else if (xscroll != 0){
//if xscroll == 0 then that means loading attributes will be taken
//care of by xscroll == $FE next scroll, so skip it
load_attr_column(xscroll/32 - 1,nametable,next_column/4 - 1)
//we subtract 1 from the 1st and 3rd arguments because we're loading
//in attribute tables 1 step ahead in order to keep up with scrolling
}
}
else if (xscroll+2) & %00001111 == 0 || draw_counter > 0 {
// on a 16 pixel boundary, so
// load the appropriate tiles
next_column = current_column
draw_column_with_counter(xscroll/16,nametable,next_column/2)
}
}
inline void update_scroll_right() {
xscroll += 2
if xscroll == 0 {
next_screen += 1
if next_screen >= 4 {
next_screen = 0
}
nametable ^= %00000001
}
if xscroll & %00000111 == 0 {
current_column = next_screen * $20
current_column += xscroll/8
}
}
inline void right_metatile_scroll() {
// use an else-if here
// so that we don't load attrs and tiles
// on the same frame, as that would take
// too much time and bleed into screen rendering
if draw_counter == 0 && ((xscroll+2) & %00011111 == 0 || xscroll == 0){
// about to enter a 32 pixel boundary, so
// draw the attributes
next_column = current_column + $20
if next_column >= $80 {
// if we're on the final screen, then wrap around to the beginning
next_column -= $80
}
if xscroll == 0 {
//if xscroll = 0 then that means we haven't moved the screen yet,
//so the next column still needs to be drawn
draw_counter = 1
load_attr_column($00,nametable ^ %00000001,next_column/4)
}
else if (xscroll+2) != 0 {
//(xcroll+2) == 0 is taken care of by xscroll==0
load_attr_column((xscroll+2)/32,nametable ^ %00000001,next_column/4 + 1)
//add 1 to 3rd argument because we are loading the column that is one ahead
//of our loading seam
}
}
else if (xscroll & %00001111) == 0 || draw_counter > 0 {
// on a 16 pixel boundary, so
// load the appropriate tiles
next_column = current_column + $20
if next_column >= $80 {
// if we're on the final screen, then wrap around to the beginning
next_column -= $80
}
draw_column_with_counter(xscroll/16,nametable ^ %00000001,next_column/2)
}
}
void clear_status_bar() {
//clear the status bar to all sky tiles
byte i
//set ppu address increment to 1 so we can draw the left and right borders
//(allows us to draw to the nametable in vertical strips rather than horizontal)
ppu_ctrl = %00000000
read_ppu_status()
ppu_set_addr(ppu_nametable0)
for i,0,until,$80 {
ppu_write_data($24) //$24 = sky tile
}
ppu_set_addr(ppu_nametable1)
for i,0,until,$80 {
ppu_write_data($24) //$24 = sky tile
}
}
void load_attr_column(byte screen_column, byte nametable, byte attrs_column) {
byte i
pointer attrs_ptr
attrs_ptr = get_attrs_column(attrs_column)
//set ppu address increment to 1 so we can draw the left and right borders
//(allows us to draw to the nametable in vertical strips rather than horizontal)
ppu_ctrl = %00000000
read_ppu_status()
for i,0,until,$08 {
if nametable == 0 {
ppu_set_addr(ppu_attrtable0 + i*8 + screen_column)
}
else if nametable == 1 {
ppu_set_addr(ppu_attrtable1 + i*8 + screen_column)
}
else if nametable == 2 {
ppu_set_addr(ppu_attrtable2 + i*8 + screen_column)
}
else if nametable == 3 {
ppu_set_addr(ppu_attrtable3 + i*8 + screen_column)
}
ppu_write_data(attrs_ptr[i])
}
}
inline pointer get_attrs_column(byte metatiles_column) {
pointer attrs_ptr
attrs_ptr = metatiles_column
attrs_ptr *= $08
attrs_ptr += attrs
return attrs_ptr
}
void draw_full_screen(byte nametable, byte metatile_column) {
draw_column(0,nametable,metatile_column)
metatile_column += 1
draw_column(1,nametable,metatile_column)
metatile_column += 1
draw_column(2,nametable,metatile_column)
metatile_column += 1
draw_column(3,nametable,metatile_column)
metatile_column += 1
draw_column(4,nametable,metatile_column)
metatile_column += 1
draw_column(5,nametable,metatile_column)
metatile_column += 1
draw_column(6,nametable,metatile_column)
metatile_column += 1
draw_column(7,nametable,metatile_column)
metatile_column += 1
draw_column(8,nametable,metatile_column)
metatile_column += 1
draw_column(9,nametable,metatile_column)
metatile_column += 1
draw_column(10,nametable,metatile_column)
metatile_column += 1
draw_column(11,nametable,metatile_column)
metatile_column += 1
draw_column(12,nametable,metatile_column)
metatile_column += 1
draw_column(13,nametable,metatile_column)
metatile_column += 1
draw_column(14,nametable,metatile_column)
metatile_column += 1
draw_column(15,nametable,metatile_column)
}
void draw_column_with_counter(byte screen_column, byte nametable, byte metatiles_column) {
pointer metatiles_ptr
screen_column *= 2
metatiles_ptr = get_metatile_column(metatiles_column)
//set ppu address increment to 32 so we can draw the left and right borders
//(allows us to draw to the nametable in vertical strips rather than horizontal)
ppu_ctrl = %00000100
read_ppu_status()
if draw_counter == 0 || draw_counter == 1 {
draw_column_first_draw(nametable, screen_column, metatiles_ptr)
}
else if draw_counter == 2 {
draw_column_second_draw(nametable, screen_column, metatiles_ptr)
}
}
inline void draw_column_first_draw(byte nametable, byte screen_column, pointer metatiles_ptr) {
//first frame of the column draw
byte i
if nametable == 0 {
ppu_set_addr(ppu_nametable0 + $80 + screen_column)
}
else if nametable == 1 {
ppu_set_addr(ppu_nametable1 + $80 + screen_column)
}
else if nametable == 2 {
ppu_set_addr(ppu_nametable2 + $80 + screen_column)
}
else if nametable == 3 {
ppu_set_addr(ppu_nametable3 + $80 + screen_column)
}
//skip to $02 because the metatile data is structured to ignore the
//first two metatiles
for i,$02,until,$0F {
draw_metatile_first_column(metatiles_ptr[i])
}
draw_counter = 2
}
inline void draw_column_second_draw(byte nametable, byte screen_column, pointer metatiles_ptr) {
//second frame of the column draw
byte i
if nametable == 0 {
ppu_set_addr(ppu_nametable0 + $80 + screen_column + 1)
}
else if nametable == 1 {
ppu_set_addr(ppu_nametable1 + $80 + screen_column + 1)
}
else if nametable == 2 {
ppu_set_addr(ppu_nametable2 + $80 + screen_column + 1)
}
else if nametable == 3 {
ppu_set_addr(ppu_nametable3 + $80 + screen_column + 1)
}
//skip to $02 because the metatile data is structured to ignore the
//first two metatiles, and end before $0F because that byte is a junk
//byte as well
for i,$02,until,$0F {
draw_metatile_second_column(metatiles_ptr[i])
}
draw_counter = 0
}
void draw_column(byte screen_column, byte nametable, byte metatiles_column) {
byte i
pointer metatiles_ptr
screen_column *= 2
metatiles_ptr = get_metatile_column(metatiles_column)
//set ppu address increment to 32 so we can draw the left and right borders
//(allows us to draw to the nametable in vertical strips rather than horizontal)
ppu_ctrl = %00000100
read_ppu_status()
if nametable == 0 {
ppu_set_addr(ppu_nametable0 + $80 + screen_column)
}
else if nametable == 1 {
ppu_set_addr(ppu_nametable1 + $80 + screen_column)
}
else if nametable == 2 {
ppu_set_addr(ppu_nametable2 + $80 + screen_column)
}
else if nametable == 3 {
ppu_set_addr(ppu_nametable3 + $80 + screen_column)
}
//skip to $02 because the metatile data is structured to ignore the
//first two metatiles, and end before $0F because that byte is a junk
//byte as well
for i,$02,until,$0F {
draw_metatile_first_column(metatiles_ptr[i])
}
if nametable == 0 {
ppu_set_addr(ppu_nametable0 + $80 + screen_column + 1)
}
else if nametable == 1 {
ppu_set_addr(ppu_nametable1 + $80 + screen_column + 1)
}
else if nametable == 2 {
ppu_set_addr(ppu_nametable2 + $80 + screen_column + 1)
}
else if nametable == 3 {
ppu_set_addr(ppu_nametable3 + $80 + screen_column + 1)
}
//skip to $02 because the metatile data is structured to ignore the
//first two metatiles
for i,$02,until,$0F {
draw_metatile_second_column(metatiles_ptr[i])
}
}
inline pointer get_metatile_column(byte metatiles_column) {
pointer metatiles_ptr
metatiles_ptr = metatiles_column
metatiles_ptr *= $10
metatiles_ptr += screen_metatiles
return metatiles_ptr
}
inline void draw_metatile_first_column(byte metatile) {
pointer metatile_ptr
metatile_ptr = metatiles
metatile_ptr += metatile*4
ppu_write_data(metatile_ptr[0])
ppu_write_data(metatile_ptr[1])
}
inline void draw_metatile_second_column(byte metatile) {
pointer metatile_ptr
metatile_ptr = metatiles
metatile_ptr += metatile*4
ppu_write_data(metatile_ptr[2])
ppu_write_data(metatile_ptr[3])
}
void init_sprites() {
byte i
for i,0,to,255 {
if (i & %00000011) == 0 {
//each sprite takes up 4 bytes, and we want to edit
//the y position of each sprite (0th byte)
//so we use the %00000011 mask to write every 4th byte (every 0th sprite byte)
oam_buffer[i] = $ef // move the sprite off screen
}
else {
oam_buffer[i] = 0
}
}
}
void load_palletes() {
byte i
read_ppu_status() // read PPU status to reset the high/low latch
ppu_set_addr(ppu_pallete_ram) // point the PPU to palette ram
for i,0,until,$20 {
ppu_write_data(pallete[i])
}
}
inline asm void ppu_wait_vblank() {
vblankwait:
BIT $2002
! BPL vblankwait
? RTS
}
const array pallete = [
$0F,$17,$18,$29,$34,$38,$18,$2A,$38,$39,$3A,$3B,$3C,$3D,$3E,$0F, //nametable palettes
$3C,$10,$37,$0F,$07,$10,$2D,$0F,$0F,$00,$0F,$36,$31,$02,$38,$3C //sprite palettes
]
//define each metatile
const array metatiles = [
//Tile positions:
//top-left bot-left top-right bot-right
$24, $24, $24, $24, // $00, should always be
// all background
$30, $31, $30, $31, // $01, basic top ground tile
$31, $31, $31, $31, // $02, all ground tile
$24, $32, $24, $24, // $03, floor flower tile
$24, $24, $24, $33, // $04, floor grass tile
$24, $36, $24, $37, // $05, bushes tile A
$24, $30, $24, $24 // $06, single-tile platform
]
//contains 4 screens worth of metatiles
//each metatile column is 16 bytes long
//each metatile column contains 3 bytes of wasted space, two at the top, and one at end
//(this is a holdover from one of my older projects, you could rearange it so that all
//the unused bytes are contiguous, you'd just have to change the loops in the draw_column functions)
const array screen_metatiles = [
//note: all columns will have 3 wasted bytes
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $03, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $04, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $06, $00, $00, $00, $00,
$00, $00, $00, $00, $05, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $01, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $03, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $01, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $03, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $04, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $01, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $01, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $01, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $01, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $01, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $01, $00, $00, $00, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $03, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $04, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF, // 15 meta tiles to fill a column plus one filler tile
$00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $01, $02, $FF // 15 meta tiles to fill a column plus one filler tile
]
const array attrs = file("attrib.bin")
segment(chrrom) const array graphics @ $0000 = file("nesthing.chr")