CHange semantics of reset_joy to make more sense

This commit is contained in:
Karol Stasiak 2019-09-21 00:57:16 +02:00
parent 8ebeb2eeeb
commit bf6f0609a1
4 changed files with 13 additions and 5 deletions

View File

@ -24,6 +24,8 @@
* Added `vectrex`, `msx_br`, `koi7n2`, `iso15`, `zx80` and `zx81` text encodings.
* `reset_joy` is now defined to always reset all joypad state variables.
* Fixed arithmetic promotion bugs for signed values.
* Fixed parsing of `zp_bytes` in platform definitions.

View File

@ -21,9 +21,9 @@ Vertical joystick movement. 1 if down, -1 if up, 0 if neither.
#### `void reset_joy()`
Resets the state variables.
For platforms with more than one button, this resets only the main button state.
On those platforms use the platform-specific functions instead.
Resets the state variables.
The default implementation resets only the main button.
May be overridden by a strong alias on some platforms that have more buttons.
## null_joy_default
@ -31,6 +31,8 @@ This module set the default joystick to no joystick.
#### `alias read_joy`
A reserved name for reading the default joystick.
## mouse
The `mouse` module automatically imports the `x_coord` module.

View File

@ -76,9 +76,9 @@ Reads the joypad from the port 1 and adds its readouts to the current readouts.
Reads the joypad from the port 2 and adds its readouts to the current readouts.
#### `void nes_reset_joy()`
#### `alias reset_joy = nes_reset_joy!`
Resets the state variables.
Unlike `reset_joy`, this resets all the NES button states.
## nes_joy1_default

View File

@ -19,12 +19,16 @@ macro void read_joy2() {
}
void nes_reset_joy() {
input_dx = 0
input_dy = 0
input_a = 0
input_b = 0
input_select = 0
input_start = 0
reset_joy()
}
alias reset_joy = nes_reset_joy!
inline void read_also_joy1() {
strobe_joypad()
__parse_nes_joypad1()