Jump to content

Photo

pm with graphisc in the fastbasic.


1 reply to this topic

#1 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 265 posts

Posted Thu Sep 13, 2018 10:52 AM

 
pm in the mod graphic.
 
cfg for fastbasic :
------------------------------------------------
FEATURES {
    STARTADDRESS: default = $3000
------------------------------------------------
 
demo of the fastavr.atr with altirra.
 
- pmtest1.xex
- pmtest2.xex
 
pm with picture (160x96)
 
dlist =560
savmsc=$58
ramadr=$2000
max=3840
 
' p/m test program
ramtop = $6a   : sdmctl = $22f  : pcolr0 = $2c0
hposp0 = $d000 : gractl = $d01d : pmbase = $d407
 
data dlidat() byte = $70, $70, $70, $4d, 
data          byte = $00,$20,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d, $0d,
data          byte = $0d, $0d, $0d, $0d, $0d, $41, 
data          byte = $00, $00 
                     
dpoke adr(dlidat)+103,adr(dlidat)
dpoke dlist,adr(dlidat)
dpoke savmsc,ramadr 
 
open #1, 4, 0, "D:MULBI.BIN"
bget #1,ramadr, max
close #1
 
' reserve memory at top
memtop = 200
p0mem  = $100 * memtop + $200
oldpos = p0mem
poke ramtop, memtop
 
' activate and configure p/m data
poke p0mem, 0 : move p0mem, p0mem+1, 127 : ' clears memory
poke pcolr0, $1f
poke sdmctl, peek(sdmctl) ! 8
poke pmbase, memtop
poke gractl, 2
 
' p/m data and blank (to clear p/m)
data pmdata()  byte = $38,$44,$54,$44,$38
data pmclear() byte = $00,$00,$00,$00,$00
 
' initial conditions
xpos = 6400 : ypos = 2560
xspd =   64 : yspd =    0
 
repeat
xpos = xpos + xspd : ypos = ypos + yspd
yspd = yspd + 2
 
if (yspd > 0) and (ypos > 12800)
yspd = -yspd
xspd = rand(512) - 256
endif
 
if xspd > 0
if xpos > 25600 then xspd = -xspd
else
if xpos <  6400 then xspd = -xspd
endif
 
exec movepm : ' move p/m graphics
until key()
 
' restore ramtop and sdmctl
poke gractl, 0
poke sdmctl, peek(sdmctl) & 247
poke ramtop, memtop + 4
 
end
 
proc movepm
x = xpos / 128 : y = p0mem + ypos / 128
 
pause 0
poke hposp0, x
move adr(pmclear), oldpos, 5
move adr(pmdata),  y,      5
oldpos = y
endproc
 
 
pm with graphisc 23 and Put/Drawto
 
dlist =560
savmsc=$58
ramadr=$2100
max=3840
 
' p/m test program
ramtop = $6a   : sdmctl = $22f  : pcolr0 = $2c0
hposp0 = $d000 : gractl = $d01d : pmbase = $d407
 
' reserve memory at top
memtop = 200
p0mem  = $100 * memtop + $200
oldpos = p0mem
poke ramtop, memtop
 
gr. 23
color 1
 
dladr=dpeek (dlist)
move dladr,$2000,255
 
dpoke dlist,$2000
dpoke $2000+4,ramadr
dpoke savmsc,ramadr
 
plot 0,0
drawto 159,95
plot 159,0
drawto 0,95
 
for z=0 to 255
poke (ramadr+z),255
next z
 
' activate and configure p/m data
poke p0mem, 0 : move p0mem, p0mem+1, 127 : ' clears memory
poke pcolr0, $1f
poke sdmctl, peek(sdmctl) ! 8
poke pmbase, memtop
poke gractl, 2
 
' p/m data and blank (to clear p/m)
data pmdata()  byte = $38,$44,$54,$44,$38
data pmclear() byte = $00,$00,$00,$00,$00
 
' initial conditions
xpos = 6400 : ypos = 2560
xspd =   64 : yspd =    0
 
repeat
xpos = xpos + xspd : ypos = ypos + yspd
yspd = yspd + 2
 
if (yspd > 0) and (ypos > 12800)
yspd = -yspd
xspd = rand(512) - 256
endif
 
if xspd > 0
if xpos > 25600 then xspd = -xspd
else
if xpos <  6400 then xspd = -xspd
endif
 
exec movepm : ' move p/m graphics
until key()
 
' restore ramtop and sdmctl
poke gractl, 0
poke sdmctl, peek(sdmctl) & 247
poke ramtop, memtop + 4
 
end
 
proc movepm
x = xpos / 128 : y = p0mem + ypos / 128
 
pause 0
poke hposp0, x
move adr(pmclear), oldpos, 5
move adr(pmdata),  y,      5
oldpos = y
endproc
 
greeting

Attached Files


Edited by funkheld, Thu Sep 13, 2018 2:00 PM.


#2 funkheld OFFLINE  

funkheld

    Moonsweeper

  • Topic Starter
  • 265 posts

Posted Thu Sep 13, 2018 11:28 AM

..........................................................................

Attached Files


Edited by funkheld, Thu Sep 13, 2018 1:55 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users