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_DISPLAY_DISABLE   0x00
#define WS_LCD_CTRL_DISPLAY_ENABLE   0x01
#define WS_LCD_CTRL_DISPLAY_SHIFT   0
#define WS_LCD_CTRL_DISPLAY_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

High contrast (drive two lines of the LCD at a time with pixel data).

Definition at line 300 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_LOW

#define WS_LCD_CTRL_CONTRAST_LOW   0x00

Low contrast (drive one line of the LCD at a time with pixel data).

Definition at line 296 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_MASK

#define WS_LCD_CTRL_CONTRAST_MASK   0x02

Definition at line 307 of file ports.h.

◆ WS_LCD_CTRL_CONTRAST_SHIFT

#define WS_LCD_CTRL_CONTRAST_SHIFT   1

Control WSC high contrast mode.

This mode works by having the LCD drive two lines at a time with data received from the SoC. The first line of the LCD is driven by the first line from the SoC, then additionally by the second line from the SoC.

Definition at line 306 of file ports.h.

◆ WS_LCD_CTRL_DISPLAY_DISABLE

#define WS_LCD_CTRL_DISPLAY_DISABLE   0x00

Disable graphics display.

Definition at line 311 of file ports.h.

◆ WS_LCD_CTRL_DISPLAY_ENABLE

#define WS_LCD_CTRL_DISPLAY_ENABLE   0x01

Enable graphics display.

Definition at line 315 of file ports.h.

◆ WS_LCD_CTRL_DISPLAY_MASK

#define WS_LCD_CTRL_DISPLAY_MASK   0x01

Definition at line 320 of file ports.h.

◆ WS_LCD_CTRL_DISPLAY_SHIFT

#define WS_LCD_CTRL_DISPLAY_SHIFT   0

Control whether or not the LCD is displaying graphics. Does not affect the segment area.

Definition at line 319 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_ICON_AUX1

#define WS_LCD_ICON_AUX1   0x08

Etc. 1 (small circle) icon.

Definition at line 341 of file ports.h.

◆ WS_LCD_ICON_AUX2

#define WS_LCD_ICON_AUX2   0x10

Etc. 2 (medium circle) icon.

Definition at line 345 of file ports.h.

◆ WS_LCD_ICON_AUX3

#define WS_LCD_ICON_AUX3   0x20

Etc. 3 (large circle) icon.

Definition at line 349 of file ports.h.

◆ WS_LCD_ICON_LATCH_CARTRIDGE

#define WS_LCD_ICON_LATCH_CARTRIDGE   0x20

Definition at line 377 of file ports.h.

◆ WS_LCD_ICON_LATCH_DISABLE

#define WS_LCD_ICON_LATCH_DISABLE   0x01

Definition at line 372 of file ports.h.

◆ WS_LCD_ICON_LATCH_HEADPHONE

#define WS_LCD_ICON_LATCH_HEADPHONE   0x02

Definition at line 373 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 371 of file ports.h.

◆ WS_LCD_ICON_LATCH_VOLUME

#define WS_LCD_ICON_LATCH_VOLUME   0x10

Definition at line 376 of file ports.h.

◆ WS_LCD_ICON_LATCH_VOLUME_A

#define WS_LCD_ICON_LATCH_VOLUME_A   0x08

Definition at line 375 of file ports.h.

◆ WS_LCD_ICON_LATCH_VOLUME_B

#define WS_LCD_ICON_LATCH_VOLUME_B   0x04

Definition at line 374 of file ports.h.

◆ WS_LCD_ICON_ORIENT_H

#define WS_LCD_ICON_ORIENT_H   0x04

Horizontal orientation icon.

Definition at line 337 of file ports.h.

◆ WS_LCD_ICON_ORIENT_V

#define WS_LCD_ICON_ORIENT_V   0x02

Vertical orientation icon.

Definition at line 333 of file ports.h.

◆ WS_LCD_ICON_PORT

#define WS_LCD_ICON_PORT   0x15

Controls the visibility of LCD sidebar icons.

Definition at line 325 of file ports.h.

◆ WS_LCD_ICON_SLEEP

#define WS_LCD_ICON_SLEEP   0x01

Sleep segment icon, depicted as a star.

Definition at line 329 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 366 of file ports.h.

◆ WS_LCD_SHADE_01_PORT

#define WS_LCD_SHADE_01_PORT   0x1C

Definition at line 379 of file ports.h.

◆ WS_LCD_SHADE_23_PORT

#define WS_LCD_SHADE_23_PORT   0x1D

Definition at line 381 of file ports.h.

◆ WS_LCD_SHADE_45_PORT

#define WS_LCD_SHADE_45_PORT   0x1E

Definition at line 383 of file ports.h.

◆ WS_LCD_SHADE_67_PORT

#define WS_LCD_SHADE_67_PORT   0x1F

Definition at line 385 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 361 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 356 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 387 of file ports.h.

◆ WS_SCR_PAL_10_PORT

#define WS_SCR_PAL_10_PORT   0x34

Definition at line 397 of file ports.h.

◆ WS_SCR_PAL_11_PORT

#define WS_SCR_PAL_11_PORT   0x36

Definition at line 398 of file ports.h.

◆ WS_SCR_PAL_12_PORT

#define WS_SCR_PAL_12_PORT   0x38

Definition at line 399 of file ports.h.

◆ WS_SCR_PAL_13_PORT

#define WS_SCR_PAL_13_PORT   0x3A

Definition at line 400 of file ports.h.

◆ WS_SCR_PAL_14_PORT

#define WS_SCR_PAL_14_PORT   0x3C

Definition at line 401 of file ports.h.

◆ WS_SCR_PAL_15_PORT

#define WS_SCR_PAL_15_PORT   0x3E

Definition at line 402 of file ports.h.

◆ WS_SCR_PAL_1_PORT

#define WS_SCR_PAL_1_PORT   0x22

Definition at line 388 of file ports.h.

◆ WS_SCR_PAL_2_PORT

#define WS_SCR_PAL_2_PORT   0x24

Definition at line 389 of file ports.h.

◆ WS_SCR_PAL_3_PORT

#define WS_SCR_PAL_3_PORT   0x26

Definition at line 390 of file ports.h.

◆ WS_SCR_PAL_4_PORT

#define WS_SCR_PAL_4_PORT   0x28

Definition at line 391 of file ports.h.

◆ WS_SCR_PAL_5_PORT

#define WS_SCR_PAL_5_PORT   0x2A

Definition at line 392 of file ports.h.

◆ WS_SCR_PAL_6_PORT

#define WS_SCR_PAL_6_PORT   0x2C

Definition at line 393 of file ports.h.

◆ WS_SCR_PAL_7_PORT

#define WS_SCR_PAL_7_PORT   0x2E

Definition at line 394 of file ports.h.

◆ WS_SCR_PAL_8_PORT

#define WS_SCR_PAL_8_PORT   0x30

Definition at line 395 of file ports.h.

◆ WS_SCR_PAL_9_PORT

#define WS_SCR_PAL_9_PORT   0x32

Definition at line 396 of file ports.h.

◆ WS_SCR_PAL_PORT

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

Definition at line 403 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 405 of file ports.h.

◆ WS_SPR_PAL_1_PORT

#define WS_SPR_PAL_1_PORT   0x32

Definition at line 406 of file ports.h.

◆ WS_SPR_PAL_2_PORT

#define WS_SPR_PAL_2_PORT   0x34

Definition at line 407 of file ports.h.

◆ WS_SPR_PAL_3_PORT

#define WS_SPR_PAL_3_PORT   0x36

Definition at line 408 of file ports.h.

◆ WS_SPR_PAL_4_PORT

#define WS_SPR_PAL_4_PORT   0x38

Definition at line 409 of file ports.h.

◆ WS_SPR_PAL_5_PORT

#define WS_SPR_PAL_5_PORT   0x3A

Definition at line 410 of file ports.h.

◆ WS_SPR_PAL_6_PORT

#define WS_SPR_PAL_6_PORT   0x3C

Definition at line 411 of file ports.h.

◆ WS_SPR_PAL_7_PORT

#define WS_SPR_PAL_7_PORT   0x3E

Definition at line 412 of file ports.h.

◆ WS_SPR_PAL_PORT

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

Definition at line 413 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.