From 04be8020b60783c0a161de04333d9e39d7de0bff Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 5 Oct 2015 17:18:53 +0300 Subject: [PATCH 1/2] nes: Document whether waitvblank waits for the start or end of vblank --- doc/nes.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/nes.sgml b/doc/nes.sgml index ca9ce72b3..ae8e4a971 100644 --- a/doc/nes.sgml +++ b/doc/nes.sgml @@ -69,7 +69,7 @@ Programs containing NES specific code may use the NES specific functions

-waitvblank +waitvblank - wait until the start of vblank get_tv From 7f409c3edb3155fe2bd6d6c9ee40f8353598ea86 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 5 Oct 2015 17:19:36 +0300 Subject: [PATCH 2/2] nes: Expose and document all joypad keys --- doc/nes.sgml | 8 ++++++++ include/nes.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/nes.sgml b/doc/nes.sgml index ae8e4a971..98c25b6af 100644 --- a/doc/nes.sgml +++ b/doc/nes.sgml @@ -123,6 +123,14 @@ No extended memory drivers are currently available for the NES.

+The generic interface doesn't export the start and select buttons. To +test for those, use the defines in nes.h instead of the generic masks. + +Example: + +if (joy_read(0) & KEY_A) + + Mouse drivers

diff --git a/include/nes.h b/include/nes.h index 3ad442280..fd762a09a 100644 --- a/include/nes.h +++ b/include/nes.h @@ -90,6 +90,15 @@ /* No support for dynamically loadable drivers */ #define DYN_DRV 0 +/* The joystick keys - all keys are supported */ +#define KEY_UP 0x10 +#define KEY_DOWN 0x20 +#define KEY_LEFT 0x40 +#define KEY_RIGHT 0x80 +#define KEY_A 0x1 +#define KEY_B 0x2 +#define KEY_SELECT 0x4 +#define KEY_START 0x8 /* The addresses of the static drivers */