C128_MultiColorCharacterMode www.lived.ch In C128 books i mostly read this: BASIC of C128 is not offering any commands to support MultiColorCharacter mode. That's why it is not easy to use it... Really? Hmmmm.... RUN! :-) Well, actually, SPRDEF is here! { the Sprite Editor, is supporting MultiColor and is a huge help when you need to } { create graphic elements out of color characters } ------------------------------------------------------------------------------------------------------------- ************************************************************************************************************* VERY IMPORTANT { Pointer } To see the new location of the characters on the screen, a pointer must be set at address 2604 { 2604,24 } You first must set the pointer before you do disable the BASIC interrupt at location 216 with a value of 255! Keep that in mind! Default { active } interrupt value is 0 { poke 216,0 } ************************************************************************************************************* DISABLE BASIC SCREEN SETUP INTERRUPT ROUTINE BASIC: ASSEMBLY: poke 216,255 lda #$ff, sta $d8 { this is disabling Basic Interrupt} { if you forget that, you won't be able to activate multi color mode } { because this interrupt routine will always put a default value of 200, $c8 } { into location 53270, $d016 immediatelly after you add a new value in 53270 } { after interrupt is disabled, you can poke the 53270 with a value of 216, $d8 } { this activates our 40 character multicolor screen } poke 53270,216 lda #$d8, sta $d016 poke 53270,24 lda #$18, sta $d016 { 40 characters, scrolling } { values 216 - 223, $d8 - $df } { values 024 - 031, $18 - $1f } poke 53270,48 lda #$30, sta $d016 poke 53270,16 lda #$10, sta $d016 { 38 characters, scrolling } { values 048 - 055, $30 - $37 { values 016 - 023, $10 - $17 DISABLE: Assembly poke 216,0 lda #$00, sta $d8 poke 53270,200 lda #$c8, sta $d016 { sets automatically after the interrupt routine is active again } ------------------------------------------------------------------------------------------------------------- COLORS, MORE COLORS AND 8 ON TOP OF THAT WITH COLOR MAP! { that's why we are here, right! } bit 00 [%00] = color register 53281, $d021 { background color } - colors 0 - 15 { the same } bit 01 [%01] = color register 53282, $d022 { 1st multicolor color } - colors 0 - 15 { for all } bit 02 [%10] = color register 53283, $d023 { 2nd multicolor color } - colors 0 - 15 { characters } bit 03 [%11] = individual color possible, see table below. However limited to only 8 { 8 - 15 } color values! bit 03 [%11] color Value black 08/$08 white 09/$09 red lO/$Oa cyan 11/$Ob purple 12/$Oc green 13/$Od blue 14/$Oe yellow 15/$Of Normal characters are made in a 8x8 grid. Multicolor characters are using an 4x8 grid. %00 Background color 0 { all characters, this is where other colors { 1 - 3 } are deleted! } %01 Background color 1 { all characters } %10 Background color 2 { all characters } %11 Foreground color 3 { independently selectable for all characters} { As mentioned, only eight colors are available { between 8 - 15 }} { Can also be accessed by pressing the C= Key and 1 - 8 numbers } { HINT: if you in SPRDEF do only drawing with a color number 4 } { that gives you later 8 different colors, using color map } { or C= Key + 1 - 8 numbers during direct rawing on the screen } { with the graphic elements! } { Somebody would say now: SWEEEEET! Haha... } EXAMPLE: { RELAX!, by using SPRDEF, to quickly create MultiColorCharacters } { you don't have to worry about these numbers! } { check the MCDone.d64 disk, file MCGRAPHIC.BAS } { to edit characters and create your own gfx elements } { 6 example characters included! Accessible: SHIFT + A,B,C,D,E,F } { Cursor is set to let you see the 8 individual colors } { when you press on C= Key + 1 - 8 to choose a color } { Note again: Only colors between 8 - 15 can be chosen as individual colors } { They also have different color as usually the colors between 8 - 15 are having } { Yes, that are colors from values between 0 - 7... Crazy world, right! } 0 0 1 1 1 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 Drawing Colors in SPRDEF are defined as follows: Number 1 = Delete colors { it's where you see 53281 colors, screen background! } Number 2 = poke 53282,x { 00 - 15, $00 - $0f } Number 3 = poke 53283,x { 00 - 15, $00 - $0f } Number 4 = poke 55296,x - poke 56295,x { 08-15, $08-$0f }, for color definition check listing above! { or here again... I know you are lazy! ;-) } bit 03 [%11] color Value black 08/$08 white 09/$09 red lO/$Oa cyan 11/$Ob purple 12/$Oc green 13/$Od blue 14/$Oe yellow 15/$Of Ergo! Just using poke 53282,x and poke 53283,x won't work! Conclusion!: To use all available colors { especially individual/character }, you need to poke the color map with values between 8 - 15 to get colors which are usually on the addresses between 0 - 7! Easy! Or hit them with C= Key + 1 - 8 number. ------------------------------------------------------------------------------------------------------------- EXTENDED BACKGROUND COLOR MODE! So there is a standard character mode { which also can be used for color graphic! 1 color each character } Then there is a multicolor {mentioned above } and the 3rd one is extended Background Color Mode. However with some additional limitations. Only first 64 characters { 00 - 63, $00 - $41 } can be used to achieve your dreams. Its activation is done by enabling { to existing value } bit 6 at the address location 53265, $d011. poke 216,255 lda #$ff, sta $d8 poke 53265,91 lda #$5b, sta $d011 poke 216,0 lda #$00, sta $d8 poke 53265,27 lda #$1b, sta $d011 { sets automatically after the interrupt routine is active again } Bits Background Color Source 7 6 0 0 background color register 0 (53281/$0021) 0 1 color register 1 (53282/$0022) 1 0 color register 2 (53283/$0023) 1 1 color register 3 (53284/$0024) Didn't bother any further with that because Multi Color is already limited enough! Probably the next step of the limitation would be to not use the C128 at all! Hahaha... :-))) No thanks! { In most books for C128, everyone is flying away from that mode anyway! } That's it for now! 20:57 05.01.2024