C128_AssemblyTowerColor { lived.ch / Edass 128, Assembler } And next little example. I am slowly progressing in learning assembly. But this is a nice little work anyway. I think it could be used for much more than visible here. e.g. game levels... i'll try to make an example... Because seeing is believing, right! ;-) *= $c00 .obj m .bank 15 ; ; watch out not to go over 2023, $7e7 ; it is end of the visible screen area! ; also avoid going below 1024, $400! ; standard start screen address ; deactivate this two JSR's for full/screen screen $400 and $d800 for colors ; graphic! = cpx #$28 ;40 chars block and cpx #$28 ;40 colors ; DISABLE! ; 1st ; jsr screen ;distance ; 2nd ; jsr colmap ;distance to nxt ; or otherwise you might crash your system! ; ldy #$00 ;main loop start multix ldx #$00 loopx1 jsr start ;start inx cpx #$14 ;20 chars block bne loopx1 ;loopx1 ldx #$00 loopx2 nop ;next char lda #$20 ;space to move nop ;the needed x jsr screen ;distance inx ;map cpx #$14 ;20x = 40 bne loopx2 ;= 1 screen line iny cpy #$18 ;loop 24x bne multix ;= 24 lines/25 nop ;exit and reset lda #$0a ;start address sta screen+1 ;to avoid going lda #$04 ;over 2023, $7e7 sta screen+2 ;scrn end address jsr art ;jump & add color nop ; 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 $040a ;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 #$14 ;20 colors bne colx1 ;1 line/40 ldx #$00 colx2 nop ;empty space lda #$20 ;space to move nop ;the needed x jsr colmap ;distance to nxt inx ;lineof colormap cpx #$14 ;20x bne colx2 ;to reach start iny ;of the 1st line cpy #$18 ;from 2nd etc. bne morecol ;repeat 24x nop ;exit and reset lda #$0a sta colmap+1 lda #$d8 sta colmap+2 rts ; ; color part ; colors lda coldat,x ;add colors colmap sta $d80a ;start position inc colmap+1 ;same as graphic 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 coldat .byte $01,$0b,$0c,$0f,$0c,$0b,$0e .byte $06,$06,$06,$06,$06,$06 .byte $0e,$0b,$0c,$0f,$0c,$0b,$01 -------------------------------------------- C128 ML Code: d c00 . 00c00 a0 00 ldy #$00 . 00c02 a2 00 ldx #$00 . 00c04 20 39 0c jsr $0c39 . 00c07 e8 inx . 00c08 e0 14 cpx #$14 . 00c0a d0 f8 bne $0c04 . 00c0c a2 00 ldx #$00 . 00c0e ea nop . 00c0f a9 20 lda #$20 . 00c11 ea nop . 00c12 20 3c 0c jsr $0c3c . 00c15 e8 inx . 00c16 e0 14 cpx #$14 . 00c18 d0 f4 bne $0c0e . 00c1a c8 iny . 00c1b c0 18 cpy #$18 . 00c1d d0 e3 bne $0c02 . 00c1f ea nop . 00c20 a9 0a lda #$0a . 00c22 8d 3d 0c sta $0c3d . 00c25 a9 04 lda #$04 . 00c27 8d 3e 0c sta $0c3e . 00c2a 20 48 0c jsr $0c48 . 00c2d ea nop . 00c2e a9 00 lda #$00 . 00c30 8d 20 d0 sta $d020 . 00c33 a9 00 lda #$00 . 00c35 8d 21 d0 sta $d021 . 00c38 60 rts . 00c39 bd 82 0c lda $0c82,x . 00c3c 8d 0a 04 sta $040a . 00c3f ee 3d 0c inc $0c3d . 00c42 d0 03 bne $0c47 . 00c44 ee 3e 0c inc $0c3e . 00c47 60 rts . 00c48 a0 00 ldy #$00 . 00c4a a2 00 ldx #$00 . 00c4c 20 73 0c jsr $0c73 . 00c4f e8 inx . 00c50 e0 14 cpx #$14 . 00c52 d0 f8 bne $0c4c . 00c54 a2 00 ldx #$00 . 00c56 ea nop . 00c57 a9 20 lda #$20 . 00c59 ea nop . 00c5a 20 76 0c jsr $0c76 . 00c5d e8 inx . 00c5e e0 14 cpx #$14 . 00c60 d0 f4 bne $0c56 . 00c62 c8 iny . 00c63 c0 18 cpy #$18 . 00c65 d0 e3 bne $0c4a . 00c67 ea nop . 00c68 a9 0a lda #$0a . 00c6a 8d 77 0c sta $0c77 . 00c6d a9 d8 lda #$d8 . 00c6f 8d 78 0c sta $0c78 . 00c72 60 rts . 00c73 bd 96 0c lda $0c96,x . 00c76 8d 0a d8 sta $d80a . 00c79 ee 77 0c inc $0c77 . 00c7c d0 03 bne $0c81 . 00c7e ee 78 0c inc $0c78 . 00c81 60 rts . 00c82 m 00c82 >00c82 a0 66 66 66 66 66 56 d6:.FFFFFvV >00c8a d6 d6 d6 d6 d6 56 66 66:VVVVVvFF >00c92 66 66 66 a0 01 0b 0c 0f:FFF..... >00c9a 0c 0b 0e 06 06 06 06 06:........ >00ca2 06 0e 0b 0c 0f 0c 0b 01:........