diff --git a/loader/samples/minexample/Makefile b/loader/samples/minexample/Makefile index 276c2f2..bedc2a7 100644 --- a/loader/samples/minexample/Makefile +++ b/loader/samples/minexample/Makefile @@ -132,6 +132,7 @@ AS_FLAGS = -Wa -I../../../shared -I ../../include -u __EXEHDR__ ZX0PRGS = \ song0.zx0.prg \ + song1.zx0.prg \ badguy.zx0.prg \ title_320-prepared.zx0.prg \ tower.zx0.prg \ @@ -181,6 +182,7 @@ $(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(ZX0PRGS) $(LZPRGS) font.bin $(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 "intrbmp" -w title_320-prepared.zx0.prg \ @@ -230,6 +232,10 @@ song0.bin: ys2_fixed_drums.fur cd $(FURC64) && ./convert.sh $(abspath $<) cp $(FURC64)/asm/song.bin $@ +song1.bin: ys2_lilia_sid.fur + cd $(FURC64) && ./convert.sh $(abspath $<) + cp $(FURC64)/asm/song.bin $@ + clean: -$(RM) $(ZX0PRGS) $(LZPRGS) -$(RM) *.o $(ASSEMBLE) $(DISKIMAGE) diff --git a/loader/samples/minexample/font.bin b/loader/samples/minexample/font.bin index adddaf8..05d4f39 100644 Binary files a/loader/samples/minexample/font.bin and b/loader/samples/minexample/font.bin differ diff --git a/loader/samples/minexample/minexample.s b/loader/samples/minexample/minexample.s index 9e68f72..7190027 100644 --- a/loader/samples/minexample/minexample.s +++ b/loader/samples/minexample/minexample.s @@ -94,51 +94,44 @@ code_start: .org CODE_START_ADDR sei - - lda #0 - jsr load_font - - lda #$34 - sta $01 - - lda #0 - tax -: - .repeat 4, I - sta $d000+(I*250), x - .endrepeat - inx - cpx #250 - bne :- - - lda #$35 - sta $01 - + lda #$0b + sta $d011 lda #0 + sta $d020 sta ZX0_dst+0 + jsr load_font + ; we don't have the music player here yet + ; so just put an rts instruction at $a003 + lda #$60 + sta $a003 + jsr init_2x + jsr clr_txt + ldx #copyright + jsr write_txt3 + ldx #$30 + ldy #$01 + jsr init_timer + lda #1 + sta timer_mode ldx #badguy jsr load_8000_zx02_2000 - lda #127 - sta $dc0d +: + lda timer_reached + beq :- - and $d011 - sta $d011 + ldx #250 + ldy #0 + jsr txt_fade_out + lda #64 + sta frame_delay + jsr wait_loop - lda $dc0d - lda $dd0d - - lda #irq_badguy - sta $ffff - - lda #$1b - sta $d011 - lda #$d2 - sta $d012 + sei + jsr set_irq_badguy lda #1 sta $d01a @@ -150,10 +143,6 @@ code_start: cli - lda #64 - sta frame_delay - jsr wait_loop - jsr intro lda #$0b @@ -170,23 +159,17 @@ code_start: lda #$a0 jsr load_8000_zx02 - ldx #towername - jsr loadraw - lda #fake_kernal_irq sta $ffff - lda #1 - sta $d01a - jsr run_nufli_bmp sei jsr init_2x lda #$0b sta $d011 + ; jmp part_11 jsr clr_txt ldx #towername + jsr load_8000_zx02_2000 : lda timer_reached @@ -207,12 +191,7 @@ code_start: ldx #$b8 ldy #$01 - jsr init_timer - lda #2 - sta timer_mode -: - lda timer_reached - beq :- + jsr txt_fade_out jsr init_bmp @@ -253,12 +232,7 @@ code_start: ldx #$90 ldy #$01 - jsr init_timer - lda #2 - sta timer_mode -: - lda timer_reached - beq :- + jsr txt_fade_out jsr init_bmp @@ -316,13 +290,7 @@ code_start: ldx #$48 ldy #$01 - jsr init_timer - lda #2 - sta timer_mode - -: - lda timer_reached - beq :- + jsr txt_fade_out jsr init_bmp @@ -393,13 +361,7 @@ code_start: ldx #$48 ldy #$01 - jsr init_timer - lda #2 - sta timer_mode - -: - lda timer_reached - beq :- + jsr txt_fade_out jsr init_bmp @@ -483,13 +445,7 @@ code_start: ldx #$20 ldy #$01 - jsr init_timer - lda #2 - sta timer_mode - -: - lda timer_reached - beq :- + jsr txt_fade_out part_9: ; $0400-$07ff buffer 0 tilemap @@ -766,8 +722,7 @@ intro: lda #120 sta frame_delay - jsr wait_loop - rts + jmp wait_loop wait_frame: @loop: @@ -907,12 +862,14 @@ irq_music: bne :+ inc timer+1 : - lda timer - cmp timer_limit - bne :+ lda timer+1 cmp timer_limit+1 + bcc :++ bne :+ + lda timer + cmp timer_limit + bcc :++ +: lda #1 sta timer_reached : @@ -1199,19 +1156,14 @@ update_bmp: jmp update_bmp irq_badguy: - pha - txa - pha - tya pha - inc vbl - ;inc $d020 - - nop - nop - nop - nop + pha + pla + pha + pla + pha + pla lda #$1b sta $d011 lda #$c8 @@ -1221,11 +1173,21 @@ irq_badguy: lda #1 sta $d021 - lda #$fa -: - cmp $d012 - bcs :- + lda #irq_badguy2 + sta $ffff + lda #$fb + sta $d012 + asl $d019 + pla + rti + +irq_badguy2: + pha + + inc vbl lda #$3b sta $d011 lda #$d8 @@ -1235,19 +1197,42 @@ irq_badguy: lda #0 sta $d021 - ;dec $d020 + lda #irq_badguy + sta $ffff + lda #$d2 + sta $d012 asl $d019 pla - tay - pla - tax - pla rti +set_irq_badguy: + lda #127 + sta $dc0d + + and $d011 + sta $d011 + + lda $dc0d + lda $dd0d + + lda #irq_badguy + sta $ffff + + lda #$1b + sta $d011 + lda #$d2 + sta $d012 + 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 @@ -1320,6 +1305,7 @@ run_nufli_bmp: sta $80 lda #0 sta $d01a + asl $d019 jsr $a000 cli jsr $3000 @@ -1509,6 +1495,16 @@ part_11: jsr $a006 cmp #17 bne :- + ; load new music + sei + jsr set_irq_badguy + + ldx #song1name + lda #$a0 + jsr load_8000_zx02 + cli + jmp end .res ((*+$ff)&$ff00|2)-* @@ -1517,8 +1513,7 @@ end: ldy #>fontname jsr fileexists bcc end - jsr load_font - jmp * + jmp code_start clear_2bufs: ldy #$44 @@ -1620,76 +1615,41 @@ copybuf: @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: -.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), ' ' +.byte " story written by " +.byte " takahiro ohura " +.byte " tomoo yamane " 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, ' ' +.byte " scenario written by " +.byte " tomoyoshi miyazaki " prog_writ: -.res (40-22)/2, ' ' -.byte " programmed by " -.res (40-22)/2, ' ' -.res (40-22)/2, ' ' -.byte " masaya hashimoto" -.res (40-22)/2, ' ' +.byte " programmed by " +.byte " masaya hashimoto " 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, ' ' +.byte " graphic arts designed by " +.byte " takahiro ohura " +.byte " ayano koshiro " +.byte " kazuhiko tsuzuki " +.byte " tomoo yamane " 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, ' ' +.byte " music composed by " +.byte " mieko ishikawa " +.byte " yuzo koshiro " +.byte " hideya nagata " scene_writ: -.res (40-22)/2, ' ' -.byte "scene set by " -.res (40-22)/2, ' ' -.res (40-22)/2, ' ' -.byte " seigo oketani " -.res (40-22)/2, ' ' -.res (40-22)/2, ' ' -.byte " yoshihiko kurata" -.res (40-22)/2, ' ' +.byte " scene set by " +.byte " seigo oketani " +.byte " yoshihiko kurata " clr_txt: lda #$80 @@ -1909,4 +1869,13 @@ write_txt2: bne :- rts +txt_fade_out: + jsr init_timer + lda #2 + sta timer_mode +: + lda timer_reached + beq :- + rts + code_end: diff --git a/loader/samples/minexample/song1.bin b/loader/samples/minexample/song1.bin new file mode 100644 index 0000000..98396cd Binary files /dev/null and b/loader/samples/minexample/song1.bin differ diff --git a/loader/samples/minexample/ys2_lilia_sid.fur b/loader/samples/minexample/ys2_lilia_sid.fur new file mode 100644 index 0000000..96aad77 Binary files /dev/null and b/loader/samples/minexample/ys2_lilia_sid.fur differ