funkheld Posted September 1, 2015 Share Posted September 1, 2015 (edited) here is the VSCROLL with MAD-Pascal: var dlist: array [0..6] of word; z: byte; procedure InitDlist(a: word); begin dlist[0]:=$7070; dlist[1]:=$4270; dlist[2]:=$9060; dlist[3]:=$2222; dlist[4]:=$0041; dlist[5]:=a; end; begin InitDlist(word(@dlist)); DPoke(560,word(@dlist)); for z:=0 to 39 do begin Poke($9060+z+39,z); end; repeat for z:=0 to 7 do begin Poke($d405,z); delay(2000); end; Poke($d405,0); for z:=0 to 7 do begin Poke($d405,7-z); delay(2000); end; until 0; end. Edited September 1, 2015 by funkheld 1 Quote Link to comment Share on other sites More sharing options...
phaeron Posted September 2, 2015 Share Posted September 2, 2015 Is there something about MAD Pascal that makes it advantageous to hardcode addresses 560 and $D405 for SDLSTL and VSCROL? I keep seeing examples posted like this. Also... both of these variables should be changed in vertical blank. Changing them without vertical synchronization risks on-screen glitches. MAD Pascal's delay() routine appears to be just scanline based. Quote Link to comment Share on other sites More sharing options...
funkheld Posted September 2, 2015 Author Share Posted September 2, 2015 (edited) the normal commands in MAD-Pascal knows you so, are not different as in other Pascal and you can apply them easily. interssant the ASM-Inline-Routinen are with which one can easily invent new routines. the progam in mad-pascal is very clear in turbo-basic and ACTION! asm commands are difficult to implement and hard to read. the speed of MAD-Pascal is similar to that of ACTION! Bget with ACTION!: char func cioq=*(byte dev, card addr, size, byte cmd, aux1, aux2) [$29$F$85$A0$86$A1$A$A$A$A$AA$A5$A5 $9D$342$A5$A3$9D$348$A5$A4$9D$349 $A5$A6$F0$8$9D$34A$A5$A7$9D$34B$98 $9D$345$A5$A1$9D$344$20$E456 $8C cio_status$C0$88$D0$6$98$A4$A0 $99 eof$A085$60] card func bget=*(byte dev, card addr, size) [$48$A9$7$85$A5$A9$0$85$A6$A5$A3$5$A4 $D0$6$85$A0$85$A1$68$60$68$20 cioq $BD$348$85$A0$BD$349$85$A1$60] open, close, bget with Mad-pascal: procedure close; begin asm { stx @sp ldx #$10 lda #12 sta iocom,x jsr ciov ldx @sp rts }; end; procedure open(namew:word); begin asm { stx @sp ldx #$10 lda #3 sta iocom,x mwa namew ioadr,x lda #4 sta ioaux1,x jsr ciov ldx @sp rts }; end; procedure bget(scr,lenght:word); begin asm { stx @sp ldx #$10 lda #7 sta iocom,x mwa scr ioadr,x mwa lenght iolen,x jsr ciov ldx @sp rts }; end; Edited September 2, 2015 by funkheld Quote Link to comment Share on other sites More sharing options...
Xuel Posted September 2, 2015 Share Posted September 2, 2015 I think what phaeron is asking is why don't you use constants for 560 and $D405? Could you write something like this without sacrificing performance? const VSCROL=$D405; ... Poke(VSCROL,z); Quote Link to comment Share on other sites More sharing options...
funkheld Posted September 2, 2015 Author Share Posted September 2, 2015 hello, thanks. Quote Link to comment Share on other sites More sharing options...
Gury Posted October 10, 2015 Share Posted October 10, 2015 Here is what you are looking for. uses crt; var z : byte; VSCROL : byte absolute $d405; dlist : array [0..4] of word = ($7070, $4270, $9060, $2222, $0041); begin DPoke(560, word(@dlist)); for z := 0 to 39 do begin Poke($9060+z+39, z); end; repeat for z := 0 to 7 do begin VSCROL := z; Delay(100); end; VSCROL := 0; for z := 0 to 7 do begin VSCROL := 7 - z; Delay(100); end; until 0; end. vscroll2.obx Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 21, 2015 Author Share Posted October 21, 2015 hello thanks. 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.