Jump to content
IGNORED

DLI and fonts


Recommended Posts

Character sets are pointed to by CHBASE ($D409)  Shadow $224 normally set to $E0 

So if using a DLI you would need your code to change $D409, remembering that VBLANK

will set it back to whatever value is at $224.

 

Text modes use multiple lines to create the character on screen,

So for text mode lines, you can change the font as many times as you like.

 

Graphics modes are single lines, so you cant use the character sets in graphics mode directly

you need to take each byte of the character you want to display on a graphics screen place it

where you need it and then the next 7 lines with the rest of the characters remaining bytes.

 

Hope that makes sense :)

 

 

 

Link to comment
Share on other sites

Using GR.12 antic 4, want to have antic 2 at bottom. I don't know how to do integrate it with this.

 

 

GRAPHICS 12+16
DL=PEEK(560)+PEEK(561)*256+4
POKE DL-1,68:REM LMS = 64+ANTICMODE NUMBER
FOR G=2 TO 19:POKE DL+G,4:NEXT G
POKE DL+20,2  < graphics 0
POKE DL+21,65 < RTI

POKE DL+22,PEEK(560):POKE DL+23,PEEK(561)
 

Link to comment
Share on other sites

1 hour ago, eflake said:

Using GR.12 antic 4, want to have antic 2 at bottom. I don't know how to do integrate it with this.

 

 

GRAPHICS 12+16
DL=PEEK(560)+PEEK(561)*256+4
POKE DL-1,68:REM LMS = 64+ANTICMODE NUMBER
FOR G=2 TO 19:POKE DL+G,4:NEXT G
POKE DL+20,2  < graphics 0
POKE DL+21,65 < RTI

POKE DL+22,PEEK(560):POKE DL+23,PEEK(561)

I think I know what you want to do, try this, it will write to that mode 2 line at the bottom.

 

10 Graphics 12+16
20 Dl=Peek(560)+Peek(561)*256+4
30 Poke Dl-1,68:Rem LMS = 64+ANTICMODE NUMBER
40 For G=2 To 19:Poke Dl+G,4:Next G
50 Poke Dl+20,2
60 Poke Dl+21,65
70 Poke Dl+22,Peek(560):Poke Dl+23,Peek(561)
75 A=Peek(88)+Peek(89)*256
80 St=40*19:Rem POINT AT MODE 2 LINE
90 I=0
100 Restore 200
110 Read B:If B=-1 Then 300
120 Poke A+St+I,B:I=I+1:Goto 110
200 Data 40,37,44,44,47,0,55,47,50,44,36,-1
300 Goto 300

 

Link to comment
Share on other sites

To do that you will need a DLI setting up in machine code, if your program is in BASIC, the DLI code

can reside in Page 6 starting at $600

 

Here's an example of a DLI in Page 6

SETDLI   LDA #DLI/256 ; DLI VECTOR HI
         STA VDSLST+1
         LDA #DLI&255 ; DLI VECTOR LO
         STA VDSLST
         LDA #$C0 ; ENABLE INTERUPT
         STA NMIEN
         RTS 

 

DLI    PHA ; DLI MUST SAVE ANY REGISTERS ON STACK 

         LDA #55 ; COLOUR
         STA COLBK ; DIRECTLY INTO COLOUR REGISTER
         PLA  ; RESTORE REGISTERS
         RTI  ; RETURN FROM INTERUPT

Edited by TGB1718
Link to comment
Share on other sites

If you want to change the font too, just add the code:-

 

DLI    PHA ; DLI MUST SAVE ANY REGISTERS ON STACK 

         LDA #55 ; COLOUR
         STA COLBK ; DIRECTLY INTO COLOUR REGISTER

         LDA #NEWFONT/256 ; THIS IS THE HIGH BYTE OF THE NEW CHAR SET LOCATION

         STA $D409
         PLA ; RESTORE REGISTERS
         RTI  ; RETURN FROM INTERUPT

 

Remember these changed values will be rest to their original values by the Vertical Blank Routine. (which is probably what you want)

Edited by TGB1718
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...