Skip to content

Commit b718de0

Browse files
committed
Adds PMHPOS statement.
1 parent 1d5a55e commit b718de0

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

manual.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,22 @@ Graphic and Sound Statements
10721072
the player or missile data use the
10731073
`PMADR()` function.
10741074

1075-
**Sets displayed color**
1076-
**SETCOLOR _num_, _hue_, _lum_ / SE.**
1075+
**Player/Missile horizontal move**
1076+
**PMHPOS _num_,_pos_ / PMH.**
1077+
1078+
Set horizontal position register for
1079+
the player or missile _num_ to _pos_.
1080+
1081+
Players 0 to 3 correspond to values 0
1082+
to 3 of _num_, missiles 0 to 3
1083+
correspond to the values 4 to 7
1084+
respectively.
1085+
1086+
This is the same as writing:
1087+
`POKE $D000 + num , pos`
1088+
1089+
**Sets displayed color**
1090+
**SETCOLOR _num_, _hue_, _lum_ / SE.**
10771091

10781092
Alters the color registers so that
10791093
color number _num_ has the given

samples/int/pmtest.bas

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
' P/M test program
2-
HPOSP0 = $D000
32

43
graphics 0 ' Setups graphics mode
54
pmgraphics 2 ' And P/M mode
@@ -39,8 +38,8 @@ proc MovePm
3938
x = xPos / 128 : y = P0Mem + yPos / 128
4039
poke $D01A,$74 ' Change background color
4140
pause 0
42-
poke HPOSP0, x
43-
mset oldPos, 5, 0
44-
move adr(PMdata), y, 5
41+
pmhpos 0, x ' Set new horizontal position
42+
mset oldPos, 5, 0 ' Clear old sprite
43+
move adr(PMdata), y, 5 ' Draw at new vertical pos.
4544
oldPos = y
4645
endproc

src/basic.syn

+1
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ PARSE_LINE_COMMAND:
605605
"RAd" emit TOK_BYTE_SADDR emit DEGFLAG emit TOK_0 emit TOK_POKE
606606
#@endif FASTBASIC_FP
607607
"PMGraphics" EXPR emit TOK_PMGRAPHICS
608+
"PMHpos" EXPR emit TOK_PUSH_NUM word HPOSP0 emit TOK_ADD emit TOK_SADDR "," EXPR emit TOK_POKE
608609

609610
PARSE_LINE_ASSIGN:
610611
VAR_WORD_SAVE "=" EXPR emit TOK_VAR_STORE E_POP_VAR

0 commit comments

Comments
 (0)