Gury Posted October 18, 2015 Share Posted October 18, 2015 Display list interrupt example: { Display list interrupt example } uses crt, graph; var dlist : word; procedure DLI_routine; begin asm { stx @sp lda #<dli ; Set up our display list interrupt vector sta $200 lda #>dli sta $201 lda #$c0 ; Enable DLI + Vertical blank routines sta nmien }; gotoxy(8, 16); writeln('Some more text...'); asm { loop jmp loop ; Wait forever dli pha ; Save registers lda #0 ; New text color ldx #36 ; New background color stx WSYNC ; Wait sta COLPF1 ; Store color stx COLPF2 ; Store color pla ; Restore registers rti ; Done ldx @sp }; end; begin InitGraph(0); CursorOff; dlist := DPeek($230); Poke(dlist+16, 130); gotoxy(6, 5); writeln('Display list interrupt example'); DLI_routine; gotoxy(8, 20); writeln('Is this text shown?'); repeat until 1; end. dli1.xex 2 Quote Link to comment Share on other sites More sharing options...
pps Posted October 20, 2015 Share Posted October 20, 2015 (edited) hmm - reads as if this one never leaves the DLI_routine: loop jmp loop so this will never occur: gotoxy(8, 20); writeln('Is this text shown?'); repeat until 1; or am I missing something? ... I did some small changes and now it works as it should: replace the loop jmp loop with a simple rts and add =0 to have an endless loop behind: repeat until 1 gury_dli.obx -> compiled programme guri_dli.zip -> .pas file Edited October 20, 2015 by pps Quote Link to comment Share on other sites More sharing options...
Gury Posted October 21, 2015 Author Share Posted October 21, 2015 Yes, I did it intentionally, but I hoped for someone to fix it for me. And here you came with a solution, thanks rts is what I was looking for. Greetings Quote Link to comment Share on other sites More sharing options...
pps Posted October 21, 2015 Share Posted October 21, 2015 Ah... Move the ldx @sp in front of the rts. This way it will be executed... Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 21, 2015 Share Posted October 21, 2015 wonderful .... thanks. greeting Quote Link to comment Share on other sites More sharing options...
Gury Posted October 22, 2015 Author Share Posted October 22, 2015 Display list interrupt example 2 - Multicolor graphics 0 screen { Display list interrupt example 2 Multicolor graphics 0 screen } uses crt, graph; var i : Byte; dlist : word; procedure DLI_routine; begin asm { stx @sp lda #<dli ; Set up our display list interrupt vector sta $200 lda #>dli sta $201 lda #$c0 ; Enable DLI + Vertical blank routines sta nmien ldx @sp rts dli pha ; Save accumulator lda VCOUNT ; Load accumulator with Vertical line counter value sta WSYNC ; Wait for horizontal sync sta COLPF2 ; Color and luminance of playfield 2 sta COLBAK ; Color and luminance of the background pla ; Restore accumulator rti ; Done with display list interrupt }; end; begin InitGraph(0); CursorOff; dlist := DPeek($230); // Set colors for 8 lines at the top fillchar(pointer(dlist+10), 8, 130); // Set colors for bottom lines fillchar(pointer(dlist+21), 4, 130); // Some text gotoxy(5, 3); writeln('Display list interrupt example 2'); gotoxy(5, 4); writeln('Multicolor graphics 0 screen'); // Display list interrupt routine DLI_routine; // More text for i := 0 to 7 do begin gotoxy(8, 16+i); writeln('Some more text on line ', 16+i); end; // Endless loop repeat until 1=0; end. dli2.xex Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 22, 2015 Share Posted October 22, 2015 hello, wonderful this Mad Pascal. greeting 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.