1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-29 16:51:10 +00:00
C02/vcs/humans.c02

67 lines
1.8 KiB
Plaintext
Raw Normal View History

2017-07-01 03:02:26 +00:00
/* Atari VCS 2 Line Kernel Test` */
#pragma origin $F800 //4k Cartridge
#include <vcshead.h02> //TIA and RIOT Registers
2017-07-01 03:25:32 +00:00
#include <vcsstub.h02> //VCS Program Stub
2017-07-01 03:02:26 +00:00
#include <vcslib.h02> //VCS Library Routines
#include <score2.h02> //Two Player Score Kernel
#include <timerbar.h02> //Two Player Score Kernel
2017-07-01 03:02:26 +00:00
#include <k2line.h02> //Two Line Game Kernel
2017-07-01 03:25:32 +00:00
//TIA Register Bit Masks
#define CLEAR = 0
#define SET = $0B
//Console Switch Bit Masks
#define P1DIFF = $80 //Player 1 Difficulty
#define P0DIFF = $40 //Player 0 Difficulty
//Constants Required by timerbar.h02
#define TMRCLR = $64
2017-07-01 03:25:32 +00:00
//Constants Required by k2line.h02
2017-07-01 03:02:26 +00:00
#define P0HGHT = 10 //Player 0 Height
#define P1HGHT = 10 //Player 1 Height
//Color Table
char colors = {$86, $C6, $46, $00, $0E, $06, $0A, $00};
//Human Shaped Player Graphics
char human = {%00011100, %00011000, %00011000, %00011000, %01011010,
%01011010, %00111100, %00000000, %00011000, %00011000};
zeropage char frame; //Frame Counter
2017-07-01 03:02:26 +00:00
/* Setup Code */
void setup() {
setclr(&colors); //Set Color Table
initmr(); //Initialize Timer Bar
2017-07-01 03:02:26 +00:00
}
/* Vertical Blank Code */
void vrtblk() {
scrprp(); //Prepare Score For Display
2017-07-01 03:02:26 +00:00
posobj(0,0); //Set P0 X-Position
p0prep(175, &human); //Set P0 Y-Position & Graphics Pointer
2017-07-01 03:02:26 +00:00
posobj(8,1); //Set P1 X-Position
p1prep(175, &human); //Set P1 Y-Position & Graphics Pointer
2017-07-01 03:02:26 +00:00
}
/* Execute Kernel Code */
void kernel() {
scrdsp(); //Display Scores
dsptmr(); //Display Timer Bar
dsplns(); //Display Playfield and Objects
2017-07-01 03:02:26 +00:00
}
/* Execute Overscan Code */
void ovrscn() {
frame++;
if (!frame & 7) { //Decrement Timer Every X Frames
if (!dectmr()) initmr(); //Reset Timer if It Runs Out
}
2017-07-01 03:02:26 +00:00
}
#include <digits.h02> //Digit Graphics
#include <vcsfoot.h02> //Finalization Code