Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
V
 Variables
 VCE blur
 VCE color modes
 VCE control register bitmask
 VCE dot clock
 VCE Functions
 VCE Helper Macros
 VCE I/O Ports
 VCE_BLACK
 VCE_BLUE
 VCE_BLUR_MASK
 VCE_BLUR_OFF
 VCE_BLUR_ON
 VCE_COLOR_MODE_BW
 VCE_COLOR_MODE_MASK
 VCE_COLOR_MODE_RGB
 VCE_CYAN
 VCE_DOT_CLOCK_10MHZ
 VCE_DOT_CLOCK_5MHZ
 VCE_DOT_CLOCK_7MHZ
 VCE_DOT_CLOCK_MASK
 VCE_GREEN
 VCE_GREY
 vce_init
 vce_load_palette
 VCE_MAGENTA
 VCE_RED
 VCE_WHITE
 VCE_YELLOW
 VDC Functions
 VDC Helper Macros
 VDC I/O Ports and Registers
 VDC registers
 VDC resgister copy in zero-page
 VDC status flags
 VDC_BG_128x32
 VDC_BG_128x64
 VDC_BG_32x32
 VDC_BG_32x64
 VDC_BG_64x32
 VDC_BG_64x64
 VDC_BXR
 VDC_BYR
 vdc_calc_addr
 vdc_clear
 VDC_CR
 VDC_CR_BG_ENABLE
 VDC_CR_HBLANK_ENABLE
 VDC_CR_RW_INC_1
 VDC_CR_RW_INC_128
 VDC_CR_RW_INC_32
 VDC_CR_RW_INC_64
 VDC_CR_SPR_COLLISION_ENABLE
 VDC_CR_SPR_ENABLE
 VDC_CR_SPR_OVERFLOW_ENABLE
 VDC_CR_VBLANK_ENABLE
 vdc_crh
 vdc_crl
 vdc_data
 VDC_DATA
 VDC_DEFAULT_BG_SIZE
 VDC_DEFAULT_SAT_ADDR
 VDC_DEFAULT_TILE_ADDR
 VDC_DEFAULT_XRES
 vdc_disable_display
 vdc_disp
 VDC_DMA_CR
 VDC_DMA_DST
 VDC_DMA_DST_DEC
 VDC_DMA_DST_INC
 VDC_DMA_LEN
 VDC_DMA_SAT_AUTO
 VDC_DMA_SATB_ENABLE
 VDC_DMA_SRC
 VDC_DMA_SRC_DEC
 VDC_DMA_SRC_INC
 VDC_DMA_VRAM_ENABLE
 vdc_enable_display
 vdc_fill_bat
 VDC_HDR
 VDC_HDR_db
 VDC_HSR
 VDC_HSR_db
 vdc_init
 vdc_load_data
 vdc_load_tiles
 VDC_MARR
 VDC_MAWR
 VDC_MWR
 VDC_RCR
 vdc_reg
 vdc_ri
 vdc_sat_addr
 vdc_sat_entry
 vdc_sat_set
 VDC_SAT_SRC
 vdc_set_bat_size
 vdc_set_cr
 vdc_set_read
 vdc_set_write
 vdc_set_xres
 vdc_setreg
 VDC_SPRITE_CG_MODE_B01
 VDC_SPRITE_CG_MODE_B23
 VDC_SPRITE_CG_MODE_MASK
 VDC_SPRITE_HEIGHT_16
 VDC_SPRITE_HEIGHT_32
 VDC_SPRITE_HEIGHT_64
 VDC_SPRITE_HEIGHT_MASK
 VDC_SPRITE_HORIZONTAL_FLIP
 VDC_SPRITE_HORIZONTAL_FLIP_MASK
 VDC_SPRITE_PALETTE_MASK
 VDC_SPRITE_PRIORITY_HIGH
 VDC_SPRITE_PRIORITY_LOW
 VDC_SPRITE_PRIORITY_MASK
 VDC_SPRITE_VERTICAL_FLIP
 VDC_SPRITE_VERTICAL_FLIP_MASK
 VDC_SPRITE_WIDTH_16
 VDC_SPRITE_WIDTH_MASK
 vdc_sr
 VDC_STATUS_BUSY
 VDC_STATUS_HBLANK
 VDC_STATUS_SATB_DMA_END
 VDC_STATUS_SPR_COLLISION
 VDC_STATUS_SPR_OVERFLOW
 VDC_STATUS_VBLANK
 VDC_STATUS_VRAM_DMA_END
 VDC_VCR
 VDC_VDR
 VDC_VSR
 vdc_wait_vsync
 vdc_xres_256
 vdc_xres_320
 vdc_xres_512
 vdc_yres_224
 vdc_yres_240
 VGM replay
 vgm_bank
 vgm_end
 vgm_loop_bank
 vgm_loop_ptr
 vgm_map
 vgm_mpr
 vgm_next_byte
 vgm_setup
 vgm_unmap
 vgm_update
 vgm_wait
 video_data
 video_reg
 videoport
 VSYNC
VCE_BLACK = $000
VCE value for black.
VCE_BLUE = $007
VCE value for blue.
VCE_BLUR_MASK = %00000100
Bit 2 is used to enable or disable sprites and background characters edge blur.
VCE_BLUR_OFF = %00000000
Disable edges blur.
VCE_BLUR_ON = %00000100
Blur edges of the sprites and background characters.
VCE_COLOR_MODE_BW = %10000000
Black and white video.
VCE_COLOR_MODE_MASK = %10000000
Bit 7 selects the video mode.
VCE_COLOR_MODE_RGB = %00000000
Color video.
VCE_CYAN = $1C7
VCE value for yellow.
VCE_DOT_CLOCK_10MHZ = %00000010
10MHz dot clock.
VCE_DOT_CLOCK_5MHZ = %00000000
5MHz dot clock.
VCE_DOT_CLOCK_7MHZ = %00000001
7MHz dot clock.
VCE_DOT_CLOCK_MASK = %00000011
Bits 0 and 1 selects the dot clock.
VCE_GREEN = $1C0
VCE value for green.
VCE_GREY = $124
VCE value for grey.
Set VCE dot clock, edge blur and background color.
VCE_MAGENTA = $03F
VCE value for magenta.
VCE_RED = $038
VCE value for red.
VCE_WHITE = $1ff
VCE value for white.
VCE_YELLOW = $1F8
VCE value for yellow.
Description of the status flags returned by reading video_reg.
VDC_BG_128x32 = %00100000
128x32 virtual background map.
VDC_BG_128x64 = %01100000
128x64 virtual background map.
VDC_BG_32x32 = %00000000
32x32 virtual background map.
VDC_BG_32x64 = %01000000
32x64 virtual background map.
VDC_BG_64x32 = %00010000
64x32 virtual background map.
VDC_BG_64x64 = %01010000
64x64 virtual background map.
VDC_BXR = $07
Background X Scroll Register
VDC_BYR = $08
Background Y Scroll Register
Compute VRAM address for a given tile in BAT.
Set N words of VRAM to 0.
VDC_CR = $05
Control Register
VDC_CR_BG_ENABLE = $0080
Enables background layer.
VDC_CR_HBLANK_ENABLE = $0004
Enables horizontal blank interrupt.
VDC_CR_RW_INC_1 = $0000
Read/write address auto-increment by 1 word.
VDC_CR_RW_INC_128 = $1800
Read/write address auto-increment by 128 words.
VDC_CR_RW_INC_32 = $0800
Read/write address auto-increment by 32 words.
VDC_CR_RW_INC_64 = $1000
Read/write address auto-increment by 64 words.
VDC_CR_SPR_COLLISION_ENABLE = $0001
Enables sprite collision interrupt.
VDC_CR_SPR_ENABLE = $0040
Enables sprites layer.
VDC_CR_SPR_OVERFLOW_ENABLE = $0002
Enables sprite overflow interrupt.
VDC_CR_VBLANK_ENABLE = $0008
Enables vertical blank interrupt.
vdc_crh = $20f4
Copy of the VDC control register MSB.
vdc_crl = $20f3
Copy of the VDC control register LSB.
Set VDC data.
VDC_DATA = $02
VRAM Data register
VDC_DEFAULT_BG_SIZE = VDC_BG_64x64
Default virtual background map size.
VDC_DEFAULT_SAT_ADDR = $7F00
Default SAT VRAM offset.
Default tile address.
VDC_DEFAULT_XRES = 256
Default horizontal resolution.
Disable background tiles and sprites display.
vdc_disp = $20f2
VDC display flag.
VDC_DMA_CR = $0F
DMA Control Register
VDC_DMA_DST = $11
DMA Destination Address Register
VDC_DMA_DST_DEC = %00001000
Destination address direction (decrement).
VDC_DMA_DST_INC = %00000000
Destination address direction (increment).
VDC_DMA_LEN = $12
DMA Transfer Length Register
VDC_DMA_SAT_AUTO = %00010000
Enable SAT DMA auto-transfer.
VDC_DMA_SATB_ENABLE = %00000001
Enables VRAM to SATB end of transfer interrupt.
VDC_DMA_SRC = $10
DMA Source Address Register
VDC_DMA_SRC_DEC = %00000100
Source address direction (decrement).
VDC_DMA_SRC_INC = %00000000
Source address direction (increment).
VDC_DMA_VRAM_ENABLE = %00000010
Enables VRAM to VRAM end of transfer interrupt.
Enable background tiles and sprites display.
Set an area in BAT to a given tile and palette.
VDC_HDR = $0B
Horizontal Display Register
Compute the value of the VDC_HDR register for a given horizontal screen resolution.
VDC_HSR = $0A
Horizontal Synchro Register
Compute the value of the VDC_HSR register for a given horizontal screen resolution.
Initialize VDC.
Copy data to VRAM.
Load 8x8 tiles data to VRAM.
VDC_MARR = $01
Memory Address Read Register
VDC_MAWR = $00
Memory Address Write Register
VDC_MWR = $09
Memory Width Register (MWR)
VDC_RCR = $06
Raster Compare Register
Initialize VDC register.
vdc_ri = $20f7
Copy of the VDC register index.
Set the VRAM address of the sprite attribute table.
Computes and set VRAM write address to SAT entry..
Set current SAT entry in VRAM.
VDC_SAT_SRC = $13
VRAM-SAT Source Address Register
Set background map virtual size.
Set VDC control registers
Set VDC VRAM read pointer.
Set VDC VRAM write pointer.
Set horizontal display resolution.
Set VDC register from value in A.
VDC_SPRITE_CG_MODE_B01 = $00
Bitplanes 0 and 1 are read, 2 and 3 are treated as zeroes.
VDC_SPRITE_CG_MODE_B23 = $01
Bitplanes 2 and 3 are read, 0 and 1 are treated as zeroes.
VDC_SPRITE_CG_MODE_MASK = $0001
Bitmask for CG mode.
VDC_SPRITE_HEIGHT_16 = $00
16 px sprite height.
VDC_SPRITE_HEIGHT_32 = $10
32 px sprite height.
VDC_SPRITE_HEIGHT_64 = $20
64 px sprite height.
VDC_SPRITE_HEIGHT_MASK = $30
Bitmask for sprite height.
VDC_SPRITE_HORIZONTAL_FLIP = $08
The sprite will be flipped horizontally.
VDC_SPRITE_HORIZONTAL_FLIP_MASK = $08
Bitmask for sprite horizontal flip flag.
VDC_SPRITE_PALETTE_MASK = $000f
Bitmask for sprite palette index.
VDC_SPRITE_PRIORITY_HIGH = $80
The sprite will be displayed in foreground.
VDC_SPRITE_PRIORITY_LOW = $00
The sprite will be displayed in background.
VDC_SPRITE_PRIORITY_MASK = $0080
Bitmask for sprite priority.
VDC_SPRITE_VERTICAL_FLIP = $80
The sprite will be flipped vertically.
VDC_SPRITE_VERTICAL_FLIP_MASK = $80
Bitmask for sprite vertical flip flag.
VDC_SPRITE_WIDTH_16 = $00
16 px sprite width.
VDC_SPRITE_WIDTH_MASK = $01
Bitmask for sprite width.
vdc_sr = $20f6
Copy of the VDC status register.
VDC_STATUS_BUSY = %01000000
Set when the VDC is waiting for a CPU access slot during the active display area.
VDC_STATUS_HBLANK = %00000100
Set when the horizontal blank interrupt occurs.
VDC_STATUS_SATB_DMA_END = %00001000
Set when the VRAM to SATB DMA transfer completion interrupt occurs.
VDC_STATUS_SPR_COLLISION = %00000001
Set when the sprite #0 collision detection interrupt occurs.
VDC_STATUS_SPR_OVERFLOW = %00000010
Set when the sprite overflow interrupt occurs.
VDC_STATUS_VBLANK = %00100000
Set when the vertical blank interrupt occurs.
VDC_STATUS_VRAM_DMA_END = %00010000
Set when the VRAM to VRAM DMA transfer completion interrupt occurs.
VDC_VCR = $0E
Vertical Display End Position Register
VDC_VDR = $0D
Vertical Display Register
VDC_VSR = $0C
Vertical Synchro Register
Wait for VSYNC.
Set horizontal (x) resolution to 256 pixels.
Set horizontal (x) resolution to 320 pixels.
Set horizontal (x) resolution to 512 pixels.
Set vertical (y) resolution to 224 pixels.
Set vertical (y) resolution to 240 pixels.
The VGM data used by the following replay routine is a stripped down version of the VGM v1.61 format.
vgm_bank .ds 1
First ROM bank of the VGM data.
vgm_end .ds 1
VGM data upper bound.
vgm_loop_bank .ds 1
Bank of the VGM loop address.
vgm_loop_ptr .ds 2
VGM loop address.
Map VGM data to MPR 6.
vgm_mpr = 6
MPR used to map VGM data.
Increment VGM data pointer.
Setup VGM player
Restore the value of MPR 6.
Read VGM frame data.
vgm_wait .ds 1
Frame delay.
video_data = videoport+2
VDC data
video_reg = videoport
VDC register latch
videoport = $0000
VDC port
VSYNC = 4
Close