Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Macros | Functions | Variables
vic4.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VIC2_IOMODE   0
 
#define VIC3_IOMODE   1
 
#define VIC_BAD_IOMODE   2
 
#define VIC4_IOMODE   3
 
#define PAL_LINE_FREQ   31250.0
 
#define NTSC_LINE_FREQ   31468.5
 
#define PAL_FRAME_TIME   20000
 
#define NTSC_FRAME_TIME   ((int)(16683.35))
 
#define TEXTURE_WIDTH   800
 
#define TEXTURE_HEIGHT   625
 
#define PHYSICAL_RASTERS_DEFAULT   PHYSICAL_RASTERS_NTSC
 
#define SCREEN_HEIGHT_VISIBLE_DEFAULT   SCREEN_HEIGHT_VISIBLE_NTSC
 
#define SCREEN_HEIGHT_VISIBLE_NTSC   480
 
#define SCREEN_HEIGHT_VISIBLE_PAL   576
 
#define PHYSICAL_RASTERS_NTSC   526
 
#define PHYSICAL_RASTERS_PAL   624
 
#define FRAME_H_FRONT   0
 
#define RASTER_CORRECTION   3
 
#define VIC4_BLINK_INTERVAL   30
 
#define REG_EBM   (vic_registers[0x11] & 0x40)
 
#define REG_MCM   (vic_registers[0x16] & 0x10)
 
#define REG_BMM   (vic_registers[0x11] & 0x20)
 
#define REG_SPRITE_ENABLE   vic_registers[0x15]
 
#define REG_BORDER_COLOR   (vic_registers[0x20] & vic_color_register_mask)
 
#define REG_SCREEN_COLOR   (vic_registers[0x21] & vic_color_register_mask)
 
#define REG_MULTICOLOR_1   (vic_registers[0x22] & vic_color_register_mask)
 
#define REG_MULTICOLOR_2   (vic_registers[0x23] & vic_color_register_mask)
 
#define REG_H640   (vic_registers[0x31] & 128)
 
#define REG_V400   (vic_registers[0x31] & 8)
 
#define REG_VICIII_ATTRIBS   (vic_registers[0x31] & 0x20)
 
#define REG_RSEL   (vic_registers[0x11] & 8)
 
#define REG_CSEL   (vic_registers[0x16] & 8)
 
#define REG_DISPLAYENABLE   (vic_registers[0x11] & 0x10)
 
#define REG_VIC2_XSCROLL   (vic_registers[0x16] & 7)
 
#define REG_VIC2_YSCROLL   (vic_registers[0x11] & 7)
 
#define REG_TBRDPOS   (vic_registers[0x48])
 
#define REG_SPRBPMEN_0_3   (vic_registers[0x49] >> 4)
 
#define REG_SPRBPMEN_4_7   (vic_registers[0x4B] >> 4)
 
#define REG_TBRDPOS_U4   (vic_registers[0x49] & 0xF)
 
#define REG_BBRDPOS   (vic_registers[0x4A])
 
#define REG_BBRDPOS_U4   (vic_registers[0x4B] & 0xF)
 
#define REG_TEXTXPOS   (vic_registers[0x4C])
 
#define REG_TEXTXPOS_U4   (vic_registers[0x4D] & 0xF)
 
#define REG_SPRTILEN   ((vic_registers[0x4D] >> 4) | (vic_registers[0x4F] & 0xF0))
 
#define REG_TEXTYPOS   (vic_registers[0x4E])
 
#define REG_TEXTYPOS_U4   (vic_registers[0x4F] & 0xF)
 
#define REG_FNRST   (vic_registers[0x53] & 0x80)
 
#define REG_16BITCHARSET   (vic_registers[0x54] & 1)
 
#define REG_FCLRLO   (vic_registers[0x54] & 2)
 
#define REG_FCLRHI   (vic_registers[0x54] & 4)
 
#define REG_SPR640   (vic_registers[0x54] & 0x10)
 
#define REG_SPRHGHT   (vic_registers[0x56])
 
#define REG_CHRYSCL   (vic_registers[0x5B])
 
#define REG_SIDBDRWD   (vic_registers[0x5C])
 
#define REG_SIDBDRWD_U5   (vic_registers[0x5D] & 0x3F)
 
#define REG_HOTREG   (vic_registers[0x5D] & 0x80)
 
#define REG_LINESTEP   vic_registers[0x58]
 
#define REG_LINESTEP_U8   vic_registers[0x59]
 
#define REG_CHARXSCALE   vic_registers[0x5A]
 
#define REG_CHRCOUNT   vic_registers[0x5E]
 
#define REG_SCRNPTR_B0   vic_registers[0x60]
 
#define REG_SCRNPTR_B1   vic_registers[0x61]
 
#define REG_SCRNPTR_B2   vic_registers[0x62]
 
#define REG_SCRNPTR_B3   (vic_registers[0x63] & 0xF)
 
#define REG_COLPTR   vic_registers[0x64]
 
#define REG_COLPTR_MSB   vic_registers[0x65]
 
#define REG_CHARPTR_B0   vic_registers[0x68]
 
#define REG_CHARPTR_B1   vic_registers[0x69]
 
#define REG_CHARPTR_B2   vic_registers[0x6A]
 
#define REG_SPRPTR_B0   vic_registers[0x6C]
 
#define REG_SPRPTR_B1   vic_registers[0x6D]
 
#define REG_SPRPTR_B2   (vic_registers[0x6E] & 0x7F)
 
#define REG_SPRITE_Y_ADJUST   vic_registers[0x72]
 
#define SINGLE_SIDE_BORDER   (((Uint16)REG_SIDBDRWD) | (REG_SIDBDRWD_U5) << 8)
 
#define BORDER_Y_TOP   (((Uint16)REG_TBRDPOS) | (REG_TBRDPOS_U4) << 8)
 
#define BORDER_Y_BOTTOM   (((Uint16)REG_BBRDPOS) | (REG_BBRDPOS_U4) << 8)
 
#define CHARGEN_Y_START   (((Uint16)REG_TEXTYPOS) | (REG_TEXTYPOS_U4) << 8)
 
#define CHARGEN_X_START   (((Uint16)REG_TEXTXPOS) | (REG_TEXTXPOS_U4) << 8)
 
#define LINESTEP_BYTES   (((Uint16)REG_LINESTEP) | (REG_LINESTEP_U8) << 8)
 
#define SCREEN_ADDR   ((Uint32)REG_SCRNPTR_B0 | (REG_SCRNPTR_B1<<8) | (REG_SCRNPTR_B2 <<16) | (REG_SCRNPTR_B3 << 24))
 
#define CHARSET_ADDR   ((Uint32)REG_CHARPTR_B0 | (REG_CHARPTR_B1<<8) | (REG_CHARPTR_B2 <<16))
 
#define VIC2_BITMAP_ADDR   ((CHARSET_ADDR) & 0xFFE000)
 
#define SPRITE_POINTER_ADDR   ((Uint32)REG_SPRPTR_B0 | (REG_SPRPTR_B1<<8) | (REG_SPRPTR_B2 <<16))
 
#define COLOUR_RAM_OFFSET   ((((Uint16)REG_COLPTR) | (REG_COLPTR_MSB) << 8))
 
#define SPRITE_POS_Y(n)
 
#define SPRITE_POS_X(n)
 
#define SPRITE_COLOR(n)   (vic_registers[0x27+(n)] & vic_color_register_mask)
 
#define SPRITE_COLOR_4BIT(n)   (vic_registers[0x27+(n)] & 0xF)
 
#define SPRITE_MULTICOLOR_1   (vic_registers[0x25] & vic_color_register_mask)
 
#define SPRITE_MULTICOLOR_2   (vic_registers[0x26] & vic_color_register_mask)
 
#define SPRITE_IS_BACK(n)   (vic_registers[0x1B] & (1 << (n)))
 
#define SPRITE_HORZ_2X(n)   (vic_registers[0x1D] & (1 << (n)))
 
#define SPRITE_VERT_2X(n)   (vic_registers[0x17] & (1 << (n)))
 
#define SPRITE_MULTICOLOR(n)   (vic_registers[0x1C] & (1 << (n)))
 
#define SPRITE_16COLOR(n)   (vic_registers[0x6B] & (1 << (n)))
 
#define SPRITE_EXTWIDTH(n)   (SPRITE_16COLOR(n) | (vic_registers[0x57] & (1 << (n))))
 
#define SPRITE_EXTHEIGHT(n)   (vic_registers[0x55] & (1 << (n)))
 
#define SPRITE_BITPLANE_ENABLE(n)   (((REG_SPRBPMEN_4_7) << 4 | REG_SPRBPMEN_0_3) & (1 << (n)))
 
#define SPRITE_16BITPOINTER   (vic_registers[0x6E] & 0x80)
 
#define SPRITE_V400(n)   (vic_registers[0x76] & (1 << (n)))
 
#define VIC3_ATTR_BLINK(c)   ((c) & 0x1)
 
#define VIC3_ATTR_REVERSE(c)   ((c) & 0x2)
 
#define VIC3_ATTR_BOLD(c)   ((c) & 0x4)
 
#define VIC3_ATTR_UNDERLINE(c)   ((c) & 0x8)
 
#define CHAR_IS256_COLOR(ch)   (REG_FCLRLO && (ch) < 0x100) || (REG_FCLRHI && (ch) > 0x0FF)
 
#define SXA_TRIM_RIGHT_BITS012(sw)   ((sw) >> 13)
 
#define SXA_VERTICAL_FLIP(cw)   ((cw) & 0x8000)
 
#define SXA_HORIZONTAL_FLIP(cw)   ((cw) & 0x4000)
 
#define SXA_GOTO_X(cw)   ((cw) & 0x1000)
 
#define SXA_4BIT_PER_PIXEL(cw)   ((cw) & 0x0800)
 
#define SXA_TRIM_RIGHT_BIT3(cw)   ((cw) & 0x0400)
 
#define SXA_ATTR_BOLD(cw)   ((cw) & 0x0040)
 
#define SXA_ATTR_REVERSE(cw)   ((cw) & 0x0020)
 
#define SET_11BIT_REG(basereg, x)
 
#define SET_12BIT_REG(basereg, x)
 
#define SET_14BIT_REG(basereg, x)
 
#define SET_16BIT_REG(basereg, x)
 
#define SET_PHYSICAL_RASTER(x)   SET_11BIT_REG(0x52, (x))
 
#define SET_BORDER_Y_TOP(x)   SET_12BIT_REG(0x48, (x))
 
#define SET_BORDER_Y_BOTTOM(x)   SET_12BIT_REG(0x4A, (x))
 
#define SET_CHARGEN_X_START(x)   SET_12BIT_REG(0x4C, (x))
 
#define SET_CHARGEN_Y_START(x)   SET_12BIT_REG(0x4E, (x))
 
#define SET_COLORRAM_BASE(x)   SET_16BIT_REG(0x64,(x))
 
#define SET_LINESTEP_BYTES(x)   SET_16BIT_REG(0x58,(x))
 
#define SPRITE_FIRST_X   31
 

Functions

void vic_init (void)
 
void vic_reset (void)
 
void vic_write_reg (unsigned int addr, Uint8 data)
 
Uint8 vic_read_reg (unsigned int addr)
 
int vic4_render_scanline (void)
 
void vic4_open_frame_access (void)
 
void vic4_close_frame_access (void)
 

Variables

int vic_iomode
 
Uint8 vic_registers []
 
Uint8 c128_d030_reg
 
const char * videostd_name
 
int videostd_frametime
 
int videostd_changed
 
Uint8 videostd_id
 
float videostd_1mhz_cycles_per_scanline
 
int vic_readjust_sdl_viewport
 
int vic4_disallow_video_std_change
 
int vic_vidp_legacy
 
int vic_chrp_legacy
 
int vic_sprp_legacy
 
const char * iomode_names [4]
 

Macro Definition Documentation

◆ BORDER_Y_BOTTOM

#define BORDER_Y_BOTTOM   (((Uint16)REG_BBRDPOS) | (REG_BBRDPOS_U4) << 8)

Definition at line 131 of file vic4.h.

◆ BORDER_Y_TOP

#define BORDER_Y_TOP   (((Uint16)REG_TBRDPOS) | (REG_TBRDPOS_U4) << 8)

Definition at line 130 of file vic4.h.

◆ CHAR_IS256_COLOR

#define CHAR_IS256_COLOR (   ch)    (REG_FCLRLO && (ch) < 0x100) || (REG_FCLRHI && (ch) > 0x0FF)

Definition at line 170 of file vic4.h.

◆ CHARGEN_X_START

#define CHARGEN_X_START   (((Uint16)REG_TEXTXPOS) | (REG_TEXTXPOS_U4) << 8)

Definition at line 133 of file vic4.h.

◆ CHARGEN_Y_START

#define CHARGEN_Y_START   (((Uint16)REG_TEXTYPOS) | (REG_TEXTYPOS_U4) << 8)

Definition at line 132 of file vic4.h.

◆ CHARSET_ADDR

#define CHARSET_ADDR   ((Uint32)REG_CHARPTR_B0 | (REG_CHARPTR_B1<<8) | (REG_CHARPTR_B2 <<16))

Definition at line 137 of file vic4.h.

◆ COLOUR_RAM_OFFSET

#define COLOUR_RAM_OFFSET   ((((Uint16)REG_COLPTR) | (REG_COLPTR_MSB) << 8))

Definition at line 140 of file vic4.h.

◆ FRAME_H_FRONT

#define FRAME_H_FRONT   0

Definition at line 50 of file vic4.h.

◆ LINESTEP_BYTES

#define LINESTEP_BYTES   (((Uint16)REG_LINESTEP) | (REG_LINESTEP_U8) << 8)

Definition at line 134 of file vic4.h.

◆ NTSC_FRAME_TIME

#define NTSC_FRAME_TIME   ((int)(16683.35))

Definition at line 33 of file vic4.h.

◆ NTSC_LINE_FREQ

#define NTSC_LINE_FREQ   31468.5

Definition at line 30 of file vic4.h.

◆ PAL_FRAME_TIME

#define PAL_FRAME_TIME   20000

Definition at line 32 of file vic4.h.

◆ PAL_LINE_FREQ

#define PAL_LINE_FREQ   31250.0

Definition at line 29 of file vic4.h.

◆ PHYSICAL_RASTERS_DEFAULT

#define PHYSICAL_RASTERS_DEFAULT   PHYSICAL_RASTERS_NTSC

Definition at line 44 of file vic4.h.

◆ PHYSICAL_RASTERS_NTSC

#define PHYSICAL_RASTERS_NTSC   526

Definition at line 48 of file vic4.h.

◆ PHYSICAL_RASTERS_PAL

#define PHYSICAL_RASTERS_PAL   624

Definition at line 49 of file vic4.h.

◆ RASTER_CORRECTION

#define RASTER_CORRECTION   3

Definition at line 51 of file vic4.h.

◆ REG_16BITCHARSET

#define REG_16BITCHARSET   (vic_registers[0x54] & 1)

Definition at line 93 of file vic4.h.

◆ REG_BBRDPOS

#define REG_BBRDPOS   (vic_registers[0x4A])

Definition at line 83 of file vic4.h.

◆ REG_BBRDPOS_U4

#define REG_BBRDPOS_U4   (vic_registers[0x4B] & 0xF)

Definition at line 84 of file vic4.h.

◆ REG_BMM

#define REG_BMM   (vic_registers[0x11] & 0x20)

Definition at line 63 of file vic4.h.

◆ REG_BORDER_COLOR

#define REG_BORDER_COLOR   (vic_registers[0x20] & vic_color_register_mask)

Definition at line 65 of file vic4.h.

◆ REG_CHARPTR_B0

#define REG_CHARPTR_B0   vic_registers[0x68]

Definition at line 113 of file vic4.h.

◆ REG_CHARPTR_B1

#define REG_CHARPTR_B1   vic_registers[0x69]

Definition at line 114 of file vic4.h.

◆ REG_CHARPTR_B2

#define REG_CHARPTR_B2   vic_registers[0x6A]

Definition at line 115 of file vic4.h.

◆ REG_CHARXSCALE

#define REG_CHARXSCALE   vic_registers[0x5A]

Definition at line 105 of file vic4.h.

◆ REG_CHRCOUNT

#define REG_CHRCOUNT   vic_registers[0x5E]

Definition at line 106 of file vic4.h.

◆ REG_CHRYSCL

#define REG_CHRYSCL   (vic_registers[0x5B])

Definition at line 99 of file vic4.h.

◆ REG_COLPTR

#define REG_COLPTR   vic_registers[0x64]

Definition at line 111 of file vic4.h.

◆ REG_COLPTR_MSB

#define REG_COLPTR_MSB   vic_registers[0x65]

Definition at line 112 of file vic4.h.

◆ REG_CSEL

#define REG_CSEL   (vic_registers[0x16] & 8)

Definition at line 74 of file vic4.h.

◆ REG_DISPLAYENABLE

#define REG_DISPLAYENABLE   (vic_registers[0x11] & 0x10)

Definition at line 75 of file vic4.h.

◆ REG_EBM

#define REG_EBM   (vic_registers[0x11] & 0x40)

Definition at line 61 of file vic4.h.

◆ REG_FCLRHI

#define REG_FCLRHI   (vic_registers[0x54] & 4)

Definition at line 95 of file vic4.h.

◆ REG_FCLRLO

#define REG_FCLRLO   (vic_registers[0x54] & 2)

Definition at line 94 of file vic4.h.

◆ REG_FNRST

#define REG_FNRST   (vic_registers[0x53] & 0x80)

Definition at line 92 of file vic4.h.

◆ REG_H640

#define REG_H640   (vic_registers[0x31] & 128)

Definition at line 70 of file vic4.h.

◆ REG_HOTREG

#define REG_HOTREG   (vic_registers[0x5D] & 0x80)

Definition at line 102 of file vic4.h.

◆ REG_LINESTEP

#define REG_LINESTEP   vic_registers[0x58]

Definition at line 103 of file vic4.h.

◆ REG_LINESTEP_U8

#define REG_LINESTEP_U8   vic_registers[0x59]

Definition at line 104 of file vic4.h.

◆ REG_MCM

#define REG_MCM   (vic_registers[0x16] & 0x10)

Definition at line 62 of file vic4.h.

◆ REG_MULTICOLOR_1

#define REG_MULTICOLOR_1   (vic_registers[0x22] & vic_color_register_mask)

Definition at line 67 of file vic4.h.

◆ REG_MULTICOLOR_2

#define REG_MULTICOLOR_2   (vic_registers[0x23] & vic_color_register_mask)

Definition at line 68 of file vic4.h.

◆ REG_RSEL

#define REG_RSEL   (vic_registers[0x11] & 8)

Definition at line 73 of file vic4.h.

◆ REG_SCREEN_COLOR

#define REG_SCREEN_COLOR   (vic_registers[0x21] & vic_color_register_mask)

Definition at line 66 of file vic4.h.

◆ REG_SCRNPTR_B0

#define REG_SCRNPTR_B0   vic_registers[0x60]

Definition at line 107 of file vic4.h.

◆ REG_SCRNPTR_B1

#define REG_SCRNPTR_B1   vic_registers[0x61]

Definition at line 108 of file vic4.h.

◆ REG_SCRNPTR_B2

#define REG_SCRNPTR_B2   vic_registers[0x62]

Definition at line 109 of file vic4.h.

◆ REG_SCRNPTR_B3

#define REG_SCRNPTR_B3   (vic_registers[0x63] & 0xF)

Definition at line 110 of file vic4.h.

◆ REG_SIDBDRWD

#define REG_SIDBDRWD   (vic_registers[0x5C])

Definition at line 100 of file vic4.h.

◆ REG_SIDBDRWD_U5

#define REG_SIDBDRWD_U5   (vic_registers[0x5D] & 0x3F)

Definition at line 101 of file vic4.h.

◆ REG_SPR640

#define REG_SPR640   (vic_registers[0x54] & 0x10)

Definition at line 96 of file vic4.h.

◆ REG_SPRBPMEN_0_3

#define REG_SPRBPMEN_0_3   (vic_registers[0x49] >> 4)

Definition at line 80 of file vic4.h.

◆ REG_SPRBPMEN_4_7

#define REG_SPRBPMEN_4_7   (vic_registers[0x4B] >> 4)

Definition at line 81 of file vic4.h.

◆ REG_SPRHGHT

#define REG_SPRHGHT   (vic_registers[0x56])

Definition at line 97 of file vic4.h.

◆ REG_SPRITE_ENABLE

#define REG_SPRITE_ENABLE   vic_registers[0x15]

Definition at line 64 of file vic4.h.

◆ REG_SPRITE_Y_ADJUST

#define REG_SPRITE_Y_ADJUST   vic_registers[0x72]

Definition at line 119 of file vic4.h.

◆ REG_SPRPTR_B0

#define REG_SPRPTR_B0   vic_registers[0x6C]

Definition at line 116 of file vic4.h.

◆ REG_SPRPTR_B1

#define REG_SPRPTR_B1   vic_registers[0x6D]

Definition at line 117 of file vic4.h.

◆ REG_SPRPTR_B2

#define REG_SPRPTR_B2   (vic_registers[0x6E] & 0x7F)

Definition at line 118 of file vic4.h.

◆ REG_SPRTILEN

#define REG_SPRTILEN   ((vic_registers[0x4D] >> 4) | (vic_registers[0x4F] & 0xF0))

Definition at line 87 of file vic4.h.

◆ REG_TBRDPOS

#define REG_TBRDPOS   (vic_registers[0x48])

Definition at line 79 of file vic4.h.

◆ REG_TBRDPOS_U4

#define REG_TBRDPOS_U4   (vic_registers[0x49] & 0xF)

Definition at line 82 of file vic4.h.

◆ REG_TEXTXPOS

#define REG_TEXTXPOS   (vic_registers[0x4C])

Definition at line 85 of file vic4.h.

◆ REG_TEXTXPOS_U4

#define REG_TEXTXPOS_U4   (vic_registers[0x4D] & 0xF)

Definition at line 86 of file vic4.h.

◆ REG_TEXTYPOS

#define REG_TEXTYPOS   (vic_registers[0x4E])

Definition at line 88 of file vic4.h.

◆ REG_TEXTYPOS_U4

#define REG_TEXTYPOS_U4   (vic_registers[0x4F] & 0xF)

Definition at line 89 of file vic4.h.

◆ REG_V400

#define REG_V400   (vic_registers[0x31] & 8)

Definition at line 71 of file vic4.h.

◆ REG_VIC2_XSCROLL

#define REG_VIC2_XSCROLL   (vic_registers[0x16] & 7)

Definition at line 76 of file vic4.h.

◆ REG_VIC2_YSCROLL

#define REG_VIC2_YSCROLL   (vic_registers[0x11] & 7)

Definition at line 77 of file vic4.h.

◆ REG_VICIII_ATTRIBS

#define REG_VICIII_ATTRIBS   (vic_registers[0x31] & 0x20)

Definition at line 72 of file vic4.h.

◆ SCREEN_ADDR

#define SCREEN_ADDR   ((Uint32)REG_SCRNPTR_B0 | (REG_SCRNPTR_B1<<8) | (REG_SCRNPTR_B2 <<16) | (REG_SCRNPTR_B3 << 24))

Definition at line 136 of file vic4.h.

◆ SCREEN_HEIGHT_VISIBLE_DEFAULT

#define SCREEN_HEIGHT_VISIBLE_DEFAULT   SCREEN_HEIGHT_VISIBLE_NTSC

Definition at line 45 of file vic4.h.

◆ SCREEN_HEIGHT_VISIBLE_NTSC

#define SCREEN_HEIGHT_VISIBLE_NTSC   480

Definition at line 46 of file vic4.h.

◆ SCREEN_HEIGHT_VISIBLE_PAL

#define SCREEN_HEIGHT_VISIBLE_PAL   576

Definition at line 47 of file vic4.h.

◆ SET_11BIT_REG

#define SET_11BIT_REG (   basereg,
  x 
)
Value:
do { \
vic_registers[((basereg)+1)] = (Uint8) ((((Uint16)(x)) & 0x700) >> 8); \
vic_registers[(basereg)] = (Uint8) ((Uint16)(x)) & 0x00FF; \
} while(0)

Definition at line 189 of file vic4.h.

◆ SET_12BIT_REG

#define SET_12BIT_REG (   basereg,
  x 
)
Value:
do { \
vic_registers[((basereg)+1)] = (Uint8) ((((Uint16)(x)) & 0xF00) >> 8); \
vic_registers[(basereg)] = (Uint8) ((Uint16)(x)) & 0x00FF; \
} while(0)

Definition at line 193 of file vic4.h.

◆ SET_14BIT_REG

#define SET_14BIT_REG (   basereg,
  x 
)
Value:
do { \
vic_registers[((basereg)+1)] = (Uint8) ((((Uint16)(x)) & 0x3F00) >> 8); \
vic_registers[(basereg)] = (Uint8) ((Uint16)(x)) & 0x00FF; \
} while(0)

Definition at line 197 of file vic4.h.

◆ SET_16BIT_REG

#define SET_16BIT_REG (   basereg,
  x 
)
Value:
do { \
vic_registers[((basereg) + 1)] = (Uint8) ((((Uint16)(x)) & 0xFF00) >> 8); \
vic_registers[(basereg)]= ((Uint16)(x)) & 0x00FF; \
} while(0)

Definition at line 205 of file vic4.h.

◆ SET_BORDER_Y_BOTTOM

#define SET_BORDER_Y_BOTTOM (   x)    SET_12BIT_REG(0x4A, (x))

Definition at line 218 of file vic4.h.

◆ SET_BORDER_Y_TOP

#define SET_BORDER_Y_TOP (   x)    SET_12BIT_REG(0x48, (x))

Definition at line 217 of file vic4.h.

◆ SET_CHARGEN_X_START

#define SET_CHARGEN_X_START (   x)    SET_12BIT_REG(0x4C, (x))

Definition at line 219 of file vic4.h.

◆ SET_CHARGEN_Y_START

#define SET_CHARGEN_Y_START (   x)    SET_12BIT_REG(0x4E, (x))

Definition at line 220 of file vic4.h.

◆ SET_COLORRAM_BASE

#define SET_COLORRAM_BASE (   x)    SET_16BIT_REG(0x64,(x))

Definition at line 224 of file vic4.h.

◆ SET_LINESTEP_BYTES

#define SET_LINESTEP_BYTES (   x)    SET_16BIT_REG(0x58,(x))

Definition at line 225 of file vic4.h.

◆ SET_PHYSICAL_RASTER

#define SET_PHYSICAL_RASTER (   x)    SET_11BIT_REG(0x52, (x))

Definition at line 212 of file vic4.h.

◆ SINGLE_SIDE_BORDER

#define SINGLE_SIDE_BORDER   (((Uint16)REG_SIDBDRWD) | (REG_SIDBDRWD_U5) << 8)

Definition at line 129 of file vic4.h.

◆ SPRITE_16BITPOINTER

#define SPRITE_16BITPOINTER   (vic_registers[0x6E] & 0x80)

Definition at line 161 of file vic4.h.

◆ SPRITE_16COLOR

#define SPRITE_16COLOR (   n)    (vic_registers[0x6B] & (1 << (n)))

Definition at line 157 of file vic4.h.

◆ SPRITE_BITPLANE_ENABLE

#define SPRITE_BITPLANE_ENABLE (   n)    (((REG_SPRBPMEN_4_7) << 4 | REG_SPRBPMEN_0_3) & (1 << (n)))

Definition at line 160 of file vic4.h.

◆ SPRITE_COLOR

#define SPRITE_COLOR (   n)    (vic_registers[0x27+(n)] & vic_color_register_mask)

Definition at line 149 of file vic4.h.

◆ SPRITE_COLOR_4BIT

#define SPRITE_COLOR_4BIT (   n)    (vic_registers[0x27+(n)] & 0xF)

Definition at line 150 of file vic4.h.

◆ SPRITE_EXTHEIGHT

#define SPRITE_EXTHEIGHT (   n)    (vic_registers[0x55] & (1 << (n)))

Definition at line 159 of file vic4.h.

◆ SPRITE_EXTWIDTH

#define SPRITE_EXTWIDTH (   n)    (SPRITE_16COLOR(n) | (vic_registers[0x57] & (1 << (n))))

Definition at line 158 of file vic4.h.

◆ SPRITE_FIRST_X

#define SPRITE_FIRST_X   31

Definition at line 229 of file vic4.h.

◆ SPRITE_HORZ_2X

#define SPRITE_HORZ_2X (   n)    (vic_registers[0x1D] & (1 << (n)))

Definition at line 154 of file vic4.h.

◆ SPRITE_IS_BACK

#define SPRITE_IS_BACK (   n)    (vic_registers[0x1B] & (1 << (n)))

Definition at line 153 of file vic4.h.

◆ SPRITE_MULTICOLOR

#define SPRITE_MULTICOLOR (   n)    (vic_registers[0x1C] & (1 << (n)))

Definition at line 156 of file vic4.h.

◆ SPRITE_MULTICOLOR_1

#define SPRITE_MULTICOLOR_1   (vic_registers[0x25] & vic_color_register_mask)

Definition at line 151 of file vic4.h.

◆ SPRITE_MULTICOLOR_2

#define SPRITE_MULTICOLOR_2   (vic_registers[0x26] & vic_color_register_mask)

Definition at line 152 of file vic4.h.

◆ SPRITE_POINTER_ADDR

#define SPRITE_POINTER_ADDR   ((Uint32)REG_SPRPTR_B0 | (REG_SPRPTR_B1<<8) | (REG_SPRPTR_B2 <<16))

Definition at line 139 of file vic4.h.

◆ SPRITE_POS_X

#define SPRITE_POS_X (   n)
Value:
(((Uint16)vic_registers[(n)*2]) | \
( (vic_registers[0x10] & (1 << (n)) ? 0x100 : 0)) | \
( (vic_registers[0x5f] & (1 << (n)) ? 0x200 : 0)))

Definition at line 146 of file vic4.h.

◆ SPRITE_POS_Y

#define SPRITE_POS_Y (   n)
Value:
(((Uint16)vic_registers[1 + (n)*2]) | \
( (vic_registers[0x77] & (1 << (n)) ? 0x100 : 0)) | \
( (vic_registers[0x78] & (1 << (n)) ? 0x200 : 0)))

Definition at line 143 of file vic4.h.

◆ SPRITE_V400

#define SPRITE_V400 (   n)    (vic_registers[0x76] & (1 << (n)))

Definition at line 162 of file vic4.h.

◆ SPRITE_VERT_2X

#define SPRITE_VERT_2X (   n)    (vic_registers[0x17] & (1 << (n)))

Definition at line 155 of file vic4.h.

◆ SXA_4BIT_PER_PIXEL

#define SXA_4BIT_PER_PIXEL (   cw)    ((cw) & 0x0800)

Definition at line 180 of file vic4.h.

◆ SXA_ATTR_BOLD

#define SXA_ATTR_BOLD (   cw)    ((cw) & 0x0040)

Definition at line 182 of file vic4.h.

◆ SXA_ATTR_REVERSE

#define SXA_ATTR_REVERSE (   cw)    ((cw) & 0x0020)

Definition at line 183 of file vic4.h.

◆ SXA_GOTO_X

#define SXA_GOTO_X (   cw)    ((cw) & 0x1000)

Definition at line 179 of file vic4.h.

◆ SXA_HORIZONTAL_FLIP

#define SXA_HORIZONTAL_FLIP (   cw)    ((cw) & 0x4000)

Definition at line 177 of file vic4.h.

◆ SXA_TRIM_RIGHT_BIT3

#define SXA_TRIM_RIGHT_BIT3 (   cw)    ((cw) & 0x0400)

Definition at line 181 of file vic4.h.

◆ SXA_TRIM_RIGHT_BITS012

#define SXA_TRIM_RIGHT_BITS012 (   sw)    ((sw) >> 13)

Definition at line 175 of file vic4.h.

◆ SXA_VERTICAL_FLIP

#define SXA_VERTICAL_FLIP (   cw)    ((cw) & 0x8000)

Definition at line 176 of file vic4.h.

◆ TEXTURE_HEIGHT

#define TEXTURE_HEIGHT   625

Definition at line 42 of file vic4.h.

◆ TEXTURE_WIDTH

#define TEXTURE_WIDTH   800

Definition at line 41 of file vic4.h.

◆ VIC2_BITMAP_ADDR

#define VIC2_BITMAP_ADDR   ((CHARSET_ADDR) & 0xFFE000)

Definition at line 138 of file vic4.h.

◆ VIC2_IOMODE

#define VIC2_IOMODE   0

Definition at line 23 of file vic4.h.

◆ VIC3_ATTR_BLINK

#define VIC3_ATTR_BLINK (   c)    ((c) & 0x1)

Definition at line 166 of file vic4.h.

◆ VIC3_ATTR_BOLD

#define VIC3_ATTR_BOLD (   c)    ((c) & 0x4)

Definition at line 168 of file vic4.h.

◆ VIC3_ATTR_REVERSE

#define VIC3_ATTR_REVERSE (   c)    ((c) & 0x2)

Definition at line 167 of file vic4.h.

◆ VIC3_ATTR_UNDERLINE

#define VIC3_ATTR_UNDERLINE (   c)    ((c) & 0x8)

Definition at line 169 of file vic4.h.

◆ VIC3_IOMODE

#define VIC3_IOMODE   1

Definition at line 24 of file vic4.h.

◆ VIC4_BLINK_INTERVAL

#define VIC4_BLINK_INTERVAL   30

Definition at line 52 of file vic4.h.

◆ VIC4_IOMODE

#define VIC4_IOMODE   3

Definition at line 26 of file vic4.h.

◆ VIC_BAD_IOMODE

#define VIC_BAD_IOMODE   2

Definition at line 25 of file vic4.h.

Function Documentation

◆ vic4_close_frame_access()

void vic4_close_frame_access ( void  )

Definition at line 217 of file vic4.c.

◆ vic4_open_frame_access()

void vic4_open_frame_access ( void  )

Definition at line 373 of file vic4.c.

◆ vic4_render_scanline()

int vic4_render_scanline ( void  )

Definition at line 1462 of file vic4.c.

◆ vic_init()

void vic_init ( void  )

Definition at line 173 of file vic4.c.

◆ vic_read_reg()

Uint8 vic_read_reg ( unsigned int  addr)

◆ vic_reset()

void vic_reset ( void  )

Definition at line 143 of file vic4.c.

◆ vic_write_reg()

void vic_write_reg ( unsigned int  addr,
Uint8  data 
)

Definition at line 539 of file vic4.c.

Here is the caller graph for this function:

Variable Documentation

◆ c128_d030_reg

Uint8 c128_d030_reg

Definition at line 49 of file vic4.c.

◆ iomode_names

const char* iomode_names[4]

Definition at line 37 of file vic4.c.

◆ vic4_disallow_video_std_change

int vic4_disallow_video_std_change

Definition at line 90 of file vic4.c.

◆ vic_chrp_legacy

int vic_chrp_legacy

Definition at line 246 of file vic4.h.

◆ vic_iomode

int vic_iomode

Definition at line 44 of file vic4.c.

◆ vic_readjust_sdl_viewport

int vic_readjust_sdl_viewport

Definition at line 89 of file vic4.c.

◆ vic_registers

Uint8 vic_registers[]

Definition at line 43 of file vic4.c.

◆ vic_sprp_legacy

int vic_sprp_legacy

Definition at line 246 of file vic4.h.

◆ vic_vidp_legacy

int vic_vidp_legacy

◆ videostd_1mhz_cycles_per_scanline

float videostd_1mhz_cycles_per_scanline

Definition at line 85 of file vic4.c.

◆ videostd_changed

int videostd_changed

Definition at line 86 of file vic4.c.

◆ videostd_frametime

int videostd_frametime

Definition at line 84 of file vic4.c.

◆ videostd_id

Uint8 videostd_id

Definition at line 82 of file vic4.c.

◆ videostd_name

const char* videostd_name

Definition at line 83 of file vic4.c.

vic_registers
Uint8 vic_registers[]
Definition: vic4.c:43
Uint8
uint8_t Uint8
Definition: fat32.c:51
x
int x
Definition: console.c:27
Uint16
uint16_t Uint16
Definition: fat32.c:50