+Philsan Posted December 24, 2021 Share Posted December 24, 2021 Hi. To add one color to a Turbo-Basic XL program, I would need a DLI that lets me change the color in register 709 at the middle of the screen (Basic graphics 7+16). Thanks! Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 24, 2021 Share Posted December 24, 2021 You don't change the shadows, they're only copied at VBlank. Change the GTIA register directly. This will generate a DLI which will put the colour stored at dec 203 into COLPF1. 10 TRAP 30:A=1536:RESTORE 9000 20 READ D:POKE A,D:A=A+1:GOTO 20 30 POKE 203,8:REM COLOUR HERE 40 GRAPHICS 0:DL=PEEK(560)+PEEK(561)*256 50 POKE 54286,64:POKE 512,0:POKE 513,6:P OKE 54286,192 60 POKE DL+15,130 998 LIST 999 END 9000 DATA 72,165,203,141,10,212,141,23,2 08,104,64,-1 2 1 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted December 24, 2021 Author Share Posted December 24, 2021 1 hour ago, Rybags said: You don't change the shadows, they're only copied at VBlank. Change the GTIA register directly. This will generate a DLI which will put the colour stored at dec 203 into COLPF1. 10 TRAP 30:A=1536:RESTORE 9000 20 READ D:POKE A,D:A=A+1:GOTO 20 30 POKE 203,8:REM COLOUR HERE 40 GRAPHICS 0:DL=PEEK(560)+PEEK(561)*256 50 POKE 54286,64:POKE 512,0:POKE 513,6:P OKE 54286,192 60 POKE DL+15,130 998 LIST 999 END 9000 DATA 72,165,203,141,10,212,141,23,2 08,104,64,-1 Thanks. I need it for graphics 7+16, but it doesn't work. Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 24, 2021 Share Posted December 24, 2021 You'll just need to change where the DLI is inserted... probably closer to +55 rather than +15 1 Quote Link to comment Share on other sites More sharing options...
Mrshoujo Posted December 24, 2021 Share Posted December 24, 2021 Aren't Display List Interrupts relocatable code? It could be stored in a string. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 24, 2021 Share Posted December 24, 2021 using similar DLI routine as @Rybags I'm switching COLBK and you can see it working I'm poking the colour in the byte of the DLI itself (1538) 10 A=1536:RESTORE 10000 20 READ D:IF D=-1 THEN 40 30 POKE A,D:A=A+1:GOTO 20 40 GRAPHICS 7+16:DL=PEEK(560)+PEEK(561)*256 50 POKE 54286,64:POKE 512,0:POKE 513,6:POKE 54286,192 60 POKE DL+40,130 998 FOR I=0 TO 255:POKE 1538,I:NEXT I 999 GOTO 998 10000 DATA 72,169,55,141,10,212,141,26 ,208,104,64,-1 MAC/65 listing of the DLI 0100 .INCLUDE #D:\MAC65\HEADER.M65 0110 *= $0600 0120 PHA 0130 LDA #55 ; COLOUR 0140 STA WSYNC 0150 STA COLBK ; BACKGROUND 0160 PLA 0170 RTI 0180 .OPT NO LIST 2 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 24, 2021 Share Posted December 24, 2021 (edited) 3 minutes ago, Mrshoujo said: Aren't Display List Interrupts relocatable code? It could be stored in a string. Depends what you use them for, my example code uses a fixed address for the colour Edited December 24, 2021 by TGB1718 Quote Link to comment Share on other sites More sharing options...
vitoco Posted December 24, 2021 Share Posted December 24, 2021 1 minute ago, Mrshoujo said: Aren't Display List Interrupts relocatable code? It could be stored in a string. As always, it depends on the contained code... But you must be sure that the string won't move as it will lock the machine if you press, for instance, BREAK and enter some immediate statement. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted December 24, 2021 Author Share Posted December 24, 2021 @Rybags 10 TRAP 30:A=1536:RESTORE 9000 20 READ D:POKE A,D:A=A+1:GOTO 20 30 POKE 203,8:REM COLOUR HERE 40 GRAPHICS 7+16:DL=PEEK(560)+PEEK(561)*256 50 POKE 54286,64:POKE 512,0:POKE 513,6:POKE 54286,192 60 POKE DL+15,130 70 COLOR 1:PLOT 0,0:DRAWTO 159,95 80 GOTO 80 9000 DATA 72,165,203,141,10,212,141,23,208,104,64,-1 1 1 Quote Link to comment Share on other sites More sharing options...
pps Posted December 24, 2021 Share Posted December 24, 2021 1 hour ago, Philsan said: @Rybags 10 TRAP 30:A=1536:RESTORE 9000 20 READ D:POKE A,D:A=A+1:GOTO 20 30 POKE 203,8:REM COLOUR HERE 40 GRAPHICS 7+16:DL=PEEK(560)+PEEK(561)*256 50 POKE 54286,64:POKE 512,0:POKE 513,6:POKE 54286,192 60 POKE DL+15,130 70 COLOR 1:PLOT 0,0:DRAWTO 159,95 80 GOTO 80 9000 DATA 72,165,203,141,10,212,141,23,208,104,64,-1 Fillippo, you have to change line no 60 130 (decimal) := $82 (hexadecimal) This is mode 2 or gfx 0 line plus DLI. Gfx 7 line is $D if I remember correct (no time to look into a reference atm), so DLI+Gfx 7 would be $8D or 141 (decimal) 1 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted December 25, 2021 Author Share Posted December 25, 2021 2 hours ago, pps said: Fillippo, you have to change line no 60 130 (decimal) := $82 (hexadecimal) This is mode 2 or gfx 0 line plus DLI. Gfx 7 line is $D if I remember correct (no time to look into a reference atm), so DLI+Gfx 7 would be $8D or 141 (decimal) Perfect, thanks Ralf. I think you can imagine why I need this DLI... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.