From 3f4765029bcfc601b2af2303b647bba298b9b94e Mon Sep 17 00:00:00 2001 From: Natt Akuma Date: Wed, 26 Nov 2025 04:35:13 +0700 Subject: [PATCH] Load font directly to the destination --- loader/samples/minexample/Makefile | 4 +- loader/samples/minexample/badguy.bin | Bin 27828 -> 27828 bytes loader/samples/minexample/font.bin | Bin 514 -> 517 bytes loader/samples/minexample/loaderconfig.inc | 2 +- loader/samples/minexample/minexample.s | 116 ++++++++------------- 5 files changed, 49 insertions(+), 73 deletions(-) diff --git a/loader/samples/minexample/Makefile b/loader/samples/minexample/Makefile index 34d520d..3f2f604 100644 --- a/loader/samples/minexample/Makefile +++ b/loader/samples/minexample/Makefile @@ -155,7 +155,7 @@ tellarch: loader: $(LOADER) $(LOADER): $(LOADERCFG) - make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) PLATFORM=$(_PLATFORM_) INSTALL=0a00 RESIDENT=0900 ZP=02 prg + make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) PLATFORM=$(_PLATFORM_) INSTALL=0b00 RESIDENT=0900 ZP=02 prg assemble: $(ASSEMBLE) @@ -174,7 +174,7 @@ endif diskimage: $(DISKIMAGE) -$(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(ZX0PRGS) $(LZPRGS) +$(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(ZX0PRGS) $(LZPRGS) use_this_sid.bin font.bin $(RM) $@ $(CC1541) -n "otomata labs" -i " 2025" \ -f "ys2intro" -w $< \ diff --git a/loader/samples/minexample/badguy.bin b/loader/samples/minexample/badguy.bin index 1c722c928ecbd92f63833ce7f51caa93510bda81..4d8173a6148c0cd04014ea1277cb2ef518b43dee 100644 GIT binary patch delta 224 mcmdmTlX1&U#tjKd^$i0HJgH{=M#fD{lkcUnZGND7#SH-a*>5WV delta 22 ecmdmTlX1&U#tjKd8wIMEC*MnD+x$TFiW>lU5ehp1 diff --git a/loader/samples/minexample/font.bin b/loader/samples/minexample/font.bin index 83283441bce5e6fe36c36d90a1b2e164257611b4..adddaf8aeab5ca99f88720d8b7361d394cd39ceb 100644 GIT binary patch literal 517 zcmXw#ziS&Y6vr(*lt7{FSm@HBgQsFTY08wXYyXD+0hu}!d{w|L4TPX9BJa@DDMN=0 z=I~G-M-U1k8biS)m>WdfK?DurFhO||$wzuTzS8?8jh?0lTqY%Vef_hXEEeOkJ)68` zeh#1o{A;!Ita(7pBOdBHve=@qd zWT&zwv#ZPQyOhs1`F<)czOL7+rfHt9LYco>4a0E$ZhwAYbT{W>hgoZ7U6WVes%k>% z3xLCe*HcO#-(4AF7}hKL4ZlFG=bZ20J5?B_toq>`mY4$~I8((b?*UFus$;$c-ABdg mX8^60bKMM@U~5VgCLwBJ$GEKRaXzGv|NrD)c;w&v(U*G~du;{) literal 514 zcmXw#y=ojW5XXf%gbHC)grH(MOb&ue8DSyJvX|mmu5jVPRVuM#)L4XoLvmoT7gD71 z1LPU<2(DbI3P-9dQlv4YOj4N?hmw(qf6_4grTLP`d-5MyAVeM>p4F4(a#y#A+pqEI zHj?3jiRV30OXWV@e02Zt3A{mxR_FkYXDjjI)JWd^mB?Ho0W#u zurDK0Ij2yQhzpUNVj_v@$0>$MVi&icZx^=Ak+D$Lx{KcL8tvTOoo}Pj+WYY5@6mC* za6?`n9k*|s`#ml98-Ma{HkcU4Lw&w$`+FlyHq<|N;Nni(y%Ab$}c=J{sU#3lFk4C diff --git a/loader/samples/minexample/loaderconfig.inc b/loader/samples/minexample/loaderconfig.inc index 7901632..dab7083 100644 --- a/loader/samples/minexample/loaderconfig.inc +++ b/loader/samples/minexample/loaderconfig.inc @@ -40,7 +40,7 @@ DECOMPRESSOR = DECOMPRESSORS::NONE; available are NONE, BITNA ; extended features, different settings can be run with the same installed drive code, increase host-side code size -.define FILE_EXISTS_API 0 ; include the fileexists call for simple multi-disk handling +.define FILE_EXISTS_API 1 ; include the fileexists call for simple multi-disk handling .define LOAD_UNDER_D000_DFFF 0 ; C-64/128: enable loading (and decompression) to the RAM at $D000..$DFFF, ; note that this does not slow down loading when not loading to RAM at $D000..$DFFF, diff --git a/loader/samples/minexample/minexample.s b/loader/samples/minexample/minexample.s index 50354a3..301e9d3 100644 --- a/loader/samples/minexample/minexample.s +++ b/loader/samples/minexample/minexample.s @@ -95,26 +95,12 @@ code_start: sei - ldx #fontname - jsr loadraw + lda #0 + jsr load_font lda #$34 sta $01 - ldx #0 -: - lda $8000, x - sta $d800, x - eor #$ff - sta $c00, x - lda $8100, x - sta $d900, x - eor #$ff - sta $d00, x - inx - bne :- - lda #0 tax : @@ -151,7 +137,7 @@ code_start: lda #$1b sta $d011 - lda #$d0 + lda #$d2 sta $d012 lda #1 @@ -1221,36 +1207,32 @@ irq_badguy: inc vbl ;inc $d020 + nop + nop + nop + nop lda #$1b sta $d011 - lda #$19 - sta $d018 lda #$c8 sta $d016 - lda $dd00 - and #3 - sta @dd00_arc+1 - lda #0 - sta $dd00 - lda #$47 + lda #$13 sta $d018 + lda #1 + sta $d021 + lda #$fa : - lda $d012 - cmp #$fb - bcc :- - - .res 2, $ea + cmp $d012 + bcs :- lda #$3b sta $d011 - lda #$19 - sta $d018 lda #$d8 sta $d016 -@dd00_arc: + lda #$19 + sta $d018 lda #0 - sta $dd00 + sta $d021 ;dec $d020 @@ -1303,60 +1285,33 @@ too_bad_txt: .res (40-16)/2, ' ' upload_text: - lda #$34 - sta $01 - stx text_ptr sty text_ptr+1 ldy #39 : lda (text_ptr), y - sec - sbc #$20 - sta $d348, y + clc + adc #$60 + sta $748, y dey - bne :- - - lda #$35 - sta $01 - - lda #1 - ldy #39 -: - sta $db48, y - dey - bne :- + bpl :- rts upload_text_bottom: - lda #$34 - sta $01 - stx text_ptr sty text_ptr+1 ldy #39 : lda (text_ptr), y - sec - sbc #$20 - sta $d348+40+40, y + clc + adc #$60 + sta $748+40+40, y dey - bne :- - - lda #$35 - sta $01 - - lda #1 - ldy #39 -: - sta $db48+40+40, y - dey - bne :- + bpl :- rts - run_nufli_bmp: lda #$01 sta $81 @@ -1433,6 +1388,18 @@ load_8000_zx02: pla jmp zx02 +load_font: + beq :+ + pha +: + ldx #fontname + jsr fileexists + bcs :- + ldx #fontname + jmp loadraw + part_10: ; the sprite data is embedded into first few bitmap pixels ; which are hidden by black border attributes @@ -1452,7 +1419,7 @@ part_10: stx $d01c lda #11 sta $d026 - lda #@y+50 + lda #@y+48 jsr position_2x ; draw top half @loop: @@ -1532,6 +1499,15 @@ part_10: .byte 2, 2, 2, 9, 2, 2 @finish: + jsr position_2x_to_display + + .res ((*+$ff)&$ff00|2)-* +end: + ldx #fontname + jsr fileexists + bcc end + jsr load_font jmp * clear_2bufs: