SYS calls

Started by wspirit, June 24, 2006, 09:10 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

wspirit

Enter C64 mode: SYS 57931

Position the cursor: BANK15: SYS DEC("CC6C"),,y,x

Boot from disk: SYS 65363

xlar54

Change the background color (VDC):

SYS DEC("CDCC"),#,26

The upper four bits of # represent the foreground color, the lower four bits the background color for the whole screen. The color bits code as follows:

bit 3/7 : Red
bit 2/6 : Green
bit 1/5 : Blue
bit 0/4 : Intensity

So, a white text on a dark blue background would be:

SYS DEC("CDCC"),242,26

To restore the color bit (bit 6 of register # 25), try:
SYS DEC("CDDA"),,25:RREG A: A=A OR 64: SYS DEC("CDCC"),A,25

Edwing

Hello!

Thanks to you for the SYSes. Although ... while the information is all valid and good to know b/c one could also use them from assembler programs, I think it's also worthwhile to keep in mind that you could simply do the following for the described tasks:

Position the cursor: CHAR,x,y (no, it doesn't need a text argument ;) )

Boot from disk: BOOT

Change the background color (VDC): COLOR 6,x (albeit not using RGBI values but BASIC ones from 1-16). The foreground color mentioned by xlar with the "VDC-POKE" to register #26 is only visible (and the same for the whole screen) if the contrary of the "restore color bit" mention thing is done before, i.e.

bank 15:sys dec("cdda"),,25:rreg a:sys dec("cdcc"),a and 192,25

Notice that in this mode, because no attribute bytes are used, you will have no blinking, underlined or alternate charset text, i.e. unless you copy the lowercase/uppercase font to the place in VDC ram where normally the uppercase/graphics one resides, you can use only the latter (=no lowercase letters).

For the sake of completeness: The POKE from wspirit to enter C64 mode has the advantage that it doesn't ask for confirmation (unlike GO64 from direct mode), but actually it only was relevant in that old revision of Basic 7.0 which also asked for confirmation when issued in a program ("modern" Basic 7.0 doesn't do that anyway).

Cheers,
George :)

xlar54

Im trying to simulate the below via ML.  The following code doesnt seem to work:

   LDX #$F2   
   LDY #$1A
   JSR $CDCC

Am I doing something wrong here?



Quote from: xlar54Change the background color (VDC):

SYS DEC("CDCC"),#,26

The upper four bits of # represent the foreground color, the lower four bits the background color for the whole screen. The color bits code as follows:

bit 3/7 : Red
bit 2/6 : Green
bit 1/5 : Blue
bit 0/4 : Intensity

So, a white text on a dark blue background would be:

SYS DEC("CDCC"),242,26

To restore the color bit (bit 6 of register # 25), try:
SYS DEC("CDDA"),,25:RREG A: A=A OR 64: SYS DEC("CDCC"),A,25

xlar54

Ugh nevermind... had been setting the wrong registers... should be:

   LDA #$F2   
   LDX #$1A
   JSR $CDCC