diff --git a/loader/build/intermediate/binary.link b/loader/build/intermediate/binary.link index 8847adf..148c8b6 100644 --- a/loader/build/intermediate/binary.link +++ b/loader/build/intermediate/binary.link @@ -3,7 +3,7 @@ MEMORY ZPRAM: start = $2, size = $fe; ZPRAM2: start = $2, size = $fe; INSTALLRAM: start = $17fe, size = $e802, file = "../build/install-c64.prg"; - RESIDENTRAM: start = $16fe, size = $e902, file = "../build/loader-c64.prg"; + RESIDENTRAM: start = $efe, size = $f102, file = "../build/loader-c64.prg"; TRANSIENTRAM: start = $3ffe, size = $c002, file = "../build/transient-c64.prg"; } diff --git a/loader/build/intermediate/install-nonreloc-c64.o b/loader/build/intermediate/install-nonreloc-c64.o index 4bd8a9f..b482114 100644 Binary files a/loader/build/intermediate/install-nonreloc-c64.o and b/loader/build/intermediate/install-nonreloc-c64.o differ diff --git a/loader/build/intermediate/loader-c64.map b/loader/build/intermediate/loader-c64.map index 1c7b4dd..34a8be5 100644 --- a/loader/build/intermediate/loader-c64.map +++ b/loader/build/intermediate/loader-c64.map @@ -30,7 +30,7 @@ NULL 000000 000000 000000 00001 RODATA 000000 000000 000000 00001 ZEROPAGE 000000 000000 000000 00001 DISKIO_ZP 000002 000006 000005 00001 -DISKIO 0016FE 0017DF 0000E2 00001 +DISKIO 000EFE 000FDF 0000E2 00001 DISKIO_INSTALL 0017FE 003352 001B55 00001 @@ -81,7 +81,7 @@ install 001800 LA loadaddrhi 000003 LZ loadaddrlo 000002 RLZ loader_zp_first 000002 EZ loader_zp_last 000006 EZ loadfile41 0005BA LA loadfile71 0004E1 LA loadfile81 000596 LA -loadraw 001700 LA onemhz71 0000DF LZ +loadraw 000F00 LA onemhz71 0000DF LZ sertoraw41 000216 LA setbv2b41 0002AD LA status_DEVICE_INCOMPATIBLE 0000FB EZ status_DEVICE_NOT_PRESENT 0000FE EZ status_FILE_NOT_FOUND 0000FF EZ status_GENERIC_KERNAL_ERROR 0000FD EZ @@ -145,7 +145,7 @@ loadfile41 0005BA LA idxloop71 00065C LA BLOCKBUFFER71 000700 EA cmdfdfix3 000702 REA cmdfdfix4 000704 REA dcodinit81 00074C LA DRVCODEND81 0007A0 EA DIRTRACKS81 0007A0 EA -BLOCKBUFFER81 000B00 EA loadraw 001700 LA +BLOCKBUFFER81 000B00 EA loadraw 000F00 LA install 001800 LA CUSTOMRECEIVE81 001FD7 EA diff --git a/loader/build/intermediate/loader-nonreloc-c64.o b/loader/build/intermediate/loader-nonreloc-c64.o index 985a22e..8acb0cc 100644 Binary files a/loader/build/intermediate/loader-nonreloc-c64.o and b/loader/build/intermediate/loader-nonreloc-c64.o differ diff --git a/loader/build/intermediate/minexample-uncompressed-c64.prg b/loader/build/intermediate/minexample-uncompressed-c64.prg index e66cc0e..231350e 100644 Binary files a/loader/build/intermediate/minexample-uncompressed-c64.prg and b/loader/build/intermediate/minexample-uncompressed-c64.prg differ diff --git a/loader/build/loader-c64.prg b/loader/build/loader-c64.prg index 09b5a55..786ce88 100644 Binary files a/loader/build/loader-c64.prg and b/loader/build/loader-c64.prg differ diff --git a/loader/build/loadersymbols-c64.inc b/loader/build/loadersymbols-c64.inc index 5667e7d..2088cce 100644 --- a/loader/build/loadersymbols-c64.inc +++ b/loader/build/loadersymbols-c64.inc @@ -1,5 +1,5 @@ -; repository version 194, built on Sat, 15 Nov 2025 23:14:57 +0300 for project "loader" using -; make PLATFORM=c64 prg INSTALL=1800 RESIDENT=1700 ZP=02 PROJECT= +; repository version 194, built on Sun, 16 Nov 2025 00:48:53 +0300 for project "loader" using +; make PLATFORM=c64 prg INSTALL=1800 RESIDENT=0F00 ZP=02 PROJECT= ; configuration config_ALLOW_2_MHZ_ON_C128 = 0 @@ -39,5 +39,5 @@ loader_zp_last = $06 ; install $1800-$3353 install = $1800 -; resident $1700-$17e0 -loadraw = $1700 +; resident $0f00-$0fe0 +loadraw = $0f00 diff --git a/loader/build/minexample-c64.d64 b/loader/build/minexample-c64.d64 index a454c02..70a10ce 100644 Binary files a/loader/build/minexample-c64.d64 and b/loader/build/minexample-c64.d64 differ diff --git a/loader/samples/minexample/Makefile b/loader/samples/minexample/Makefile index 4ed6213..6ebeb05 100644 --- a/loader/samples/minexample/Makefile +++ b/loader/samples/minexample/Makefile @@ -137,7 +137,7 @@ tellarch: loader: $(LOADER) $(LOADER): $(LOADERCFG) - make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) PLATFORM=$(_PLATFORM_) INSTALL=1800 RESIDENT=1700 ZP=02 prg + make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) PLATFORM=$(_PLATFORM_) INSTALL=1800 RESIDENT=0F00 ZP=02 prg assemble: $(ASSEMBLE) @@ -160,10 +160,11 @@ $(DISKIMAGE): $(ASSEMBLE) $(RM) $@ $(CC1541) -n "ys2 intro" -i test \ -f $(NAME) -w $< \ - -f "sid" -w sid.bin \ + -f "sid" -w use_this_sid.bin \ -f "badguy" -w badguy.zx0.prg \ -f "font" -w font.bin \ -f "scrmap" -w tilemap.bin.lz \ + -f "intrbmp" -w title_320-prepared.zx0.prg \ $@ diff --git a/loader/samples/minexample/badguy.zx0.prg b/loader/samples/minexample/badguy.zx0.prg index 5836884..747c87d 100644 Binary files a/loader/samples/minexample/badguy.zx0.prg and b/loader/samples/minexample/badguy.zx0.prg differ diff --git a/loader/samples/minexample/conv_zx0.sh b/loader/samples/minexample/conv_zx0.sh index 9b71c57..9f45280 100644 --- a/loader/samples/minexample/conv_zx0.sh +++ b/loader/samples/minexample/conv_zx0.sh @@ -1,4 +1,7 @@ zx02/zx02 badguyz.bin badguy.zx0 -printf "\x00\xe0" > badguy.zx0.prg +printf "\x00\x80" > badguy.zx0.prg cat badguy.zx0 >> badguy.zx0.prg -python3 aart_lz.py tilemap.bin tilemap.bin.lz \ No newline at end of file +python3 aart_lz.py tilemap.bin tilemap.bin.lz +zx02/zx02 title_320-prepared.bin title_320-prepared.zx0 +printf "\x00\x80" > title_320-prepared.zx0.prg +cat title_320-prepared.zx0 >> title_320-prepared.zx0.prg \ No newline at end of file diff --git a/loader/samples/minexample/font.bin b/loader/samples/minexample/font.bin index 247613f..8328344 100644 Binary files a/loader/samples/minexample/font.bin and b/loader/samples/minexample/font.bin differ diff --git a/loader/samples/minexample/font.bin.bak b/loader/samples/minexample/font.bin.bak index 9a9d138..247613f 100755 Binary files a/loader/samples/minexample/font.bin.bak and b/loader/samples/minexample/font.bin.bak differ diff --git a/loader/samples/minexample/minexample.o b/loader/samples/minexample/minexample.o index 7bc493b..475f5f2 100644 Binary files a/loader/samples/minexample/minexample.o and b/loader/samples/minexample/minexample.o differ diff --git a/loader/samples/minexample/minexample.s b/loader/samples/minexample/minexample.s index 9b54b24..f27b3d1 100644 --- a/loader/samples/minexample/minexample.s +++ b/loader/samples/minexample/minexample.s @@ -20,6 +20,8 @@ text_ptr: .res 2 aart_lz_buffer := $fd00 .include "lz_zp.asm" +CODE_START_ADDR = $e000 + .segment "CODE" ZP=$e0 @@ -31,11 +33,99 @@ pntr = ZP+7 .org $080d - jsr install +copy_start: sei lda #$35 sta $01 + lda #>(code_end-CODE_START_ADDR) + sta $ff + lda #<(code_end-CODE_START_ADDR) + sta $fe + + lda #CODE_START_ADDR + sta $fd + + lda #code_start + sta $fb + +@copy_loop: + ldy #0 + lda ($fa), y + sta ($fc), y + inc $fc + bne :+ + inc $fd +: + inc $fa + bne :+ + inc $fb +: + lda $fe + bne :+ + dec $ff +: + dec $fe + lda $fe + ora $ff + bne @copy_loop + + lda #$36 + sta $01 + cli + jsr install + sei + lda #$35 + sta $01 + jmp CODE_START_ADDR + +run_nufli_bmp: + lda #$01 + sta $81 + lda #$29 + sta $80 + lda #0 + sta $d01a + jsr $a000 + cli + 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 +: + rts + + .res loadraw - * +.incbin "../../build/loader-c64.prg", 2 + + .res install - * +.incbin "../../build/install-c64.prg", 2 + +code_start: + .org CODE_START_ADDR + + sei ldx #fontname @@ -46,9 +136,9 @@ pntr = ZP+7 ldx #0 : - lda $e000, x + lda $8000, x sta $d800, x - lda $e100, x + lda $8100, x sta $d900, x inx bne :- @@ -75,7 +165,7 @@ pntr = ZP+7 lda #0 sta ZX0_src - lda #$e0 + lda #$80 sta ZX0_src+1 lda #0 sta ZX0_dst @@ -175,8 +265,125 @@ pntr = ZP+7 lda #$1a sta frame_until jsr wait_frame_until + + lda #120 + sta frame_delay + jsr wait_loop + + lda #$0b + sta $d011 + + sei + ldx #introname + jsr loadraw + + lda #0 + sta ZX0_src + lda #$80 + sta ZX0_src+1 + lda #0 + sta ZX0_dst + lda #$10 + jsr zx02 + + ldx #sidname + jsr loadraw + + lda #fake_kernal_irq + sta $ffff + + lda #1 + sta $d01a + + jsr run_nufli_bmp + sei + jsr init_2x jmp * +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 + + lda #0 + sta $d01a + + lda #$63; <(985248/100) + sta $dc04 + lda #$26;>(985248/100) + sta $dc05 + + 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 + +irq_music: + pha + txa + pha + tya + pha + + inc $d020 + jsr $a003 + dec $d020 + + pla + tay + pla + tax + pla + jmp $dc0c + + +fake_kernal_irq: + pha + txa + pha + tya + pha + tsx + lda $0104, x + and #$10 + beq :+ + jmp ($0314) +: + jmp ($0314) ; fuck you + wait_loop: loop2: lda vbl @@ -438,7 +645,8 @@ irq_badguy: badguy: .byte "badguy",0 fontname: .byte "font",0 - +sidname: .byte "sid", 0 +introname: .byte "intrbmp", 0 darmtower_txt: .res (40-26)/2, ' ' @@ -486,8 +694,22 @@ upload_text: .include "zx02.asm" .include "thcmod_lz.asm" - .res loadraw - * -.incbin "../../build/loader-c64.prg", 2 +.res $ea31-*, $ff + ;asl $d019 + pla + tay + pla + tax + pla + rti - .res install - * -.incbin "../../build/install-c64.prg", 2 \ No newline at end of file +.res $ea81-*, $ff + ;asl $d019 + pla + tay + pla + tax + pla + rti + +code_end: diff --git a/loader/samples/minexample/sid.bin b/loader/samples/minexample/sid.bin index 74d7539..8f609d1 100644 Binary files a/loader/samples/minexample/sid.bin and b/loader/samples/minexample/sid.bin differ diff --git a/loader/samples/minexample/sid.bin.bak b/loader/samples/minexample/sid.bin.bak new file mode 100755 index 0000000..74d7539 Binary files /dev/null and b/loader/samples/minexample/sid.bin.bak differ diff --git a/loader/samples/minexample/title_320-prepared.bin b/loader/samples/minexample/title_320-prepared.bin new file mode 100644 index 0000000..2f5b2ce Binary files /dev/null and b/loader/samples/minexample/title_320-prepared.bin differ diff --git a/loader/samples/minexample/title_320-prepared.prg b/loader/samples/minexample/title_320-prepared.prg new file mode 100644 index 0000000..e6f9465 Binary files /dev/null and b/loader/samples/minexample/title_320-prepared.prg differ diff --git a/loader/samples/minexample/title_320-prepared.prg.bak b/loader/samples/minexample/title_320-prepared.prg.bak new file mode 100755 index 0000000..d029e3b Binary files /dev/null and b/loader/samples/minexample/title_320-prepared.prg.bak differ diff --git a/loader/samples/minexample/title_320-prepared.zx0 b/loader/samples/minexample/title_320-prepared.zx0 new file mode 100644 index 0000000..00b597a Binary files /dev/null and b/loader/samples/minexample/title_320-prepared.zx0 differ diff --git a/loader/samples/minexample/title_320-prepared.zx0.prg b/loader/samples/minexample/title_320-prepared.zx0.prg new file mode 100644 index 0000000..377fc80 Binary files /dev/null and b/loader/samples/minexample/title_320-prepared.zx0.prg differ diff --git a/loader/samples/minexample/use_this_sid.bin b/loader/samples/minexample/use_this_sid.bin new file mode 100644 index 0000000..7a9ce8f Binary files /dev/null and b/loader/samples/minexample/use_this_sid.bin differ diff --git a/loader/samples/minexample/use_this_sid.bin.bak b/loader/samples/minexample/use_this_sid.bin.bak new file mode 100755 index 0000000..ce87634 Binary files /dev/null and b/loader/samples/minexample/use_this_sid.bin.bak differ diff --git a/loader/samples/minexample/ys2_new.bin b/loader/samples/minexample/ys2_new.bin index 35c2508..836c632 100644 Binary files a/loader/samples/minexample/ys2_new.bin and b/loader/samples/minexample/ys2_new.bin differ diff --git a/loader/samples/minexample/ys2_new.bin.bak b/loader/samples/minexample/ys2_new.bin.bak new file mode 100755 index 0000000..35c2508 Binary files /dev/null and b/loader/samples/minexample/ys2_new.bin.bak differ diff --git a/loader/samples/minexample/ys2sid.bin b/loader/samples/minexample/ys2sid.bin index fd26ed3..372de98 100644 Binary files a/loader/samples/minexample/ys2sid.bin and b/loader/samples/minexample/ys2sid.bin differ diff --git a/loader/samples/minexample/ys2sid.bin.bak b/loader/samples/minexample/ys2sid.bin.bak new file mode 100755 index 0000000..fd26ed3 Binary files /dev/null and b/loader/samples/minexample/ys2sid.bin.bak differ