diff --git a/manual.md b/manual.md index f928a43..821c6f2 100644 --- a/manual.md +++ b/manual.md @@ -1072,8 +1072,22 @@ Graphic and Sound Statements the player or missile data use the `PMADR()` function. -**Sets displayed color** -**SETCOLOR _num_, _hue_, _lum_ / SE.** +**Player/Missile horizontal move** +**PMHPOS _num_,_pos_ / PMH.** + + Set horizontal position register for + the player or missile _num_ to _pos_. + + Players 0 to 3 correspond to values 0 + to 3 of _num_, missiles 0 to 3 + correspond to the values 4 to 7 + respectively. + + This is the same as writing: + `POKE $D000 + num , pos` + +**Sets displayed color** +**SETCOLOR _num_, _hue_, _lum_ / SE.** Alters the color registers so that color number _num_ has the given diff --git a/samples/int/pmtest.bas b/samples/int/pmtest.bas index 9719683..aa476ea 100644 --- a/samples/int/pmtest.bas +++ b/samples/int/pmtest.bas @@ -1,5 +1,4 @@ ' P/M test program -HPOSP0 = $D000 graphics 0 ' Setups graphics mode pmgraphics 2 ' And P/M mode @@ -39,8 +38,8 @@ proc MovePm x = xPos / 128 : y = P0Mem + yPos / 128 poke $D01A,$74 ' Change background color pause 0 - poke HPOSP0, x - mset oldPos, 5, 0 - move adr(PMdata), y, 5 + pmhpos 0, x ' Set new horizontal position + mset oldPos, 5, 0 ' Clear old sprite + move adr(PMdata), y, 5 ' Draw at new vertical pos. oldPos = y endproc diff --git a/src/basic.syn b/src/basic.syn index 065e644..7db8332 100644 --- a/src/basic.syn +++ b/src/basic.syn @@ -605,6 +605,7 @@ PARSE_LINE_COMMAND: "RAd" emit TOK_BYTE_SADDR emit DEGFLAG emit TOK_0 emit TOK_POKE #@endif FASTBASIC_FP "PMGraphics" EXPR emit TOK_PMGRAPHICS + "PMHpos" EXPR emit TOK_PUSH_NUM word HPOSP0 emit TOK_ADD emit TOK_SADDR "," EXPR emit TOK_POKE PARSE_LINE_ASSIGN: VAR_WORD_SAVE "=" EXPR emit TOK_VAR_STORE E_POP_VAR