C128_Full40_40CharOnly { lived.ch / Edass 128, Assembler }, 26.12.2023 { you can do less and get surprised, or not } { but never go above 40 characters or above 25 lines! } full40.asm -a:0011-a: -e: *= $c00 .obj m .bank 15 ; ; this is 40 character wide only, but ; could have less and get some effects! ; but never go above 40 or you will get ; your unwanted christmas gift too early! ; ldy #$00 ;main loop start multix ldx #$00 loopx1 jsr start ;start inx cpx #40 ;40 chars block bne loopx1 ;40 is max!!! ldx #$00 ;for 40 char scrn iny cpy #16 ;loop 16 lines bne multix ; ; ;exit and reset lda #$00 ;start address sta screen+1 ;to avoid going lda #$04 ;over 2023, $7e7 sta screen+2 ;scrn end address jsr art ;jump & add color ; ; lda #$00 ;after return sta $d020 ;make screen lda #$00 ;black sta $d021 rts ;back to basic ; ;graphic part ; start lda data,x ;towerbuilding screen sta $0400 ;start position inc screen+1 ;low byte up bne carryt ;if zero,fall inc screen+2 ;here through carryt rts ;raise hibyte ; ; adding colors map starts here! ; art ldy #$00 ;main loop start morecol ldx #$00 ;to add colors colx1 jsr colors ;read colors inx cpx #40 ;40 colors bne colx1 ;never go above ldx #$00 ;40 chars!!! iny ; cpy #16 ;16 lines bne morecol ;and never more ; ;than 25 lines!! ; ;reset and back lda #$00 sta colmap+1 lda #$d8 sta colmap+2 rts ; ; color part ; colors lda coldat,x ;add colors colmap sta $d800 ;start position inc colmap+1 ;same as graphic ; ;top left corner bne carryc ;if zero,fall inc colmap+2 ;here through carryc rts ;raise high byte ; data .byte $a0,$66,$66,$66,$66,$66,$56 .byte $d6,$d6,$d6,$d6,$d6,$d6 .byte $56,$66,$66,$66,$66,$66,$a0 .byte $a0,$66,$66,$66,$66,$66,$56 .byte $d6,$d6,$d6,$d6,$d6,$d6 .byte $56,$66,$66,$66,$66,$66,$a0 ; coldat .byte $01,$0b,$0c,$0f,$0c,$0b,$0e .byte $06,$06,$06,$06,$06,$06 .byte $0e,$0b,$0c,$0f,$0c,$0b,$01 .byte $01,$0b,$0c,$0f,$0c,$0b,$0e .byte $06,$06,$06,$06,$06,$06 .byte $0e,$0b,$0c,$0f,$0c,$0b,$01