diff --git a/loader/samples/minexample/Makefile b/loader/samples/minexample/Makefile index 1f82186..d3fc9ef 100644 --- a/loader/samples/minexample/Makefile +++ b/loader/samples/minexample/Makefile @@ -160,8 +160,8 @@ diskimage: $(DISKIMAGE) $(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(RM) $@ - $(CC1541) -n "ys2 intro" -i test \ - -f $(NAME) -w $< \ + $(CC1541) -n "ys2 intro" -i otomata \ + -f "ys2" -w $< \ -f "sid" -w use_this_sid.bin \ -f "badguy" -w badguy.zx0.prg \ -f "font" -w font.bin \ @@ -170,6 +170,8 @@ $(DISKIMAGE): $(ASSEMBLE) $(CC1541) -f "tower" -w tower.zx0.prg \ -f "towerbm" -w tower_beam.zx0.prg \ -f "field" -w field.zx0.prg \ + -f "fallstar" -w falling_star.zx0.prg \ + -f "lilia" -w lilia.zx0.prg \ $@ diff --git a/loader/samples/minexample/conv_zx0.sh b/loader/samples/minexample/conv_zx0.sh index eb6b93a..b4b6bcf 100644 --- a/loader/samples/minexample/conv_zx0.sh +++ b/loader/samples/minexample/conv_zx0.sh @@ -13,4 +13,10 @@ printf "\x00\x80" > tower_beam.zx0.prg cat tower_beam.zx0 >> tower_beam.zx0.prg zx02/zx02 field.bin field.zx0 printf "\x00\x80" > field.zx0.prg -cat field.zx0 >> field.zx0.prg \ No newline at end of file +cat field.zx0 >> field.zx0.prg +zx02/zx02 falling_star.bin falling_star.zx0 +printf "\x00\x80" > falling_star.zx0.prg +cat falling_star.zx0 >> falling_star.zx0.prg +zx02/zx02 lilia.bin lilia.zx0 +printf "\x00\x80" > lilia.zx0.prg +cat lilia.zx0 >> lilia.zx0.prg \ No newline at end of file diff --git a/loader/samples/minexample/falling_star.bin b/loader/samples/minexample/falling_star.bin new file mode 100644 index 0000000..b1c2a7d Binary files /dev/null and b/loader/samples/minexample/falling_star.bin differ diff --git a/loader/samples/minexample/falling_star.zx0 b/loader/samples/minexample/falling_star.zx0 new file mode 100644 index 0000000..a19134d Binary files /dev/null and b/loader/samples/minexample/falling_star.zx0 differ diff --git a/loader/samples/minexample/falling_star.zx0.prg b/loader/samples/minexample/falling_star.zx0.prg new file mode 100644 index 0000000..9324e8d Binary files /dev/null and b/loader/samples/minexample/falling_star.zx0.prg differ diff --git a/loader/samples/minexample/lilia.bin b/loader/samples/minexample/lilia.bin new file mode 100644 index 0000000..7e15986 Binary files /dev/null and b/loader/samples/minexample/lilia.bin differ diff --git a/loader/samples/minexample/lilia.zx0 b/loader/samples/minexample/lilia.zx0 new file mode 100644 index 0000000..03a4acb Binary files /dev/null and b/loader/samples/minexample/lilia.zx0 differ diff --git a/loader/samples/minexample/lilia.zx0.prg b/loader/samples/minexample/lilia.zx0.prg new file mode 100644 index 0000000..0e0ffc0 Binary files /dev/null and b/loader/samples/minexample/lilia.zx0.prg differ diff --git a/loader/samples/minexample/minexample.s b/loader/samples/minexample/minexample.s index 33334c5..a9cee81 100644 --- a/loader/samples/minexample/minexample.s +++ b/loader/samples/minexample/minexample.s @@ -419,6 +419,112 @@ code_start: lda #$27 sta frame_until 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 loadraw + lda #0 + sta ZX0_src + lda #$80 + sta ZX0_src+1 + lda #0 + sta ZX0_dst + lda #$20 + jsr zx02 + +: + lda timer_reached + beq :- + + ldx #$48 + ldy #$01 + jsr init_timer + lda #2 + sta timer_mode + +: + lda timer_reached + beq :- + + jsr init_bmp + + lda #$1d + sta frame_until + 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 loadraw + lda #0 + sta ZX0_src + lda #$80 + sta ZX0_src+1 + lda #0 + sta ZX0_dst + lda #$20 + jsr zx02 + +: + lda timer_reached + beq :- + + ldx #$10 + ldy #$01 + jsr init_timer + lda #8*11 + sta timer + lda #2 + sta timer_mode + + +: + lda timer_reached + beq :- + + jsr init_bmp + + lda #$08 + sta frame_until + jsr wait_frame_until_2x + jmp * @@ -498,60 +604,6 @@ wait_frame: bmi @loop2 rts -story_writ: -.res 11, ' ' -.byte "story written by" -.res 40-(16+11), ' ' -.res 11, ' ' -.res 5, ' ' -.byte "takahiro ohura" -.res 40-(14+11+5), ' ' -.res 11, ' ' -.res 5, ' ' -.byte "tomoo yamane" -.res 40-(12+11+5), ' ' - -scenario_writ: -.res (40-24)/2, ' ' -.byte " scenario written by " -.res (40-24)/2, ' ' -.res (40-24)/2, ' ' -.byte " tomoyoshi miyazaki" -.res (40-24)/2, ' ' - -prog_writ: -.res (40-22)/2, ' ' -.byte " programmed by " -.res (40-22)/2, ' ' -.res (40-22)/2, ' ' -.byte " masaya hashimoto" -.res (40-22)/2, ' ' - -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 - init_2x: lda #127 sta $dc0d @@ -914,20 +966,13 @@ update_bmp: bcc :+ inc bmp_ptr+1 : - lda bmp_addr - clc - adc #8 - sta bmp_addr - bcc :+ - inc bmp_addr+1 -: - ldy #0 + ldy #8 lda (bmp_addr), y ldy scr_ptr_lo sta (scr_ptr), y - ldy #1 + ldy #9 lda (bmp_addr), y ldy scr_ptr_lo sta (cram_ptr), y @@ -940,7 +985,7 @@ update_bmp: lda bmp_addr clc - adc #2 + adc #10 sta bmp_addr bcc :+ inc bmp_addr+1 @@ -1009,6 +1054,8 @@ introname: .byte "intrbmp", 0 towername: .byte "tower", 0 towerbeamname: .byte "towerbm", 0 fieldname: .byte "field", 0 +fallingstarname: .byte "fallstar", 0 +lilianame: .byte "lilia", 0 darmtower_txt: .res (40-26)/2, ' ' @@ -1025,78 +1072,6 @@ too_bad_txt: .byte "too bad..." .res (40-10)/2, ' ' -write_txt3: - stx text_ptr - sty text_ptr+1 - - ldx #0 - ldy #0 -: - lda (text_ptr), y - sec - sbc #$20 - ora #$80 - sta $400+10*40, x - iny - inx - cpx #40 - bne :- - - ldx #0 -: - lda (text_ptr), y - sec - sbc #$20 - ora #$80 - sta $400+12*40, x - iny - inx - cpx #40 - bne :- - - ldx #0 -: - lda (text_ptr), y - sec - sbc #$20 - ora #$80 - sta $400+14*40, x - iny - inx - cpx #40 - bne :- - rts - -write_txt2: - stx text_ptr - sty text_ptr+1 - - ldx #0 - ldy #0 -: - lda (text_ptr), y - sec - sbc #$20 - ora #$80 - sta $400+11*40, x - iny - inx - cpx #40 - bne :- - - ldx #0 -: - lda (text_ptr), y - sec - sbc #$20 - ora #$80 - sta $400+13*40, x - iny - inx - cpx #40 - bne :- - rts - upload_text: lda #$34 sta $01 @@ -1181,4 +1156,282 @@ run_nufli_bmp: .include "zx02.asm" .include "thcmod_lz.asm" +story_writ: +.res 11, ' ' +.byte "story written by" +.res 40-(16+11), ' ' +.res 11, ' ' +.res 5, ' ' +.byte "takahiro ohura" +.res 40-(14+11+5), ' ' +.res 11, ' ' +.res 5, ' ' +.byte "tomoo yamane" +.res 40-(12+11+5), ' ' + +scenario_writ: +.res (40-24)/2, ' ' +.byte " scenario written by " +.res (40-24)/2, ' ' +.res (40-24)/2, ' ' +.byte " tomoyoshi miyazaki" +.res (40-24)/2, ' ' + +prog_writ: +.res (40-22)/2, ' ' +.byte " programmed by " +.res (40-22)/2, ' ' +.res (40-22)/2, ' ' +.byte " masaya hashimoto" +.res (40-22)/2, ' ' + +gart_writ: +.res (40-24)/2, ' ' +.byte "graphic arts designed by" +.res (40-24)/2, ' ' +.res (40-24)/2, ' ' +.byte " takahiro ohura " +.res (40-24)/2, ' ' +.res (40-24)/2, ' ' +.byte " ayano koshiro " +.res (40-24)/2, ' ' +.res (40-24)/2, ' ' +.byte " kazuhiko tsuzuki " +.res (40-24)/2, ' ' +.res (40-24)/2, ' ' +.byte " tomoo yamane " +.res (40-24)/2, ' ' + +music_writ: +.res (40-20)/2, ' ' +.byte " music composed by " +.res (40-20)/2, ' ' +.res (40-20)/2, ' ' +.byte " mieko ishikawa" +.res (40-20)/2, ' ' +.res (40-20)/2, ' ' +.byte " yuzo koshiro " +.res (40-20)/2, ' ' +.res (40-20)/2, ' ' +.byte " hideya nagata " +.res (40-20)/2, ' ' + +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 + + ldx #0 + ldy #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+8*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+10*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+12*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+14*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+16*40, x + iny + inx + cpx #40 + bne :- + rts + +write_txt4: + stx text_ptr + sty text_ptr+1 + + ldx #0 + ldy #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+9*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+11*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+13*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+15*40, x + iny + inx + cpx #40 + bne :- + + rts + +write_txt3: + stx text_ptr + sty text_ptr+1 + + ldx #0 + ldy #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+10*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+12*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+14*40, x + iny + inx + cpx #40 + bne :- + rts + +write_txt2: + stx text_ptr + sty text_ptr+1 + + ldx #0 + ldy #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+11*40, x + iny + inx + cpx #40 + bne :- + + ldx #0 +: + lda (text_ptr), y + sec + sbc #$20 + ora #$80 + sta $400+13*40, x + iny + inx + cpx #40 + bne :- + rts + code_end: