PM-Colli mit Bild im Grafikmodus in Action....


PM-Colli mit Bild im Grafikmodus in Action....

von atarineuling » Fr 6. Sep 2013, 21:54
Hallo, guten Tag.
Jetzt habe ich mal im Grafikmodus graphics(7) ein Bild geladen (multi.bin).
Eine LInie gezeichnet mit dem Action-Befehl und ein PM welches mit Bild und Linie kolligiert. Die Displaylist habe ich nach den neuesten Erfahrungen modernisiert :D

Gestartet wird in Action mit R"SPRCOL1.ACT"

Code: Alles auswählen
module

byte cio_status
card dlist =560

byte array data =
  [ 63 33 33 33 33 33 63 ]

byte dlst0=   [ $70 $70 $70 $4D ]
card lms  = [ 36960 ]
byte dlst1= [ $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $0D $0D $0D $0D $0D
              $0D $0D $0D $0D $0D $41 ]
card  djmp= [ 0 ]

proc pm_init ()
  byte ramtop=$6A,sdmctl=$22F, gractl=$D01D,pmbase=$D407
  card pmadr=$2D5
  byte gprior=$26F

  gprior=1
  ramtop==-24
  sdmctl==%$1C
  pmadr=ramtop*$100+$400

  pmbase=ramtop
  gractl=3

  zero (ramtop*$100,$800)
return

proc p_pos (byte num,xpos,ypos,card shape,byte len)
  byte array hpos=$D000
  card pmadr=$2D5,adr

  adr=pmadr
  adr==+num*$100+ypos

  moveblock (adr,shape,len)
  hpos(num)=xpos
return

proc p_size (byte num,size)
  byte array ps=$D008

  ps(num)=size
return

proc pm_col (byte num,hue,lum)
  byte array pcol=$2C0

  pcol (num)=hue*$10+lum
return

proc m_pos (byte num,xpos,ypos,card shape,len)
  byte array hpos=$D004
  card pmadr=$2D5,adr

  adr=pmadr-$100
  adr==+ypos

  moveblock (adr,shape,len)

  hpos=xpos
return

proc p_clear (byte num)
  card pmadr=$2D5
  zero (pmadr+num*$100,$100)
return

proc pm_restore ()
  byte u
  byte array hpos=$D000

  for u=0 to 8
  do
    hpos(u)=0
  od
return

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]

proc bput=*(byte dev, card addr, size)
[$48$A9$B$85$A5$A9$0$85$A6$A5$A3$5$A4
$D0$2$68$60$68$4C cioq]

proc delay(card z)
    card i
    for i=0 to z
    do
    od
return

proc main()
  card shape
  byte joy0, x,y,p, testxy
  byte p0pf=$D004, hitclr=$D01E

  graphics(7)
  color=1

  pm_init ()

  shape=data
  pm_col (0,7,0)

  djmp=@dlst0
  dlist=@dlst0

  close (1)
  open(1,"D:mulbi.bin",4)
  bget (1,$9060,3840)
  close (1)

  plot(0,0)
  drawto(79,95)

  x=80
  y=60
  p_clear (0)
  p_pos (0,x,y,shape,7)

  do
     joy0=stick(0)
    delay(1000)

     if joy0=14 then
       testxy=1
       y=y-1
        p_clear (0)
       p_pos (0,x,y,shape,7)
    elseif joy0=13 then
      testxy=2
        y=y+1
        p_clear (0)
       p_pos (0,x,y,shape,7)
    elseif joy0=7 then
      testxy=3
       x=x+1
        p_clear (0)
       p_pos (0,x,y,shape,7)
    elseif joy0=11 then
      testxy=4
       x=x-1
        p_clear (0)
       p_pos (0,x,y,shape,7)
     fi

     if p0pf > 0 then
       if testxy=1 then
          y=y+2
           p_clear (0)
           p_pos (0,x,y,shape,7)
       elseif testxy=2 then
         y=y-2
           p_clear (0)
           p_pos (0,x,y,shape,7)
         elseif testxy=3 then
         x=x-2
           p_clear (0)
           p_pos (0,x,y,shape,7)
         elseif testxy=4 then
         x=x+2
           p_clear (0)
           p_pos (0,x,y,shape,7)
         fi
         testxy=0
         hitclr=1
    fi
  od
return


Gruss