Skip to content

Commit

Permalink
Adds PMHPOS statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Feb 25, 2019
1 parent 1d5a55e commit b718de0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
18 changes: 16 additions & 2 deletions manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions samples/int/pmtest.bas
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
' P/M test program
HPOSP0 = $D000

graphics 0 ' Setups graphics mode
pmgraphics 2 ' And P/M mode
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions src/basic.syn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b718de0

Please sign in to comment.