Go to the documentation of this file.
11 #ifndef _SUPERVISION_H
12 #define _SUPERVISION_H
18 #define SV_SYSTEM_CLOCK_HZ 4000000
19 #define SV_LCD_WIDTH 160
20 #define SV_LCD_HEIGHT 160
22 #define SV_TRIGGER_START 0x80
23 #define SV_TRIGGER_STOP 0x00
31 #define SV_LCD (*(volatile struct __sv_lcd*) 0x2000)
39 #define SV_VDMA (*(volatile struct __sv_vdma*) 0x2008)
40 #define SV_VDMA_FROM_VRAM(addr) ((uint16_t) (addr))
41 #define SV_VDMA_TO_VRAM(addr) (((uint16_t) (addr)) | 0x4000)
48 #define SV_AUDIO_TONE_R (*(volatile struct __sv_tone*) 0x2010)
49 #define SV_AUDIO_TONE_L (*(volatile struct __sv_tone*) 0x2014)
51 #define SV_AUDIO_TONE_REPEAT 0x40
52 #define SV_AUDIO_TONE_ONESHOT 0x00
53 #define SV_AUDIO_TONE_DUTY_12_5 0x00
54 #define SV_AUDIO_TONE_DUTY_25 0x10
55 #define SV_AUDIO_TONE_DUTY_50 0x20
56 #define SV_AUDIO_TONE_DUTY_75 0x30
57 #define SV_AUDIO_TONE_VOLUME(n) (n)
64 #define SV_AUDIO_NOISE (*(volatile strut __sv_noise*) 0x2028)
66 #define SV_AUDIO_NOISE_DIV_8 0x00
67 #define SV_AUDIO_NOISE_DIV_16 0x01
68 #define SV_AUDIO_NOISE_DIV_32 0x02
69 #define SV_AUDIO_NOISE_DIV_64 0x03
70 #define SV_AUDIO_NOISE_DIV_128 0x04
71 #define SV_AUDIO_NOISE_DIV_256 0x05
72 #define SV_AUDIO_NOISE_DIV_512 0x06
73 #define SV_AUDIO_NOISE_DIV_1024 0x07
74 #define SV_AUDIO_NOISE_DIV_2048 0x08
75 #define SV_AUDIO_NOISE_DIV_4096 0x09
76 #define SV_AUDIO_NOISE_DIV_8192 0x0A
77 #define SV_AUDIO_NOISE_DIV_16384 0x0B
78 #define SV_AUDIO_NOISE_DIV_32768 0x0C
79 #define SV_AUDIO_NOISE_DIV_65536 0x0D
81 #define SV_AUDIO_NOISE_ENABLE 0x10
82 #define SV_AUDIO_NOISE_LEFT 0x08
83 #define SV_AUDIO_NOISE_RIGHT 0x04
84 #define SV_AUDIO_NOISE_MONO 0x0C
85 #define SV_AUDIO_NOISE_REPEAT 0x02
86 #define SV_AUDIO_NOISE_ONESHOT 0x00
87 #define SV_AUDIO_NOISE_TAP_15 0x01
88 #define SV_AUDIO_NOISE_TAP_7 0x00
96 #define SV_AUDIO_DMA (*(volatile struct __sv_adma*) 0x2018)
98 #define SV_AUDIO_DMA_BANK(n) ((n) << 4)
99 #define SV_AUDIO_DMA_LEFT 0x08
100 #define SV_AUDIO_DMA_RIGHT 0x04
101 #define SV_AUDIO_DMA_MONO 0x0C
102 #define SV_AUDIO_DMA_DIV_256 0x00
103 #define SV_AUDIO_DMA_DIV_512 0x01
104 #define SV_AUDIO_DMA_DIV_1024 0x02
105 #define SV_AUDIO_DMA_DIV_2048 0x03
107 #define SV_JOY (*(volatile uint8_t *) 0x2020)
108 #define SV_JOY_START 0x80
109 #define SV_JOY_SELECT 0x40
110 #define SV_JOY_A 0x20
111 #define SV_JOY_B 0x10
112 #define SV_JOY_UP 0x08
113 #define SV_JOY_DOWN 0x04
114 #define SV_JOY_LEFT 0x02
115 #define SV_JOY_RIGHT 0x01
121 #define SV_LINK (*(volatile struct __sv_link*) 0x2021)
130 #define SV_SYS (*(volatile struct __sv_sys*) 0x2023)
132 #define SV_IRQ_STATUS_TIMER 0x01
133 #define SV_IRQ_STATUS_AUDIO_DMA 0x02
135 #define SV_SYS_NMI_ENABLE 0x01
136 #define SV_SYS_NMI_DISABLE 0x00
137 #define SV_SYS_IRQ_TIMER_ENABLE 0x02
138 #define SV_SYS_IRQ_TIMER_DISABLE 0x00
139 #define SV_SYS_IRQ_AUDIO_DMA_ENABLE 0x04
140 #define SV_SYS_IRQ_AUDIO_DMA_DISABLE 0x00
141 #define SV_SYS_LCD_ENABLE 0x08
142 #define SV_SYS_LCD_DISABLE 0x00
143 #define SV_SYS_TIMER_PRESCALER_256 0x00
144 #define SV_SYS_TIMER_PRESCALER_16384 0x10
145 #define SV_SYS_BANK_MASK 0xE0
146 #define SV_SYS_BANK(n) ((n) << 5)
148 #define SV_RAM ((uint8_t*) 0x0000)
149 #define SV_VRAM ((uint8_t*) 0x4000)
150 #define SV_ROM ((uint8_t*) 0x8000)
151 #define SV_ROM_FIXED ((uint8_t*) 0xC000)
153 #define SV_VRAM_WIDTH 192
154 #define SV_VRAM_HEIGHT 170
155 #define SV_VRAM_PITCH 48
156 #define SV_VRAM_ROW(y) ((uint8_t*) (0x4000 + ((y) * SV_VRAM_PITCH)))
158 #define SV_COLOR_WHITE 0x00
159 #define SV_COLOR_LIGHT_GREY 0x01
160 #define SV_COLOR_DARK_GREY 0x02
161 #define SV_COLOR_BLACK 0x03
178 __attribute__((leaf, callback(2))) void banked_call(
uint8_t bank_id,
180 __attribute__((leaf))
uint8_t sv_bank_get(
void);
181 __attribute__((leaf))
void sv_bank_set(
uint8_t id);
183 #define SV_CART_ROM_KB(kb) \
184 asm(".globl __cart_rom_size\n__cart_rom_size = " #kb)
::uint16_t uint16_t
Definition: cstdint:22
char const void * data
Definition: neslib.h:92
void sv_dma_from_vram(void *dest, const void *src, uint16_t len)
uint8_t sv_sys_control_get(void)
uint8_t uint16_t uint16_t length
Definition: bios.h:181
::uint8_t uint8_t
Definition: cstdint:21
void sv_dma_to_vram(void *dest, const void *src, uint16_t len)
const void * src
Definition: memory.h:57
byte x
Definition: api.h:26
byte byte y
Definition: api.h:26
void(* method)(void))
Definition: supervision.h:179
byte byte byte byte byte dir
Definition: api.h:114
char bank_id
Definition: mapper.h:97
void sv_lcd_disable(void)
void sv_sys_control_set(uint8_t value)
char len
Definition: nesdoug.h:26