49 # error This module may only be used when compiling for the NES!
55 #define COLOR_BLACK 0x00
56 #define COLOR_WHITE 0x01
57 #define COLOR_RED 0x02
58 #define COLOR_CYAN 0x03
59 #define COLOR_PURPLE 0x04
60 #define COLOR_GREEN 0x05
61 #define COLOR_BLUE 0x06
62 #define COLOR_YELLOW 0x07
63 #define COLOR_ORANGE 0x08
64 #define COLOR_BROWN 0x09
65 #define COLOR_LIGHTRED 0x0A
66 #define COLOR_GRAY1 0x0B
67 #define COLOR_GRAY2 0x0C
68 #define COLOR_LIGHTGREEN 0x0D
69 #define COLOR_LIGHTBLUE 0x0E
70 #define COLOR_GRAY3 0x0F
73 #define JOY_UP_MASK 0x10
74 #define JOY_DOWN_MASK 0x20
75 #define JOY_LEFT_MASK 0x40
76 #define JOY_RIGHT_MASK 0x80
77 #define JOY_BTN_1_MASK 0x01
78 #define JOY_BTN_2_MASK 0x02
79 #define JOY_BTN_3_MASK 0x04
80 #define JOY_BTN_4_MASK 0x08
82 #define JOY_BTN_A_MASK JOY_BTN_1_MASK
83 #define JOY_BTN_B_MASK JOY_BTN_2_MASK
84 #define JOY_SELECT_MASK JOY_BTN_3_MASK
85 #define JOY_START_MASK JOY_BTN_4_MASK
87 #define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK)
88 #define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK)
89 #define JOY_SELECT(v) ((v) & JOY_SELECT_MASK)
90 #define JOY_START(v) ((v) & JOY_START_MASK)
101 unsigned char control;
114 #define PPU (*(volatile struct __ppu*)0x2000)
115 #define SPRITE_DMA (APU.sprite.dma)
120 unsigned char control;
122 unsigned char period_low;
123 unsigned char len_period_high;
126 unsigned char counter;
127 unsigned char unused;
128 unsigned char period_low;
129 unsigned char len_period_high;
132 unsigned char control;
133 unsigned char unused;
134 unsigned char period;
138 unsigned char control;
139 unsigned char output;
147 unsigned char unused;
148 unsigned char fcontrol;
150 #define APU (*(volatile struct __apu*)0x4000)
152 #define JOYPAD ((volatile unsigned char *)0x4016)
159 unsigned char get_tv (
void);
uint8_t uint16_t uint16_t length
Definition: bios.h:181
uint8_t uint16_t address
Definition: bios.h:180
unsigned char get_tv(void) __attribute__((leaf))
unsigned scroll
Definition: nesdoug.h:70
char len
Definition: nesdoug.h:26
char const void * data
Definition: neslib.h:92