Jump to content
IGNORED

VSCROLL with MAD-Pascal-


funkheld

Recommended Posts

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 by funkheld
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by funkheld
Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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...