SCREEN-DELETION-WITH-RANDOM-VALUES -------------------------------------------------------------------------------------------------- TOOL: EDASS-128 Editor/Assembler {Commodore C128} Language: Assembler Extra: - Author: Misel Zivanovic Note: (C) 26th April 2026 - www.lived.ch, mzretro.ch Information: I had to update this doc, 29.04.2026. The first address i used caused the issues with the SFK {Set Function Keys}. I forgot that it uses the space from $0b00 and this random deletion code went slightly over $0b00. Ergo, SFK didn't work correctly anymore! You can assembly this routine despite all that from $0ac8 because later you won't need SFK anyway. --------------------------------------------------------------------------------------------------- This little code will delete your screen. And it will do that by making little squares disappear from your screen. To make the effects complete and also to make sure the full content will be delete, a *ROM-Routine is used at the end to delete the screen completely *Note: C128 ROM-Routines can be called only if you are using BANK 15! Also generating and getting the random numbers will work only there! That being said, you could have your code also in BANK 0 and then just switch to BANK 15, call the ROM-Routine{s} and switch back to BANK 0 again. *** We don't do that here ***! Only BANK 15 is used! To test the assembler code, run this BASIC LINE below in BASIC 7.0 {DIRECT MODE, NO LINE NUMBERS!!!} Just copy and paste it after the assembler code is available in the memory {meaning it must be assembled after you have all typed in or did a copy/paste within the EDASS-128} {C128 BASIC 7, test code! Assembly part below must be in the memory before you start this!} fora=1024to2023:pokea,224:next:char1,0,4,"sys 4864 :::"+chr$(19):poke842,13:poke208,1:end --------------------------------------------------------------------------------------------------- Project-Name and source code: Can be called with SYS 2760 from BASIC --------------------------------------------------------------------------------------------------- HINT FOR C64 USERS: To make this code also 100% Commodore C64 compatible: 1st - REMOVE sta $ff00 2nd - REPLACE jsr $c142 ; clear screen with jsr $e544 ; clear screen OR with lda #$93 jsr $ffd2 3rd - USE C64 suitable memory are, e.g. $0340 or higher e.g. $c000 depending on the assembler editor you are going to use on the C64 side. {there is EDASS-64 existing for the Commodore C64 too!} --------------------------------------------------------------------------------------------------- ; screen deletion as a random pattern ; looks good and needs a little space ; placed low from $1300 to not disturb ; ; note: you can also use even lower ; addresses, e.g. from $ac8 and up ; until $0dff (sprites are from $0e00) ; but then SFK won't work because it ; is in that region! ; not important when you don't use ; EDASS-128 ; ;26.04.2026 ; *= $1300 .obj m .bank 15 ; lda #$00 sta value sta $ff00 ; bank 15 ;------------------------------- lda #$ff ; random numbers sta $d40e ; check compute sta $d40f ; mapping c128 lda #$80 ; for more info. sta $d412 ;------------------------------- loop1 ldy #$00 loop2 lda $d41b ; read random # tax lda #$20 ; space to delete sta $0400,x ; screen 1st part sta $0600,x ; screen 3rd part lda $d41b ; get new rnd # tax lda #$20 sta $0500,x ; screen 2nd part sta $06e8,x ; screen 4th part iny cpy #$08 ; repeat 8x bne loop2 lda #$e0 ; wait on the a1 cmp $d012 ; raster line bne a1 ; to slow things lda value tay iny tya sta value cpy #$85 ; repeat all bne loop1 ; $85, dec 133 ; times jsr $c142 ; clear screen rts ; back to basic value .byte 0