Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Macros | Functions | Variables
vic4.c File Reference
#include "xemu/emutools.h"
#include "mega65.h"
#include "xemu/cpu65.h"
#include "vic4.h"
#include "vic4_palette.h"
#include "memory_mapper.h"
#include "hypervisor.h"
#include "configdb.h"
#include "xemu/f011_core.h"
#include "xemu/emutools_files.h"
#include "io_mapper.h"
Include dependency graph for vic4.c:

Go to the source code of this file.

Macros

#define SPRITE_SPRITE_COLLISION
 
#define SPRITE_FG_COLLISION
 
#define display_row_count   vic_registers[0x7B]
 
#define DISPLAY_HEIGHT   ((max_rasters-1)-20)
 
#define TEXT_HEIGHT_200   400
 
#define TEXT_HEIGHT_400   400
 
#define CHARGEN_Y_SCALE_200   2
 
#define CHARGEN_Y_SCALE_400   1
 
#define chargen_y_pixels   0
 
#define TOP_BORDERS_HEIGHT_200   (DISPLAY_HEIGHT - TEXT_HEIGHT_200)
 
#define TOP_BORDERS_HEIGHT_400   (DISPLAY_HEIGHT - TEXT_HEIGHT_400)
 
#define SINGLE_TOP_BORDER_200   (TOP_BORDERS_HEIGHT_200 >> 1)
 
#define SINGLE_TOP_BORDER_400   (TOP_BORDERS_HEIGHT_400 >> 1)
 
#define CASE_VIC_2(n)   case n+0x100
 
#define CASE_VIC_3(n)   case n+0x080
 
#define CASE_VIC_4(n)   case n
 
#define CASE_VIC_ALL(n)   CASE_VIC_2(n): CASE_VIC_3(n): CASE_VIC_4(n)
 
#define CASE_VIC_3_4(n)   CASE_VIC_3(n): CASE_VIC_4(n)
 
#define DO_SPRITE_SPRITE_COLLISION(pos, cond)
 
#define SPRITE_ANY_COLLISION
 
#define DO_SPRITE_FG_COLLISION(pos, cond)
 

Functions

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

Variables

const char * iomode_names [4] = { "VIC2", "VIC3", "BAD!", "VIC4" }
 
Uint8 vic_registers [0x80]
 
int vic_iomode
 
Uint8 c128_d030_reg
 
Uint8 videostd_id = 0xFF
 
const char * videostd_name = "<UNDEF>"
 
int videostd_frametime = NTSC_FRAME_TIME
 
float videostd_1mhz_cycles_per_scanline = 32.0
 
int videostd_changed = 0
 
int vic_readjust_sdl_viewport = 0
 
int vic4_disallow_video_std_change = 1
 

Macro Definition Documentation

◆ CASE_VIC_2

#define CASE_VIC_2 (   n)    case n+0x100

Definition at line 524 of file vic4.c.

◆ CASE_VIC_3

#define CASE_VIC_3 (   n)    case n+0x080

Definition at line 525 of file vic4.c.

◆ CASE_VIC_3_4

#define CASE_VIC_3_4 (   n)    CASE_VIC_3(n): CASE_VIC_4(n)

Definition at line 528 of file vic4.c.

◆ CASE_VIC_4

#define CASE_VIC_4 (   n)    case n

Definition at line 526 of file vic4.c.

◆ CASE_VIC_ALL

#define CASE_VIC_ALL (   n)    CASE_VIC_2(n): CASE_VIC_3(n): CASE_VIC_4(n)

Definition at line 527 of file vic4.c.

◆ chargen_y_pixels

#define chargen_y_pixels   0

Definition at line 99 of file vic4.c.

◆ CHARGEN_Y_SCALE_200

#define CHARGEN_Y_SCALE_200   2

Definition at line 97 of file vic4.c.

◆ CHARGEN_Y_SCALE_400

#define CHARGEN_Y_SCALE_400   1

Definition at line 98 of file vic4.c.

◆ DISPLAY_HEIGHT

#define DISPLAY_HEIGHT   ((max_rasters-1)-20)

Definition at line 94 of file vic4.c.

◆ display_row_count

#define display_row_count   vic_registers[0x7B]

Definition at line 66 of file vic4.c.

◆ DO_SPRITE_FG_COLLISION

#define DO_SPRITE_FG_COLLISION (   pos,
  cond 
)
Value:
do { \
if (is_fg[pos] && (cond)) \
vic_registers[0x1F] |= sprbmask; \
} while (0)

Definition at line 940 of file vic4.c.

◆ DO_SPRITE_SPRITE_COLLISION

#define DO_SPRITE_SPRITE_COLLISION (   pos,
  cond 
)
Value:
do { \
if (cond) { \
const Uint8 sp = is_sprite[pos]; \
is_sprite[pos] = sp | sprbmask; \
if (sp) \
vic_registers[0x1E] |= sp | sprbmask; \
} \
} while (0)

Definition at line 921 of file vic4.c.

◆ SINGLE_TOP_BORDER_200

#define SINGLE_TOP_BORDER_200   (TOP_BORDERS_HEIGHT_200 >> 1)

Definition at line 102 of file vic4.c.

◆ SINGLE_TOP_BORDER_400

#define SINGLE_TOP_BORDER_400   (TOP_BORDERS_HEIGHT_400 >> 1)

Definition at line 103 of file vic4.c.

◆ SPRITE_ANY_COLLISION

#define SPRITE_ANY_COLLISION

Definition at line 930 of file vic4.c.

◆ SPRITE_FG_COLLISION

#define SPRITE_FG_COLLISION

Definition at line 34 of file vic4.c.

◆ SPRITE_SPRITE_COLLISION

#define SPRITE_SPRITE_COLLISION

Definition at line 33 of file vic4.c.

◆ TEXT_HEIGHT_200

#define TEXT_HEIGHT_200   400

Definition at line 95 of file vic4.c.

◆ TEXT_HEIGHT_400

#define TEXT_HEIGHT_400   400

Definition at line 96 of file vic4.c.

◆ TOP_BORDERS_HEIGHT_200

#define TOP_BORDERS_HEIGHT_200   (DISPLAY_HEIGHT - TEXT_HEIGHT_200)

Definition at line 100 of file vic4.c.

◆ TOP_BORDERS_HEIGHT_400

#define TOP_BORDERS_HEIGHT_400   (DISPLAY_HEIGHT - TEXT_HEIGHT_400)

Definition at line 101 of file vic4.c.

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 ( int unsigned  addr)

Definition at line 784 of file vic4.c.

Here is the caller graph for this function:

◆ 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] = { "VIC2", "VIC3", "BAD!", "VIC4" }

Definition at line 37 of file vic4.c.

◆ vic4_disallow_video_std_change

int vic4_disallow_video_std_change = 1

Definition at line 90 of file vic4.c.

◆ vic_iomode

int vic_iomode

Definition at line 44 of file vic4.c.

◆ vic_readjust_sdl_viewport

int vic_readjust_sdl_viewport = 0

Definition at line 89 of file vic4.c.

◆ vic_registers

Uint8 vic_registers[0x80]

Definition at line 43 of file vic4.c.

◆ videostd_1mhz_cycles_per_scanline

float videostd_1mhz_cycles_per_scanline = 32.0

Definition at line 85 of file vic4.c.

◆ videostd_changed

int videostd_changed = 0

Definition at line 86 of file vic4.c.

◆ videostd_frametime

int videostd_frametime = NTSC_FRAME_TIME

Definition at line 84 of file vic4.c.

◆ videostd_id

Uint8 videostd_id = 0xFF

Definition at line 82 of file vic4.c.

◆ videostd_name

const char* videostd_name = "<UNDEF>"

Definition at line 83 of file vic4.c.

Uint8
uint8_t Uint8
Definition: fat32.c:51