llvm-mos-sdk
Macros | Typedefs | Enumerations | Functions | Variables
vcslib.h File Reference
#include <atari2600.h>
#include <stdint.h>
Include dependency graph for vcslib.h:

Go to the source code of this file.

Macros

#define set_horiz_pos(objindex, xpos)   _set_horiz_pos(xpos,objindex)
 
#define do_wsync()   __attribute__((leaf)) asm volatile("sta $42 /* WSYNC */");
 
#define apply_hmove()   __attribute__((leaf)) asm volatile("sta $42 /* WSYNC */" "\n" "sta $6a /* HMOVE */");
 
#define P0   0
 
#define P1   1
 
#define M0   2
 
#define M1   3
 
#define BALL   4
 
#define SW_RESET()   ((RIOT.swchb & RESET_MASK) == 0)
 
#define SW_SELECT()   ((RIOT.swchb & SELECT_MASK) == 0)
 
#define SW_COLOR()   ((RIOT.swchb & BW_MASK) != 0)
 
#define SW_P0_PRO()   ((RIOT.swchb & P0_DIFF_MASK) != 0)
 
#define SW_P1_PRO()   ((RIOT.swchb & P1_DIFF_MASK) != 0)
 
#define JOY_UP(plyr)   (!(RIOT.swcha & ((plyr) ? 0x1 : ~MOVE_UP)))
 
#define JOY_DOWN(plyr)   (!(RIOT.swcha & ((plyr) ? 0x2 : ~MOVE_DOWN)))
 
#define JOY_LEFT(plyr)   (!(RIOT.swcha & ((plyr) ? 0x4 : ~MOVE_LEFT)))
 
#define JOY_RIGHT(plyr)   (!(RIOT.swcha & ((plyr) ? 0x8 : ~MOVE_RIGHT)))
 
#define JOY_FIRE(plyr)   !(((plyr) ? TIA.inpt5 : TIA.inpt4) & 0x80)
 
#define COLOR_CONV(color)   (SW_COLOR() ? color : color & 0x0f)
 
#define _CYCLES(lines)   (((lines) * 76) - 13)
 
#define _TIM64(cycles)   (((cycles) >> 6) - (((cycles) & 63) < 12))
 
#define _T1024(cycles)   ((cycles) >> 10)
 
#define VBLANK_TIM64   _TIM64(_CYCLES(37))
 
#define KERNAL_TIM64   _TIM64(_CYCLES(194))
 
#define OVERSCAN_TIM64   _TIM64(_CYCLES(32))
 

Typedefs

typedef unsigned char byte
 
typedef signed char sbyte
 
typedef unsigned short word
 

Enumerations

enum  TIAObject {
  PLAYER_0 =0, PLAYER_1, MISSILE_0, MISSILE_1,
  BALL
}
 

Functions

void kernel_1 (void)
 
void kernel_2 (void)
 
void kernel_3 (void)
 
void kernel_4 (void)
 

Variables

byte objindex
 

Macro Definition Documentation

◆ _CYCLES

#define _CYCLES (   lines)    (((lines) * 76) - 13)

◆ _T1024

#define _T1024 (   cycles)    ((cycles) >> 10)

◆ _TIM64

#define _TIM64 (   cycles)    (((cycles) >> 6) - (((cycles) & 63) < 12))

◆ apply_hmove

#define apply_hmove ( )    __attribute__((leaf)) asm volatile("sta $42 /* WSYNC */" "\n" "sta $6a /* HMOVE */");

◆ BALL

#define BALL   4

◆ COLOR_CONV

#define COLOR_CONV (   color)    (SW_COLOR() ? color : color & 0x0f)

◆ do_wsync

#define do_wsync ( )    __attribute__((leaf)) asm volatile("sta $42 /* WSYNC */");

◆ JOY_DOWN

#define JOY_DOWN (   plyr)    (!(RIOT.swcha & ((plyr) ? 0x2 : ~MOVE_DOWN)))

◆ JOY_FIRE

#define JOY_FIRE (   plyr)    !(((plyr) ? TIA.inpt5 : TIA.inpt4) & 0x80)

◆ JOY_LEFT

#define JOY_LEFT (   plyr)    (!(RIOT.swcha & ((plyr) ? 0x4 : ~MOVE_LEFT)))

◆ JOY_RIGHT

#define JOY_RIGHT (   plyr)    (!(RIOT.swcha & ((plyr) ? 0x8 : ~MOVE_RIGHT)))

◆ JOY_UP

#define JOY_UP (   plyr)    (!(RIOT.swcha & ((plyr) ? 0x1 : ~MOVE_UP)))

◆ KERNAL_TIM64

#define KERNAL_TIM64   _TIM64(_CYCLES(194))

◆ M0

#define M0   2

◆ M1

#define M1   3

◆ OVERSCAN_TIM64

#define OVERSCAN_TIM64   _TIM64(_CYCLES(32))

◆ P0

#define P0   0

◆ P1

#define P1   1

◆ set_horiz_pos

#define set_horiz_pos (   objindex,
  xpos 
)    _set_horiz_pos(xpos,objindex)

◆ SW_COLOR

#define SW_COLOR ( )    ((RIOT.swchb & BW_MASK) != 0)

◆ SW_P0_PRO

#define SW_P0_PRO ( )    ((RIOT.swchb & P0_DIFF_MASK) != 0)

◆ SW_P1_PRO

#define SW_P1_PRO ( )    ((RIOT.swchb & P1_DIFF_MASK) != 0)

◆ SW_RESET

#define SW_RESET ( )    ((RIOT.swchb & RESET_MASK) == 0)

◆ SW_SELECT

#define SW_SELECT ( )    ((RIOT.swchb & SELECT_MASK) == 0)

◆ VBLANK_TIM64

#define VBLANK_TIM64   _TIM64(_CYCLES(37))

Typedef Documentation

◆ byte

typedef unsigned char byte

◆ sbyte

typedef signed char sbyte

◆ word

typedef unsigned short word

Enumeration Type Documentation

◆ TIAObject

enum TIAObject
Enumerator
PLAYER_0 
PLAYER_1 
MISSILE_0 
MISSILE_1 
BALL 

Function Documentation

◆ kernel_1()

void kernel_1 ( void  )

◆ kernel_2()

void kernel_2 ( void  )

◆ kernel_3()

void kernel_3 ( void  )

◆ kernel_4()

void kernel_4 ( void  )

Variable Documentation

◆ objindex

byte objindex