git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit b774c3d6b5c2e3360987fe86a5516992b42b8974
parent 05a81b7d4cdc70ad8adda5e2bbc8c800e7d0cdc5
Author: Toxa <56631470+untoxa@users.noreply.github.com>
Date:   Thu,  5 Nov 2020 23:13:36 +0300

Merge pull request #76 from bbbbbr/develop_movesamples

Move Example Projects into separate folders and give them individual makefiles
Diffstat:
Mgbdk-lib/examples/gb/Makefile137+++++++++++--------------------------------------------------------------------
Agbdk-lib/examples/gb/banks/Makefile63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rgbdk-lib/examples/gb/bank_0.c -> gbdk-lib/examples/gb/banks/bank_0.c0
Rgbdk-lib/examples/gb/bank_1.c -> gbdk-lib/examples/gb/banks/bank_1.c0
Rgbdk-lib/examples/gb/bank_2.c -> gbdk-lib/examples/gb/banks/bank_2.c0
Rgbdk-lib/examples/gb/bank_3.c -> gbdk-lib/examples/gb/banks/bank_3.c0
Rgbdk-lib/examples/gb/banks.c -> gbdk-lib/examples/gb/banks/banks.c0
Agbdk-lib/examples/gb/banks_farprt/Makefile34++++++++++++++++++++++++++++++++++
Rgbdk-lib/examples/gb/bank2code.c -> gbdk-lib/examples/gb/banks_farprt/bank2code.c0
Rgbdk-lib/examples/gb/farptr.c -> gbdk-lib/examples/gb/banks_farprt/banks_farptr.c0
Rgbdk-lib/examples/gb/MBC1_RAM_INIT.s -> gbdk-lib/examples/gb/banks_new/MBC1_RAM_INIT.s0
Agbdk-lib/examples/gb/banks_new/Makefile32++++++++++++++++++++++++++++++++
Rgbdk-lib/examples/gb/new_banks.c -> gbdk-lib/examples/gb/banks_new/banks_new.c0
Agbdk-lib/examples/gb/bcd/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/bcd.c -> gbdk-lib/examples/gb/bcd/bcd.c0
Mgbdk-lib/examples/gb/colorbar/Makefile4++++
Agbdk-lib/examples/gb/comm/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/comm.c -> gbdk-lib/examples/gb/comm/comm.c0
Agbdk-lib/examples/gb/crash/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/crash.c -> gbdk-lib/examples/gb/crash/crash.c0
Mgbdk-lib/examples/gb/dscan/Makefile4++++
Agbdk-lib/examples/gb/filltest/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/filltest.c -> gbdk-lib/examples/gb/filltest/filltest.c0
Agbdk-lib/examples/gb/fonts/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/fonts.c -> gbdk-lib/examples/gb/fonts/fonts.c0
Dgbdk-lib/examples/gb/fprpn.c104-------------------------------------------------------------------------------
Agbdk-lib/examples/gb/fprpn/Makefile20++++++++++++++++++++
Agbdk-lib/examples/gb/fprpn/fprpn.c105+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Agbdk-lib/examples/gb/galaxy/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/galaxy.c -> gbdk-lib/examples/gb/galaxy/galaxy.c0
Mgbdk-lib/examples/gb/gb-dtmf/Makefile6+++++-
Mgbdk-lib/examples/gb/gb-dtmf/gb-dtmf.c60++++++++++++++++++++++++++++++------------------------------
Agbdk-lib/examples/gb/irq/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/irq.c -> gbdk-lib/examples/gb/irq/irq.c0
Agbdk-lib/examples/gb/lcd_isr_wobble/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/wobble.c -> gbdk-lib/examples/gb/lcd_isr_wobble/lcd_isr_wobble.c0
Agbdk-lib/examples/gb/paint/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/paint.c -> gbdk-lib/examples/gb/paint/paint.c0
Agbdk-lib/examples/gb/ram_function/Makefile32++++++++++++++++++++++++++++++++
Rgbdk-lib/examples/gb/ram_fn.c -> gbdk-lib/examples/gb/ram_function/ram_fn.c0
Agbdk-lib/examples/gb/rand/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/rand.c -> gbdk-lib/examples/gb/rand/rand.c0
Agbdk-lib/examples/gb/rpn/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/rpn.c -> gbdk-lib/examples/gb/rpn/rpn.c0
Agbdk-lib/examples/gb/samptest/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/samptest.c -> gbdk-lib/examples/gb/samptest/samptest.c0
Mgbdk-lib/examples/gb/sgb_border/Makefile4++++
Agbdk-lib/examples/gb/sgb_multiplayer/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/multiplayer.c -> gbdk-lib/examples/gb/sgb_multiplayer/sgb_multiplayer.c0
Agbdk-lib/examples/gb/sgb_pong/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/pong.c -> gbdk-lib/examples/gb/sgb_pong/sgb_pong.c0
Agbdk-lib/examples/gb/sound/Makefile17+++++++++++++++++
Rgbdk-lib/examples/gb/sound.c -> gbdk-lib/examples/gb/sound/sound.c0
Dgbdk-lib/examples/gb/space.s1296-------------------------------------------------------------------------------
Agbdk-lib/examples/gb/space/Makefile17+++++++++++++++++
Agbdk-lib/examples/gb/space/space.s1296+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56 files changed, 1919 insertions(+), 1550 deletions(-)

diff --git a/gbdk-lib/examples/gb/Makefile b/gbdk-lib/examples/gb/Makefile @@ -1,119 +1,17 @@ -CC = ../../bin/lcc -Wa-l -Wl-m -Wl-j - -BINS = galaxy.gb \ - space.gb \ - paint.gb \ - rpn.gb \ - rand.gb \ - comm.gb \ - irq.gb \ - filltest.gb \ - ram_fn.gb \ - fonts.gb \ - samptest.gb \ - banks.gb \ - new_banks.gb \ - farptr.gb \ - bcd.gb \ - wobble.gb \ - crash.gb \ - multiplayer.gb \ - pong.gb - -# sound.gb: Cant do bitfields -OTHER = sound.gb \ - -all: $(BINS) - -make.bat: Makefile - @echo "REM Automatically generated from Makefile" > make.bat - @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat - -%.o: %.c - $(CC) -c -o $@ $< - -%.s: %.c - $(CC) -S -o $@ $< - -%.o: %.s - $(CC) -c -o $@ $< - -%.gb: %.o - $(CC) -o $@ $< - -clean: - rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi - -############################################################ -# Multiple bank example - -# Compile bank 0 (no ROM) -# RAM bank 0 : -Wf-ba0 -# -bank_0.o: bank_0.c - $(CC) -Wf-ba0 -c -o $@ $< - -# Compile bank 1 (ROM+RAM) -# ROM bank 1 : -Wf-bo1 -# RAM bank 1 : -Wf-ba1 -# -bank_1.o: bank_1.c - $(CC) -Wf-bo1 -Wf-ba1 -c -o $@ $< - -# Compile bank 2 (ROM+RAM) -# ROM bank 2 : -Wf-bo2 -# RAM bank 2 : -Wf-ba2 -# -bank_2.o: bank_2.c - $(CC) -Wf-bo2 -Wf-ba2 -c -o $@ $< - -# Compile bank 3 (ROM+RAM) -# ROM bank 3 : -Wf-bo3 -# RAM bank 3 : -Wf-ba3 -# -bank_3.o: bank_3.c - $(CC) -Wf-bo3 -Wf-ba3 -c -o $@ $< - -# Link banks -# ROM+MBC1+RAM : -Wl-yt2 -# 4 ROM banks : -Wl-yo4 -# 4 RAM banks : -Wl-ya4 -# -banks.gb: banks.o bank_0.o bank_1.o bank_2.o bank_3.o - $(CC) -Wl-yt2 -Wl-yo4 -Wl-ya4 -o $@ banks.o bank_0.o bank_1.o bank_2.o bank_3.o - -############################################################ -# Far pointers example - -bank2code.o: bank2code.c - $(CC) -Wf-bo1 -c -o $@ $< - -farptr.gb: farptr.o bank2code.o - $(CC) -Wl-yt1 -Wl-yo4 -o $@ bank2code.o farptr.o - -############################################################ -# Multiple banks NEW example - -new_banks.gb: MBC1_RAM_INIT.o new_banks.o - $(CC) -Wl-yt2 -Wl-yo4 -Wl-ya4 -o $@ MBC1_RAM_INIT.o new_banks.o - -############################################################ -# RAM function example - -ram_fn.o: ram_fn.c - $(CC) -D_inc_ram=0xD000 -D_inc_hiram=0xFFA0 -c -o $@ $< - -ram_fn.gb: ram_fn.o - $(CC) -Wl-g_inc_ram=0xD000 -Wl-g_inc_hiram=0xFFA0 -o $@ ram_fn.o - -############################################################ -# SGB multiplayer example - -multiplayer.gb: multiplayer.o - $(CC) -Wm-ys -o $@ $< - -############################################################ -# SGB pong example - -pong.gb: pong.o - $(CC) -Wm-ys -o $@ $< +# Register all subdirectories in the project's root directory. +SUBDIRS := $(wildcard */.) + +# Top-level phony targets. +all clean make.bat: $(SUBDIRS) FORCE +# Similar to: +# .PHONY: all clean +# all clean: $(SUBDIRS) +# GNU's .PHONY target is more efficient in that it explicitly declares non-files. + +# Recurse `make` into each subdirectory +# Pass along targets specified at command-line (if any). +$(SUBDIRS): FORCE + $(MAKE) -C $@ $(MAKECMDGOALS) + +# Force targets. +FORCE: + diff --git a/gbdk-lib/examples/gb/banks/Makefile b/gbdk-lib/examples/gb/banks/Makefile @@ -0,0 +1,63 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = banks.gb \ + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +%.o: %.c + $(CC) -c -o $@ $< + +%.s: %.c + $(CC) -S -o $@ $< + +%.o: %.s + $(CC) -c -o $@ $< + +%.gb: %.o + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + +############################################################ +# Multiple bank example + +# Compile bank 0 (no ROM) +# RAM bank 0 : -Wf-ba0 +# +bank_0.o: bank_0.c + $(CC) -Wf-ba0 -c -o $@ $< + +# Compile bank 1 (ROM+RAM) +# ROM bank 1 : -Wf-bo1 +# RAM bank 1 : -Wf-ba1 +# +bank_1.o: bank_1.c + $(CC) -Wf-bo1 -Wf-ba1 -c -o $@ $< + +# Compile bank 2 (ROM+RAM) +# ROM bank 2 : -Wf-bo2 +# RAM bank 2 : -Wf-ba2 +# +bank_2.o: bank_2.c + $(CC) -Wf-bo2 -Wf-ba2 -c -o $@ $< + +# Compile bank 3 (ROM+RAM) +# ROM bank 3 : -Wf-bo3 +# RAM bank 3 : -Wf-ba3 +# +bank_3.o: bank_3.c + $(CC) -Wf-bo3 -Wf-ba3 -c -o $@ $< + +# Link banks +# ROM+MBC1+RAM : -Wl-yt2 +# 4 ROM banks : -Wl-yo4 +# 4 RAM banks : -Wl-ya4 +# +banks.gb: banks.o bank_0.o bank_1.o bank_2.o bank_3.o + $(CC) -Wl-yt2 -Wl-yo4 -Wl-ya4 -o $@ banks.o bank_0.o bank_1.o bank_2.o bank_3.o + diff --git a/gbdk-lib/examples/gb/bank_0.c b/gbdk-lib/examples/gb/banks/bank_0.c diff --git a/gbdk-lib/examples/gb/bank_1.c b/gbdk-lib/examples/gb/banks/bank_1.c diff --git a/gbdk-lib/examples/gb/bank_2.c b/gbdk-lib/examples/gb/banks/bank_2.c diff --git a/gbdk-lib/examples/gb/bank_3.c b/gbdk-lib/examples/gb/banks/bank_3.c diff --git a/gbdk-lib/examples/gb/banks.c b/gbdk-lib/examples/gb/banks/banks.c diff --git a/gbdk-lib/examples/gb/banks_farprt/Makefile b/gbdk-lib/examples/gb/banks_farprt/Makefile @@ -0,0 +1,34 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = banks_farptr.gb \ + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +%.o: %.c + $(CC) -c -o $@ $< + +%.s: %.c + $(CC) -S -o $@ $< + +%.o: %.s + $(CC) -c -o $@ $< + +%.gb: %.o + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + +############################################################ +# Banks using Far pointers example + +bank2code.o: bank2code.c + $(CC) -Wf-bo1 -c -o $@ $< + +banks_farptr.gb: banks_farptr.o bank2code.o + $(CC) -Wl-yt1 -Wl-yo4 -o $@ bank2code.o banks_farptr.o + diff --git a/gbdk-lib/examples/gb/bank2code.c b/gbdk-lib/examples/gb/banks_farprt/bank2code.c diff --git a/gbdk-lib/examples/gb/farptr.c b/gbdk-lib/examples/gb/banks_farprt/banks_farptr.c diff --git a/gbdk-lib/examples/gb/MBC1_RAM_INIT.s b/gbdk-lib/examples/gb/banks_new/MBC1_RAM_INIT.s diff --git a/gbdk-lib/examples/gb/banks_new/Makefile b/gbdk-lib/examples/gb/banks_new/Makefile @@ -0,0 +1,32 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = banks_new.gb + + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +%.o: %.c + $(CC) -c -o $@ $< + +%.s: %.c + $(CC) -S -o $@ $< + +%.o: %.s + $(CC) -c -o $@ $< + +%.gb: %.o + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + + +############################################################ +# Multiple banks NEW method example + +banks_new.gb: MBC1_RAM_INIT.o banks_new.o + $(CC) -Wl-yt2 -Wl-yo4 -Wl-ya4 -o $@ MBC1_RAM_INIT.o banks_new.o diff --git a/gbdk-lib/examples/gb/new_banks.c b/gbdk-lib/examples/gb/banks_new/banks_new.c diff --git a/gbdk-lib/examples/gb/bcd/Makefile b/gbdk-lib/examples/gb/bcd/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = bcd.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/bcd.c b/gbdk-lib/examples/gb/bcd/bcd.c diff --git a/gbdk-lib/examples/gb/colorbar/Makefile b/gbdk-lib/examples/gb/colorbar/Makefile @@ -6,6 +6,10 @@ BINS = colorbar.gb all: $(BINS) +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< diff --git a/gbdk-lib/examples/gb/comm/Makefile b/gbdk-lib/examples/gb/comm/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = comm.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/comm.c b/gbdk-lib/examples/gb/comm/comm.c diff --git a/gbdk-lib/examples/gb/crash/Makefile b/gbdk-lib/examples/gb/crash/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = crash.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/crash.c b/gbdk-lib/examples/gb/crash/crash.c diff --git a/gbdk-lib/examples/gb/dscan/Makefile b/gbdk-lib/examples/gb/dscan/Makefile @@ -4,6 +4,10 @@ BINS = dscan.gb all: $(BINS) +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + %.o: %.c $(CC) -c -o $@ $< diff --git a/gbdk-lib/examples/gb/filltest/Makefile b/gbdk-lib/examples/gb/filltest/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = filltest.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/filltest.c b/gbdk-lib/examples/gb/filltest/filltest.c diff --git a/gbdk-lib/examples/gb/fonts/Makefile b/gbdk-lib/examples/gb/fonts/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = fonts.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/fonts.c b/gbdk-lib/examples/gb/fonts/fonts.c diff --git a/gbdk-lib/examples/gb/fprpn.c b/gbdk-lib/examples/gb/fprpn.c @@ -1,104 +0,0 @@ -#include <stdio.h> - -#define MAXOP 40 -#define NUMBER '0' -#define STACKSIZE 40 - -UBYTE sp; -float stack[STACKSIZE]; - -char s[MAXOP]; -UBYTE pos; -float f; - -void push(float f) -{ - if(sp < STACKSIZE) - stack[sp++] = f; - else - puts("Stack full"); -} - -float pop() -{ - if(sp > 0) - return stack[--sp]; - else - puts("Stack empty"); - return 0.0; -} - -float top() -{ - if(sp > 0) - return stack[sp-1]; - else - puts("Stack empty"); - return 0.0; -} - -BYTE read_op() -{ - if(pos == 0) { - gets(s); - } - - while(s[pos] == ' ' || s[pos] == '\t') - pos++; - - if(s[pos] == '\0') { - pos = 0; - return('\n'); - } - - if(!isdigit(s[pos])) - return(s[pos++]); - - f = s[pos] - '0'; - while(isdigit(s[++pos])) { - BYTE i = s[pos] - '0'; - f = 10.0 * f; - f += (float)i; - } -/* f = 10.0 * f + (float)(BYTE)(s[pos] - '0'); */ - - return NUMBER; -} - -void main() -{ - BYTE type; - float op2; - - puts("FP RPN Calculator"); - sp = 0; - pos = 0; - - while((type = read_op(s)) != 0) { - switch(type) { - case NUMBER: - push(f); - break; - case '+': - push(pop() + pop()); - break; - case '*': - push(pop() * pop()); - break; - case '-': - op2 = pop(); - push(pop() - op2); - break; - case '/': - op2 = pop(); - if(op2 != 0) - push(pop() / op2); - else - puts("Divide by 0"); - break; - case '\n': - printf("==> %f\n", top()); - break; - } - } -} diff --git a/gbdk-lib/examples/gb/fprpn/Makefile b/gbdk-lib/examples/gb/fprpn/Makefile @@ -0,0 +1,20 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +# Disabled building this for now since it's broken +BINS = +# BINS = fprpn.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat +# Disabled building this for now since it's broken +# @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/fprpn/fprpn.c b/gbdk-lib/examples/gb/fprpn/fprpn.c @@ -0,0 +1,105 @@ +#include <stdio.h> +#include <ctype.h> + +#define MAXOP 40 +#define NUMBER '0' +#define STACKSIZE 40 + +UBYTE sp; +float stack[STACKSIZE]; + +char s[MAXOP]; +UBYTE pos; +float f; + +void push(float f) +{ + if(sp < STACKSIZE) + stack[sp++] = f; + else + puts("Stack full"); +} + +float pop() +{ + if(sp > 0) + return stack[--sp]; + else + puts("Stack empty"); + return 0.0; +} + +float top() +{ + if(sp > 0) + return stack[sp-1]; + else + puts("Stack empty"); + return 0.0; +} + +BYTE read_op() +{ + if(pos == 0) { + gets(s); + } + + while(s[pos] == ' ' || s[pos] == '\t') + pos++; + + if(s[pos] == '\0') { + pos = 0; + return('\n'); + } + + if(!isdigit(s[pos])) + return(s[pos++]); + + f = s[pos] - '0'; + while(isdigit(s[++pos])) { + BYTE i = s[pos] - '0'; + f = 10.0 * f; + f += (float)i; + } +/* f = 10.0 * f + (float)(BYTE)(s[pos] - '0'); */ + + return NUMBER; +} + +void main() +{ + BYTE type; + float op2; + + puts("FP RPN Calculator"); + sp = 0; + pos = 0; + + while((type = read_op(s)) != 0) { + switch(type) { + case NUMBER: + push(f); + break; + case '+': + push(pop() + pop()); + break; + case '*': + push(pop() * pop()); + break; + case '-': + op2 = pop(); + push(pop() - op2); + break; + case '/': + op2 = pop(); + if(op2 != 0) + push(pop() / op2); + else + puts("Divide by 0"); + break; + case '\n': + printf("==> %f\n", top()); + break; + } + } +} diff --git a/gbdk-lib/examples/gb/galaxy/Makefile b/gbdk-lib/examples/gb/galaxy/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = galaxy.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/galaxy.c b/gbdk-lib/examples/gb/galaxy/galaxy.c diff --git a/gbdk-lib/examples/gb/gb-dtmf/Makefile b/gbdk-lib/examples/gb/gb-dtmf/Makefile @@ -4,9 +4,13 @@ BINS = gb-dtmf.gb all: $(BINS) +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + %.s: %.c $(CC) -S -o $@ $< - + %.o: %.c $(CC) -c -o $@ $< diff --git a/gbdk-lib/examples/gb/gb-dtmf/gb-dtmf.c b/gbdk-lib/examples/gb/gb-dtmf/gb-dtmf.c @@ -19,7 +19,7 @@ #include "key_num.c" /* Sprite pattern for each key pad */ #include "cursor.c" /* cursor pattern */ -/* +/* usage of BG data file name number of BG type of matrix aount ------------------------------------------------- @@ -69,7 +69,7 @@ */ /* We have to calculate the frequency as followin formula - + DTMF has two set frequency, we have to decide Row & Column with each digit('0','1','2'...) */ @@ -82,9 +82,9 @@ #define R1 0x44U /* 697Hz, 697Hz */ #define R2 0x56U /* 770Hz, 770Hz */ #define R3 0x66U /* 852Hz, 851Hz */ -#define R4 0x75U /* 941Hz, 942Hz */ +#define R4 0x75U /* 941Hz, 942Hz */ -const unsigned char row[4] = {R1,R2,R3,R4}; /* DTMF frequency strage of Row */ +const unsigned char row[4] = {R1,R2,R3,R4}; /* DTMF frequency strage of Row */ const unsigned char col[4] = {C1,C2,C3,C4}; /* DTMF frequency strage of Col */ /* It is possible to set up initial screen by each BG data. */ @@ -116,7 +116,7 @@ const unsigned char dtmf_tile[] = { }; /* - Button image + Button image Normal buttons are created by 3tiles x 3tiles(24pixels x 24pixels) Dialing button is created by 6tiles x 3tiles(48pixels x 24pixels) */ @@ -187,12 +187,12 @@ void init_dial() void dialtone(UWORD dtmf_on, UWORD dtmf_off, char str[20]) { UBYTE i = 0; - + while(str[i]){ switch(str[i]){ case '1': NR13_REG = R1; - NR23_REG = C1; + NR23_REG = C1; break; case '2': NR13_REG = R1; @@ -200,72 +200,72 @@ void dialtone(UWORD dtmf_on, UWORD dtmf_off, char str[20]) break; case '3': NR13_REG = R1; - NR23_REG = C3; + NR23_REG = C3; break; case 'A': case 'a': NR13_REG = R1; - NR23_REG = C4; + NR23_REG = C4; break; case '4': NR13_REG = R2; - NR23_REG = C1; + NR23_REG = C1; break; case '5': NR13_REG = R2; - NR23_REG = C2; + NR23_REG = C2; break; case '6': NR13_REG = R2; - NR23_REG = C3; + NR23_REG = C3; break; case 'B': case 'b': NR13_REG = R2; - NR23_REG = C4; + NR23_REG = C4; break; case '7': NR13_REG = R3; - NR23_REG = C1; + NR23_REG = C1; break; case '8': NR13_REG = R3; - NR23_REG = C2; + NR23_REG = C2; break; case '9': NR13_REG = R3; - NR23_REG = C3; + NR23_REG = C3; break; case 'C': case 'c': NR13_REG = R3; - NR23_REG = C4; + NR23_REG = C4; break; case '*': NR13_REG = R4; - NR23_REG = C1; + NR23_REG = C1; break; case '0': NR13_REG = R4; - NR23_REG = C2; + NR23_REG = C2; break; case '#': NR13_REG = R4; - NR23_REG = C3; + NR23_REG = C3; break; case 'D': case 'd': NR13_REG = R4; - NR23_REG = C4; + NR23_REG = C4; break; case ',': delay(dtmf_on); /* keep on */ delay(dtmf_off); /* keep off */ - + default: NR51_REG = 0x00U; /* sound off */ goto skip; - + } NR24_REG = 0x87U; /* ch2 tips */ NR51_REG = 0x33U; /* sound on */ @@ -502,13 +502,13 @@ void init_key() move_sprite(22, key_x, key_y); } -void init_bkg() +void init_background() { /* Initialize the background */ set_bkg_data( 0, 9, frame_lcd); set_bkg_data( 9, 9, break_btn); set_bkg_data(18, 9, press_btn); - + set_bkg_tiles(0, 0, 20, 18, dtmf_tile); } @@ -549,13 +549,13 @@ void main() off_time = DTMF_OFF; disable_interrupts(); - + SPRITES_8x8; /* sprites are 8x8 */ init_dial(); - - init_bkg(); - + + init_background(); + init_key(); init_cursor(); @@ -594,7 +594,7 @@ void main() /* sound output on */ NR51_REG = 0x33U; } - + /* '?' button */ /* appear the title during press A button */ if(i == 5 && j == 0 && !non_flick){ diff --git a/gbdk-lib/examples/gb/irq/Makefile b/gbdk-lib/examples/gb/irq/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = irq.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/irq.c b/gbdk-lib/examples/gb/irq/irq.c diff --git a/gbdk-lib/examples/gb/lcd_isr_wobble/Makefile b/gbdk-lib/examples/gb/lcd_isr_wobble/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = lcd_isr_wobble.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/wobble.c b/gbdk-lib/examples/gb/lcd_isr_wobble/lcd_isr_wobble.c diff --git a/gbdk-lib/examples/gb/paint/Makefile b/gbdk-lib/examples/gb/paint/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = paint.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/paint.c b/gbdk-lib/examples/gb/paint/paint.c diff --git a/gbdk-lib/examples/gb/ram_function/Makefile b/gbdk-lib/examples/gb/ram_function/Makefile @@ -0,0 +1,32 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = ram_fn.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +%.o: %.c + $(CC) -c -o $@ $< + +%.s: %.c + $(CC) -S -o $@ $< + +%.o: %.s + $(CC) -c -o $@ $< + +%.gb: %.o + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + + +ram_fn.o: ram_fn.c + $(CC) -D_inc_ram=0xD000 -D_inc_hiram=0xFFA0 -c -o $@ $< + +ram_fn.gb: ram_fn.o + $(CC) -Wl-g_inc_ram=0xD000 -Wl-g_inc_hiram=0xFFA0 -o $@ ram_fn.o + diff --git a/gbdk-lib/examples/gb/ram_fn.c b/gbdk-lib/examples/gb/ram_function/ram_fn.c diff --git a/gbdk-lib/examples/gb/rand/Makefile b/gbdk-lib/examples/gb/rand/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = rand.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/rand.c b/gbdk-lib/examples/gb/rand/rand.c diff --git a/gbdk-lib/examples/gb/rpn/Makefile b/gbdk-lib/examples/gb/rpn/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = rpn.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/rpn.c b/gbdk-lib/examples/gb/rpn/rpn.c diff --git a/gbdk-lib/examples/gb/samptest/Makefile b/gbdk-lib/examples/gb/samptest/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = samptest.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/samptest.c b/gbdk-lib/examples/gb/samptest/samptest.c diff --git a/gbdk-lib/examples/gb/sgb_border/Makefile b/gbdk-lib/examples/gb/sgb_border/Makefile @@ -3,5 +3,9 @@ CC = ../../../bin/lcc all: $(CC) -Wm-ys -o border.gb border.c sgb_border.c +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + clean: rm -f *.o *.lst *.map *.gb *.ihx *.sym *.cdb *.adb *.asm diff --git a/gbdk-lib/examples/gb/sgb_multiplayer/Makefile b/gbdk-lib/examples/gb/sgb_multiplayer/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = sgb_multiplayer.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/multiplayer.c b/gbdk-lib/examples/gb/sgb_multiplayer/sgb_multiplayer.c diff --git a/gbdk-lib/examples/gb/sgb_pong/Makefile b/gbdk-lib/examples/gb/sgb_pong/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = sgb_pong.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/pong.c b/gbdk-lib/examples/gb/sgb_pong/sgb_pong.c diff --git a/gbdk-lib/examples/gb/sound/Makefile b/gbdk-lib/examples/gb/sound/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = sound.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.c + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/sound.c b/gbdk-lib/examples/gb/sound/sound.c diff --git a/gbdk-lib/examples/gb/space.s b/gbdk-lib/examples/gb/space.s @@ -1,1296 +0,0 @@ - ;; Little demo illustrating how to use the graphical possibilities - ;; of the GB (background, window and animated sprite) - ;; I have used fixed-point values for both the position and - ;; speed of objects to get smooth movements - ;; - ;; OBJ data : 0x8000 -> 0x8FFF (unsigned) - ;; Window data : 0x8800 -> 0x97FF (signed) - ;; Background data : 0x8800 -> 0x97FF (signed) - ;; - ;; Tiled 0xFC -> 0xFF are standard tiles (all black -> all white) - ;; - ;; Keys: - ;; Arrow keys : Change the speed (and direction) of the sprite - ;; Arrow keys + A : Change the speed (and direction) of the window - ;; Arrow keys + B : Change the speed (and direction) of the background - ;; START : Open/close the door - ;; SELECT : Basic fading effect - ;; - ;; Note that the window is kept in the lower right part of the screen - ;; since it can't be made transparent - - .include "../../lib/small/asxxxx/global.s" - - .globl .init_vram - .globl .copy_vram - .globl .init_wtt - .globl .init_btt - .globl .set_xy_wtt - .globl .mv_sprite - .globl .set_sprite_prop - .globl .set_sprite_tile - .globl .jpad - - .NBDFRAMES = .endfilm-.film ; Nb frames for the door - .NBSFRAMES = 0x07 ; Nb frames for the sprite - .WINSZX = 0x80 ; Size of the picture in the window - .WINSZY = 0x50 - .MINWINX = .MAXWNDPOSX-.WINSZX+1 ; Bounds of the window origin - .MINWINY = .MAXWNDPOSY-.WINSZY+1 - .MAXWINX = .MAXWNDPOSX - .MAXWINY = .MAXWNDPOSY - .FADESTEP = 0x10 ; Nb steps for the fading effect - .STARTFADE = 0x06*.FADESTEP ; Initial value for the fading effect - - .CLOSED = 0x00 - .OPENING = 0x01 - .OPENED = 0x02 - .CLOSING = 0x03 - - .module Space - - .area _BSS - -.time: ; Global "time" value (counter) - .ds 0x01 - -.doorstate: ; State of the door (OPENED, CLOSED...) - .ds 0x01 -.doorpos: ; Current position in the door animation - .ds 0x01 - -.color: ; Current color for fading effect - .ds 0x01 - -.sframe: ; Current frame of the sprite - .ds 0x01 - -.bposx: ; Background position (fixed point) - .ds 0x02 -.bposy: - .ds 0x02 -.bspx: ; Background speed (fixed point) - .ds 0x02 -.bspy: - .ds 0x02 - -.wposx: ; Window position (fixed point) - .ds 0x02 -.wposy: - .ds 0x02 -.wspx: ; Window speed (fixed point) - .ds 0x02 -.wspy: - .ds 0x02 - -.sposx: ; Sprite position (fixed point) - .ds 0x02 -.sposy: - .ds 0x02 -.sspx: ; Sprite speed (fixed point) - .ds 0x02 -.sspy: - .ds 0x02 - - .area _CODE - -_main:: - DI ; Disable interrupts - ;; Turn the screen off - CALL .display_off - - XOR A - LD (.time),A - LD (.color),A - - LD A,#0b11100100 - LDH (.BGP),A - LDH (.OBP0),A - - ; Initialize tiles - LD HL,#0x8000 - LD DE,#0x1000 - LD B,#0x00 - CALL .init_vram ; Init the tile set at 0x8000 with 0x00 - LD B,#0xFF - CALL .init_btt ; Init the tiles tables with 0xFF - CALL .init_wtt - - LD BC,#.tp0 ; Move tiles (standard tiles) - LD HL,#0x9000-(.endtp0-.tp0) - LD DE,#.endtp0-.tp0 - CALL .copy_vram - - LD BC,#.tp1 ; Move tiles (earth) - LD HL,#0x8000 - LD DE,#.endtp1-.tp1 - CALL .copy_vram - - LD BC,#.tp2 ; Move tiles (door) - LD HL,#0x8800 - LD DE,#.endtp2-.tp2 - CALL .copy_vram - - LD BC,#.tp3 ; Move tiles (background) - LD HL,#0x9000 - LD DE,#.endtp3-.tp3 - CALL .copy_vram - - ;; Draw the background - LD BC,#.bkg_tiles - LD HL,#0x9800 - LD DE,#0x0400 ; One whole GB Screen - CALL .copy_vram - - ;; Draw the frame in the window - LD BC,#.frame_tiles - LD DE,#0x0000/8 ; Place image at (0x00,0x00) - LD HL,#0x8050/8 ; Image size is 0x80 x 0x50 - CALL .set_xy_wtt - - ;; Draw the door in the window - LD BC,#.door1_tiles - LD DE,#0x1010/8 ; Place image at (0x10,0x10) - LD HL,#0x6030/8 ; Image size is 0x60 x 0x30 - CALL .set_xy_wtt - LD A,#.CLOSED - LD (.doorstate),A - - ; Initialize background - XOR A - LD (.bposx),A - LDH (.SCX),A - LD (.bposx+1),A - LD (.bposy),A - LDH (.SCY),A - LD (.bposy+1),A - LD A,#-0x01 - LD (.bspx),A - XOR A - LD (.bspx+1),A - XOR A - LD (.bspy),A - LD A,#0x80 - LD (.bspy+1),A - - ; Initialize window - LD A,#.MAXWNDPOSX - LD (.wposx),A - LDH (.WX),A - XOR A - LD (.wposx+1),A - LD A,#.MAXWNDPOSY - LD (.wposy),A - LDH (.WY),A - XOR A - LD (.wposy+1),A - LD A,#-0x01 - LD (.wspx),A - LD A,#0x80 - LD (.wspx+1),A - LD A,#-0x01 - LD (.wspy),A - LD A,#0xC0 - LD (.wspy+1),A - - ; Initialize sprite - XOR A - LD (.sframe),A - LD C,#0x00 ; Sprite 0x00 - LD D,#0x00 ; Default sprite properties - CALL .set_sprite_prop - LD C,#0x01 ; Sprite 0x01 - LD D,#0x00 ; Default sprite properties - CALL .set_sprite_prop - - LD A,#0x10 - LD (.sposx),A - XOR A - LD (.sposx+1),A - LD A,#0x10 - LD (.sposy),A - XOR A - LD (.sposy+1),A - XOR A - LD (.sspx),A - LD A,#0x40 - LD (.sspx+1),A - XOR A - LD (.sspy),A - LD A,#0x40 - LD (.sspy+1),A - CALL .tile_sprite ; Set sprite tiles - CALL .place_sprite ; Place sprites - - LD A,#0b11100111 ; LCD = On - ; WindowBank = 0x9C00 - ; Window = On - ; BG Chr = 0x8800 - ; BG Bank = 0x9800 - ; OBJ = 8x16 - ; OBJ = On - ; BG = On - LDH (.LCDC),A - EI ; Enable interrupts -1$: - LD A,(.time) - INC A - LD (.time),A - - LD B,#0x04 ; Skip four VBLs (slow down animation) -2$: - CALL .wait_vbl_done - DEC B - JR NZ,2$ - - CALL .fade - CALL .door - CALL .scroll - CALL .animate_sprite - - CALL .jpad - LD D,A - - AND #.B ; Is B pressed ? - JP NZ,10$ - - LD A,D - AND #.A ; Is A pressed ? - JP NZ,20$ - - LD A,D - AND #.SELECT ; Is SELECT pressed ? - JR Z,3$ - LD A,#.STARTFADE - LD (.color),A -3$: - LD A,D - AND #.START ; Is START pressed ? - JR Z,5$ - LD A,(.doorstate) - CP #.CLOSED - JR NZ,4$ - LD A,#.OPENING - LD (.doorstate),A - XOR A - LD (.doorpos),A - JR 5$ -4$: - CP #.OPENED - JR NZ,5$ - LD A,#.CLOSING - LD (.doorstate),A - LD A,#.NBDFRAMES - LD (.doorpos),A -5$: - LD A,D - AND #.UP ; Is UP pressed ? - JR Z,6$ - LD BC,#0x0010 - LD A,(.sspy) ; Load speed into HL - LD H,A - LD A,(.sspy+1) - LD L,A - LD A,L ; Substract BC from HL - SUB C - LD (.sspy+1),A - LD A,H - SBC B - LD (.sspy),A ; Store new speed - JR 7$ -6$: - LD A,D - AND #.DOWN ; Is DOWN pressed ? - JR Z,7$ - LD BC,#0x0010 - LD A,(.sspy) ; Load speed into HL - LD H,A - LD A,(.sspy+1) - LD L,A - ADD HL,BC ; Add them - LD A,H ; Store new speed - LD (.sspy),A - LD A,L - LD (.sspy+1),A -7$: - LD A,D - AND #.LEFT ; Is LEFT pressed ? - JR Z,8$ - LD BC,#0x0010 - LD A,(.sspx) ; Load speed into HL - LD H,A - LD A,(.sspx+1) - LD L,A - LD A,L ; Substract BC from HL - SUB C - LD (.sspx+1),A - LD A,H - SBC B - LD (.sspx),A ; Store new speed - JP 1$ -8$: - LD A,D - AND #.RIGHT ; Is RIGHT pressed ? - JP Z,1$ - LD BC,#0x0010 - LD A,(.sspx) ; Load speed into HL - LD H,A - LD A,(.sspx+1) - LD L,A - ADD HL,BC ; Add them - LD A,H ; Store new speed - LD (.sspx),A - LD A,L - LD (.sspx+1),A - JP 1$ - -10$: - LD A,D - AND #.UP ; Is UP pressed ? - JP Z,11$ - LD BC,#0x0010 - LD A,(.bspy) ; Load speed into HL - LD H,A - LD A,(.bspy+1) - LD L,A - LD A,L ; Substract BC from HL - SUB C - LD (.bspy+1),A - LD A,H - SBC B - LD (.bspy),A ; Store new speed - JR 12$ -11$: - LD A,D - AND #.DOWN ; Is DOWN pressed ? - JP Z,12$ - LD BC,#0x0010 - LD A,(.bspy) ; Load speed into HL - LD H,A - LD A,(.bspy+1) - LD L,A - ADD HL,BC ; Add them - LD A,H ; Store new speed - LD (.bspy),A - LD A,L - LD (.bspy+1),A -12$: - LD A,D - AND #.LEFT ; Is LEFT pressed ? - JP Z,13$ - LD BC,#0x0010 - LD A,(.bspx) ; Load speed into HL - LD H,A - LD A,(.bspx+1) - LD L,A - LD A,L ; Substract BC from HL - SUB C - LD (.bspx+1),A - LD A,H - SBC B - LD (.bspx),A ; Store new speed - JP 1$ -13$: - LD A,D - AND #.RIGHT ; Is RIGHT pressed ? - JP Z,1$ - LD BC,#0x0010 - LD A,(.bspx) ; Load speed into HL - LD H,A - LD A,(.bspx+1) - LD L,A - ADD HL,BC ; Add them - LD A,H ; Store new speed - LD (.bspx),A - LD A,L - LD (.bspx+1),A - JP 1$ - -20$: - LD A,D - AND #.UP ; Is UP pressed ? - JP Z,21$ - LD BC,#0x0010 - LD A,(.wspy) ; Load speed into HL - LD H,A - LD A,(.wspy+1) - LD L,A - LD A,L ; Substract BC from HL - SUB C - LD (.wspy+1),A - LD A,H - SBC B - LD (.wspy),A ; Store new speed - JR 22$ -21$: - LD A,D - AND #.DOWN ; Is DOWN pressed ? - JP Z,22$ - LD BC,#0x0010 - LD A,(.wspy) ; Load speed into HL - LD H,A - LD A,(.wspy+1) - LD L,A - ADD HL,BC ; Add them - LD A,H ; Store new speed - LD (.wspy),A - LD A,L - LD (.wspy+1),A -22$: - LD A,D - AND #.LEFT ; Is LEFT pressed ? - JP Z,23$ - LD BC,#0x0010 - LD A,(.wspx) ; Load speed into HL - LD H,A - LD A,(.wspx+1) - LD L,A - LD A,L ; Substract BC from HL - SUB C - LD (.wspx+1),A - LD A,H - SBC B - LD (.wspx),A ; Store new speed - JP 1$ -23$: - LD A,D - AND #.RIGHT ; Is RIGHT pressed ? - JP Z,1$ - LD BC,#0x0010 - LD A,(.wspx) ; Load speed into HL - LD H,A - LD A,(.wspx+1) - LD L,A - ADD HL,BC ; Add them - LD A,H ; Store new speed - LD (.wspx),A - LD A,L - LD (.wspx+1),A - JP 1$ - - RET - - ;; Fade the screen (off and on) -.fade: - - LD A,(.color) ; Load color into A - CP #0x00 - RET Z - CP #.STARTFADE - JR NZ,1$ - LD A,#0b11111001 - JR 6$ -1$: - CP #.STARTFADE-.FADESTEP - JR NZ,2$ - LD A,#0b11111110 - JR 6$ -2$: - CP #.STARTFADE-0x02*.FADESTEP - JR NZ,3$ - LD A,#0b11111111 - JR 6$ -3$: - CP #.STARTFADE-0x03*.FADESTEP - JR NZ,4$ - LD A,#0b11111110 - JR 6$ -4$: - CP #.STARTFADE-0x04*.FADESTEP - JR NZ,5$ - LD A,#0b11111001 - JR 6$ -5$: - CP #.STARTFADE-0x05*.FADESTEP - JR NZ,7$ - LD A,#0b11100100 -6$: - LDH (.BGP),A -7$: - LD A,(.color) - DEC A - LD (.color),A - RET - - ;; Scroll the background, the window and the sprite -.scroll: - - ;; Update background - LD A,(.bposx) ; Load background position into HL - LD H,A - LD A,(.bposx+1) - LD L,A - LD A,(.bspx) ; Load background speed into BC - LD B,A - LD A,(.bspx+1) - LD C,A - ADD HL,BC ; Add them - LD A,L ; Store new background position - LD (.bposx+1),A - LD A,H - LD (.bposx),A - LDH (.SCX),A ; Update position - - LD A,(.bposy) ; Load background position into HL - LD H,A - LD A,(.bposy+1) - LD L,A - LD A,(.bspy) ; Load background speed into BC - LD B,A - LD A,(.bspy+1) - LD C,A - ADD HL,BC ; Add them - LD A,L ; Store new background position - LD (.bposy+1),A - LD A,H - LD (.bposy),A - LDH (.SCY),A ; Update position - - ;; Update window - LD A,(.wspx) ; Load window speed into BC - LD B,A - LD A,(.wspx+1) - LD C,A - LD A,(.wposx) ; Load window position into HL - LD H,A - LD A,(.wposx+1) - LD L,A - ADD HL,BC ; Add them - LD A,L ; Store new window position - LD (.wposx+1),A - LD A,H - LD (.wposx),A - - ;; X position - LD A,(.wposx) ; Check window position - LD H,#0x00 ; We must use 16 bit registers since the - LD L,A ; window is not less than 0x80 pixels - LD BC,#.MAXWINX - LD A,L ; Substract BC from HL - SUB C - LD A,H - SBC B - AND #0x80 - JR NZ,1$ ; Maximum value ? - LD A,#.MAXWINX - LD (.wposx),A ; Correct window position - LD A,(.wspx+1) ; Load window speed into BC - LD C,A - LD A,(.wspx) - LD B,A - AND #0x80 ; Speed is already negative ? - JR NZ,3$ - JR 2$ -1$: - LD A,(.wposx) ; Check window position - LD H,#0x00 ; We must use 16 bit registers since the - LD L,A ; window is not less than 0x80 pixels - LD BC,#.MINWINX+1 - LD A,L ; Substract BC from HL - SUB C - LD A,H - SBC B - AND #0x80 - JR Z,3$ ; Minimum value ? - LD A,#.MINWINX - LD (.wposx),A ; Correct window position - LD A,(.wspx+1) ; Load window speed into BC - LD C,A - LD A,(.wspx) - LD B,A - AND #0x80 ; Speed is already positive ? - JR Z,3$ -2$: - LD HL,#0x00 ; Invert speed - LD A,L ; Substract BC from HL - SUB C - LD (.wspx+1),A - LD A,H - SBC B - LD (.wspx),A ; Store new speed -3$: - LD A,(.wposx) - LDH (.WX),A ; Update position - - LD A,(.wspy) ; Load window speed into BC - LD B,A - LD A,(.wspy+1) - LD C,A - LD A,(.wposy) ; Load window position into HL - LD H,A - LD A,(.wposy+1) - LD L,A - ADD HL,BC ; Add them - LD A,L ; Store new window position - LD (.wposy+1),A - LD A,H - LD (.wposy),A - - ;; Y position - LD A,(.wposy) ; Check window position - LD H,#0x00 ; We must use 16 bit registers since the - LD L,A ; window is not less than 0x80 pixels - LD BC,#.MAXWINY - LD A,L ; Substract BC from HL - SUB C - LD A,H - SBC B - AND #0x80 - JR NZ,4$ ; Maximum value ? - LD A,#.MAXWINY - LD (.wposy),A ; Correct window position - LD A,(.wspy+1) ; Load window speed into BC - LD C,A - LD A,(.wspy) - LD B,A - AND #0x80 ; Speed is already negative ? - JR NZ,6$ - JR 5$ -4$: - LD A,(.wposy) ; Check window position - LD H,#0x00 ; We must use 16 bit registers since the - LD L,A ; window is not less than 0x80 pixels - LD BC,#.MINWINY+1 - LD A,L ; Substract BC from HL - SUB C - LD A,H - SBC B - AND #0x80 - JR Z,6$ ; Minimum value ? - LD A,#.MINWINY - LD (.wposy),A ; Correct window position - LD A,(.wspy+1) ; Load window speed into BC - LD C,A - LD A,(.wspy) - LD B,A - AND #0x80 ; Speed is already positive ? - JR Z,6$ -5$: - LD HL,#0x00 ; Invert speed - LD A,L ; Substract BC from HL - SUB C - LD (.wspy+1),A - LD A,H - SBC B - LD (.wspy),A ; Store new speed -6$: - LD A,(.wposy) - LDH (.WY),A ; Update position - - ;; Update sprite - LD A,(.sposx) ; Load sprite position into HL - LD H,A - LD A,(.sposx+1) - LD L,A - LD A,(.sspx) ; Load sprite speed into BC - LD B,A - LD A,(.sspx+1) - LD C,A - ADD HL,BC ; Add them - LD A,L ; Store new sprite position - LD (.sposx+1),A - LD A,H - LD (.sposx),A - - LD A,(.sposy) ; Load sprite position into HL - LD H,A - LD A,(.sposy+1) - LD L,A - LD A,(.sspy) ; Load sprite speed into BC - LD B,A - LD A,(.sspy+1) - LD C,A - ADD HL,BC ; Add them - LD A,L ; Store new sprite position - LD (.sposy+1),A - LD A,H - LD (.sposy),A - CALL .place_sprite ; Update position - - RET - - ;; Open and close the door -.door: - LD A,(.doorstate) - CP #.OPENING - JP Z,.open_door - CP #.CLOSING - JP Z,.close_door - RET - -.open_door: - LD A,(.doorpos) - LD HL,#.film+0x02 - LD B,#0x00 - LD C,A - ADD HL,BC - LD C,(HL) - INC HL - LD B,(HL) - LD DE,#0x1010/8 ; Place image at (0x10,0x10) - LD HL,#0x6030/8 ; Image size is 0x60 x 0x30 - CALL .set_xy_wtt - - LD A,(.doorpos) - ADD A,#0x02 - LD (.doorpos),A - CP #.NBDFRAMES - RET NZ - LD A,#.OPENED - LD (.doorstate),A - RET - -.close_door: - LD A,(.doorpos) - LD HL,#.film-0x02 - LD B,#0x00 - LD C,A - ADD HL,BC - LD C,(HL) - INC HL - LD B,(HL) - LD DE,#0x1010/8 ; Place image at (0x10,0x10) - LD HL,#0x6030/8 ; Image size is 0x60 x 0x30 - CALL .set_xy_wtt - - LD A,(.doorpos) - SUB A,#0x02 - LD (.doorpos),A - RET NZ - LD A,#.CLOSED - LD (.doorstate),A - RET - - ;; Animate sprite -.animate_sprite: - LD A,(.time) - AND #0x07 - RET NZ - - LD A,(.sframe) - INC A - CP #.NBSFRAMES - JR NZ,1$ - XOR A -1$: - LD (.sframe),A - - CALL .tile_sprite - RET - - ;; Set sprite tiles -.tile_sprite: - LD A,(.sframe) - LD HL,#.earth_tiles - RLCA - LD B,#0x00 - LD C,A - ADD HL,BC - LD C,#0x00 ; Sprite 0x00 - LD A,(HL+) - LD D,A - PUSH HL - CALL .set_sprite_tile - POP HL - - LD C,#0x01 ; Sprite 0x01 - LD A,(HL+) - LD D,A - CALL .set_sprite_tile - - RET - - ;; Place sprite -.place_sprite: - LD C,#0x00 ; Sprite 0x00 - LD A,(.sposx) - LD D,A - LD A,(.sposy) - LD E,A - PUSH DE ; Store position - CALL .mv_sprite - - LD C,#0x01 ; Sprite 0x01 - POP DE ; Restore position - LD A,#0x08 - ADD A,D - LD D,A - CALL .mv_sprite - - RET - - .area _LIT - -.tp0: - -.std_data: - - ; Basic tiles (0xFC to 0xFF) - - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00 - .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF - .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -.endtp0: - -.tp1: - -.earth_data: - - ; Tile 0x00 - .byte 0x07,0x07,0x18,0x1F,0x32,0x2D,0x71,0x4E,0x70,0x4F,0xF8,0x87,0xF8,0x87,0xF8,0x87 - .byte 0xFC,0x83,0xFE,0x81,0x7F,0x40,0x7F,0x40,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0xF0,0x30,0x78,0x88,0x3C,0xC4,0x5C,0xA4,0x9E,0x62,0x3E,0xC2,0x3E,0xC2 - .byte 0x5E,0xA2,0x7E,0x82,0x0C,0xF4,0x0C,0xF4,0x98,0x68,0xB0,0x70,0xC0,0xC0,0x00,0x00 - .byte 0x07,0x07,0x1F,0x18,0x2F,0x30,0x4F,0x70,0x6F,0x50,0x9F,0xE0,0x9F,0xE0,0xBF,0xC0 - .byte 0xFF,0x80,0xB7,0xC8,0x63,0x5C,0x43,0x7C,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0xB0,0x70,0x18,0xE8,0x0C,0xF4,0x0C,0xF4,0x82,0x7E,0x82,0x7E,0x86,0x7A - .byte 0xC6,0x3A,0xE6,0x1A,0xF4,0x0C,0xFC,0x04,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 - - ; Tile 0x08 - .byte 0x07,0x07,0x1E,0x19,0x20,0x3F,0x40,0x7F,0x42,0x7D,0x81,0xFE,0x81,0xFE,0x83,0xFC - .byte 0xD7,0xA8,0xBB,0xC4,0x6E,0x51,0x7C,0x43,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0x70,0xB0,0xE8,0x18,0xF4,0x0C,0xF4,0x0C,0xFE,0x02,0xFE,0x02,0xFE,0x02 - .byte 0xFE,0x02,0x7E,0x82,0x3C,0xC4,0x3C,0xC4,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 - .byte 0x07,0x07,0x1B,0x1C,0x20,0x3F,0x40,0x7F,0x40,0x7F,0xE0,0x9F,0x90,0xEF,0x89,0xF6 - .byte 0x8D,0xF2,0x9F,0xE0,0x5E,0x61,0x6F,0x50,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0xB0,0x70,0x28,0xD8,0x04,0xFC,0x2C,0xD4,0x1E,0xE2,0x1E,0xE2,0x3E,0xC2 - .byte 0x7E,0x82,0xB6,0x4A,0xE4,0x1C,0xC4,0x3C,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 - - ; Tile 0x10 - .byte 0x07,0x07,0x18,0x1F,0x20,0x3F,0x40,0x7F,0x40,0x7F,0xEE,0x91,0xF1,0x8E,0xE0,0x9F - .byte 0xE0,0x9F,0xF1,0x8E,0x71,0x4E,0x72,0x4D,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0xF0,0x30,0x08,0xF8,0x04,0xFC,0x04,0xFC,0x02,0xFE,0x02,0xFE,0x92,0x6E - .byte 0xD6,0x2A,0xFE,0x02,0xEC,0x14,0xFC,0x04,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 - .byte 0x07,0x07,0x1D,0x1A,0x36,0x29,0x5C,0x63,0x6C,0x53,0xCE,0xB1,0x9F,0xE0,0x9E,0xE1 - .byte 0xAE,0xD1,0xBF,0xC0,0x47,0x78,0x47,0x78,0x2F,0x30,0x1F,0x18,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0x70,0xB0,0x08,0xF8,0x04,0xFC,0x04,0xFC,0xE2,0x1E,0x32,0xCE,0x0E,0xF2 - .byte 0x0E,0xF2,0x1E,0xE2,0x1C,0xE4,0x2C,0xD4,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 - - ; Tile 0x18 - .byte 0x07,0x07,0x1E,0x19,0x33,0x2C,0x49,0x76,0x42,0x7D,0xC4,0xBB,0xC1,0xBE,0xC1,0xBE - .byte 0xE2,0x9D,0xF3,0x8C,0x78,0x47,0x78,0x47,0x3C,0x23,0x1C,0x1B,0x07,0x07,0x00,0x00 - .byte 0xC0,0xC0,0x70,0xB0,0x68,0x98,0xC4,0x3C,0xC4,0x3C,0xEE,0x12,0xF2,0x0E,0xE2,0x1E - .byte 0xE2,0x1E,0xF2,0x0E,0x7C,0x84,0x7C,0x84,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 - -.endtp1: - -.tp2: - -.frame_data: - - ; Tile 0x00 - .byte 0xFF,0x00,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F - .byte 0xFF,0x00,0x01,0xFE,0x03,0xFC,0x07,0xF8,0x0F,0xF0,0x1F,0xE0,0x3F,0xC0,0x7F,0x80 - .byte 0xFF,0x00,0xFE,0x01,0xFC,0x03,0xF8,0x07,0xF0,0x0F,0xE0,0x1F,0xC0,0x3F,0x80,0x7F - .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF - .byte 0xFF,0x00,0xFF,0x01,0xFD,0x03,0xF9,0x07,0xF1,0x0F,0xE1,0x1F,0xC1,0x3F,0x81,0x7F - .byte 0x80,0x7F,0x81,0x7E,0x83,0x7C,0x87,0x78,0x8F,0x70,0x9F,0x60,0xBF,0x40,0xFF,0x00 - .byte 0xFF,0x70,0xFF,0x98,0xEF,0xB8,0xCF,0xF8,0xFF,0x70,0xFF,0x00,0xFF,0x00,0xFF,0x01 - .byte 0xFF,0x00,0xFE,0x01,0xFC,0x03,0xF8,0x07,0xF0,0x0F,0xE0,0x1F,0xC0,0x3F,0xFF,0xFF - - ; Tile 0x08 - .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF - .byte 0x00,0xFF,0x01,0xFE,0x03,0xFC,0x07,0xF8,0x0F,0xF0,0x1F,0xE0,0x3F,0xC0,0xFF,0xFF - .byte 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF - .byte 0xFF,0x0E,0xFF,0x13,0xFD,0x17,0xF9,0x1F,0xFE,0x0F,0xE0,0x1F,0xC0,0x3F,0x80,0xFF - .byte 0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF - .byte 0xFF,0x01,0xFF,0x01,0xFD,0x03,0xF9,0x07,0xF1,0x0F,0xE1,0x1F,0xC1,0x3F,0x81,0x7F - .byte 0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F - .byte 0x01,0xFF,0x01,0xFF,0x03,0xFD,0x07,0xF9,0x0F,0xF1,0x1F,0xE1,0x3F,0xC1,0x7F,0x81 - - ; Tile 0x10 - .byte 0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01 - .byte 0x01,0xFF,0x01,0xFE,0x03,0xFC,0x77,0xF8,0xFF,0x98,0xEF,0xB8,0xCF,0xF8,0x7F,0xF0 - .byte 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x0E,0xFF,0x13,0xFD,0x17,0xF9,0x1F,0xFF,0x0E - .byte 0x80,0x7F,0x81,0x7E,0x83,0x7C,0x87,0x78,0x8F,0x70,0x9F,0x60,0xBF,0x40,0xFF,0x7F - .byte 0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0xFF,0xFF - -.door1_data: - - ; Tile 0x15 - .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF - .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF - .byte 0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF - -.door2_data: - - ; Tile 0x18 - .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF - .byte 0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF - .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF - .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - -.door3_data: - - ; Tile 0x1C - .byte 0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF - .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF - .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF - .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - -.door4_data: - - ; Tile 0x20 - .byte 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - -.endtp2: - -.tp3: - -.bkg_data: - - ; Tile 0x00 - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xF7,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xDF,0xFF,0xEF,0xFF,0xFF,0xF7,0xFF,0xFB,0xFF,0xFD,0xFF,0xFE,0xFE,0xFF - - ; Tile 0x08 - .byte 0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7D,0xFE,0x7C,0x39 - .byte 0xFF,0xFF,0xF7,0xFF,0xEF,0xFF,0xFF,0xDF,0xFF,0xBF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFE,0xFF,0xFD - .byte 0xBB,0x01,0xC7,0x83,0xC7,0x83,0xC7,0x83,0xBB,0x01,0x7C,0x39,0x7D,0xFE,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F - .byte 0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFB,0xAF,0x77,0x27,0x8F,0xDF,0x8F,0x27,0x8F - - ; Tile 0x10 - .byte 0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFB,0xFF,0xF7,0xEF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xBF,0xFF,0xDF,0xEF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFE,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xAF,0x77,0xFF,0xFB,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF - - ; Tile 0x18 - .byte 0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x7D,0xFE,0x7C,0x39 - .byte 0xFF,0xFF,0xF7,0xFF,0xEF,0xFF,0xFF,0xDF,0xFF,0xBF,0xFF,0x7F,0x7F,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFD - - ; Tile 0x20 - .byte 0xFF,0xFF,0xDF,0xFF,0xEF,0xFF,0xFF,0xF7,0xFF,0xFB,0xFE,0xFD,0xFD,0xFE,0xFE,0xFF - .byte 0xAB,0x11,0xC7,0x83,0x83,0xC7,0xC7,0x83,0xAB,0x11,0x7C,0x39,0x7D,0xFE,0xFE,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFB,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0x7F - .byte 0xFB,0xFF,0xFF,0xFD,0xFE,0xFE,0xFE,0xFF,0xFE,0xFE,0xFF,0xFD,0xFB,0xFF,0xFF,0xFF - .byte 0xEF,0xFF,0xFF,0xDF,0x3F,0xBF,0x3F,0x7F,0x3F,0xBF,0xFF,0xDF,0xEF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFB,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFD,0xFE,0xFE,0xFD - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF - - ; Tile 0x28 - .byte 0xF7,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - .byte 0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF - -.endtp3: - - ; Image size: 0x40 x 0x40 - ; Number of tiles (total - unique): 0x40 - 0x2D - -.bkg_tiles: - - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC - - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A - - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC - - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 - - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC - - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 - - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 - - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 - - ; Image size: 0x10 x 0x70 - ; Number of tiles (total - unique): 0x1C - 0x1C - -.earth_tiles: - - .byte 0x00,0x02 - .byte 0x04,0x06 - .byte 0x08,0x0A - .byte 0x0C,0x0E - .byte 0x10,0x12 - .byte 0x14,0x16 - .byte 0x18,0x1A - - ; Image size: 0x80 x 0x50 - ; Number of tiles (total - unique): 0xA0 - 0x15 - -.frame_tiles: - - .byte 0x80,0x81,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0xFD,0x84 - .byte 0x85,0x86,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x8B,0x8C - .byte 0xFD,0x8D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8E,0x8F - .byte 0x82,0x8C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x85,0x90 - .byte 0x8E,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x8D - .byte 0x85,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x82,0x8C - .byte 0xFD,0x8D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8E,0x8F - .byte 0x82,0x8C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x85,0x90 - .byte 0x8E,0x91,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0x92,0x8D - .byte 0x93,0x8A,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x87,0x94 - - ; Image size: 0x60 x 0x30 - ; Number of tiles (total - unique): 0x48 - 0x03 - -.door1_tiles: - - .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 - .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 - .byte 0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97 - .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 - .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 - .byte 0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97 - - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - - ; Image size: 0x60 x 0x30 - ; Number of tiles (total - unique): 0x48 - 0x04 - -.door2_tiles: - - .byte 0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98 - .byte 0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99 - .byte 0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A - .byte 0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98 - .byte 0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99 - .byte 0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B - - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - - ; Image size: 0x60 x 0x30 - ; Number of tiles (total - unique): 0x48 - 0x04 - -.door3_tiles: - - .byte 0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C - .byte 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D - .byte 0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E - .byte 0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C - .byte 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D - .byte 0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F - - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - - ; Image size: 0x60 x 0x30 - ; Number of tiles (total - unique): 0x48 - 0x01 - -.door4_tiles: - - .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 - .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 - .byte 0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97 - .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 - .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 - .byte 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0 - - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC - -.film: - .word .door1_tiles+0x0C*0 - .word .door2_tiles+0x0C*0 - .word .door3_tiles+0x0C*0 - .word .door4_tiles+0x0C*0 - .word .door1_tiles+0x0C*1 - .word .door2_tiles+0x0C*1 - .word .door3_tiles+0x0C*1 - .word .door4_tiles+0x0C*1 - .word .door1_tiles+0x0C*2 - .word .door2_tiles+0x0C*2 - .word .door3_tiles+0x0C*2 - .word .door4_tiles+0x0C*2 - .word .door1_tiles+0x0C*3 - .word .door2_tiles+0x0C*3 - .word .door3_tiles+0x0C*3 - .word .door4_tiles+0x0C*3 - .word .door1_tiles+0x0C*4 - .word .door2_tiles+0x0C*4 - .word .door3_tiles+0x0C*4 - .word .door4_tiles+0x0C*4 - .word .door1_tiles+0x0C*5 - .word .door2_tiles+0x0C*5 - .word .door3_tiles+0x0C*5 - .word .door4_tiles+0x0C*5 -.endfilm: - .word .door1_tiles+0x0C*6 diff --git a/gbdk-lib/examples/gb/space/Makefile b/gbdk-lib/examples/gb/space/Makefile @@ -0,0 +1,17 @@ +CC = ../../../bin/lcc -Wa-l -Wl-m -Wl-j + +BINS = space.gb + +all: $(BINS) + +make.bat: Makefile + @echo "REM Automatically generated from Makefile" > make.bat + @make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat + +# Compile and link single file in one pass +%.gb: %.s + $(CC) -o $@ $< + +clean: + rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi + diff --git a/gbdk-lib/examples/gb/space/space.s b/gbdk-lib/examples/gb/space/space.s @@ -0,0 +1,1296 @@ + ;; Little demo illustrating how to use the graphical possibilities + ;; of the GB (background, window and animated sprite) + ;; I have used fixed-point values for both the position and + ;; speed of objects to get smooth movements + ;; + ;; OBJ data : 0x8000 -> 0x8FFF (unsigned) + ;; Window data : 0x8800 -> 0x97FF (signed) + ;; Background data : 0x8800 -> 0x97FF (signed) + ;; + ;; Tiled 0xFC -> 0xFF are standard tiles (all black -> all white) + ;; + ;; Keys: + ;; Arrow keys : Change the speed (and direction) of the sprite + ;; Arrow keys + A : Change the speed (and direction) of the window + ;; Arrow keys + B : Change the speed (and direction) of the background + ;; START : Open/close the door + ;; SELECT : Basic fading effect + ;; + ;; Note that the window is kept in the lower right part of the screen + ;; since it can't be made transparent + + .include "../../../lib/small/asxxxx/global.s" + + .globl .init_vram + .globl .copy_vram + .globl .init_wtt + .globl .init_btt + .globl .set_xy_wtt + .globl .mv_sprite + .globl .set_sprite_prop + .globl .set_sprite_tile + .globl .jpad + + .NBDFRAMES = .endfilm-.film ; Nb frames for the door + .NBSFRAMES = 0x07 ; Nb frames for the sprite + .WINSZX = 0x80 ; Size of the picture in the window + .WINSZY = 0x50 + .MINWINX = .MAXWNDPOSX-.WINSZX+1 ; Bounds of the window origin + .MINWINY = .MAXWNDPOSY-.WINSZY+1 + .MAXWINX = .MAXWNDPOSX + .MAXWINY = .MAXWNDPOSY + .FADESTEP = 0x10 ; Nb steps for the fading effect + .STARTFADE = 0x06*.FADESTEP ; Initial value for the fading effect + + .CLOSED = 0x00 + .OPENING = 0x01 + .OPENED = 0x02 + .CLOSING = 0x03 + + .module Space + + .area _BSS + +.time: ; Global "time" value (counter) + .ds 0x01 + +.doorstate: ; State of the door (OPENED, CLOSED...) + .ds 0x01 +.doorpos: ; Current position in the door animation + .ds 0x01 + +.color: ; Current color for fading effect + .ds 0x01 + +.sframe: ; Current frame of the sprite + .ds 0x01 + +.bposx: ; Background position (fixed point) + .ds 0x02 +.bposy: + .ds 0x02 +.bspx: ; Background speed (fixed point) + .ds 0x02 +.bspy: + .ds 0x02 + +.wposx: ; Window position (fixed point) + .ds 0x02 +.wposy: + .ds 0x02 +.wspx: ; Window speed (fixed point) + .ds 0x02 +.wspy: + .ds 0x02 + +.sposx: ; Sprite position (fixed point) + .ds 0x02 +.sposy: + .ds 0x02 +.sspx: ; Sprite speed (fixed point) + .ds 0x02 +.sspy: + .ds 0x02 + + .area _CODE + +_main:: + DI ; Disable interrupts + ;; Turn the screen off + CALL .display_off + + XOR A + LD (.time),A + LD (.color),A + + LD A,#0b11100100 + LDH (.BGP),A + LDH (.OBP0),A + + ; Initialize tiles + LD HL,#0x8000 + LD DE,#0x1000 + LD B,#0x00 + CALL .init_vram ; Init the tile set at 0x8000 with 0x00 + LD B,#0xFF + CALL .init_btt ; Init the tiles tables with 0xFF + CALL .init_wtt + + LD BC,#.tp0 ; Move tiles (standard tiles) + LD HL,#0x9000-(.endtp0-.tp0) + LD DE,#.endtp0-.tp0 + CALL .copy_vram + + LD BC,#.tp1 ; Move tiles (earth) + LD HL,#0x8000 + LD DE,#.endtp1-.tp1 + CALL .copy_vram + + LD BC,#.tp2 ; Move tiles (door) + LD HL,#0x8800 + LD DE,#.endtp2-.tp2 + CALL .copy_vram + + LD BC,#.tp3 ; Move tiles (background) + LD HL,#0x9000 + LD DE,#.endtp3-.tp3 + CALL .copy_vram + + ;; Draw the background + LD BC,#.bkg_tiles + LD HL,#0x9800 + LD DE,#0x0400 ; One whole GB Screen + CALL .copy_vram + + ;; Draw the frame in the window + LD BC,#.frame_tiles + LD DE,#0x0000/8 ; Place image at (0x00,0x00) + LD HL,#0x8050/8 ; Image size is 0x80 x 0x50 + CALL .set_xy_wtt + + ;; Draw the door in the window + LD BC,#.door1_tiles + LD DE,#0x1010/8 ; Place image at (0x10,0x10) + LD HL,#0x6030/8 ; Image size is 0x60 x 0x30 + CALL .set_xy_wtt + LD A,#.CLOSED + LD (.doorstate),A + + ; Initialize background + XOR A + LD (.bposx),A + LDH (.SCX),A + LD (.bposx+1),A + LD (.bposy),A + LDH (.SCY),A + LD (.bposy+1),A + LD A,#-0x01 + LD (.bspx),A + XOR A + LD (.bspx+1),A + XOR A + LD (.bspy),A + LD A,#0x80 + LD (.bspy+1),A + + ; Initialize window + LD A,#.MAXWNDPOSX + LD (.wposx),A + LDH (.WX),A + XOR A + LD (.wposx+1),A + LD A,#.MAXWNDPOSY + LD (.wposy),A + LDH (.WY),A + XOR A + LD (.wposy+1),A + LD A,#-0x01 + LD (.wspx),A + LD A,#0x80 + LD (.wspx+1),A + LD A,#-0x01 + LD (.wspy),A + LD A,#0xC0 + LD (.wspy+1),A + + ; Initialize sprite + XOR A + LD (.sframe),A + LD C,#0x00 ; Sprite 0x00 + LD D,#0x00 ; Default sprite properties + CALL .set_sprite_prop + LD C,#0x01 ; Sprite 0x01 + LD D,#0x00 ; Default sprite properties + CALL .set_sprite_prop + + LD A,#0x10 + LD (.sposx),A + XOR A + LD (.sposx+1),A + LD A,#0x10 + LD (.sposy),A + XOR A + LD (.sposy+1),A + XOR A + LD (.sspx),A + LD A,#0x40 + LD (.sspx+1),A + XOR A + LD (.sspy),A + LD A,#0x40 + LD (.sspy+1),A + CALL .tile_sprite ; Set sprite tiles + CALL .place_sprite ; Place sprites + + LD A,#0b11100111 ; LCD = On + ; WindowBank = 0x9C00 + ; Window = On + ; BG Chr = 0x8800 + ; BG Bank = 0x9800 + ; OBJ = 8x16 + ; OBJ = On + ; BG = On + LDH (.LCDC),A + EI ; Enable interrupts +1$: + LD A,(.time) + INC A + LD (.time),A + + LD B,#0x04 ; Skip four VBLs (slow down animation) +2$: + CALL .wait_vbl_done + DEC B + JR NZ,2$ + + CALL .fade + CALL .door + CALL .scroll + CALL .animate_sprite + + CALL .jpad + LD D,A + + AND #.B ; Is B pressed ? + JP NZ,10$ + + LD A,D + AND #.A ; Is A pressed ? + JP NZ,20$ + + LD A,D + AND #.SELECT ; Is SELECT pressed ? + JR Z,3$ + LD A,#.STARTFADE + LD (.color),A +3$: + LD A,D + AND #.START ; Is START pressed ? + JR Z,5$ + LD A,(.doorstate) + CP #.CLOSED + JR NZ,4$ + LD A,#.OPENING + LD (.doorstate),A + XOR A + LD (.doorpos),A + JR 5$ +4$: + CP #.OPENED + JR NZ,5$ + LD A,#.CLOSING + LD (.doorstate),A + LD A,#.NBDFRAMES + LD (.doorpos),A +5$: + LD A,D + AND #.UP ; Is UP pressed ? + JR Z,6$ + LD BC,#0x0010 + LD A,(.sspy) ; Load speed into HL + LD H,A + LD A,(.sspy+1) + LD L,A + LD A,L ; Substract BC from HL + SUB C + LD (.sspy+1),A + LD A,H + SBC B + LD (.sspy),A ; Store new speed + JR 7$ +6$: + LD A,D + AND #.DOWN ; Is DOWN pressed ? + JR Z,7$ + LD BC,#0x0010 + LD A,(.sspy) ; Load speed into HL + LD H,A + LD A,(.sspy+1) + LD L,A + ADD HL,BC ; Add them + LD A,H ; Store new speed + LD (.sspy),A + LD A,L + LD (.sspy+1),A +7$: + LD A,D + AND #.LEFT ; Is LEFT pressed ? + JR Z,8$ + LD BC,#0x0010 + LD A,(.sspx) ; Load speed into HL + LD H,A + LD A,(.sspx+1) + LD L,A + LD A,L ; Substract BC from HL + SUB C + LD (.sspx+1),A + LD A,H + SBC B + LD (.sspx),A ; Store new speed + JP 1$ +8$: + LD A,D + AND #.RIGHT ; Is RIGHT pressed ? + JP Z,1$ + LD BC,#0x0010 + LD A,(.sspx) ; Load speed into HL + LD H,A + LD A,(.sspx+1) + LD L,A + ADD HL,BC ; Add them + LD A,H ; Store new speed + LD (.sspx),A + LD A,L + LD (.sspx+1),A + JP 1$ + +10$: + LD A,D + AND #.UP ; Is UP pressed ? + JP Z,11$ + LD BC,#0x0010 + LD A,(.bspy) ; Load speed into HL + LD H,A + LD A,(.bspy+1) + LD L,A + LD A,L ; Substract BC from HL + SUB C + LD (.bspy+1),A + LD A,H + SBC B + LD (.bspy),A ; Store new speed + JR 12$ +11$: + LD A,D + AND #.DOWN ; Is DOWN pressed ? + JP Z,12$ + LD BC,#0x0010 + LD A,(.bspy) ; Load speed into HL + LD H,A + LD A,(.bspy+1) + LD L,A + ADD HL,BC ; Add them + LD A,H ; Store new speed + LD (.bspy),A + LD A,L + LD (.bspy+1),A +12$: + LD A,D + AND #.LEFT ; Is LEFT pressed ? + JP Z,13$ + LD BC,#0x0010 + LD A,(.bspx) ; Load speed into HL + LD H,A + LD A,(.bspx+1) + LD L,A + LD A,L ; Substract BC from HL + SUB C + LD (.bspx+1),A + LD A,H + SBC B + LD (.bspx),A ; Store new speed + JP 1$ +13$: + LD A,D + AND #.RIGHT ; Is RIGHT pressed ? + JP Z,1$ + LD BC,#0x0010 + LD A,(.bspx) ; Load speed into HL + LD H,A + LD A,(.bspx+1) + LD L,A + ADD HL,BC ; Add them + LD A,H ; Store new speed + LD (.bspx),A + LD A,L + LD (.bspx+1),A + JP 1$ + +20$: + LD A,D + AND #.UP ; Is UP pressed ? + JP Z,21$ + LD BC,#0x0010 + LD A,(.wspy) ; Load speed into HL + LD H,A + LD A,(.wspy+1) + LD L,A + LD A,L ; Substract BC from HL + SUB C + LD (.wspy+1),A + LD A,H + SBC B + LD (.wspy),A ; Store new speed + JR 22$ +21$: + LD A,D + AND #.DOWN ; Is DOWN pressed ? + JP Z,22$ + LD BC,#0x0010 + LD A,(.wspy) ; Load speed into HL + LD H,A + LD A,(.wspy+1) + LD L,A + ADD HL,BC ; Add them + LD A,H ; Store new speed + LD (.wspy),A + LD A,L + LD (.wspy+1),A +22$: + LD A,D + AND #.LEFT ; Is LEFT pressed ? + JP Z,23$ + LD BC,#0x0010 + LD A,(.wspx) ; Load speed into HL + LD H,A + LD A,(.wspx+1) + LD L,A + LD A,L ; Substract BC from HL + SUB C + LD (.wspx+1),A + LD A,H + SBC B + LD (.wspx),A ; Store new speed + JP 1$ +23$: + LD A,D + AND #.RIGHT ; Is RIGHT pressed ? + JP Z,1$ + LD BC,#0x0010 + LD A,(.wspx) ; Load speed into HL + LD H,A + LD A,(.wspx+1) + LD L,A + ADD HL,BC ; Add them + LD A,H ; Store new speed + LD (.wspx),A + LD A,L + LD (.wspx+1),A + JP 1$ + + RET + + ;; Fade the screen (off and on) +.fade: + + LD A,(.color) ; Load color into A + CP #0x00 + RET Z + CP #.STARTFADE + JR NZ,1$ + LD A,#0b11111001 + JR 6$ +1$: + CP #.STARTFADE-.FADESTEP + JR NZ,2$ + LD A,#0b11111110 + JR 6$ +2$: + CP #.STARTFADE-0x02*.FADESTEP + JR NZ,3$ + LD A,#0b11111111 + JR 6$ +3$: + CP #.STARTFADE-0x03*.FADESTEP + JR NZ,4$ + LD A,#0b11111110 + JR 6$ +4$: + CP #.STARTFADE-0x04*.FADESTEP + JR NZ,5$ + LD A,#0b11111001 + JR 6$ +5$: + CP #.STARTFADE-0x05*.FADESTEP + JR NZ,7$ + LD A,#0b11100100 +6$: + LDH (.BGP),A +7$: + LD A,(.color) + DEC A + LD (.color),A + RET + + ;; Scroll the background, the window and the sprite +.scroll: + + ;; Update background + LD A,(.bposx) ; Load background position into HL + LD H,A + LD A,(.bposx+1) + LD L,A + LD A,(.bspx) ; Load background speed into BC + LD B,A + LD A,(.bspx+1) + LD C,A + ADD HL,BC ; Add them + LD A,L ; Store new background position + LD (.bposx+1),A + LD A,H + LD (.bposx),A + LDH (.SCX),A ; Update position + + LD A,(.bposy) ; Load background position into HL + LD H,A + LD A,(.bposy+1) + LD L,A + LD A,(.bspy) ; Load background speed into BC + LD B,A + LD A,(.bspy+1) + LD C,A + ADD HL,BC ; Add them + LD A,L ; Store new background position + LD (.bposy+1),A + LD A,H + LD (.bposy),A + LDH (.SCY),A ; Update position + + ;; Update window + LD A,(.wspx) ; Load window speed into BC + LD B,A + LD A,(.wspx+1) + LD C,A + LD A,(.wposx) ; Load window position into HL + LD H,A + LD A,(.wposx+1) + LD L,A + ADD HL,BC ; Add them + LD A,L ; Store new window position + LD (.wposx+1),A + LD A,H + LD (.wposx),A + + ;; X position + LD A,(.wposx) ; Check window position + LD H,#0x00 ; We must use 16 bit registers since the + LD L,A ; window is not less than 0x80 pixels + LD BC,#.MAXWINX + LD A,L ; Substract BC from HL + SUB C + LD A,H + SBC B + AND #0x80 + JR NZ,1$ ; Maximum value ? + LD A,#.MAXWINX + LD (.wposx),A ; Correct window position + LD A,(.wspx+1) ; Load window speed into BC + LD C,A + LD A,(.wspx) + LD B,A + AND #0x80 ; Speed is already negative ? + JR NZ,3$ + JR 2$ +1$: + LD A,(.wposx) ; Check window position + LD H,#0x00 ; We must use 16 bit registers since the + LD L,A ; window is not less than 0x80 pixels + LD BC,#.MINWINX+1 + LD A,L ; Substract BC from HL + SUB C + LD A,H + SBC B + AND #0x80 + JR Z,3$ ; Minimum value ? + LD A,#.MINWINX + LD (.wposx),A ; Correct window position + LD A,(.wspx+1) ; Load window speed into BC + LD C,A + LD A,(.wspx) + LD B,A + AND #0x80 ; Speed is already positive ? + JR Z,3$ +2$: + LD HL,#0x00 ; Invert speed + LD A,L ; Substract BC from HL + SUB C + LD (.wspx+1),A + LD A,H + SBC B + LD (.wspx),A ; Store new speed +3$: + LD A,(.wposx) + LDH (.WX),A ; Update position + + LD A,(.wspy) ; Load window speed into BC + LD B,A + LD A,(.wspy+1) + LD C,A + LD A,(.wposy) ; Load window position into HL + LD H,A + LD A,(.wposy+1) + LD L,A + ADD HL,BC ; Add them + LD A,L ; Store new window position + LD (.wposy+1),A + LD A,H + LD (.wposy),A + + ;; Y position + LD A,(.wposy) ; Check window position + LD H,#0x00 ; We must use 16 bit registers since the + LD L,A ; window is not less than 0x80 pixels + LD BC,#.MAXWINY + LD A,L ; Substract BC from HL + SUB C + LD A,H + SBC B + AND #0x80 + JR NZ,4$ ; Maximum value ? + LD A,#.MAXWINY + LD (.wposy),A ; Correct window position + LD A,(.wspy+1) ; Load window speed into BC + LD C,A + LD A,(.wspy) + LD B,A + AND #0x80 ; Speed is already negative ? + JR NZ,6$ + JR 5$ +4$: + LD A,(.wposy) ; Check window position + LD H,#0x00 ; We must use 16 bit registers since the + LD L,A ; window is not less than 0x80 pixels + LD BC,#.MINWINY+1 + LD A,L ; Substract BC from HL + SUB C + LD A,H + SBC B + AND #0x80 + JR Z,6$ ; Minimum value ? + LD A,#.MINWINY + LD (.wposy),A ; Correct window position + LD A,(.wspy+1) ; Load window speed into BC + LD C,A + LD A,(.wspy) + LD B,A + AND #0x80 ; Speed is already positive ? + JR Z,6$ +5$: + LD HL,#0x00 ; Invert speed + LD A,L ; Substract BC from HL + SUB C + LD (.wspy+1),A + LD A,H + SBC B + LD (.wspy),A ; Store new speed +6$: + LD A,(.wposy) + LDH (.WY),A ; Update position + + ;; Update sprite + LD A,(.sposx) ; Load sprite position into HL + LD H,A + LD A,(.sposx+1) + LD L,A + LD A,(.sspx) ; Load sprite speed into BC + LD B,A + LD A,(.sspx+1) + LD C,A + ADD HL,BC ; Add them + LD A,L ; Store new sprite position + LD (.sposx+1),A + LD A,H + LD (.sposx),A + + LD A,(.sposy) ; Load sprite position into HL + LD H,A + LD A,(.sposy+1) + LD L,A + LD A,(.sspy) ; Load sprite speed into BC + LD B,A + LD A,(.sspy+1) + LD C,A + ADD HL,BC ; Add them + LD A,L ; Store new sprite position + LD (.sposy+1),A + LD A,H + LD (.sposy),A + CALL .place_sprite ; Update position + + RET + + ;; Open and close the door +.door: + LD A,(.doorstate) + CP #.OPENING + JP Z,.open_door + CP #.CLOSING + JP Z,.close_door + RET + +.open_door: + LD A,(.doorpos) + LD HL,#.film+0x02 + LD B,#0x00 + LD C,A + ADD HL,BC + LD C,(HL) + INC HL + LD B,(HL) + LD DE,#0x1010/8 ; Place image at (0x10,0x10) + LD HL,#0x6030/8 ; Image size is 0x60 x 0x30 + CALL .set_xy_wtt + + LD A,(.doorpos) + ADD A,#0x02 + LD (.doorpos),A + CP #.NBDFRAMES + RET NZ + LD A,#.OPENED + LD (.doorstate),A + RET + +.close_door: + LD A,(.doorpos) + LD HL,#.film-0x02 + LD B,#0x00 + LD C,A + ADD HL,BC + LD C,(HL) + INC HL + LD B,(HL) + LD DE,#0x1010/8 ; Place image at (0x10,0x10) + LD HL,#0x6030/8 ; Image size is 0x60 x 0x30 + CALL .set_xy_wtt + + LD A,(.doorpos) + SUB A,#0x02 + LD (.doorpos),A + RET NZ + LD A,#.CLOSED + LD (.doorstate),A + RET + + ;; Animate sprite +.animate_sprite: + LD A,(.time) + AND #0x07 + RET NZ + + LD A,(.sframe) + INC A + CP #.NBSFRAMES + JR NZ,1$ + XOR A +1$: + LD (.sframe),A + + CALL .tile_sprite + RET + + ;; Set sprite tiles +.tile_sprite: + LD A,(.sframe) + LD HL,#.earth_tiles + RLCA + LD B,#0x00 + LD C,A + ADD HL,BC + LD C,#0x00 ; Sprite 0x00 + LD A,(HL+) + LD D,A + PUSH HL + CALL .set_sprite_tile + POP HL + + LD C,#0x01 ; Sprite 0x01 + LD A,(HL+) + LD D,A + CALL .set_sprite_tile + + RET + + ;; Place sprite +.place_sprite: + LD C,#0x00 ; Sprite 0x00 + LD A,(.sposx) + LD D,A + LD A,(.sposy) + LD E,A + PUSH DE ; Store position + CALL .mv_sprite + + LD C,#0x01 ; Sprite 0x01 + POP DE ; Restore position + LD A,#0x08 + ADD A,D + LD D,A + CALL .mv_sprite + + RET + + .area _LIT + +.tp0: + +.std_data: + + ; Basic tiles (0xFC to 0xFF) + + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00 + .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF + .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + +.endtp0: + +.tp1: + +.earth_data: + + ; Tile 0x00 + .byte 0x07,0x07,0x18,0x1F,0x32,0x2D,0x71,0x4E,0x70,0x4F,0xF8,0x87,0xF8,0x87,0xF8,0x87 + .byte 0xFC,0x83,0xFE,0x81,0x7F,0x40,0x7F,0x40,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0xF0,0x30,0x78,0x88,0x3C,0xC4,0x5C,0xA4,0x9E,0x62,0x3E,0xC2,0x3E,0xC2 + .byte 0x5E,0xA2,0x7E,0x82,0x0C,0xF4,0x0C,0xF4,0x98,0x68,0xB0,0x70,0xC0,0xC0,0x00,0x00 + .byte 0x07,0x07,0x1F,0x18,0x2F,0x30,0x4F,0x70,0x6F,0x50,0x9F,0xE0,0x9F,0xE0,0xBF,0xC0 + .byte 0xFF,0x80,0xB7,0xC8,0x63,0x5C,0x43,0x7C,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0xB0,0x70,0x18,0xE8,0x0C,0xF4,0x0C,0xF4,0x82,0x7E,0x82,0x7E,0x86,0x7A + .byte 0xC6,0x3A,0xE6,0x1A,0xF4,0x0C,0xFC,0x04,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 + + ; Tile 0x08 + .byte 0x07,0x07,0x1E,0x19,0x20,0x3F,0x40,0x7F,0x42,0x7D,0x81,0xFE,0x81,0xFE,0x83,0xFC + .byte 0xD7,0xA8,0xBB,0xC4,0x6E,0x51,0x7C,0x43,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0x70,0xB0,0xE8,0x18,0xF4,0x0C,0xF4,0x0C,0xFE,0x02,0xFE,0x02,0xFE,0x02 + .byte 0xFE,0x02,0x7E,0x82,0x3C,0xC4,0x3C,0xC4,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 + .byte 0x07,0x07,0x1B,0x1C,0x20,0x3F,0x40,0x7F,0x40,0x7F,0xE0,0x9F,0x90,0xEF,0x89,0xF6 + .byte 0x8D,0xF2,0x9F,0xE0,0x5E,0x61,0x6F,0x50,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0xB0,0x70,0x28,0xD8,0x04,0xFC,0x2C,0xD4,0x1E,0xE2,0x1E,0xE2,0x3E,0xC2 + .byte 0x7E,0x82,0xB6,0x4A,0xE4,0x1C,0xC4,0x3C,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 + + ; Tile 0x10 + .byte 0x07,0x07,0x18,0x1F,0x20,0x3F,0x40,0x7F,0x40,0x7F,0xEE,0x91,0xF1,0x8E,0xE0,0x9F + .byte 0xE0,0x9F,0xF1,0x8E,0x71,0x4E,0x72,0x4D,0x3F,0x20,0x1F,0x18,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0xF0,0x30,0x08,0xF8,0x04,0xFC,0x04,0xFC,0x02,0xFE,0x02,0xFE,0x92,0x6E + .byte 0xD6,0x2A,0xFE,0x02,0xEC,0x14,0xFC,0x04,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 + .byte 0x07,0x07,0x1D,0x1A,0x36,0x29,0x5C,0x63,0x6C,0x53,0xCE,0xB1,0x9F,0xE0,0x9E,0xE1 + .byte 0xAE,0xD1,0xBF,0xC0,0x47,0x78,0x47,0x78,0x2F,0x30,0x1F,0x18,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0x70,0xB0,0x08,0xF8,0x04,0xFC,0x04,0xFC,0xE2,0x1E,0x32,0xCE,0x0E,0xF2 + .byte 0x0E,0xF2,0x1E,0xE2,0x1C,0xE4,0x2C,0xD4,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 + + ; Tile 0x18 + .byte 0x07,0x07,0x1E,0x19,0x33,0x2C,0x49,0x76,0x42,0x7D,0xC4,0xBB,0xC1,0xBE,0xC1,0xBE + .byte 0xE2,0x9D,0xF3,0x8C,0x78,0x47,0x78,0x47,0x3C,0x23,0x1C,0x1B,0x07,0x07,0x00,0x00 + .byte 0xC0,0xC0,0x70,0xB0,0x68,0x98,0xC4,0x3C,0xC4,0x3C,0xEE,0x12,0xF2,0x0E,0xE2,0x1E + .byte 0xE2,0x1E,0xF2,0x0E,0x7C,0x84,0x7C,0x84,0xF8,0x08,0xF0,0x30,0xC0,0xC0,0x00,0x00 + +.endtp1: + +.tp2: + +.frame_data: + + ; Tile 0x00 + .byte 0xFF,0x00,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F + .byte 0xFF,0x00,0x01,0xFE,0x03,0xFC,0x07,0xF8,0x0F,0xF0,0x1F,0xE0,0x3F,0xC0,0x7F,0x80 + .byte 0xFF,0x00,0xFE,0x01,0xFC,0x03,0xF8,0x07,0xF0,0x0F,0xE0,0x1F,0xC0,0x3F,0x80,0x7F + .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF + .byte 0xFF,0x00,0xFF,0x01,0xFD,0x03,0xF9,0x07,0xF1,0x0F,0xE1,0x1F,0xC1,0x3F,0x81,0x7F + .byte 0x80,0x7F,0x81,0x7E,0x83,0x7C,0x87,0x78,0x8F,0x70,0x9F,0x60,0xBF,0x40,0xFF,0x00 + .byte 0xFF,0x70,0xFF,0x98,0xEF,0xB8,0xCF,0xF8,0xFF,0x70,0xFF,0x00,0xFF,0x00,0xFF,0x01 + .byte 0xFF,0x00,0xFE,0x01,0xFC,0x03,0xF8,0x07,0xF0,0x0F,0xE0,0x1F,0xC0,0x3F,0xFF,0xFF + + ; Tile 0x08 + .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF + .byte 0x00,0xFF,0x01,0xFE,0x03,0xFC,0x07,0xF8,0x0F,0xF0,0x1F,0xE0,0x3F,0xC0,0xFF,0xFF + .byte 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF + .byte 0xFF,0x0E,0xFF,0x13,0xFD,0x17,0xF9,0x1F,0xFE,0x0F,0xE0,0x1F,0xC0,0x3F,0x80,0xFF + .byte 0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF + .byte 0xFF,0x01,0xFF,0x01,0xFD,0x03,0xF9,0x07,0xF1,0x0F,0xE1,0x1F,0xC1,0x3F,0x81,0x7F + .byte 0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F,0x80,0x7F + .byte 0x01,0xFF,0x01,0xFF,0x03,0xFD,0x07,0xF9,0x0F,0xF1,0x1F,0xE1,0x3F,0xC1,0x7F,0x81 + + ; Tile 0x10 + .byte 0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01 + .byte 0x01,0xFF,0x01,0xFE,0x03,0xFC,0x77,0xF8,0xFF,0x98,0xEF,0xB8,0xCF,0xF8,0x7F,0xF0 + .byte 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x0E,0xFF,0x13,0xFD,0x17,0xF9,0x1F,0xFF,0x0E + .byte 0x80,0x7F,0x81,0x7E,0x83,0x7C,0x87,0x78,0x8F,0x70,0x9F,0x60,0xBF,0x40,0xFF,0x7F + .byte 0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0xFF,0xFF + +.door1_data: + + ; Tile 0x15 + .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF + .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF + .byte 0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF + +.door2_data: + + ; Tile 0x18 + .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF + .byte 0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF + .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF + .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + +.door3_data: + + ; Tile 0x1C + .byte 0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF + .byte 0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF + .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0x00,0xFF,0x00,0xFF + .byte 0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + +.door4_data: + + ; Tile 0x20 + .byte 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + +.endtp2: + +.tp3: + +.bkg_data: + + ; Tile 0x00 + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xF7,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xDF,0xFF,0xEF,0xFF,0xFF,0xF7,0xFF,0xFB,0xFF,0xFD,0xFF,0xFE,0xFE,0xFF + + ; Tile 0x08 + .byte 0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7D,0xFE,0x7C,0x39 + .byte 0xFF,0xFF,0xF7,0xFF,0xEF,0xFF,0xFF,0xDF,0xFF,0xBF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFE,0xFF,0xFD + .byte 0xBB,0x01,0xC7,0x83,0xC7,0x83,0xC7,0x83,0xBB,0x01,0x7C,0x39,0x7D,0xFE,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F + .byte 0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFB,0xAF,0x77,0x27,0x8F,0xDF,0x8F,0x27,0x8F + + ; Tile 0x10 + .byte 0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFB,0xFF,0xF7,0xEF,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xBF,0xFF,0xDF,0xEF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFE,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xAF,0x77,0xFF,0xFB,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF + + ; Tile 0x18 + .byte 0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x7D,0xFE,0x7C,0x39 + .byte 0xFF,0xFF,0xF7,0xFF,0xEF,0xFF,0xFF,0xDF,0xFF,0xBF,0xFF,0x7F,0x7F,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFD + + ; Tile 0x20 + .byte 0xFF,0xFF,0xDF,0xFF,0xEF,0xFF,0xFF,0xF7,0xFF,0xFB,0xFE,0xFD,0xFD,0xFE,0xFE,0xFF + .byte 0xAB,0x11,0xC7,0x83,0x83,0xC7,0xC7,0x83,0xAB,0x11,0x7C,0x39,0x7D,0xFE,0xFE,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFB,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0x7F + .byte 0xFB,0xFF,0xFF,0xFD,0xFE,0xFE,0xFE,0xFF,0xFE,0xFE,0xFF,0xFD,0xFB,0xFF,0xFF,0xFF + .byte 0xEF,0xFF,0xFF,0xDF,0x3F,0xBF,0x3F,0x7F,0x3F,0xBF,0xFF,0xDF,0xEF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFB,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFD,0xFE,0xFE,0xFD + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xFF + + ; Tile 0x28 + .byte 0xF7,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + .byte 0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + +.endtp3: + + ; Image size: 0x40 x 0x40 + ; Number of tiles (total - unique): 0x40 - 0x2D + +.bkg_tiles: + + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + .byte 0x00,0x01,0x02,0x03,0xFC,0xFC,0x04,0xFC + + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + .byte 0xFC,0x05,0x06,0xFC,0x07,0x08,0x09,0x0A + + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + .byte 0xFC,0xFC,0xFC,0x02,0x0B,0x0C,0x0D,0xFC + + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + .byte 0x0E,0x0F,0x10,0xFC,0x11,0x12,0x13,0x14 + + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + .byte 0x15,0x16,0x17,0xFC,0x18,0x19,0x1A,0xFC + + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + .byte 0x1B,0x1C,0x1D,0xFC,0xFC,0x1E,0x1F,0x20 + + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + .byte 0x21,0x22,0xFC,0x23,0x24,0x25,0xFC,0x26 + + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + .byte 0x27,0x13,0x28,0x29,0x2A,0x2B,0x2C,0x11 + + ; Image size: 0x10 x 0x70 + ; Number of tiles (total - unique): 0x1C - 0x1C + +.earth_tiles: + + .byte 0x00,0x02 + .byte 0x04,0x06 + .byte 0x08,0x0A + .byte 0x0C,0x0E + .byte 0x10,0x12 + .byte 0x14,0x16 + .byte 0x18,0x1A + + ; Image size: 0x80 x 0x50 + ; Number of tiles (total - unique): 0xA0 - 0x15 + +.frame_tiles: + + .byte 0x80,0x81,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0xFD,0x84 + .byte 0x85,0x86,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x8B,0x8C + .byte 0xFD,0x8D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8E,0x8F + .byte 0x82,0x8C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x85,0x90 + .byte 0x8E,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0x8D + .byte 0x85,0x90,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x82,0x8C + .byte 0xFD,0x8D,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8E,0x8F + .byte 0x82,0x8C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x85,0x90 + .byte 0x8E,0x91,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0xFD,0x82,0x83,0x81,0x92,0x8D + .byte 0x93,0x8A,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x87,0x88,0x89,0x8A,0x87,0x94 + + ; Image size: 0x60 x 0x30 + ; Number of tiles (total - unique): 0x48 - 0x03 + +.door1_tiles: + + .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 + .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 + .byte 0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97 + .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 + .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 + .byte 0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97 + + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + + ; Image size: 0x60 x 0x30 + ; Number of tiles (total - unique): 0x48 - 0x04 + +.door2_tiles: + + .byte 0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98 + .byte 0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99 + .byte 0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A,0x9A + .byte 0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x98 + .byte 0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99,0x99 + .byte 0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B,0x9B + + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + + ; Image size: 0x60 x 0x30 + ; Number of tiles (total - unique): 0x48 - 0x04 + +.door3_tiles: + + .byte 0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C + .byte 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D + .byte 0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E,0x9E + .byte 0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C,0x9C + .byte 0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D,0x9D + .byte 0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F,0x9F + + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + + ; Image size: 0x60 x 0x30 + ; Number of tiles (total - unique): 0x48 - 0x01 + +.door4_tiles: + + .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 + .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 + .byte 0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97,0x97 + .byte 0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95,0x95 + .byte 0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96,0x96 + .byte 0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0,0xA0 + + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + .byte 0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC + +.film: + .word .door1_tiles+0x0C*0 + .word .door2_tiles+0x0C*0 + .word .door3_tiles+0x0C*0 + .word .door4_tiles+0x0C*0 + .word .door1_tiles+0x0C*1 + .word .door2_tiles+0x0C*1 + .word .door3_tiles+0x0C*1 + .word .door4_tiles+0x0C*1 + .word .door1_tiles+0x0C*2 + .word .door2_tiles+0x0C*2 + .word .door3_tiles+0x0C*2 + .word .door4_tiles+0x0C*2 + .word .door1_tiles+0x0C*3 + .word .door2_tiles+0x0C*3 + .word .door3_tiles+0x0C*3 + .word .door4_tiles+0x0C*3 + .word .door1_tiles+0x0C*4 + .word .door2_tiles+0x0C*4 + .word .door3_tiles+0x0C*4 + .word .door4_tiles+0x0C*4 + .word .door1_tiles+0x0C*5 + .word .door2_tiles+0x0C*5 + .word .door3_tiles+0x0C*5 + .word .door4_tiles+0x0C*5 +.endfilm: + .word .door1_tiles+0x0C*6

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.