C128_GraphicsMultiColorAssemblyInfo lived.ch, 12:50 04.03.2024 --------------------------------------- Standard Graphic Modes Text Mode lda #$00, sta $d8 Graphic 1 {full screen 16 colors high resolution, 320 x 200 } lda #$20, sta $d8 Graphic 2 {split screen 16 colors high resolution 320 x xxx } lda #$60, sta $d8, *depending on text part Graphic 3 {full screen multi color low resolution 160 x 200 } lda #$a0, sta $d8 Graphic 4 {split screen multi color low resolution 160 x xxx } lda #$e0, sta $d8, *depending on text part Update 22.02.2024 { this Multi Color resolution is quite misleading if you take it for granted } { the actual horizontal resolution is still 320, meaning if you do: } { 10 ldx#$00 } { 20 loop lda #$ff } { 30 sta $2000,x } { 40 inx } { 50 cpx #$a0 -> = dec 160 and it should be right end of the screen } { 60 bne loop } { it will draw only until middle of the screen, not to the very right end! } { in MultiColor, 1 pixel is 'converted to 2 pixels, horizontally and that why } { the resolution is 160, not 320, but that's wrong! You still need to address } { both location, not just one! Ergo, you need a value of 320 to reach right end } { and not 160, like the resolution numbers are suggesting. } { and on top of that, the GRAPHIC 4 mode is buggy and it isn't update the values} { after you called the mandatory SCNCLR 4 or GRAPHIC 4,1 {1 stands for deletion}} { solution is to call SCNCLR 3 or GRAPHIC 3,1 and then switch to GRAPHIC 4,0,x } { x = split-screen value for GRAPHIC/TEXT mode } { Now the problems is, i don't see nowhere the information of how to do that in } { assembly? Not in one single book for C128 i read is this information available} { for now i used therefore BASIC/Assembly mix to achieve what i wanted } { check MultiColor Graphic examples! } Split Screen Line 16 { Mode 2, 4 } = lda #$b0, sta $0a34 * Split screen raster line is set using register $0a34, dec 2612 If split screen is set, value hier is copied to $d012, dec 53266 to position the raster line To position it properly: ( row line * 8 ) + 48 Default value is 208 = scanline of 20 (208-48) = 160 / 8 = 20 --------------------------------------------------------------------------------------------------------------------- Hires Graphics Drawing Color { first half of the byte with values #$0 - #$f } Background Color { 2nd half of the byte with values #$0 - #$f } { e.g lda #$06, [0 ist first half], [6 is second half] in sta $03e2 means black drawing color on blue background } Colors Value Address black lda #$06 sta $03e2 white lda #$16 sta $03e2 red lda #$26 sta $03e2 cyan lda #$36 sta $03e2 purple lda #$46 sta $03e2 green lda #$56 sta $03e2 dark blue lda #$66 sta $03e2 yellow lda #$76 sta $03e2 orange lda #$86 sta $03e2 brown lda #$96 sta $03e2 light red lda #$a6 sta $03e2 dark grey lda #$b6 sta $03e2 medium grey lda #$c6 sta $03e2 light green lda #$d6 sta $03e2 light blue lda #$e6 sta $03e2 light grey lda #$f6 sta $03e2 --------------------------------------------------------------------------------------------------------------------- MultiColorMode Graphic 3 and 4: (low res) This is initial routine i managed to put together to actually update the colors after the change. First is the activation of Graphic 3 mode, then delete and update everything. Eventually you can call the drawings data... and switch to Graphic 4 (graphic/Text) if you want or just don't call it to remain in Graphic 3, full screen mode. (see examples available for download for better understanding) mcgfx1.asm -e:0064-a: -e: init0 lda #$00 ;bank 15 sta $ff00 lda #$a0 ;graphic 3 sta $d8 ;mode lda #$03 ; sta $83 ;multicolor lda #$05 sta $84 ;color 2,x lda #$0b sta $85 ;color 3,x lda #$0c sta $86 ;color 1,x lda #$00 sta $d020 ;border color lda #$00 sta $d021 ;screen color lda #$0e sta $f1 ;text color lda #$a0 ;mc graphic 3 jsr $6acd ;deletion 'cos jsr $6ad0 ;graph 4 is buggy jsr $6ad3 ;and causing jsr $6a5c ;troubles jsr $6b30 rts init2 lda #$e0 ;switch mode sta $d8 ;graph/text lda #144 ;raster (12) sta $0a34 rts