libws libws
WSwan hardware library for the Wonderful toolchain
Loading...
Searching...
No Matches
Hardware defines - Display hardware I/O ports

Macros

#define WS_DISPLAY_CTRL_PORT   0x00
#define WS_DISPLAY_CTRL_SCR1_ENABLE   0x01
#define WS_DISPLAY_CTRL_SCR2_ENABLE   0x02
#define WS_DISPLAY_CTRL_SPR_ENABLE   0x04
#define WS_DISPLAY_CTRL_SPR_WIN_ENABLE   0x08
#define WS_DISPLAY_CTRL_SCR2_WIN_INSIDE   0x20
#define WS_DISPLAY_CTRL_SCR2_WIN_OUTSIDE   0x30
#define WS_DISPLAY_CTRL_SCR2_WIN_SHIFT   4
#define WS_DISPLAY_CTRL_SCR2_WIN_MASK   0x30
#define WS_DISPLAY_CTRL_SCR2_WIN_ENABLE_BIT   0x20
#define WS_DISPLAY_CTRL_SCR2_WIN_OUTSIDE_BIT   0x10
#define WS_DISPLAY_BACK_PORT   0x01
#define WS_DISPLAY_LINE_PORT   0x02
#define WS_DISPLAY_LINE_IRQ_PORT   0x03
#define WS_SPR_BASE_PORT   0x04
#define WS_SPR_BASE_ADDR(n)
#define WS_SPR_FIRST_PORT   0x05
#define WS_SPR_COUNT_PORT   0x06
#define WS_SCR_BASE_PORT   0x07
#define WS_SCR_BASE_ADDR1(n)
#define WS_SCR_BASE_ADDR2(n)
#define WS_SCR2_WIN_X1_PORT   0x08
#define WS_SCR2_WIN_Y1_PORT   0x09
#define WS_SCR2_WIN_X2_PORT   0x0A
#define WS_SCR2_WIN_Y2_PORT   0x0B
#define WS_SPR_WIN_X1_PORT   0x0C
#define WS_SPR_WIN_Y1_PORT   0x0D
#define WS_SPR_WIN_X2_PORT   0x0E
#define WS_SPR_WIN_Y2_PORT   0x0F
#define WS_SCR1_SCRL_X_PORT   0x10
#define WS_SCR1_SCRL_Y_PORT   0x11
#define WS_SCR2_SCRL_X_PORT   0x12
#define WS_SCR2_SCRL_Y_PORT   0x13
#define WS_LCD_CTRL_PORT   0x14
#define WS_LCD_CTRL_CONTRAST_LOW   0x00
#define WS_LCD_CTRL_CONTRAST_HIGH   0x02
#define WS_LCD_CTRL_CONTRAST_SHIFT   1
#define WS_LCD_CTRL_CONTRAST_MASK   0x02
#define WS_LCD_CTRL_SLEEP_ON   0x00
#define WS_LCD_CTRL_SLEEP_OFF   0x01
#define WS_LCD_CTRL_SLEEP_SHIFT   0
#define WS_LCD_CTRL_SLEEP_MASK   0x01
#define WS_LCD_ICON_PORT   0x15
#define WS_LCD_ICON_SLEEP   0x01
#define WS_LCD_ICON_ORIENT_V   0x02
#define WS_LCD_ICON_ORIENT_H   0x04
#define WS_LCD_ICON_AUX1   0x08
#define WS_LCD_ICON_AUX2   0x10
#define WS_LCD_ICON_AUX3   0x20
#define WS_LCD_VTOTAL_PORT   0x16
#define WS_LCD_STN_VSYNC_PORT   0x17
#define WS_LCD_NEXT_LINE_PORT   0x18
#define WS_LCD_ICON_LATCH_PORT   0x1A
#define WS_LCD_ICON_LATCH_DISABLE   0x01
#define WS_LCD_ICON_LATCH_HEADPHONE   0x02
#define WS_LCD_ICON_LATCH_VOLUME_B   0x04
#define WS_LCD_ICON_LATCH_VOLUME_A   0x08
#define WS_LCD_ICON_LATCH_VOLUME   0x10
#define WS_LCD_ICON_LATCH_CARTRIDGE   0x20
#define WS_LCD_SHADE_01_PORT   0x1C
#define WS_LCD_SHADE_23_PORT   0x1D
#define WS_LCD_SHADE_45_PORT   0x1E
#define WS_LCD_SHADE_67_PORT   0x1F
#define WS_SCR_PAL_0_PORT   0x20
#define WS_SCR_PAL_1_PORT   0x22
#define WS_SCR_PAL_2_PORT   0x24
#define WS_SCR_PAL_3_PORT   0x26
#define WS_SCR_PAL_4_PORT   0x28
#define WS_SCR_PAL_5_PORT   0x2A
#define WS_SCR_PAL_6_PORT   0x2C
#define WS_SCR_PAL_7_PORT   0x2E
#define WS_SCR_PAL_8_PORT   0x30
#define WS_SCR_PAL_9_PORT   0x32
#define WS_SCR_PAL_10_PORT   0x34
#define WS_SCR_PAL_11_PORT   0x36
#define WS_SCR_PAL_12_PORT   0x38
#define WS_SCR_PAL_13_PORT   0x3A
#define WS_SCR_PAL_14_PORT   0x3C
#define WS_SCR_PAL_15_PORT   0x3E
#define WS_SCR_PAL_PORT(i)
#define WS_SPR_PAL_0_PORT   0x30
#define WS_SPR_PAL_1_PORT   0x32
#define WS_SPR_PAL_2_PORT   0x34
#define WS_SPR_PAL_3_PORT   0x36
#define WS_SPR_PAL_4_PORT   0x38
#define WS_SPR_PAL_5_PORT   0x3A
#define WS_SPR_PAL_6_PORT   0x3C
#define WS_SPR_PAL_7_PORT   0x3E
#define WS_SPR_PAL_PORT(i)

Detailed Description

Macro Definition Documentation

◆ WS_DISPLAY_BACK_PORT

#define WS_DISPLAY_BACK_PORT   0x01

The display's background shade/color.

Definition at line 192 of file ports.h.

◆ WS_DISPLAY_CTRL_PORT

#define WS_DISPLAY_CTRL_PORT   0x00

Definition at line 159 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR1_ENABLE

#define WS_DISPLAY_CTRL_SCR1_ENABLE   0x01

Enable the Screen 1 layer.

Definition at line 163 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_ENABLE

#define WS_DISPLAY_CTRL_SCR2_ENABLE   0x02

Enable the Screen 2 layer.

Definition at line 167 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_WIN_ENABLE_BIT

#define WS_DISPLAY_CTRL_SCR2_WIN_ENABLE_BIT   0x20

Definition at line 186 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_WIN_INSIDE

#define WS_DISPLAY_CTRL_SCR2_WIN_INSIDE   0x20

Limit drawing the Screen 2 window to inside its bounds.

Definition at line 179 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_WIN_MASK

#define WS_DISPLAY_CTRL_SCR2_WIN_MASK   0x30

Definition at line 185 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_WIN_OUTSIDE

#define WS_DISPLAY_CTRL_SCR2_WIN_OUTSIDE   0x30

Limit drawing the Screen 2 window to outside its bounds.

Definition at line 183 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_WIN_OUTSIDE_BIT

#define WS_DISPLAY_CTRL_SCR2_WIN_OUTSIDE_BIT   0x10

Definition at line 187 of file ports.h.

◆ WS_DISPLAY_CTRL_SCR2_WIN_SHIFT

#define WS_DISPLAY_CTRL_SCR2_WIN_SHIFT   4

Definition at line 184 of file ports.h.

◆ WS_DISPLAY_CTRL_SPR_ENABLE

#define WS_DISPLAY_CTRL_SPR_ENABLE   0x04

Enable the sprite layer.

Definition at line 171 of file ports.h.

◆ WS_DISPLAY_CTRL_SPR_WIN_ENABLE

#define WS_DISPLAY_CTRL_SPR_WIN_ENABLE   0x08

Enable the sprite window.

Definition at line 175 of file ports.h.

◆ WS_DISPLAY_LINE_IRQ_PORT

#define WS_DISPLAY_LINE_IRQ_PORT   0x03

The line on the start of which the line interurpt should be requested.

Definition at line 204 of file ports.h.

◆ WS_DISPLAY_LINE_PORT

#define WS_DISPLAY_LINE_PORT   0x02

The current line being drawn by the display.

Note that final color translation is applied with a one-line delay; for changing LCD shade or color palette values, subtract 1 from this value.

Definition at line 199 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_HIGH

#define WS_LCD_CTRL_CONTRAST_HIGH   0x02

Definition at line 294 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_LOW

#define WS_LCD_CTRL_CONTRAST_LOW   0x00

Definition at line 293 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_MASK

#define WS_LCD_CTRL_CONTRAST_MASK   0x02

Definition at line 296 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_SHIFT

#define WS_LCD_CTRL_CONTRAST_SHIFT   1

Definition at line 295 of file ports.h.

◆ WS_LCD_CTRL_PORT

#define WS_LCD_CTRL_PORT   0x14

Controls LCD driver functionality.

Definition at line 292 of file ports.h.

◆ WS_LCD_CTRL_SLEEP_MASK

#define WS_LCD_CTRL_SLEEP_MASK   0x01

Definition at line 300 of file ports.h.

◆ WS_LCD_CTRL_SLEEP_OFF

#define WS_LCD_CTRL_SLEEP_OFF   0x01

Definition at line 298 of file ports.h.

◆ WS_LCD_CTRL_SLEEP_ON

#define WS_LCD_CTRL_SLEEP_ON   0x00

Definition at line 297 of file ports.h.

◆ WS_LCD_CTRL_SLEEP_SHIFT

#define WS_LCD_CTRL_SLEEP_SHIFT   0

Definition at line 299 of file ports.h.

◆ WS_LCD_ICON_AUX1

#define WS_LCD_ICON_AUX1   0x08

Etc. 1 (small circle) icon.

Definition at line 321 of file ports.h.

◆ WS_LCD_ICON_AUX2

#define WS_LCD_ICON_AUX2   0x10

Etc. 2 (medium circle) icon.

Definition at line 325 of file ports.h.

◆ WS_LCD_ICON_AUX3

#define WS_LCD_ICON_AUX3   0x20

Etc. 3 (large circle) icon.

Definition at line 329 of file ports.h.

◆ WS_LCD_ICON_LATCH_CARTRIDGE

#define WS_LCD_ICON_LATCH_CARTRIDGE   0x20

Definition at line 357 of file ports.h.

◆ WS_LCD_ICON_LATCH_DISABLE

#define WS_LCD_ICON_LATCH_DISABLE   0x01

Definition at line 352 of file ports.h.

◆ WS_LCD_ICON_LATCH_HEADPHONE

#define WS_LCD_ICON_LATCH_HEADPHONE   0x02

Definition at line 353 of file ports.h.

◆ WS_LCD_ICON_LATCH_PORT

#define WS_LCD_ICON_LATCH_PORT   0x1A

Latched (SoC-controlled) icon status/control.

Definition at line 351 of file ports.h.

◆ WS_LCD_ICON_LATCH_VOLUME

#define WS_LCD_ICON_LATCH_VOLUME   0x10

Definition at line 356 of file ports.h.

◆ WS_LCD_ICON_LATCH_VOLUME_A

#define WS_LCD_ICON_LATCH_VOLUME_A   0x08

Definition at line 355 of file ports.h.

◆ WS_LCD_ICON_LATCH_VOLUME_B

#define WS_LCD_ICON_LATCH_VOLUME_B   0x04

Definition at line 354 of file ports.h.

◆ WS_LCD_ICON_ORIENT_H

#define WS_LCD_ICON_ORIENT_H   0x04

Horizontal orientation icon.

Definition at line 317 of file ports.h.

◆ WS_LCD_ICON_ORIENT_V

#define WS_LCD_ICON_ORIENT_V   0x02

Vertical orientation icon.

Definition at line 313 of file ports.h.

◆ WS_LCD_ICON_PORT

#define WS_LCD_ICON_PORT   0x15

Controls the visibility of LCD sidebar icons.

Definition at line 305 of file ports.h.

◆ WS_LCD_ICON_SLEEP

#define WS_LCD_ICON_SLEEP   0x01

Sleep segment icon, depicted as a star.

Definition at line 309 of file ports.h.

◆ WS_LCD_NEXT_LINE_PORT

#define WS_LCD_NEXT_LINE_PORT   0x18

The next line to start drawing on. Write-only. Not recommended for use.

Definition at line 346 of file ports.h.

◆ WS_LCD_SHADE_01_PORT

#define WS_LCD_SHADE_01_PORT   0x1C

Definition at line 359 of file ports.h.

◆ WS_LCD_SHADE_23_PORT

#define WS_LCD_SHADE_23_PORT   0x1D

Definition at line 361 of file ports.h.

◆ WS_LCD_SHADE_45_PORT

#define WS_LCD_SHADE_45_PORT   0x1E

Definition at line 363 of file ports.h.

◆ WS_LCD_SHADE_67_PORT

#define WS_LCD_SHADE_67_PORT   0x1F

Definition at line 365 of file ports.h.

◆ WS_LCD_STN_VSYNC_PORT

#define WS_LCD_STN_VSYNC_PORT   0x17

On STN models (WS/WSC), this controls the start of the vertical back porch. For compatibility, this should always be set to 3 less than LCD_VTOTAL.

Definition at line 341 of file ports.h.

◆ WS_LCD_VTOTAL_PORT

#define WS_LCD_VTOTAL_PORT   0x16

The final line preceding line counter restart and the beginning of active display. By default, this is set to 158, which equals 159 total lines per frame.

For safety reasons, this should only be set to even values.

Definition at line 336 of file ports.h.

◆ WS_SCR1_SCRL_X_PORT

#define WS_SCR1_SCRL_X_PORT   0x10

X drawing offset of the Screen 1 layer.

Definition at line 272 of file ports.h.

◆ WS_SCR1_SCRL_Y_PORT

#define WS_SCR1_SCRL_Y_PORT   0x11

Y drawing offset of the Screen 1 layer.

Definition at line 277 of file ports.h.

◆ WS_SCR2_SCRL_X_PORT

#define WS_SCR2_SCRL_X_PORT   0x12

X drawing offset of the Screen 2 layer.

Definition at line 282 of file ports.h.

◆ WS_SCR2_SCRL_Y_PORT

#define WS_SCR2_SCRL_Y_PORT   0x13

Y drawing offset of the Screen 2 layer.

Definition at line 287 of file ports.h.

◆ WS_SCR2_WIN_X1_PORT

#define WS_SCR2_WIN_X1_PORT   0x08

Left-most pixel of the Screen 2 window.

Definition at line 232 of file ports.h.

◆ WS_SCR2_WIN_X2_PORT

#define WS_SCR2_WIN_X2_PORT   0x0A

Right-most pixel of the Screen 2 window.

Definition at line 242 of file ports.h.

◆ WS_SCR2_WIN_Y1_PORT

#define WS_SCR2_WIN_Y1_PORT   0x09

Top-most pixel of the Screen 2 window.

Definition at line 237 of file ports.h.

◆ WS_SCR2_WIN_Y2_PORT

#define WS_SCR2_WIN_Y2_PORT   0x0B

Bottom-most pixel of the Screen 2 window.

Definition at line 247 of file ports.h.

◆ WS_SCR_BASE_ADDR1

#define WS_SCR_BASE_ADDR1 ( n)
Value:
(((unsigned int) (n)) >> 11)

Definition at line 226 of file ports.h.

◆ WS_SCR_BASE_ADDR2

#define WS_SCR_BASE_ADDR2 ( n)
Value:
((((unsigned int) (n)) >> 11) << 4)

Definition at line 227 of file ports.h.

◆ WS_SCR_BASE_PORT

#define WS_SCR_BASE_PORT   0x07

Base address of screen layer data.

Definition at line 225 of file ports.h.

◆ WS_SCR_PAL_0_PORT

#define WS_SCR_PAL_0_PORT   0x20

Definition at line 367 of file ports.h.

◆ WS_SCR_PAL_10_PORT

#define WS_SCR_PAL_10_PORT   0x34

Definition at line 377 of file ports.h.

◆ WS_SCR_PAL_11_PORT

#define WS_SCR_PAL_11_PORT   0x36

Definition at line 378 of file ports.h.

◆ WS_SCR_PAL_12_PORT

#define WS_SCR_PAL_12_PORT   0x38

Definition at line 379 of file ports.h.

◆ WS_SCR_PAL_13_PORT

#define WS_SCR_PAL_13_PORT   0x3A

Definition at line 380 of file ports.h.

◆ WS_SCR_PAL_14_PORT

#define WS_SCR_PAL_14_PORT   0x3C

Definition at line 381 of file ports.h.

◆ WS_SCR_PAL_15_PORT

#define WS_SCR_PAL_15_PORT   0x3E

Definition at line 382 of file ports.h.

◆ WS_SCR_PAL_1_PORT

#define WS_SCR_PAL_1_PORT   0x22

Definition at line 368 of file ports.h.

◆ WS_SCR_PAL_2_PORT

#define WS_SCR_PAL_2_PORT   0x24

Definition at line 369 of file ports.h.

◆ WS_SCR_PAL_3_PORT

#define WS_SCR_PAL_3_PORT   0x26

Definition at line 370 of file ports.h.

◆ WS_SCR_PAL_4_PORT

#define WS_SCR_PAL_4_PORT   0x28

Definition at line 371 of file ports.h.

◆ WS_SCR_PAL_5_PORT

#define WS_SCR_PAL_5_PORT   0x2A

Definition at line 372 of file ports.h.

◆ WS_SCR_PAL_6_PORT

#define WS_SCR_PAL_6_PORT   0x2C

Definition at line 373 of file ports.h.

◆ WS_SCR_PAL_7_PORT

#define WS_SCR_PAL_7_PORT   0x2E

Definition at line 374 of file ports.h.

◆ WS_SCR_PAL_8_PORT

#define WS_SCR_PAL_8_PORT   0x30

Definition at line 375 of file ports.h.

◆ WS_SCR_PAL_9_PORT

#define WS_SCR_PAL_9_PORT   0x32

Definition at line 376 of file ports.h.

◆ WS_SCR_PAL_PORT

#define WS_SCR_PAL_PORT ( i)
Value:
(0x20 + (2 * ((i) - 0)))

Definition at line 383 of file ports.h.

◆ WS_SPR_BASE_ADDR

#define WS_SPR_BASE_ADDR ( n)
Value:
(((unsigned int) (n)) >> 9)

Definition at line 210 of file ports.h.

◆ WS_SPR_BASE_PORT

#define WS_SPR_BASE_PORT   0x04

Base address of sprite table data.

Definition at line 209 of file ports.h.

◆ WS_SPR_COUNT_PORT

#define WS_SPR_COUNT_PORT   0x06

Number of consecutive sprites to draw from the sprite table (1 - 128).

Definition at line 220 of file ports.h.

◆ WS_SPR_FIRST_PORT

#define WS_SPR_FIRST_PORT   0x05

First sprite to draw from the sprite table (0 - 127).

Definition at line 215 of file ports.h.

◆ WS_SPR_PAL_0_PORT

#define WS_SPR_PAL_0_PORT   0x30

Definition at line 385 of file ports.h.

◆ WS_SPR_PAL_1_PORT

#define WS_SPR_PAL_1_PORT   0x32

Definition at line 386 of file ports.h.

◆ WS_SPR_PAL_2_PORT

#define WS_SPR_PAL_2_PORT   0x34

Definition at line 387 of file ports.h.

◆ WS_SPR_PAL_3_PORT

#define WS_SPR_PAL_3_PORT   0x36

Definition at line 388 of file ports.h.

◆ WS_SPR_PAL_4_PORT

#define WS_SPR_PAL_4_PORT   0x38

Definition at line 389 of file ports.h.

◆ WS_SPR_PAL_5_PORT

#define WS_SPR_PAL_5_PORT   0x3A

Definition at line 390 of file ports.h.

◆ WS_SPR_PAL_6_PORT

#define WS_SPR_PAL_6_PORT   0x3C

Definition at line 391 of file ports.h.

◆ WS_SPR_PAL_7_PORT

#define WS_SPR_PAL_7_PORT   0x3E

Definition at line 392 of file ports.h.

◆ WS_SPR_PAL_PORT

#define WS_SPR_PAL_PORT ( i)
Value:
(0x30 + (2 * ((i) - 0)))

Definition at line 393 of file ports.h.

◆ WS_SPR_WIN_X1_PORT

#define WS_SPR_WIN_X1_PORT   0x0C

Left-most pixel of the sprite window.

Definition at line 252 of file ports.h.

◆ WS_SPR_WIN_X2_PORT

#define WS_SPR_WIN_X2_PORT   0x0E

Right-most pixel of the sprite window.

Definition at line 262 of file ports.h.

◆ WS_SPR_WIN_Y1_PORT

#define WS_SPR_WIN_Y1_PORT   0x0D

Top-most pixel of the sprite window.

Definition at line 257 of file ports.h.

◆ WS_SPR_WIN_Y2_PORT

#define WS_SPR_WIN_Y2_PORT   0x0F

Bottom-most pixel of the sprite window.

Definition at line 267 of file ports.h.