From 1744e672862660370173f4fdae738fa70c6f26ae Mon Sep 17 00:00:00 2001 From: Natt Akuma Date: Sat, 29 Nov 2025 10:27:57 +0700 Subject: [PATCH] Compress the main $e000 code too --- .gitignore | 14 +- loader/samples/minexample/Makefile | 17 +- loader/samples/minexample/bin.cfg | 11 + loader/samples/minexample/font.bin | Bin 529 -> 512 bytes loader/samples/minexample/main.asm | 1794 +++++++++++++++++++++- loader/samples/minexample/minexample.s | 1864 +---------------------- loader/samples/minexample/song1.bin | Bin 4464 -> 0 bytes loader/samples/minexample/test/bin.cfg | 11 + loader/samples/minexample/test/main.asm | 10 + 9 files changed, 1844 insertions(+), 1877 deletions(-) create mode 100644 loader/samples/minexample/bin.cfg delete mode 100644 loader/samples/minexample/song1.bin create mode 100644 loader/samples/minexample/test/bin.cfg create mode 100644 loader/samples/minexample/test/main.asm diff --git a/.gitignore b/.gitignore index 07aa64f..576f741 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,13 @@ loader/build loader/tools/cc1541/cc1541 -loader/samples/minexample/*.bak -loader/samples/minexample/*.o -loader/samples/minexample/*.zx0.prg -loader/samples/minexample/*.lz.prg -loader/samples/minexample/*.tmp +loader/samples/minexample/**/*.bak +loader/samples/minexample/**/*.o +loader/samples/minexample/**/*.zx0.prg +loader/samples/minexample/**/*.lz.prg +loader/samples/minexample/**/*.tmp +loader/samples/minexample/main.zx0 loader/samples/minexample/song0.bin +loader/samples/minexample/song1.bin +loader/samples/minexample/font.prg +loader/samples/minexample/test/*.prg diff --git a/loader/samples/minexample/Makefile b/loader/samples/minexample/Makefile index faf8311..725b102 100644 --- a/loader/samples/minexample/Makefile +++ b/loader/samples/minexample/Makefile @@ -164,9 +164,7 @@ $(LOADER): $(LOADERCFG) assemble: $(ASSEMBLE) -$(SOURCE): $(LOADER) ; - -$(ASSEMBLE): $(SOURCE) +$(ASSEMBLE): $(SOURCE) $(LOADER) main.zx0 $(MKDIR) $(BUILDDIR) $(MKDIR) $(INTERMDIR) ifeq ($(_PLATFORM_),c64) @@ -180,14 +178,14 @@ endif diskimage: $(DISKIMAGE) -$(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(ZX0PRGS) $(LZPRGS) font.bin +$(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(ZX0PRGS) $(LZPRGS) font.prg $(RM) $@ $(CC1541) -n "otomata labs" -i " 2025" \ -f "ys2intro" -w $< \ -f "song0" -w song0.zx0.prg \ -f "song1" -w song1.zx0.prg \ -f "badguy" -w badguy.zx0.prg \ - -f "font" -w font.bin \ + -f "font" -w font.prg \ -f "intrbmp" -w title_320-prepared.zx0.prg \ -f "tower" -w tower.zx0.prg \ -f "towerbm" -w tower_beam.zx0.prg \ @@ -229,6 +227,12 @@ $(ZX02): $(PRINTF) "\000\220" | $(CAT) - $@.tmp > $@ $(RM) $@.tmp +main.zx0: main.asm + $(RM) $@ + $(AS) -t c64 -C bin.cfg -o $@.tmp $< + $(ZX02) $@.tmp $@ + $(RM) $@.tmp + song0.bin: ys2_fixed_drums.fur cd $(FURC64) && ./convert.sh $(abspath $<) cp $(FURC64)/asm/song.bin $@ @@ -237,6 +241,9 @@ song1.bin: ys2_lilia_sid.fur cd $(FURC64) && ./convert.sh $(abspath $<) cp $(FURC64)/asm/song.bin $@ +font.prg: test/main.asm font.bin #test/logo.bin test/txtbg.bin + $(AS) -t c64 -C test/bin.cfg -o $@ $< + clean: -$(RM) $(ZX0PRGS) $(LZPRGS) -$(RM) *.o $(ASSEMBLE) $(DISKIMAGE) diff --git a/loader/samples/minexample/bin.cfg b/loader/samples/minexample/bin.cfg new file mode 100644 index 0000000..88a98b7 --- /dev/null +++ b/loader/samples/minexample/bin.cfg @@ -0,0 +1,11 @@ +MEMORY { + ZP: file = "", start = $0002, size = $00FE, define = yes; + MAIN: file = %O, start = $E000, size = $1FFA; +} +SEGMENTS { + ZEROPAGE: load = ZP, type = zp, optional = yes; + CODE: load = MAIN, type = rw; + RODATA: load = MAIN, type = ro, optional = yes; + DATA: load = MAIN, type = rw, optional = yes; + BSS: load = MAIN, type = bss, optional = yes, define = yes; +} diff --git a/loader/samples/minexample/font.bin b/loader/samples/minexample/font.bin index 60320e77e37014caa8e8ff567f7cc5d05c05b0f3..13078277a37661ec46e40c360db565fa87d49c7b 100644 GIT binary patch delta 7 OcmbQp(!jEii3tD*j{&~` delta 25 XcmZo*naIM#z_Wmfp8*N@@bCcuD8d3i diff --git a/loader/samples/minexample/main.asm b/loader/samples/minexample/main.asm index 3718b33..8497f4c 100644 --- a/loader/samples/minexample/main.asm +++ b/loader/samples/minexample/main.asm @@ -1,15 +1,691 @@ .feature c_comments +.include "../../build/loadersymbols-c64.inc" -.zeropage +.ZEROPAGE +.org $10 +bmp_delay: .res 1 +bmp_addr: .res 2 +bmp_ptr: .res 2 +scr_ptr_lo: .res 1 +scr_ptr: .res 2 +cram_ptr: .res 2 +chr_count: .res 1 +vbl: .res 1 +frame: .res 1 +cur_frame: .res 1 +frame_delay: .res 1 +frame_until: .res 1 +text_ptr: .res 2 +timer: .res 2 +timer_limit: .res 2 +timer_reached: .res 2 +timer_mode: .res 1 +enable_music: .res 1 +temp: .res 3 + +.include "lz_zp.asm" + +zx02 = $082f +check_return = $08b5 +CODE_START_ADDR = $e000 +aart_lz_buffer = $fd00 .segment "CODE" -.org $080D -main: - sei - lda #$35 - sta $01 +ZP=$e0 +offset = ZP+0 +ZX0_src = ZP+2 +ZX0_dst = ZP+4 +bitr = ZP+6 +pntr = ZP+7 + + .org CODE_START_ADDR +code_start: + lda #0 + sta $d020 + sta ZX0_dst+0 + lda #$0b + sta $d011 + jsr load_font + .assert * = CODE_START_ADDR + 15, error + lda #0 + sta enable_music + jsr init_2x + jsr clr_txt + ldx #copyright + jsr write_txt3 + ldx #$00 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #badguy + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$90 + ldy #$01 + jsr txt_fade_out + + sei + jsr init_bmp + jsr set_irq_badguy + lda #0 + sta vbl + cli + + jsr intro + + lda #$0b + sta $d011 + + sei + ldx #introname + lda #$10 + jsr load_8000_zx02 + + ldx #song0name + lda #$a0 + jsr load_8000_zx02 + + lda #fake_kernal_irq + sta $ffff + inc enable_music + + jsr run_nufli_bmp + sei + jsr init_2x + lda #$0b + sta $d011 + + jsr clr_txt + ldx #story_writ + jsr write_txt3 + ldx #$30 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #towername + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$b8 + ldy #$01 + jsr txt_fade_out + + jsr init_bmp + + lda #0 + sta vbl + + lda #$11 + jsr wait_frame_until_2x + + ldx #$6c +: + jsr wait_frame + jsr wait_frame + dex + bpl :- + + lda #$0b + sta $d011 + + jsr clr_txt + ldx #scenario_writ + jsr write_txt2 + ldx #$80 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #towerbeamname + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$90 + ldy #$01 + jsr txt_fade_out + + jsr init_bmp + + lda #0 + sta vbl + + lda #$0d + jsr wait_frame_until_2x + lda bmp_addr + sta temp + lda bmp_addr+1 + sta temp+1 + lda cur_frame + sta temp+2 + + ldx #17 +: + txa + pha + lda temp+2 + sta cur_frame + lda temp + sta bmp_addr + lda temp+1 + sta bmp_addr+1 + lda #$0d+3 + jsr wait_frame_until_2x + pla + tax + dex + bpl :- + + lda #$0b + sta $d011 + + jsr clr_txt + ldx #prog_writ + jsr write_txt2 + ldx #$a8 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #fieldname + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$48 + ldy #$01 + jsr txt_fade_out + + jsr init_bmp + + lda #0 + sta vbl + + lda #$08 + jsr wait_frame_until_2x + lda bmp_addr + sta temp + lda bmp_addr+1 + sta temp+1 + lda cur_frame + sta temp+2 + + ldx #2 +: + txa + pha + lda temp+2 + sta cur_frame + lda temp + sta bmp_addr + lda temp+1 + sta bmp_addr+1 + lda #$08+8 + jsr wait_frame_until_2x + pla + tax + dex + bpl :- + + + lda #0 + sta vbl + lda #$27 + jsr wait_frame_until_2x + + ldx #25 +: + jsr wait_frame + dex + bpl :- + + lda #$0b + sta $d011 + + jsr clr_txt + ldx #gart_writ + jsr write_txt5 + ldx #$80 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #fallingstarname + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$48 + ldy #$01 + jsr txt_fade_out + + jsr init_bmp + + lda #$1d + jsr wait_frame_until_2x + + ldx #5 +: + jsr wait_frame + dex + bpl :- + + lda #$0b + sta $d011 + + jsr clr_txt + ldx #music_writ + jsr write_txt4 + ldx #$80 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #lilianame + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$10 + ldy #$01 + lda #8*11 + jsr txt_fade_out_offset + + ldx #$c4 + ldy #$01 + jsr init_timer + + jsr init_bmp + + lda #$08 + jsr wait_frame_until_2x + +: + lda timer_reached + beq :- + + lda #$0b + sta $d011 + + jsr clr_txt + ldx #scene_writ + jsr write_txt3 + ldx #$80 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #liliaheroname + jsr load_8000_zx02_2000 + +: + lda timer_reached + beq :- + + ldx #$20 + ldy #$01 + jsr txt_fade_out + + jsr init_bmp + + ldx #4 +: + lda #0 + sta vbl + lda #60 +: + cmp vbl + bne :- + dex + bpl :-- + +part_9: + ; $0400-$07ff buffer 0 tilemap + ; $2000-$3fff buffer 0 bitmap + ; $4000-$5fff buffer 1 bitmap + ; $6000-$63ff buffer 1 tilemap + ; $6400-$6417 next buffer CRAM + ; $7000-$77ff tileset bitmap + ; $7800-$78ff tileset tile colors + ; $7900-$79ff tileset CRAM colors + ; $9000- compressed tilemap + + jsr clr_txt + ldx #art_direct + jsr write_txt2 + ldx #$c0 + ldy #$01 + jsr init_timer + + lda #1 + sta timer_mode + + ldx #islandname + lda #$70 + jsr load_8000_zx02 + ldx #islandmapname + jsr loadraw + ldx #0 + ldy #$90 + jsr LZ_init_decomp + +: + lda timer_reached + beq :- + + ldx #$90 + ldy #$01 + lda #8 + jsr txt_fade_out_offset + + lda #0 + sta $d011 + jsr clear_2bufs + + ; set up sprites to cover scrolling + lda #$ff + ldx #0 +: sta $2000,x + sta $4000,x + inx + bne :- + .repeat 4, I + ldx #I*48+$58 + stx $d000+I*2 + stx $d008+I*2 + .endrepeat + ldx #6 +: + lda #$42 + sta $d001,x + lda #$d7 + sta $d009,x + dex + dex + bpl :- + ldx #7 +: + lda #$80 + sta $07f8,x + lda #0 + sta $63f8,x + sta $d027,x + dex + bpl :- + stx $d01d + stx $d015 + inx + stx $d010 + stx $d017 + stx $d01b + stx $d01c + stx frame + + lda #$18 + sta $d018 + lda #<((17+4)*40+$408) + sta text_ptr + lda #>((17+4)*40+$408) + sta text_ptr+1 + ldx #16 +: + lda #0 + lda text_ptr + sec + sbc #40 + sta text_ptr + sta scr_ptr + sta cram_ptr + sta bmp_ptr + lda text_ptr+1 + sbc #0 + sta text_ptr+1 + sta scr_ptr+1 + ; carry is always set here + adc #$d8-$04-1 + sta cram_ptr+1 + adc #<(($20>>3)-$d8) + asl bmp_ptr + rol a + asl bmp_ptr + rol a + asl bmp_ptr + rol a + sta bmp_ptr+1 + stx temp+1 + jsr drawrow + ldx temp+1 + dex + bpl :- + lda #0 + sta cram_ptr + lda #$64 + sta cram_ptr+1 +: + lda $d011 + bpl :- + lda #$38 + sta $d011 + lda #$18 + sta $d016 + lda #3 + sta timer_mode +@loop: + lda #0 + sta vbl + lda frame + cmp #$e1 + bcc :+ + jmp @finish +: + and #1 + tax + jsr copybuf + jsr drawrow +: + lda vbl + cmp #32 + bcc :- + ; B U M R U S H C R A M C O P Y F U N K + ldy #23 +: .repeat 16, I + lda $d808+(19-I)*40,y + sta $d808+(20-I)*40,y + .endrepeat + lda $6400,y + sta $d808+4*40,y + dey + bpl :- + inc frame + lda frame + lsr a + lda #$18 + ldx #3 + bcc :+ + lda #$80 + ldx #2 +: + sta $d018 + stx $dd00 + jmp @loop + +@finish: + ldx #$a8 + ldy #$01 + jsr init_timer +: + lda timer_reached + beq :- + lda #$0b + sta $d011 + lda #0 + sta $d015 + lda #3 + sta $dd00 + + ; we run out of space before the fixed location vector return now + jmp part_10 + +drawrow: + ldy #0 +charloop: + sty temp + lda #$70>>3 + sta bmp_addr+1 + jsr LZ_get_byte + tax + asl a + rol bmp_addr+1 + asl a + rol bmp_addr+1 + asl a + rol bmp_addr+1 + sta bmp_addr + ldy #0 + .repeat 8, I + lda (bmp_addr),y + sta (bmp_ptr),y + iny + .endrepeat + clc + lda bmp_ptr + adc #8 + sta bmp_ptr + bne :+ + inc bmp_ptr+1 +: + ldy temp + lda $7800,x + sta (scr_ptr),y + lda $7900,x + sta (cram_ptr),y + iny + cpy #24 + bne charloop + rts + +intro: + lda #0 + jsr sfx_init + + lda #7 + jsr wait_frame_until + + lda #64 + sta frame_delay + jsr wait_loop + + lda #1 + jsr sfx_init + + ldx #darmtower_txt + jsr upload_text + ldx #<(darmtower_txt+40) + ldy #>(darmtower_txt+40) + jsr upload_text_bottom + + lda #50*5 + sta frame_delay + jsr wait_loop + + jsr clear_text + + lda #$0d + jsr wait_frame_until + + ldx #adol_win + jsr upload_text + ldx #<(adol_win+40) + ldy #>(adol_win+40) + jsr upload_text_bottom + + lda #50*5 + sta frame_delay + jsr wait_loop + + jsr clear_text + ldx #too_bad_txt + jsr upload_text + + lda #50*5 + sta frame_delay + jsr wait_loop + + jsr clear_text + + lda #$13 + jsr wait_frame_until + + lda #0 + jsr sfx_init + + lda #$1a + jsr wait_frame_until + + lda #120 + sta frame_delay + jmp wait_loop + +wait_frame: +@loop: + bit $d011 + bpl @loop +@loop2: + bit $d011 + bmi @loop2 + rts + +init_2x: lda #127 sta $dc0d @@ -19,9 +695,9 @@ main: lda $dc0d lda $dd0d - lda #irq + lda #>irq_music sta $ffff lda #$0b @@ -29,13 +705,29 @@ main: lda #$00 sta $d012 +position_2x_to_display: + lda #50 +position_2x: +: + bit $d011 + bpl :- +: + bit $d011 + bmi :- +: + cmp $d012 + bne :- + lda #0 sta $d01a + sta $dc0e lda #$63; <(985248/100) sta $dc04 - lda #$26;>(985248/100) + lda #$26; >(985248/100) sta $dc05 + lda #$11 + sta $dc0e lda $dc0d and #$81 @@ -47,10 +739,43 @@ main: lda #$81 sta $dc0d - lda #0 - jsr $1000 +@loop: + bit $d011 + bpl @loop +@loop2: + bit $d011 + bmi @loop2 cli - jmp * + rts + +init_timer: + lda #0 + sta timer_reached + sta timer_mode + sta timer + sta timer+1 + stx timer_limit + sty timer_limit+1 + rts + +fade_cols: + .byte 0, 0 + .byte $0, $0, $0, $0, $b, $c, $f, $1 + .res 32-10, $1 + +fake_kernal_irq: + pha + txa + pha + tya + pha + tsx + lda $0104, x + and #$10 + beq :+ + jmp ($0314) +: + jmp ($0314) ; fuck you irq_music: pha @@ -59,18 +784,1049 @@ irq_music: tya pha - inc $d020 - jsr $1003 - dec $d020 + lda $dd00 + and #3 + sta @dd00_arc+1 + and #3 + sta $dd00 + + inc vbl + + ;inc $d020 + lda enable_music + beq :+ + jsr $a003 +: + ;dec $d020 + + lda timer_mode + cmp #1 + bne :+ + lda timer+1 + bne :+ + lda timer + lsr + lsr + lsr + tax + lda fade_cols, x + sta $d021 +: + lda timer_mode + cmp #2 + bne :+ + lda timer+1 + bne :+ + lda timer + lsr + lsr + lsr + eor #31 + tax + lda fade_cols, x + sta $d021 +: + + inc timer + bne :+ + inc timer+1 +: + lda timer + sec + sbc timer_limit + lda timer+1 + sbc timer_limit+1 + bcc :+ + lda #1 + sta timer_reached +: + lda timer_mode + cmp #3 + bne @timer_done + lda vbl + lsr a + bcs @timer_done + lsr a + and #7 + ora #$38 + sta $d011 + +@timer_done: + +@dd00_arc: + lda #0 + sta $dd00 pla tay pla tax pla - ;rti jmp $dc0c - -.res $1000-* -.incbin "ys2_sid.sid", $7e+($1000-$ff6) \ No newline at end of file +wait_loop: +@loop2: + lda vbl + beq @loop2 + + lda #0 + sta vbl + + lda enable_music + bne :+ + jsr sfx_play +: + + dec frame_delay + lda frame_delay + beq :+ + jmp @loop2 +: + rts + +wait_frame_until: + sta frame_until +@loop: + lda vbl + beq @loop + + lda #0 + sta vbl + + lda cur_frame + cmp #2 + bcc :+ + jsr sfx_play +: + + dec bmp_delay + bpl :+ + jsr update_bmp +: + + lda cur_frame + cmp frame_until + beq :+ + + jmp @loop +: + rts + +wait_frame_until_2x: + sta frame_until +@loop: + lda vbl + cmp #2 + bcc @loop + + lda #0 + sta vbl + + dec bmp_delay + bpl :+ + jsr update_bmp +: + + lda cur_frame + cmp frame_until + beq :+ + jmp @loop +: + rts + +init_bmp: + lda #$0b + sta $d011 + lda #$19 + sta $d018 + lda #$d8 + sta $d016 + + lda $4710 + lsr + lsr + lsr + lsr + sta $d020 + + lda $4710 + and #$0f + sta $d021 + + lda #0 + sta cur_frame + sta bmp_delay + + lda #$11 + sta bmp_addr + lda #$47 + sta bmp_addr+1 + + ldx #0 +: + .repeat 4, I + lda $3f40+(I*250), x + sta $400+(I*250), x + lda $4328+(I*250), x + sta $d800+(I*250), x + .endrepeat + inx + cpx #250 + bne :- + + lda #$3b + sta $d011 + rts + +inc_bmp_addr: + inc bmp_addr + bne :+ + inc bmp_addr+1 +: + rts + +update_bmp: + ldy #0 + sty scr_ptr + sty cram_ptr + lda (bmp_addr), y + jsr inc_bmp_addr + sta chr_count + cmp #0 ; tfw flags update in inc_bmp_addr + bne @skip_frame_end + lda (bmp_addr), y + jsr inc_bmp_addr + sta bmp_delay + inc cur_frame + rts +@skip_frame_end: + + lda (bmp_addr), y + sta bmp_ptr + iny + lda (bmp_addr), y + clc + adc #$20 + sta bmp_ptr+1 + + iny + lda (bmp_addr), y + sta scr_ptr_lo + iny + lda (bmp_addr), y + clc + adc #$04 + sta scr_ptr+1 + clc + adc #$d8-$04 + sta cram_ptr+1 + + ldy #0 + lda bmp_addr + clc + adc #4 + sta bmp_addr + bcc :+ + inc bmp_addr+1 +: + + ldx #0 +@loop: + ldy #0 + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + iny + lda (bmp_addr), y + sta (bmp_ptr), y + + lda bmp_ptr + clc + adc #8 + sta bmp_ptr + bcc :+ + inc bmp_ptr+1 +: + + ldy #8 + lda (bmp_addr), y + ldy scr_ptr_lo + sta (scr_ptr), y + + ldy #9 + lda (bmp_addr), y + ldy scr_ptr_lo + sta (cram_ptr), y + + inc scr_ptr_lo + bne :+ + inc scr_ptr+1 + inc cram_ptr+1 +: + + lda bmp_addr + clc + adc #10 + sta bmp_addr + bcc :+ + inc bmp_addr+1 +: + + dec chr_count + ldx chr_count + bne @loop + jmp update_bmp + +irq_badguy: + pha + + pha + pla + pha + pla + pha + pla + lda #$1b + sta $d011 + lda #$c8 + sta $d016 + lda #$13 + sta $d018 + lda #1 + sta $d021 + + lda #irq_badguy2 + sta $ffff + lda #$fb + sta $d012 + + asl $d019 + pla + rti + +irq_badguy2: + pha + + inc vbl + lda #$3b + sta $d011 + lda #$d8 + sta $d016 + lda #$19 + sta $d018 + lda #0 + sta $d021 + + lda #irq_badguy + sta $ffff + lda #$d2 + sta $d012 + + lda enable_music + beq :+ + txa + pha + tya + pha + jsr $a003 + pla + tay + pla + tax +: + asl $d019 + pla + rti + +set_irq_badguy: + lda #127 + sta $dc0d + + and $d011 + sta $d011 + + lda $dc0d + lda $dd0d + + lda #irq_badguy + sta $ffff + + lda #$d2 + sta $d012 + lda #1 + sta $d01a + asl $d019 + rts + +badguy: .byte "badguy",0 +fontname: .byte "font",0 +song0name: .byte "song0", 0 +song1name: .byte "song1", 0 +introname: .byte "intrbmp", 0 +towername: .byte "tower", 0 +towerbeamname: .byte "towerbm", 0 +fieldname: .byte "field", 0 +fallingstarname: .byte "fallstar", 0 +lilianame: .byte "lilia", 0 +liliaheroname: .byte "lilhero", 0 +islandname: .byte "island", 0 +islandmapname: .byte "islandmap", 0 +cloudsname: .byte "clouds", 0 +liliatalkname: .byte "liltalk", 0 + + +darmtower_txt: + .byte " darm's tower has fallen silent. " + .byte " what should we do? " + +adol_win: + .byte " ", 34, "it must be adol, let's see " + .byte " how far he'll get!", 34, " " + +too_bad_txt: + .byte " as you command. " + +upload_text: + stx text_ptr + sty text_ptr+1 + + ldy #39 +: + lda (text_ptr), y + clc + adc #$60 + sta $748, y + dey + bpl :- + rts + +upload_text_bottom: + stx text_ptr + sty text_ptr+1 + + ldy #39 +: + lda (text_ptr), y + clc + adc #$60 + sta $748+40+40, y + dey + bpl :- + rts + +clear_text: + lda #$80 + ldy #39 +: + sta $748, y + sta $748+40+40, y + dey + bpl :- + rts + +run_nufli_bmp: + lda #$01 + sta $81 + lda #$29 + sta $80 + lda #0 + sta $d01a + asl $d019 + jsr $a000 + jsr $3000 +@loop: + bit $d011 + bpl @loop + jsr $a003 +@loop2: + bit $d011 + bmi @loop2 + lda #0 + sta $d020 + sta $d021 + jsr $a003 + lda $80 + bne :+ + dec $81 +: + dec $80 + lda $81 + cmp #$ff + beq :+ + jmp @loop +: + lda #0 + sta $d015 + rts + + +.res $ea31-*, $ff + ;asl $d019 + pla + tay + pla + tax + pla + rti + +.res $ea81-*, $ff + ;asl $d019 + pla + tay + pla + tax + pla + rti + +.include "sfx.asm" +.include "thcmod_lz.asm" + +zx02_8000: + pha + jmp :+ + +load_8000_zx02_2000: + lda #$20 +load_8000_zx02: + pha + jsr loadraw +: + lda #0 + sta ZX0_src + sta ZX0_dst + lda #$80 + sta ZX0_src+1 + pla + jmp zx02 + +load_font: + bcc :+ + pha +: + ldx #fontname + jsr loadraw + bcs :- + rts + +part_10: + ; the sprite data is embedded into first few bitmap pixels + ; which are hidden by black border attributes +@y = 93 + jsr clr_txt + ldx #total_direct + jsr write_txt2 + ldx #$c0 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #cloudsname + jsr load_8000_zx02_2000 +: + lda timer_reached + beq :- + + ldx #$48 + ldy #$01 + lda #$40 + jsr txt_fade_out_offset + + jsr init_bmp + ldx #0 + stx $d010 + stx $d017 + stx $d01d + stx $d025 + stx frame + dex + stx $d01b + stx $d01c + lda #11 + sta $d026 + lda #@y+48 + jsr position_2x + lda #0 + sta vbl + ; draw top half +@loop: + bit $d011 + bpl @loop + ldx #0 + ldy #0 + lda frame + bpl :+ + jmp @finish +: + cmp #$74 + bcc :+ + lda #$74 +: + pha +: + clc + adc @sprxs,x + sta $d000,y + sta temp + lda @sprys,x + sta $d001,y + txa + ora #$80 + sta $7f8,x + lda @sprcols,x + sta $d027,x + lda temp + iny + iny + inx + cpx #8 + bcc :- + lda #$ff + sta $d015 + + ; draw bottom half +: + bit $d011 + bmi :- + lda #@y+37 +: + cmp $d012 + bcs :- + + ldx #0 + ldy #0 + pla + clc +: + adc @sprxs+8,x + sta $d000,y + sta temp + lda @sprys+8,x + sta $d001,y + txa + ora #$88 + sta $7f8,x + lda @sprcols+8,x + sta $d027,x + lda temp + iny + iny + inx + cpx #6 + bcc :- + + lda vbl + and #15 + bne :+ + inc frame +: + jmp @loop + +@sprxs: + .byte 48, <-24, 24, 24, <-64, 24, 24, 24 + .byte 48-40, 24, 24, 24, <-44, 24 + +@sprys: + .byte @y-8, @y, @y, @y, @y+21, @y+21, @y+21, @y+21 + .byte @y+42, @y+42, @y+42, @y+42, @y+63, @y+63 + +@sprcols: + .byte 2, 5, 5, 5, 14, 14, 14, 6 + .byte 2, 2, 2, 9, 2, 2 + +@finish: + lda #$0b + sta $d011 + lda #0 + sta $d015 + + jsr clr_txt + ldx #produced + jsr write_txt2 + ldx #$c0 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode +: + lda timer_reached + beq :- + + ldx #$48 + ldy #$01 + lda #8*11 + jsr txt_fade_out_offset + +part_11: + jsr clr_txt + ldx #presented + jsr write_txt1 + ldx #$c0 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode + + ldx #liliatalkname + jsr load_8000_zx02_2000 +: + lda timer_reached + beq :- + + ; tell the music to end and wait +: + lda #1 + jsr $a006 + cmp #17 + bne :- + + ldx #$00 + ldy #$01 + lda #8*11 + jsr txt_fade_out_offset +: + lda timer_reached + beq :- + + ; load new music + sei + ldx #song1name + lda #$a0 + jsr load_8000_zx02 + jsr $a000 + jsr init_bmp + jsr set_irq_badguy + inc enable_music + cli + + lda #<256 + jsr wait_frame_until + lda #301-256 + jsr wait_frame_until + + sei + lda #$0b + sta $d011 + ldx #64 +: + jsr wait_frame + dex + bpl :- + jsr clr_txt + ldx #turn_disk + jsr write_txt2 + lda #1 + sta $d021 + jmp check_return + +clear_2bufs: + ldy #$44 + .byte $2c ; skip next instruction +clear_buf: + ldy #$20 + lda #$20 + sta @dst+2 + lda #0 + tax +: + sta $400,x + sta $500,x + sta $600,x + sta $700,x + inx + bne :- +@dst: + sta $2000,x + inx + bne @dst + inc @dst+2 + dey + bne @dst + rts + +copybuf: + lda @bsrclo,x + sta bmp_addr + lda @bsrchi,x + sta bmp_addr+1 + lda @bdstlo,x + sta bmp_ptr + lda @bdsthi,x + sta bmp_ptr+1 + lda @tsrclo,x + sta text_ptr + lda @tsrchi,x + sta text_ptr+1 + lda @tdstlo,x + sta scr_ptr + lda @tdsthi,x + sta scr_ptr+1 + ldx #16 +@loop: + ldy #23 +: lda (text_ptr),y + sta (scr_ptr),y + dey + bpl :- + ldy #191 +: lda (bmp_addr),y + sta (bmp_ptr),y + dey + bne :- + lda (bmp_addr),y + sta (bmp_ptr),y + ; math dumb cpu be struggling a lot here + lda text_ptr + sec + sbc #40 + sta text_ptr + bcs :+ + dec text_ptr+1 +: + lda scr_ptr + sec + sbc #40 + sta scr_ptr + bcs :+ + dec scr_ptr+1 +: + lda bmp_addr + sec + sbc #<320 + sta bmp_addr + bcs :+ + dec bmp_addr+1 +: + dec bmp_addr+1 + lda bmp_ptr + sec + sbc #<320 + sta bmp_ptr + bcs :+ + dec bmp_ptr+1 +: + dec bmp_ptr+1 + dex + bne @loop + rts + +@bsrclo: .lobytes (15+4)*320+$2040, (15+4)*320+$4040 +@bsrchi: .hibytes (15+4)*320+$2040, (15+4)*320+$4040 +@bdstlo: .lobytes (16+4)*320+$4040, (16+4)*320+$2040 +@bdsthi: .hibytes (16+4)*320+$4040, (16+4)*320+$2040 +@tsrclo: .lobytes (15+4)*40+$0408, (15+4)*40+$6008 +@tsrchi: .hibytes (15+4)*40+$0408, (15+4)*40+$6008 +@tdstlo: .lobytes (16+4)*40+$6008, (16+4)*40+$0408 +@tdsthi: .hibytes (16+4)*40+$6008, (16+4)*40+$0408 + +copyright: +.byte " ys ^ " +.byte " copyright 1988 falcom " +.byte " all right reserved " + +story_writ: +.byte " story written by " +.byte " takahiro ohura " +.byte " tomoo yamane " + +scenario_writ: +.byte " scenario written by " +.byte " tomoyoshi miyazaki " + +prog_writ: +.byte " programmed by " +.byte " masaya hashimoto " + +gart_writ: +.byte " graphic arts designed by " +.byte " takahiro ohura " +.byte " ayano koshiro " +.byte " kazuhiko tsuzuki " +.byte " tomoo yamane " + +music_writ: +.byte " music composed by " +.byte " mieko ishikawa " +.byte " yuzo koshiro " +.byte " hideya nagata " + +scene_writ: +.byte " scene set by " +.byte " seigo oketani " +.byte " yoshihiko kurata " + +art_direct: +.byte " art directed by " +.byte " seigo oketani " + +total_direct: +.byte " total directed by " +.byte " masaya hashimoto " + +produced: +.byte " produced by " +.byte " masayuki katoh " + +presented: +.byte " presented by falcom " + +turn_disk: +.byte " insert datadisk in " +.byte " drive 8 then return " + +clr_txt: + lda #$80 + ldx #0 +: + .repeat 4, I + sta $400+(I*250), x + .endrepeat + inx + cpx #250 + bne :- + lda #0 + ldx #0 +: + .repeat 4, I + sta $d800+(I*250), x + .endrepeat + inx + cpx #250 + bne :- + lda #$13 + sta $d018 + lda #$1b + sta $d011 + rts + +write_txt5: + stx text_ptr + sty text_ptr+1 + ldy #0 + lda #<($400+8*40) + ldx #>($400+8*40) + jsr write_txt_to + lda #<($400+10*40) + ldx #>($400+10*40) + jsr write_txt_to + lda #<($400+12*40) + ldx #>($400+12*40) + jsr write_txt_to + lda #<($400+14*40) + ldx #>($400+14*40) + jsr write_txt_to + lda #<($400+16*40) + ldx #>($400+16*40) + jmp write_txt_to + +write_txt4: + stx text_ptr + sty text_ptr+1 + ldy #0 + lda #<($400+9*40) + ldx #>($400+9*40) + jsr write_txt_to + lda #<($400+11*40) + ldx #>($400+11*40) + jsr write_txt_to + lda #<($400+13*40) + ldx #>($400+13*40) + jsr write_txt_to + lda #<($400+15*40) + ldx #>($400+15*40) + jmp write_txt_to + +write_txt3: + stx text_ptr + sty text_ptr+1 + ldy #0 + lda #<($400+10*40) + ldx #>($400+10*40) + jsr write_txt_to + lda #<($400+12*40) + ldx #>($400+12*40) + jsr write_txt_to + lda #<($400+14*40) + ldx #>($400+14*40) + jmp write_txt_to + +write_txt2: + stx text_ptr + sty text_ptr+1 + ldy #0 + lda #<($400+11*40) + ldx #>($400+11*40) + jsr write_txt_to + lda #<($400+13*40) + ldx #>($400+13*40) + jmp write_txt_to + +write_txt1: + stx text_ptr + sty text_ptr+1 + ldy #0 + lda #<($400+12*40) + ldx #>($400+12*40) + ; fall through + +write_txt_to: + sta @dst+1 + stx @dst+2 + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 +@dst: + sta $400, x + iny + inx + cpx #40 + bne :- + rts + +txt_fade_out: + lda #0 +txt_fade_out_offset: + pha + jsr init_timer + pla + sta timer + lda #2 + sta timer_mode +: + lda timer_reached + beq :- + rts diff --git a/loader/samples/minexample/minexample.s b/loader/samples/minexample/minexample.s index 8572c53..76eca09 100644 --- a/loader/samples/minexample/minexample.s +++ b/loader/samples/minexample/minexample.s @@ -1,31 +1,6 @@ .feature c_comments .include "../../build/loadersymbols-c64.inc" -.ZEROPAGE -.org $10 -bmp_delay: .res 1 -bmp_addr: .res 2 -bmp_ptr: .res 2 -scr_ptr_lo: .res 1 -scr_ptr: .res 2 -cram_ptr: .res 2 -chr_count: .res 1 -vbl: .res 1 -frame: .res 1 -cur_frame: .res 1 -frame_delay: .res 1 -frame_until: .res 1 -text_ptr: .res 2 -timer: .res 2 -timer_limit: .res 2 -timer_reached: .res 2 -timer_mode: .res 1 -enable_music: .res 1 -temp: .res 3 - -aart_lz_buffer := $fd00 -.include "lz_zp.asm" - CODE_START_ADDR = $e000 .segment "CODE" @@ -45,43 +20,23 @@ copy_start: lda #$35 sta $01 - lda #code_start - sta $fd - - lda #code_load - sta $fb - - ldy #0 - ldx #>(code_end-code_start) - beq :+++ -: - lda ($fa), y - sta ($fc), y - iny - bne :- - inc $fb - inc $fd - dex - bne :- - beq :+ -: - lda ($fa), y - sta ($fc), y - iny -: - cpy #<(code_end-code_start) - bne :-- + lda #code + sta ZX0_src+1 + lda #CODE_START_ADDR + jsr zx02 inc $01 cli jsr install sei dec $01 - jmp code_start + jmp CODE_START_ADDR + +.include "zx02.asm" check_return: ; for some reason GETIN enable interrupts back @@ -96,7 +51,10 @@ check_return: cmp #$0d bne :- dec $01 - jmp code_start + jmp CODE_START_ADDR + + .assert zx02 = $082f, error, .sprintf("change zx02 address to $%04x", zx02) + .assert check_return = $08b5, error, .sprintf("change check_return address to $%04x", check_return) .res loadraw - * .incbin "../../build/loader-c64.prg", 2 @@ -104,1794 +62,4 @@ check_return: .res install - * .incbin "../../build/install-c64.prg", 2 -code_load: - .org CODE_START_ADDR -code_start: - lda #0 - sta $d020 - sta ZX0_dst+0 - lda #$0b - sta $d011 - jsr load_font - .assert * = CODE_START_ADDR + 15, error - lda #0 - sta enable_music - jsr init_2x - jsr clr_txt - ldx #copyright - jsr write_txt3 - ldx #$00 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #badguy - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$90 - ldy #$01 - jsr txt_fade_out - - sei - jsr init_bmp - jsr set_irq_badguy - lda #0 - sta vbl - cli - - jsr intro - - lda #$0b - sta $d011 - - sei - ldx #introname - lda #$10 - jsr load_8000_zx02 - - ldx #song0name - lda #$a0 - jsr load_8000_zx02 - - lda #fake_kernal_irq - sta $ffff - inc enable_music - - jsr run_nufli_bmp - sei - jsr init_2x - lda #$0b - sta $d011 - - jsr clr_txt - ldx #story_writ - jsr write_txt3 - ldx #$30 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #towername - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$b8 - ldy #$01 - jsr txt_fade_out - - jsr init_bmp - - lda #0 - sta vbl - - lda #$11 - jsr wait_frame_until_2x - - ldx #$6c -: - jsr wait_frame - jsr wait_frame - dex - bpl :- - - lda #$0b - sta $d011 - - jsr clr_txt - ldx #scenario_writ - jsr write_txt2 - ldx #$80 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #towerbeamname - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$90 - ldy #$01 - jsr txt_fade_out - - jsr init_bmp - - lda #0 - sta vbl - - lda #$0d - jsr wait_frame_until_2x - lda bmp_addr - sta temp - lda bmp_addr+1 - sta temp+1 - lda cur_frame - sta temp+2 - - ldx #17 -: - txa - pha - lda temp+2 - sta cur_frame - lda temp - sta bmp_addr - lda temp+1 - sta bmp_addr+1 - lda #$0d+3 - jsr wait_frame_until_2x - pla - tax - dex - bpl :- - - lda #$0b - sta $d011 - - jsr clr_txt - ldx #prog_writ - jsr write_txt2 - ldx #$a8 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #fieldname - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$48 - ldy #$01 - jsr txt_fade_out - - jsr init_bmp - - lda #0 - sta vbl - - lda #$08 - jsr wait_frame_until_2x - lda bmp_addr - sta temp - lda bmp_addr+1 - sta temp+1 - lda cur_frame - sta temp+2 - - ldx #2 -: - txa - pha - lda temp+2 - sta cur_frame - lda temp - sta bmp_addr - lda temp+1 - sta bmp_addr+1 - lda #$08+8 - jsr wait_frame_until_2x - pla - tax - dex - bpl :- - - - lda #0 - sta vbl - lda #$27 - jsr wait_frame_until_2x - - ldx #25 -: - jsr wait_frame - dex - bpl :- - - lda #$0b - sta $d011 - - jsr clr_txt - ldx #gart_writ - jsr write_txt5 - ldx #$80 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #fallingstarname - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$48 - ldy #$01 - jsr txt_fade_out - - jsr init_bmp - - lda #$1d - jsr wait_frame_until_2x - - ldx #5 -: - jsr wait_frame - dex - bpl :- - - lda #$0b - sta $d011 - - jsr clr_txt - ldx #music_writ - jsr write_txt4 - ldx #$80 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #lilianame - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$10 - ldy #$01 - lda #8*11 - jsr txt_fade_out_offset - - ldx #$c4 - ldy #$01 - jsr init_timer - - jsr init_bmp - - lda #$08 - jsr wait_frame_until_2x - -: - lda timer_reached - beq :- - - lda #$0b - sta $d011 - - jsr clr_txt - ldx #scene_writ - jsr write_txt3 - ldx #$80 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #liliaheroname - jsr load_8000_zx02_2000 - -: - lda timer_reached - beq :- - - ldx #$20 - ldy #$01 - jsr txt_fade_out - - jsr init_bmp - - ldx #4 -: - lda #0 - sta vbl - lda #60 -: - cmp vbl - bne :- - dex - bpl :-- - -part_9: - ; $0400-$07ff buffer 0 tilemap - ; $2000-$3fff buffer 0 bitmap - ; $4000-$5fff buffer 1 bitmap - ; $6000-$63ff buffer 1 tilemap - ; $6400-$6417 next buffer CRAM - ; $7000-$77ff tileset bitmap - ; $7800-$78ff tileset tile colors - ; $7900-$79ff tileset CRAM colors - ; $9000- compressed tilemap - - jsr clr_txt - ldx #art_direct - jsr write_txt2 - ldx #$c0 - ldy #$01 - jsr init_timer - - lda #1 - sta timer_mode - - ldx #islandname - lda #$70 - jsr load_8000_zx02 - ldx #islandmapname - jsr loadraw - ldx #0 - ldy #$90 - jsr LZ_init_decomp - -: - lda timer_reached - beq :- - - ldx #$90 - ldy #$01 - lda #8 - jsr txt_fade_out_offset - - lda #0 - sta $d011 - jsr clear_2bufs - - ; set up sprites to cover scrolling - lda #$ff - ldx #0 -: sta $2000,x - sta $4000,x - inx - bne :- - .repeat 4, I - ldx #I*48+$58 - stx $d000+I*2 - stx $d008+I*2 - .endrepeat - ldx #6 -: - lda #$42 - sta $d001,x - lda #$d7 - sta $d009,x - dex - dex - bpl :- - ldx #7 -: - lda #$80 - sta $07f8,x - lda #0 - sta $63f8,x - sta $d027,x - dex - bpl :- - stx $d01d - stx $d015 - inx - stx $d010 - stx $d017 - stx $d01b - stx $d01c - stx frame - - lda #$18 - sta $d018 - lda #<((17+4)*40+$408) - sta text_ptr - lda #>((17+4)*40+$408) - sta text_ptr+1 - ldx #16 -: - lda #0 - lda text_ptr - sec - sbc #40 - sta text_ptr - sta scr_ptr - sta cram_ptr - sta bmp_ptr - lda text_ptr+1 - sbc #0 - sta text_ptr+1 - sta scr_ptr+1 - ; carry is always set here - adc #$d8-$04-1 - sta cram_ptr+1 - adc #<(($20>>3)-$d8) - asl bmp_ptr - rol a - asl bmp_ptr - rol a - asl bmp_ptr - rol a - sta bmp_ptr+1 - stx temp+1 - jsr drawrow - ldx temp+1 - dex - bpl :- - lda #0 - sta cram_ptr - lda #$64 - sta cram_ptr+1 -: - lda $d011 - bpl :- - lda #$38 - sta $d011 - lda #$18 - sta $d016 - lda #3 - sta timer_mode -@loop: - lda #0 - sta vbl - lda frame - cmp #$e1 - bcc :+ - jmp @finish -: - and #1 - tax - jsr copybuf - jsr drawrow -: - lda vbl - cmp #32 - bcc :- - ; B U M R U S H C R A M C O P Y F U N K - ldy #23 -: .repeat 16, I - lda $d808+(19-I)*40,y - sta $d808+(20-I)*40,y - .endrepeat - lda $6400,y - sta $d808+4*40,y - dey - bpl :- - inc frame - lda frame - lsr a - lda #$18 - ldx #3 - bcc :+ - lda #$80 - ldx #2 -: - sta $d018 - stx $dd00 - jmp @loop - -@finish: - ldx #$a8 - ldy #$01 - jsr init_timer -: - lda timer_reached - beq :- - lda #$0b - sta $d011 - lda #0 - sta $d015 - lda #3 - sta $dd00 - - ; we run out of space before the fixed location vector return now - jmp part_10 - -drawrow: - ldy #0 -charloop: - sty temp - lda #$70>>3 - sta bmp_addr+1 - jsr LZ_get_byte - tax - asl a - rol bmp_addr+1 - asl a - rol bmp_addr+1 - asl a - rol bmp_addr+1 - sta bmp_addr - ldy #0 - .repeat 8, I - lda (bmp_addr),y - sta (bmp_ptr),y - iny - .endrepeat - clc - lda bmp_ptr - adc #8 - sta bmp_ptr - bne :+ - inc bmp_ptr+1 -: - ldy temp - lda $7800,x - sta (scr_ptr),y - lda $7900,x - sta (cram_ptr),y - iny - cpy #24 - bne charloop - rts - -intro: - lda #0 - jsr sfx_init - - lda #7 - jsr wait_frame_until - - lda #64 - sta frame_delay - jsr wait_loop - - lda #1 - jsr sfx_init - - ldx #darmtower_txt - jsr upload_text - ldx #<(darmtower_txt+40) - ldy #>(darmtower_txt+40) - jsr upload_text_bottom - - lda #50*5 - sta frame_delay - jsr wait_loop - - jsr clear_text - - lda #$0d - jsr wait_frame_until - - ldx #adol_win - jsr upload_text - ldx #<(adol_win+40) - ldy #>(adol_win+40) - jsr upload_text_bottom - - lda #50*5 - sta frame_delay - jsr wait_loop - - jsr clear_text - ldx #too_bad_txt - jsr upload_text - - lda #50*5 - sta frame_delay - jsr wait_loop - - jsr clear_text - - lda #$13 - jsr wait_frame_until - - lda #0 - jsr sfx_init - - lda #$1a - jsr wait_frame_until - - lda #120 - sta frame_delay - jmp wait_loop - -wait_frame: -@loop: - bit $d011 - bpl @loop -@loop2: - bit $d011 - bmi @loop2 - rts - -init_2x: - lda #127 - sta $dc0d - - and $d011 - sta $d011 - - lda $dc0d - lda $dd0d - - lda #irq_music - sta $ffff - - lda #$0b - sta $d011 - lda #$00 - sta $d012 - -position_2x_to_display: - lda #50 -position_2x: -: - bit $d011 - bpl :- -: - bit $d011 - bmi :- -: - cmp $d012 - bne :- - - lda #0 - sta $d01a - sta $dc0e - - lda #$63; <(985248/100) - sta $dc04 - lda #$26; >(985248/100) - sta $dc05 - lda #$11 - sta $dc0e - - lda $dc0d - and #$81 - sta $dc0d - - lda #$40 - sta $dc0c - - lda #$81 - sta $dc0d - -@loop: - bit $d011 - bpl @loop -@loop2: - bit $d011 - bmi @loop2 - cli - rts - -init_timer: - lda #0 - sta timer_reached - sta timer_mode - sta timer - sta timer+1 - stx timer_limit - sty timer_limit+1 - rts - -fade_cols: - .byte 0, 0 - .byte $0, $0, $0, $0, $b, $c, $f, $1 - .res 32-10, $1 - -fake_kernal_irq: - pha - txa - pha - tya - pha - tsx - lda $0104, x - and #$10 - beq :+ - jmp ($0314) -: - jmp ($0314) ; fuck you - -irq_music: - pha - txa - pha - tya - pha - - lda $dd00 - and #3 - sta @dd00_arc+1 - and #3 - sta $dd00 - - inc vbl - - ;inc $d020 - lda enable_music - beq :+ - jsr $a003 -: - ;dec $d020 - - lda timer_mode - cmp #1 - bne :+ - lda timer+1 - bne :+ - lda timer - lsr - lsr - lsr - tax - lda fade_cols, x - sta $d021 -: - lda timer_mode - cmp #2 - bne :+ - lda timer+1 - bne :+ - lda timer - lsr - lsr - lsr - eor #31 - tax - lda fade_cols, x - sta $d021 -: - - inc timer - bne :+ - inc timer+1 -: - lda timer - sec - sbc timer_limit - lda timer+1 - sbc timer_limit+1 - bcc :+ - lda #1 - sta timer_reached -: - lda timer_mode - cmp #3 - bne @timer_done - lda vbl - lsr a - bcs @timer_done - lsr a - and #7 - ora #$38 - sta $d011 - -@timer_done: - -@dd00_arc: - lda #0 - sta $dd00 - - pla - tay - pla - tax - pla - jmp $dc0c - -wait_loop: -@loop2: - lda vbl - beq @loop2 - - lda #0 - sta vbl - - jsr sfx_play - - dec frame_delay - lda frame_delay - beq :+ - jmp @loop2 -: - rts - -wait_frame_until: - sta frame_until -@loop: - lda vbl - beq @loop - - lda #0 - sta vbl - - lda cur_frame - cmp #2 - bcc :+ - jsr sfx_play -: - - dec bmp_delay - bpl :+ - jsr update_bmp -: - - lda cur_frame - cmp frame_until - beq :+ - - jmp @loop -: - rts - -wait_frame_until_2x: - sta frame_until -@loop: - lda vbl - cmp #2 - bcc @loop - - lda #0 - sta vbl - - dec bmp_delay - bpl :+ - jsr update_bmp -: - - lda cur_frame - cmp frame_until - beq :+ - jmp @loop -: - rts - -init_bmp: - lda #$0b - sta $d011 - lda #$19 - sta $d018 - lda #$d8 - sta $d016 - - lda $4710 - lsr - lsr - lsr - lsr - sta $d020 - - lda $4710 - and #$0f - sta $d021 - - lda #0 - sta cur_frame - sta bmp_delay - - lda #$11 - sta bmp_addr - lda #$47 - sta bmp_addr+1 - - ldx #0 -: - .repeat 4, I - lda $3f40+(I*250), x - sta $400+(I*250), x - lda $4328+(I*250), x - sta $d800+(I*250), x - .endrepeat - inx - cpx #250 - bne :- - - lda #$3b - sta $d011 - rts - -inc_bmp_addr: - inc bmp_addr - bne :+ - inc bmp_addr+1 -: - rts - -update_bmp: - ldy #0 - sty scr_ptr - sty cram_ptr - lda (bmp_addr), y - jsr inc_bmp_addr - sta chr_count - cmp #0 ; tfw flags update in inc_bmp_addr - bne @skip_frame_end - lda (bmp_addr), y - jsr inc_bmp_addr - sta bmp_delay - inc cur_frame - rts -@skip_frame_end: - - lda (bmp_addr), y - sta bmp_ptr - iny - lda (bmp_addr), y - clc - adc #$20 - sta bmp_ptr+1 - - iny - lda (bmp_addr), y - sta scr_ptr_lo - iny - lda (bmp_addr), y - clc - adc #$04 - sta scr_ptr+1 - clc - adc #$d8-$04 - sta cram_ptr+1 - - ldy #0 - lda bmp_addr - clc - adc #4 - sta bmp_addr - bcc :+ - inc bmp_addr+1 -: - - ldx #0 -@loop: - ldy #0 - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - iny - lda (bmp_addr), y - sta (bmp_ptr), y - - lda bmp_ptr - clc - adc #8 - sta bmp_ptr - bcc :+ - inc bmp_ptr+1 -: - - ldy #8 - lda (bmp_addr), y - ldy scr_ptr_lo - sta (scr_ptr), y - - ldy #9 - lda (bmp_addr), y - ldy scr_ptr_lo - sta (cram_ptr), y - - inc scr_ptr_lo - bne :+ - inc scr_ptr+1 - inc cram_ptr+1 -: - - lda bmp_addr - clc - adc #10 - sta bmp_addr - bcc :+ - inc bmp_addr+1 -: - - dec chr_count - ldx chr_count - bne @loop - jmp update_bmp - -irq_badguy: - pha - - pha - pla - pha - pla - pha - pla - lda #$1b - sta $d011 - lda #$c8 - sta $d016 - lda #$13 - sta $d018 - lda #1 - sta $d021 - - lda #irq_badguy2 - sta $ffff - lda #$fb - sta $d012 - - asl $d019 - pla - rti - -irq_badguy2: - pha - - inc vbl - lda #$3b - sta $d011 - lda #$d8 - sta $d016 - lda #$19 - sta $d018 - lda #0 - sta $d021 - - lda #irq_badguy - sta $ffff - lda #$d2 - sta $d012 - - lda enable_music - beq :+ - txa - pha - tya - pha - jsr $a003 - pla - tay - pla - tax -: - asl $d019 - pla - rti - -set_irq_badguy: - lda #127 - sta $dc0d - - and $d011 - sta $d011 - - lda $dc0d - lda $dd0d - - lda #irq_badguy - sta $ffff - - lda #$d2 - sta $d012 - lda #1 - sta $d01a - asl $d019 - rts - -badguy: .byte "badguy",0 -fontname: .byte "font",0 -song0name: .byte "song0", 0 -song1name: .byte "song1", 0 -introname: .byte "intrbmp", 0 -towername: .byte "tower", 0 -towerbeamname: .byte "towerbm", 0 -fieldname: .byte "field", 0 -fallingstarname: .byte "fallstar", 0 -lilianame: .byte "lilia", 0 -liliaheroname: .byte "lilhero", 0 -islandname: .byte "island", 0 -islandmapname: .byte "islandmap", 0 -cloudsname: .byte "clouds", 0 -liliatalkname: .byte "liltalk", 0 - - -darmtower_txt: - .byte " darm's tower has fallen silent. " - .byte " what should we do? " - -adol_win: - .byte " ", 34, "it must be adol, let's see " - .byte " how far he'll get!", 34, " " - -too_bad_txt: - .byte " as you command. " - -upload_text: - stx text_ptr - sty text_ptr+1 - - ldy #39 -: - lda (text_ptr), y - clc - adc #$60 - sta $748, y - dey - bpl :- - rts - -upload_text_bottom: - stx text_ptr - sty text_ptr+1 - - ldy #39 -: - lda (text_ptr), y - clc - adc #$60 - sta $748+40+40, y - dey - bpl :- - rts - -clear_text: - lda #$80 - ldy #39 -: - sta $748, y - sta $748+40+40, y - dey - bpl :- - rts - -run_nufli_bmp: - lda #$01 - sta $81 - lda #$29 - sta $80 - lda #0 - sta $d01a - asl $d019 - jsr $a000 - jsr $3000 -@loop: - bit $d011 - bpl @loop - jsr $a003 -@loop2: - bit $d011 - bmi @loop2 - lda #0 - sta $d020 - sta $d021 - jsr $a003 - lda $80 - bne :+ - dec $81 -: - dec $80 - lda $81 - cmp #$ff - beq :+ - jmp @loop -: - lda #0 - sta $d015 - rts - - -.res $ea31-*, $ff - ;asl $d019 - pla - tay - pla - tax - pla - rti - -.res $ea81-*, $ff - ;asl $d019 - pla - tay - pla - tax - pla - rti - -.include "sfx.asm" -.include "zx02.asm" -.include "thcmod_lz.asm" - -zx02_8000: - pha - jmp :+ - -load_8000_zx02_2000: - lda #$20 -load_8000_zx02: - pha - jsr loadraw -: - lda #0 - sta ZX0_src - sta ZX0_dst - lda #$80 - sta ZX0_src+1 - pla - jmp zx02 - -load_font: - bcc :+ - pha -: - ldx #fontname - jsr loadraw - bcs :- - rts - -part_10: - ; the sprite data is embedded into first few bitmap pixels - ; which are hidden by black border attributes -@y = 93 - jsr clr_txt - ldx #total_direct - jsr write_txt2 - ldx #$c0 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #cloudsname - jsr load_8000_zx02_2000 -: - lda timer_reached - beq :- - - ldx #$48 - ldy #$01 - lda #$40 - jsr txt_fade_out_offset - - jsr init_bmp - ldx #0 - stx $d010 - stx $d017 - stx $d01d - stx $d025 - stx frame - dex - stx $d01b - stx $d01c - lda #11 - sta $d026 - lda #@y+48 - jsr position_2x - lda #0 - sta vbl - ; draw top half -@loop: - bit $d011 - bpl @loop - ldx #0 - ldy #0 - lda frame - bpl :+ - jmp @finish -: - cmp #$74 - bcc :+ - lda #$74 -: - pha -: - clc - adc @sprxs,x - sta $d000,y - sta temp - lda @sprys,x - sta $d001,y - txa - ora #$80 - sta $7f8,x - lda @sprcols,x - sta $d027,x - lda temp - iny - iny - inx - cpx #8 - bcc :- - lda #$ff - sta $d015 - - ; draw bottom half -: - bit $d011 - bmi :- - lda #@y+37 -: - cmp $d012 - bcs :- - - ldx #0 - ldy #0 - pla - clc -: - adc @sprxs+8,x - sta $d000,y - sta temp - lda @sprys+8,x - sta $d001,y - txa - ora #$88 - sta $7f8,x - lda @sprcols+8,x - sta $d027,x - lda temp - iny - iny - inx - cpx #6 - bcc :- - - lda vbl - and #15 - bne :+ - inc frame -: - jmp @loop - -@sprxs: - .byte 48, <-24, 24, 24, <-64, 24, 24, 24 - .byte 48-40, 24, 24, 24, <-44, 24 - -@sprys: - .byte @y-8, @y, @y, @y, @y+21, @y+21, @y+21, @y+21 - .byte @y+42, @y+42, @y+42, @y+42, @y+63, @y+63 - -@sprcols: - .byte 2, 5, 5, 5, 14, 14, 14, 6 - .byte 2, 2, 2, 9, 2, 2 - -@finish: - lda #$0b - sta $d011 - lda #0 - sta $d015 - - jsr clr_txt - ldx #produced - jsr write_txt2 - ldx #$c0 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode -: - lda timer_reached - beq :- - - ldx #$48 - ldy #$01 - lda #8*11 - jsr txt_fade_out_offset - -part_11: - jsr clr_txt - ldx #presented - jsr write_txt1 - ldx #$c0 - ldy #$01 - jsr init_timer - lda #1 - sta timer_mode - - ldx #liliatalkname - jsr load_8000_zx02_2000 -: - lda timer_reached - beq :- - - ; tell the music to end and wait -: - lda #1 - jsr $a006 - cmp #17 - bne :- - - ldx #$00 - ldy #$01 - lda #8*11 - jsr txt_fade_out_offset -: - lda timer_reached - beq :- - - ; load new music - sei - ldx #song1name - lda #$a0 - jsr load_8000_zx02 - jsr $a000 - jsr init_bmp - jsr set_irq_badguy - inc enable_music - cli - - lda #<256 - jsr wait_frame_until - lda #301-256 - jsr wait_frame_until - - sei - lda #$0b - sta $d011 - ldx #64 -: - jsr wait_frame - dex - bpl :- - jsr clr_txt - ldx #turn_disk - jsr write_txt2 - lda #1 - sta $d021 - jmp check_return - -clear_2bufs: - ldy #$44 - .byte $2c ; skip next instruction -clear_buf: - ldy #$20 - lda #$20 - sta @dst+2 - lda #0 - tax -: - sta $400,x - sta $500,x - sta $600,x - sta $700,x - inx - bne :- -@dst: - sta $2000,x - inx - bne @dst - inc @dst+2 - dey - bne @dst - rts - -copybuf: - lda @bsrclo,x - sta bmp_addr - lda @bsrchi,x - sta bmp_addr+1 - lda @bdstlo,x - sta bmp_ptr - lda @bdsthi,x - sta bmp_ptr+1 - lda @tsrclo,x - sta text_ptr - lda @tsrchi,x - sta text_ptr+1 - lda @tdstlo,x - sta scr_ptr - lda @tdsthi,x - sta scr_ptr+1 - ldx #16 -@loop: - ldy #23 -: lda (text_ptr),y - sta (scr_ptr),y - dey - bpl :- - ldy #191 -: lda (bmp_addr),y - sta (bmp_ptr),y - dey - bne :- - lda (bmp_addr),y - sta (bmp_ptr),y - ; math dumb cpu be struggling a lot here - lda text_ptr - sec - sbc #40 - sta text_ptr - bcs :+ - dec text_ptr+1 -: - lda scr_ptr - sec - sbc #40 - sta scr_ptr - bcs :+ - dec scr_ptr+1 -: - lda bmp_addr - sec - sbc #<320 - sta bmp_addr - bcs :+ - dec bmp_addr+1 -: - dec bmp_addr+1 - lda bmp_ptr - sec - sbc #<320 - sta bmp_ptr - bcs :+ - dec bmp_ptr+1 -: - dec bmp_ptr+1 - dex - bne @loop - rts - -@bsrclo: .lobytes (15+4)*320+$2040, (15+4)*320+$4040 -@bsrchi: .hibytes (15+4)*320+$2040, (15+4)*320+$4040 -@bdstlo: .lobytes (16+4)*320+$4040, (16+4)*320+$2040 -@bdsthi: .hibytes (16+4)*320+$4040, (16+4)*320+$2040 -@tsrclo: .lobytes (15+4)*40+$0408, (15+4)*40+$6008 -@tsrchi: .hibytes (15+4)*40+$0408, (15+4)*40+$6008 -@tdstlo: .lobytes (16+4)*40+$6008, (16+4)*40+$0408 -@tdsthi: .hibytes (16+4)*40+$6008, (16+4)*40+$0408 - -copyright: -.byte " ys ^ " -.byte " copyright 1988 falcom " -.byte " all right reserved " - -story_writ: -.byte " story written by " -.byte " takahiro ohura " -.byte " tomoo yamane " - -scenario_writ: -.byte " scenario written by " -.byte " tomoyoshi miyazaki " - -prog_writ: -.byte " programmed by " -.byte " masaya hashimoto " - -gart_writ: -.byte " graphic arts designed by " -.byte " takahiro ohura " -.byte " ayano koshiro " -.byte " kazuhiko tsuzuki " -.byte " tomoo yamane " - -music_writ: -.byte " music composed by " -.byte " mieko ishikawa " -.byte " yuzo koshiro " -.byte " hideya nagata " - -scene_writ: -.byte " scene set by " -.byte " seigo oketani " -.byte " yoshihiko kurata " - -art_direct: -.byte " art directed by " -.byte " seigo oketani " - -total_direct: -.byte " total directed by " -.byte " masaya hashimoto " - -produced: -.byte " produced by " -.byte " masayuki katoh " - -presented: -.byte " presented by falcom " - -turn_disk: -.byte " insert datadisk in " -.byte " drive 8 then return " - -clr_txt: - lda #$80 - ldx #0 -: - .repeat 4, I - sta $400+(I*250), x - .endrepeat - inx - cpx #250 - bne :- - lda #0 - ldx #0 -: - .repeat 4, I - sta $d800+(I*250), x - .endrepeat - inx - cpx #250 - bne :- - lda #$13 - sta $d018 - lda #$1b - sta $d011 - rts - -write_txt5: - stx text_ptr - sty text_ptr+1 - ldy #0 - lda #<($400+8*40) - ldx #>($400+8*40) - jsr write_txt_to - lda #<($400+10*40) - ldx #>($400+10*40) - jsr write_txt_to - lda #<($400+12*40) - ldx #>($400+12*40) - jsr write_txt_to - lda #<($400+14*40) - ldx #>($400+14*40) - jsr write_txt_to - lda #<($400+16*40) - ldx #>($400+16*40) - jmp write_txt_to - -write_txt4: - stx text_ptr - sty text_ptr+1 - ldy #0 - lda #<($400+9*40) - ldx #>($400+9*40) - jsr write_txt_to - lda #<($400+11*40) - ldx #>($400+11*40) - jsr write_txt_to - lda #<($400+13*40) - ldx #>($400+13*40) - jsr write_txt_to - lda #<($400+15*40) - ldx #>($400+15*40) - jmp write_txt_to - -write_txt3: - stx text_ptr - sty text_ptr+1 - ldy #0 - lda #<($400+10*40) - ldx #>($400+10*40) - jsr write_txt_to - lda #<($400+12*40) - ldx #>($400+12*40) - jsr write_txt_to - lda #<($400+14*40) - ldx #>($400+14*40) - jmp write_txt_to - -write_txt2: - stx text_ptr - sty text_ptr+1 - ldy #0 - lda #<($400+11*40) - ldx #>($400+11*40) - jsr write_txt_to - lda #<($400+13*40) - ldx #>($400+13*40) - jmp write_txt_to - -write_txt1: - stx text_ptr - sty text_ptr+1 - ldy #0 - lda #<($400+12*40) - ldx #>($400+12*40) - ; fall through - -write_txt_to: - sta @dst+1 - stx @dst+2 - ldx #0 -: - lda (text_ptr), y - sec - sbc #$20 - ora #$80 -@dst: - sta $400, x - iny - inx - cpx #40 - bne :- - rts - -txt_fade_out: - lda #0 -txt_fade_out_offset: - pha - jsr init_timer - pla - sta timer - lda #2 - sta timer_mode -: - lda timer_reached - beq :- - rts - -code_end: +code: .incbin "main.zx0" diff --git a/loader/samples/minexample/song1.bin b/loader/samples/minexample/song1.bin deleted file mode 100644 index 98396cd3e31b4825764e60d6f075140ba51b16df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4464 zcmdT{eNa#XSXBcoGNr~qpVilYMZry(4}gzT8bi1 zB@|eqsZ|T=#Umz2B8dUCLd}Dq!V-4IO*>3yhuK#5i`Lz#^ZwdxgWT*nFF}I#WB=Vd z;l6wBJ@kV81FD{Yt?0~&b|E1Q@V`YWiMyu>YiVx>+Q{5wQ$kX&j|k~ zB{aD-362WZ4Gw|z0P6sD4jduo19k}B0?Pu{4}+S1hhQ;- zOLSZIfoqT3Qi-aTJZMroM0OJJ=TNaF1ZN|R)4-g-vVnPkxquY`D+aa`SQW4uV0FL_ z080m!3ak;>7GQIMl>plgEE!lSq3FSpz@7$2EL#rDfcEQ~1l|3uXtNM3`CuC10rg0z zjiWcl%eLE6!gpQ%n8byCC`V@s385JUgats{g?qq-1#8AT?l%R;=I z(jYl5&v5sFbO~@lrOSZJiG2~iibfwT`S;Bw@03N0o`GCE(K8Tm>eTU2P2!v=-W8Ux zCUO2TP24=_7J{P>i^iLwa5E~d+M*cTT%_4Ynz&6@IqcYD{p=)`CMu_}P}OwGg^S^o)_|EyYr!1C*-5Ps1^6EDgud9z+q-0@)74;eLJ{6u0f1tpR(8tpyWdZ3p>R_@#hW zxy`(*+O6>MZh`U$%qEa6`nLg6-YFw}1&XNDPHV>LKh> zkheszYYDp!vArb-Y$l&>!^ld_2FUd0;jYWBPCUaBLynl9V>zM$SS4YpwuR+&0~5M-ct54y;{DV z2T_V`p@iB4?oIIAb1t7C$IM>r!Y;f#aWp|Tjwd42(I-JX=7$~_kT6vwVY6E?a7n2z z(*#{$mUIr}IH?2V>FDdZJCn6k1fLg!tR<_H(>RXc1xgt5d=}Bpq%qBl zEnS1q+6N68B&Oj#hq`!)N*>I3sH$vHX)eeQg3!kGNw|<0Z#hvF7sP;vgGwWbDilp_ zGu$i$S0Q}94?Ho(!w%){b(vwA3LgUak`OTU4r+qfO_|%$2fAjPLlrHkqXgIMATLBU z%mDd{J9M}0bll7XS04D|Fgwt5LU-c~z9{G=fyl;(9i$u18%@G~#mpwMbtPhO-DzZq z{PobJqG6Q zBs@>}RO-dIkYoc)Qulvh18fDRp=a2lJ&ge!)cge%8Yve)zM+xQb`8i$_)^g3b6s&O z-JkC{Q8fG`A`WUk!3n!DSkg|=R~Q+MYIVPCMeP=CS6OR$9k7GYHQZW`uc^am;8WDE z0(lc62j&^1IvB%zUWcpq#R2d(0!}fEDHFyHgEifF%c(`3az)1)!w-OQ<{5M_e5eo` zQE?34EKi=n*?9O3-XthXr1Nge z8jwDATh`)XcU#thbj5A?HAsH9wx-ILW`IhMpO%kJ&NsQ7rW%G;Ry$D_Tt@!wC zDfFr2IG#qIm~x;0HLKe3n#tm)V_ePGgoi^>hB+c|0Gk}3 z-O|!`c8KDhy?ggnR+_7--m9*zsTKEDR#n&5?YAC0bfo_1@kVi9RjtK(=)hFux{rDxF zSYGy;qh^Z&Im*ppogoyT;0jlVG+@1g@mtTRf@JR z;%v7s%w{sDi;De=ybHa!$S)|m5hLNyc)NR)Ky)iX>50@78tV5(>Tdk@q8#RUfp>I7 z9Bk(u{5;}f7r)@9PUQG~;~r&PF@JsnqJwuTfg*w(+=D=!2p1-~6gj5X^Ap_0W2rj9 z|3?9*HF3s|@L0yf4f_75fYXkl-f8^1`+J%n<;@WX#vO_N+R$7RM~FlG5Lb`?CJ7(# JM?wOT`Y(svn1lcT diff --git a/loader/samples/minexample/test/bin.cfg b/loader/samples/minexample/test/bin.cfg new file mode 100644 index 0000000..ba97093 --- /dev/null +++ b/loader/samples/minexample/test/bin.cfg @@ -0,0 +1,11 @@ +MEMORY { + ZP: file = "", start = $0002, size = $00FE, define = yes; + MAIN: file = %O, start = $0BFE, size = $C402; +} +SEGMENTS { + ZEROPAGE: load = ZP, type = zp, optional = yes; + CODE: load = MAIN, type = rw; + RODATA: load = MAIN, type = ro, optional = yes; + DATA: load = MAIN, type = rw, optional = yes; + BSS: load = MAIN, type = bss, optional = yes, define = yes; +} diff --git a/loader/samples/minexample/test/main.asm b/loader/samples/minexample/test/main.asm new file mode 100644 index 0000000..f831ad0 --- /dev/null +++ b/loader/samples/minexample/test/main.asm @@ -0,0 +1,10 @@ +.zeropage + +.segment "CODE" + + .word $0c00 + .incbin "font.bin" + .res 12 + +entry: + jmp *