diff --git a/kfest2018/FASTCLEAR.BIN b/kfest2018/FASTCLEAR.BIN new file mode 100644 index 0000000..e1256d5 Binary files /dev/null and b/kfest2018/FASTCLEAR.BIN differ diff --git a/kfest2018/FASTEST.BIN b/kfest2018/FASTEST.BIN new file mode 100644 index 0000000..9c05f3c Binary files /dev/null and b/kfest2018/FASTEST.BIN differ diff --git a/kfest2018/INSANECLEAR.BIN b/kfest2018/INSANECLEAR.BIN new file mode 100644 index 0000000..156bdd1 Binary files /dev/null and b/kfest2018/INSANECLEAR.BIN differ diff --git a/kfest2018/Makefile b/kfest2018/Makefile new file mode 100644 index 0000000..14ccf8b --- /dev/null +++ b/kfest2018/Makefile @@ -0,0 +1,58 @@ + +all: INSANECLEAR.BIN FASTEST.BIN SETSCRN.BIN NORMAL.BIN NORMALSMC.BIN FASTCLEAR.BIN NORMALINCFONT.BIN NORMALAL31.BIN + +FASTEST.BIN: driver.s fastfont.s + rm -f fastest.xex + cat driver.s fastfont.s > temp.s + atrcopy . assemble -f -s temp.s -r 0x5000 -o FASTEST.BIN + atrcopy kfest.dsk add FASTEST.BIN -f + rm -f apple2auto.state + +SETSCRN.BIN: setscrn.s + rm -f setscrn.bin + cat setscrn.s > temp.s + atrcopy . assemble -f -s temp.s -r 0x5000 -o SETSCRN.BIN + atrcopy kfest.dsk add SETSCRN.BIN -f + rm -f apple2auto.state + +NORMAL.BIN: driver.s normal.s + cat driver.s normal.s > temp.s + atrcopy . assemble -f -d fatfont128.dat@0x6000 -s temp.s -r 0x5000 -o NORMAL.BIN + atrcopy kfest.dsk add NORMAL.BIN -f + rm -f apple2auto.state + +NORMALINCFONT.BIN: driver.s normalincfont.s + cat driver.s normalincfont.s > temp.s + atrcopy . assemble -f -d fatfont128.dat@0x6000 -s temp.s -r 0x5000 -o NORMALINCFONT.BIN + atrcopy kfest.dsk add NORMALINCFONT.BIN -f + rm -f apple2auto.state + +NORMALAL31.BIN: driver.s normalal31.s + cat driver.s normalal31.s > temp.s + atrcopy . assemble -f -d fatfont128.dat@0x6000 -s temp.s -r 0x5000 -o NORMALAL31.BIN + atrcopy kfest.dsk add NORMALAL31.BIN -f + rm -f apple2auto.state + +NORMALSMC.BIN: driver.s normalsmc.s + cat driver.s normalsmc.s > temp.s + atrcopy . assemble -f -d fatfont128.dat@0x6000 -s temp.s -r 0x5000 -o NORMALSMC.BIN + atrcopy kfest.dsk add NORMALSMC.BIN -f + rm -f apple2auto.state + +FASTCLEAR.BIN: fastclear.s + cat fastclear.s > temp.s + atrcopy . assemble -f -s fastclear.s -r 0x5000 -o FASTCLEAR.BIN + atrcopy kfest.dsk add FASTCLEAR.BIN -f + rm -f apple2auto.state + +INSANECLEAR.BIN: insaneclear.s + cat insaneclear.s > temp.s + atrcopy . assemble -f -s insaneclear.s -r 0x4000 -o INSANECLEAR.BIN + atrcopy insaneclear.dsk boot -b INSANECLEAR.BIN --brun 4000 -f + rm -f apple2auto.state + +clean: + rm -f working.dsk + +reallyclean: clean + rm -f player-missile.hgr player-missile-2.hgr kansasfest-hackfest.hgr title.hgr \ No newline at end of file diff --git a/kfest2018/NORMAL.BIN b/kfest2018/NORMAL.BIN new file mode 100644 index 0000000..0d4c2af Binary files /dev/null and b/kfest2018/NORMAL.BIN differ diff --git a/kfest2018/NORMALAL31.BIN b/kfest2018/NORMALAL31.BIN new file mode 100644 index 0000000..61aa55e Binary files /dev/null and b/kfest2018/NORMALAL31.BIN differ diff --git a/kfest2018/NORMALINCFONT.BIN b/kfest2018/NORMALINCFONT.BIN new file mode 100644 index 0000000..30a5ef2 Binary files /dev/null and b/kfest2018/NORMALINCFONT.BIN differ diff --git a/kfest2018/NORMALSMC.BIN b/kfest2018/NORMALSMC.BIN new file mode 100644 index 0000000..568dfb9 Binary files /dev/null and b/kfest2018/NORMALSMC.BIN differ diff --git a/kfest2018/SETSCRN.BIN b/kfest2018/SETSCRN.BIN new file mode 100644 index 0000000..01c659d Binary files /dev/null and b/kfest2018/SETSCRN.BIN differ diff --git a/kfest2018/driver.s b/kfest2018/driver.s new file mode 100644 index 0000000..94f8e32 --- /dev/null +++ b/kfest2018/driver.s @@ -0,0 +1,97 @@ + +FIRST_CHAR_OF_SCREEN = $06 +FIRST_CHAR_OF_LINE = $07 +CURRENT_CHAR = $08 +FRAME_COUNT = $09 + + + *= $5000 + +start_set + jsr set_hires + jsr clrscr + jsr driver + jsr set_text + rts + brk + +driver + lda #$00 + sta FIRST_CHAR_OF_SCREEN + lda #64 + sta FRAME_COUNT +page_loop + jsr page + dec FRAME_COUNT + bne page_loop + rts + +; os memory map +KEYBOARD = $c000 +KBDSTROBE = $c010 +CLRTEXT = $c050 +SETTEXT = $c051 +CLRMIXED = $c052 +SETMIXED = $c053 +TXTPAGE1 = $c054 +TXTPAGE2 = $c055 +CLRHIRES = $c056 +SETHIRES = $c057 + + +set_hires bit CLRTEXT ; start with HGR page 1, full screen + bit CLRMIXED + bit TXTPAGE1 + bit SETHIRES + rts + +set_text bit SETTEXT + bit CLRMIXED + bit TXTPAGE1 + bit CLRHIRES + rts + +; clear hires page 1 only +clrscr lda #$20 + sta clrscr_smc+2 + lda #0 + ldy #0 +clrscr_smc sta $ff00,y + iny + bne clrscr_smc + inc clrscr_smc+2 + ldx clrscr_smc+2 + cpx #$40 + bcc clrscr_smc + rts + + *= $5074 + +page + inc FIRST_CHAR_OF_SCREEN + lda FIRST_CHAR_OF_SCREEN + sta FIRST_CHAR_OF_LINE + + ldy #$00 +line_loop + ldx #$00 + lda FIRST_CHAR_OF_LINE + sta CURRENT_CHAR +char_loop + lda CURRENT_CHAR + jsr font_test + inc CURRENT_CHAR + inx + cpx #40 + bcc char_loop + + inc FIRST_CHAR_OF_LINE + iny + cpy #24 + bcc line_loop + + rts + + + +font_test diff --git a/kfest2018/fastclear.s b/kfest2018/fastclear.s new file mode 100644 index 0000000..00aef70 --- /dev/null +++ b/kfest2018/fastclear.s @@ -0,0 +1,285 @@ +; AUTOGENERATED FILE; DO NOT EDIT! +; +; This file was generated by asmgen.py, a 6502 code generator sponsored by +; the Player/Missile Podcast. (The sprite compiler is based on HiSprite by +; Quinn Dunki). +; +; The code produced by asmgen is licensed under the Creative Commons +; Attribution 4.0 International (CC BY 4.0), so you are free to use the code in +; this file for any purpose. (The code generator itself is licensed under the +; GPLv3.) + +FIRST_CHAR_OF_SCREEN = $06 +FIRST_CHAR_OF_LINE = $07 +CURRENT_CHAR = $08 +FRAME_COUNT = $09 + + + *= $5000 + +start_set + jsr set_hires + jsr clrscr + jsr driver + jsr set_text + rts + brk + +driver + lda #$00 + sta FIRST_CHAR_OF_SCREEN + lda #64 + sta FRAME_COUNT +page_loop + jsr page + dec FRAME_COUNT + bne page_loop + rts + +; os memory map +KEYBOARD = $c000 +KBDSTROBE = $c010 +CLRTEXT = $c050 +SETTEXT = $c051 +CLRMIXED = $c052 +SETMIXED = $c053 +TXTPAGE1 = $c054 +TXTPAGE2 = $c055 +CLRHIRES = $c056 +SETHIRES = $c057 + + +set_hires bit CLRTEXT ; start with HGR page 1, full screen + bit CLRMIXED + bit TXTPAGE1 + bit SETHIRES + rts + +set_text bit SETTEXT + bit CLRMIXED + bit TXTPAGE1 + bit CLRHIRES + rts + +; clear hires page 1 only +clrscr lda #$20 + sta clrscr_smc+2 + lda #0 + ldy #0 +clrscr_smc sta $ff00,y + iny + bne clrscr_smc + inc clrscr_smc+2 + ldx clrscr_smc+2 + cpx #$40 + bcc clrscr_smc + rts + + *= $5074 + +page + +FASTCLEAR_2000 ; A,X clobbered + lda FRAME_COUNT + ldx #39 +FASTCLEAR_2000_INNER + sta $2000,x + sta $2400,x + sta $2800,x + sta $2c00,x + sta $3000,x + sta $3400,x + sta $3800,x + sta $3c00,x + sta $2080,x + sta $2480,x + sta $2880,x + sta $2c80,x + sta $3080,x + sta $3480,x + sta $3880,x + sta $3c80,x + sta $2100,x + sta $2500,x + sta $2900,x + sta $2d00,x + sta $3100,x + sta $3500,x + sta $3900,x + sta $3d00,x + sta $2180,x + sta $2580,x + sta $2980,x + sta $2d80,x + sta $3180,x + sta $3580,x + sta $3980,x + sta $3d80,x + sta $2200,x + sta $2600,x + sta $2a00,x + sta $2e00,x + sta $3200,x + sta $3600,x + sta $3a00,x + sta $3e00,x + sta $2280,x + sta $2680,x + sta $2a80,x + sta $2e80,x + sta $3280,x + sta $3680,x + sta $3a80,x + sta $3e80,x + sta $2300,x + sta $2700,x + sta $2b00,x + sta $2f00,x + sta $3300,x + sta $3700,x + sta $3b00,x + sta $3f00,x + sta $2380,x + sta $2780,x + sta $2b80,x + sta $2f80,x + sta $3380,x + sta $3780,x + sta $3b80,x + sta $3f80,x + sta $2028,x + sta $2428,x + sta $2828,x + sta $2c28,x + sta $3028,x + sta $3428,x + sta $3828,x + sta $3c28,x + sta $20a8,x + sta $24a8,x + sta $28a8,x + sta $2ca8,x + sta $30a8,x + sta $34a8,x + sta $38a8,x + sta $3ca8,x + sta $2128,x + sta $2528,x + sta $2928,x + sta $2d28,x + sta $3128,x + sta $3528,x + sta $3928,x + sta $3d28,x + sta $21a8,x + sta $25a8,x + sta $29a8,x + sta $2da8,x + sta $31a8,x + sta $35a8,x + sta $39a8,x + sta $3da8,x + sta $2228,x + sta $2628,x + sta $2a28,x + sta $2e28,x + sta $3228,x + sta $3628,x + sta $3a28,x + sta $3e28,x + sta $22a8,x + sta $26a8,x + sta $2aa8,x + sta $2ea8,x + sta $32a8,x + sta $36a8,x + sta $3aa8,x + sta $3ea8,x + sta $2328,x + sta $2728,x + sta $2b28,x + sta $2f28,x + sta $3328,x + sta $3728,x + sta $3b28,x + sta $3f28,x + sta $23a8,x + sta $27a8,x + sta $2ba8,x + sta $2fa8,x + sta $33a8,x + sta $37a8,x + sta $3ba8,x + sta $3fa8,x + sta $2050,x + sta $2450,x + sta $2850,x + sta $2c50,x + sta $3050,x + sta $3450,x + sta $3850,x + sta $3c50,x + sta $20d0,x + sta $24d0,x + sta $28d0,x + sta $2cd0,x + sta $30d0,x + sta $34d0,x + sta $38d0,x + sta $3cd0,x + sta $2150,x + sta $2550,x + sta $2950,x + sta $2d50,x + sta $3150,x + sta $3550,x + sta $3950,x + sta $3d50,x + sta $21d0,x + sta $25d0,x + sta $29d0,x + sta $2dd0,x + sta $31d0,x + sta $35d0,x + sta $39d0,x + sta $3dd0,x + sta $2250,x + sta $2650,x + sta $2a50,x + sta $2e50,x + sta $3250,x + sta $3650,x + sta $3a50,x + sta $3e50,x + sta $22d0,x + sta $26d0,x + sta $2ad0,x + sta $2ed0,x + sta $32d0,x + sta $36d0,x + sta $3ad0,x + sta $3ed0,x + sta $2350,x + sta $2750,x + sta $2b50,x + sta $2f50,x + sta $3350,x + sta $3750,x + sta $3b50,x + sta $3f50,x + sta $23d0,x + sta $27d0,x + sta $2bd0,x + sta $2fd0,x + sta $33d0,x + sta $37d0,x + sta $3bd0,x + sta $3fd0,x + dex + bmi FASTCLEAR_2000_RTS + + jmp FASTCLEAR_2000_INNER +FASTCLEAR_2000_RTS + rts + + diff --git a/kfest2018/fastfont.s b/kfest2018/fastfont.s new file mode 100644 index 0000000..6b6d7a7 --- /dev/null +++ b/kfest2018/fastfont.s @@ -0,0 +1,1127 @@ +; AUTOGENERATED FILE; DO NOT EDIT! +; +; This file was generated by asmgen.py, a 6502 code generator sponsored by +; the Player/Missile Podcast. (The sprite compiler is based on HiSprite by +; Quinn Dunki). +; +; The code produced by asmgen is licensed under the Creative Commons +; Attribution 4.0 International (CC BY 4.0), so you are free to use the code in +; this file for any purpose. (The code generator itself is licensed under the +; GPLv3.) + +SCRATCH_0 = $D0 + +FASTFONT_H1 ; A = character, X = column, Y = row; A is clobbered, X&Y are not + pha + lda FASTFONT_H1_JMP_HI,y + sta FASTFONT_H1_JMP+2 + lda FASTFONT_H1_JMP_LO,y + sta FASTFONT_H1_JMP+1 + sty scratch_0 + pla + tay +FASTFONT_H1_JMP + jmp $ffff + + +FASTFONT_H1_JMP_HI + .byte >FASTFONT_H1_0 + .byte >FASTFONT_H1_1 + .byte >FASTFONT_H1_2 + .byte >FASTFONT_H1_3 + .byte >FASTFONT_H1_4 + .byte >FASTFONT_H1_5 + .byte >FASTFONT_H1_6 + .byte >FASTFONT_H1_7 + .byte >FASTFONT_H1_8 + .byte >FASTFONT_H1_9 + .byte >FASTFONT_H1_10 + .byte >FASTFONT_H1_11 + .byte >FASTFONT_H1_12 + .byte >FASTFONT_H1_13 + .byte >FASTFONT_H1_14 + .byte >FASTFONT_H1_15 + .byte >FASTFONT_H1_16 + .byte >FASTFONT_H1_17 + .byte >FASTFONT_H1_18 + .byte >FASTFONT_H1_19 + .byte >FASTFONT_H1_20 + .byte >FASTFONT_H1_21 + .byte >FASTFONT_H1_22 + .byte >FASTFONT_H1_23 +FASTFONT_H1_JMP_LO + .byte FASTFONT_H2_0 + .byte >FASTFONT_H2_1 + .byte >FASTFONT_H2_2 + .byte >FASTFONT_H2_3 + .byte >FASTFONT_H2_4 + .byte >FASTFONT_H2_5 + .byte >FASTFONT_H2_6 + .byte >FASTFONT_H2_7 + .byte >FASTFONT_H2_8 + .byte >FASTFONT_H2_9 + .byte >FASTFONT_H2_10 + .byte >FASTFONT_H2_11 + .byte >FASTFONT_H2_12 + .byte >FASTFONT_H2_13 + .byte >FASTFONT_H2_14 + .byte >FASTFONT_H2_15 + .byte >FASTFONT_H2_16 + .byte >FASTFONT_H2_17 + .byte >FASTFONT_H2_18 + .byte >FASTFONT_H2_19 + .byte >FASTFONT_H2_20 + .byte >FASTFONT_H2_21 + .byte >FASTFONT_H2_22 + .byte >FASTFONT_H2_23 +FASTFONT_H2_JMP_LO + .byte fatfont + adc font_ptr+1 + sta font_ptr+1 + + lda hgrtextrow_l,y ; load address of first line of hgr text + sta hgr_ptr + lda hgrtextrow_h,y + sta hgr_ptr+1 + + ldx #0 +slowfont_loop + txa + tay + lda (font_ptr),y + ldy SCRATCH_X ; col goes in y + sta (hgr_ptr),y + clc + lda #4 + adc hgr_ptr+1 + sta hgr_ptr+1 + inx + cpx #8 + bcc slowfont_loop + +done + ldx SCRATCH_X + ldy SCRATCH_Y + rts + + + + +hgrtextrow_l + .byte $00,$80,$00,$80,$00,$80,$00,$80 + .byte $28,$A8,$28,$A8,$28,$A8,$28,$A8 + .byte $50,$D0,$50,$D0,$50,$D0,$50,$D0 +hgrtextrow_h + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 diff --git a/kfest2018/normalal31.s b/kfest2018/normalal31.s new file mode 100644 index 0000000..817430e --- /dev/null +++ b/kfest2018/normalal31.s @@ -0,0 +1,71 @@ + +SCRATCH_X = $D0 +SCRATCH_Y = $D1 +FONT_PTR = $D2 +HGR_PTR = $D4 + +FATFONT = $6000 + +; A = character, X = column, Y = row; A is clobbered, X&Y are not + + stx SCRATCH_X + sty SCRATCH_Y + + ; find address of glyph + sta font_ptr + lda #0 + sta font_ptr + 1 + asl font_ptr ; multiply by 8 + rol font_ptr + 1 + asl font_ptr + rol font_ptr + 1 + asl font_ptr + rol font_ptr + 1 + + clc ; add font table address to get pointer inside font table + lda #fatfont + adc font_ptr+1 + sta font_ptr+1 + + clc + lda hgrtextrow_l,y ; load address of first line of hgr text + adc SCRATCH_X + sta hgr_ptr + lda hgrtextrow_h,y + adc #0 + sta hgr_ptr+1 + + ldy #0 +slowfont_loop + lda (font_ptr),y + sta (hgr_ptr),y + clc + lda hgr_ptr + adc #$ff + sta hgr_ptr + lda #3 + adc hgr_ptr+1 + sta hgr_ptr+1 + iny + cpy #8 + bcc slowfont_loop + +done + ldx SCRATCH_X + ldy SCRATCH_Y + rts + + + + +hgrtextrow_l + .byte $00,$80,$00,$80,$00,$80,$00,$80 + .byte $28,$A8,$28,$A8,$28,$A8,$28,$A8 + .byte $50,$D0,$50,$D0,$50,$D0,$50,$D0 +hgrtextrow_h + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 diff --git a/kfest2018/normalincfont.s b/kfest2018/normalincfont.s new file mode 100644 index 0000000..0a3f577 --- /dev/null +++ b/kfest2018/normalincfont.s @@ -0,0 +1,71 @@ + +SCRATCH_X = $D0 +SCRATCH_Y = $D1 +FONT_PTR = $D2 +HGR_PTR = $D4 + +FATFONT = $6000 + +; A = character, X = column, Y = row; A is clobbered, X&Y are not + + stx SCRATCH_X + sty SCRATCH_Y + + ; find address of glyph + sta font_ptr + lda #0 + sta font_ptr + 1 + asl font_ptr ; multiply by 8 + rol font_ptr + 1 + asl font_ptr + rol font_ptr + 1 + asl font_ptr + rol font_ptr + 1 + + clc ; add font table address to get pointer inside font table + lda #fatfont + adc font_ptr+1 + sta font_ptr+1 + + lda hgrtextrow_l,y ; load address of first line of hgr text + sta hgr_ptr + lda hgrtextrow_h,y + sta hgr_ptr+1 + + ldx #0 +slowfont_loop + ldy #0 + lda (font_ptr),y + ldy SCRATCH_X ; col goes in y + sta (hgr_ptr),y + clc + lda #4 + adc hgr_ptr+1 + sta hgr_ptr+1 + clc + inc font_ptr + bcc ?1 + inc font_ptr+1 +?1 inx + cpx #8 + bcc slowfont_loop + +done + ldx SCRATCH_X + ldy SCRATCH_Y + rts + + + + +hgrtextrow_l + .byte $00,$80,$00,$80,$00,$80,$00,$80 + .byte $28,$A8,$28,$A8,$28,$A8,$28,$A8 + .byte $50,$D0,$50,$D0,$50,$D0,$50,$D0 +hgrtextrow_h + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 diff --git a/kfest2018/normalsmc.s b/kfest2018/normalsmc.s new file mode 100644 index 0000000..9c39bfd --- /dev/null +++ b/kfest2018/normalsmc.s @@ -0,0 +1,66 @@ + +SCRATCH_X = $D0 +SCRATCH_Y = $D1 +FONT_PTR = $D2 +HGR_PTR = $D4 + +FATFONT = $6000 + +; A = character, X = column, Y = row; A is clobbered, X&Y are not + + stx SCRATCH_X + sty SCRATCH_Y + + ; find address of glyph + sta font_ptr + lda #0 + sta font_ptr + 1 + asl font_ptr ; multiply by 8 + rol font_ptr + 1 + asl font_ptr + rol font_ptr + 1 + asl font_ptr + rol font_ptr + 1 + + clc ; add font table address to get pointer inside font table + lda #fatfont + adc font_ptr+1 + sta slowfont_loop_smc+2 + + lda hgrtextrow_l,y ; load address of first line of hgr text + sta hgr_ptr + lda hgrtextrow_h,y + sta hgr_ptr+1 + + ldx #0 + ldy SCRATCH_X ; col goes in y +slowfont_loop +slowfont_loop_smc + lda $ffff,x + sta (hgr_ptr),y + clc + lda #4 + adc hgr_ptr+1 + sta hgr_ptr+1 + inx + cpx #8 + bcc slowfont_loop + + ldx SCRATCH_X + ldy SCRATCH_Y + rts + + + + +hgrtextrow_l + .byte $00,$80,$00,$80,$00,$80,$00,$80 + .byte $28,$A8,$28,$A8,$28,$A8,$28,$A8 + .byte $50,$D0,$50,$D0,$50,$D0,$50,$D0 +hgrtextrow_h + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 + .byte $20,$20,$21,$21,$22,$22,$23,$23 diff --git a/kfest2018/setscrn.s b/kfest2018/setscrn.s new file mode 100644 index 0000000..09e801a --- /dev/null +++ b/kfest2018/setscrn.s @@ -0,0 +1,59 @@ + + + *= $5000 + +start_set + jsr set_hires + jsr test + jsr set_text + jmp forever + rts + brk + +forever + jmp forever + +; os memory map +KEYBOARD = $c000 +KBDSTROBE = $c010 +CLRTEXT = $c050 +SETTEXT = $c051 +CLRMIXED = $c052 +SETMIXED = $c053 +TXTPAGE1 = $c054 +TXTPAGE2 = $c055 +CLRHIRES = $c056 +SETHIRES = $c057 + + +set_hires bit CLRTEXT ; start with HGR page 1, full screen + bit CLRMIXED + bit TXTPAGE1 + bit SETHIRES + rts + +set_text bit SETTEXT + bit CLRMIXED + bit TXTPAGE1 + bit CLRHIRES + rts + + + *= $5074 +test +; set hires page 1 only + lda #$20 + sta setscr_smc+2 + lda #0 + ldy #0 + lda #$ff +setscr_smc sta $ff00,y ; 4 + iny ; 2 + bne setscr_smc ; 4 = 10 * 256 + inc setscr_smc+2 ; 6 + ldx setscr_smc+2 ; 6 + cpx #$40 ; 2 + bcc setscr_smc ; 4 + rts ; (18 + 10*256) * 32 = 82496 + + brk