Skip to content

Commit 5175a0a

Browse files
committed
Use MSET in samples.
1 parent 41f3293 commit 5175a0a

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

samples/int/carrera3d.bas

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@
8585
if gbase&960 = 960
8686
gbase = gbase+256
8787
endif
88-
next y
89-
' Moved here to optimize space, corresponds to the clearing of PM data
90-
dpoke pmadr,0
88+
next y
9189

9290
' Adds display list first and last bytes to all DLs
9391
d = dlist
@@ -104,8 +102,8 @@
104102
d = d + 88
105103
next curvature
106104

107-
' Sets PM data (continued from above)
108-
move pmadr, pmadr+1, 999
105+
' Clears PM data
106+
mset pmadr, 999, 0
109107

110108
' Our car bitmap data for the PM 0 and 1
111109
data pm1() byte = $18,$18,$18,$3C,$3C,$24,$24,$3C,$00,$18,$18,$3C,$7E,$7E,$00,$FF,$00,$7E,$7E

samples/int/pmtest.bas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ poke RAMTOP, MemTop
99

1010
' Activate and configure P/M data
1111
graphics 0
12-
poke P0Mem, 0 : move P0Mem, P0Mem+1, 127 : ' Clears Memory
12+
mset P0Mem, 128, 0 ' Clears Memory
1313
poke PCOLR0, $1F
1414
poke SDMCTL, Peek(SDMCTL) ! 8
1515
poke PMBASE, MemTop
1616
poke GRACTL, 2
1717

1818
' P/M data and blank (to clear P/M)
1919
DATA PMdata() byte = $38,$44,$54,$44,$38
20-
DATA PMclear() byte = $00,$00,$00,$00,$00
2120

2221
' Initial Conditions
2322
xPos = 6400 : yPos = 2560
@@ -35,22 +34,23 @@ repeat
3534
else
3635
if xPos < 6400 Then xSpd = -xSpd
3736
endif
38-
exec MovePm : ' Move P/M Graphics
37+
exec MovePm ' Move P/M Graphics
3938
until Key()
4039

4140
' Restore RAMTOP and SDMCTL
4241
poke GRACTL, 0
4342
poke SDMCTL, Peek(SDMCTL) & 247
4443
poke RAMTOP, MemTop + 4
44+
graphics 0
4545

4646
END
4747

4848
proc MovePm
4949
x = xPos / 128 : y = P0Mem + yPos / 128
50-
poke $D01A,$74 : ' Change background color
50+
poke $D01A,$74 ' Change background color
5151
pause 0
5252
poke HPOSP0, x
53-
move adr(PMclear), oldPos, 5
54-
move adr(PMdata), y, 5
53+
mset oldPos, 5, 0
54+
move adr(PMdata), y, 5
5555
oldPos = y
5656
endproc

0 commit comments

Comments
 (0)