Skip to content

Commit

Permalink
Use MSET in samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Oct 27, 2018
1 parent 41f3293 commit 5175a0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions samples/int/carrera3d.bas
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@
if gbase&960 = 960
gbase = gbase+256
endif
next y
' Moved here to optimize space, corresponds to the clearing of PM data
dpoke pmadr,0
next y

' Adds display list first and last bytes to all DLs
d = dlist
Expand All @@ -104,8 +102,8 @@
d = d + 88
next curvature

' Sets PM data (continued from above)
move pmadr, pmadr+1, 999
' Clears PM data
mset pmadr, 999, 0

' Our car bitmap data for the PM 0 and 1
data pm1() byte = $18,$18,$18,$3C,$3C,$24,$24,$3C,$00,$18,$18,$3C,$7E,$7E,$00,$FF,$00,$7E,$7E
Expand Down
12 changes: 6 additions & 6 deletions samples/int/pmtest.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ poke RAMTOP, MemTop

' Activate and configure P/M data
graphics 0
poke P0Mem, 0 : move P0Mem, P0Mem+1, 127 : ' Clears Memory
mset P0Mem, 128, 0 ' 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
Expand All @@ -35,22 +34,23 @@ repeat
else
if xPos < 6400 Then xSpd = -xSpd
endif
exec MovePm : ' Move P/M Graphics
exec MovePm ' Move P/M Graphics
until Key()

' Restore RAMTOP and SDMCTL
poke GRACTL, 0
poke SDMCTL, Peek(SDMCTL) & 247
poke RAMTOP, MemTop + 4
graphics 0

END

proc MovePm
x = xPos / 128 : y = P0Mem + yPos / 128
poke $D01A,$74 : ' Change background color
poke $D01A,$74 ' Change background color
pause 0
poke HPOSP0, x
move adr(PMclear), oldPos, 5
move adr(PMdata), y, 5
mset oldPos, 5, 0
move adr(PMdata), y, 5
oldPos = y
endproc

0 comments on commit 5175a0a

Please sign in to comment.