tfv: initial credits demo

This commit is contained in:
Vince Weaver 2018-07-02 15:50:09 -04:00
parent fff76cb454
commit c37314374b
3 changed files with 65 additions and 2 deletions

View File

@ -5,8 +5,12 @@
#include "../tfv_zp.h"
#include "../tfv/tfv_sprites.h"
#include "../tfv/tfv_sprites.c"
#include "gr-sim.h"
int main(int argc, char **argv) {
int yy,ch;
@ -55,7 +59,7 @@ int main(int argc, char **argv) {
soft_switch(TXTCLR); // LDA TXTCLR
soft_switch(MIXCLR);
color_equals(2);
color_equals(4);
for(i=28;i<48;i++) {
basic_hlin(0,39,i);
}
@ -103,16 +107,56 @@ int main(int argc, char **argv) {
set_plaid();
int frame=0;
int tree1_x=28,tree1_y=28;
int tree2_x=37,tree2_y=30;
grsim_put_sprite_page(PAGE0,
bird_rider_stand_right,
17,30);
while(1) {
grsim_update();
color_equals(4);
for(i=28;i<48;i++) {
basic_hlin(0,39,i);
}
grsim_put_sprite_page(PAGE0,
small_tree,
tree1_x,tree1_y);
grsim_put_sprite_page(PAGE0,
big_tree,
tree2_x,tree2_y);
if (frame%8>4) {
grsim_put_sprite_page(PAGE0,
bird_rider_stand_right,
17,30);
}
else {
grsim_put_sprite_page(PAGE0,
bird_rider_walk_right,
17,30);
}
ch=grsim_input();
if (ch) break;
usleep(100000);
frame++;
if (frame>31) frame=0;
if (frame%4==0) {
tree2_x--;
if (tree2_x<0) tree2_x=37;
}
if (frame%16==0) {
tree1_x--;
if (tree1_x<0) tree1_x=37;
}
}

View File

@ -402,3 +402,19 @@ unsigned char numbers[10][11]={
},
};
unsigned char small_tree[]={
0x3,0x3,
0x00,0xCC,0x00,
0xCC,0xCC,0xCC,
0x00,0x88,0x00,
};
unsigned char big_tree[]={
0x5,0x5,
0x00,0x00,0xCC,0x00,0x00,
0x00,0xC0,0xCC,0xC0,0x00,
0x00,0xCC,0xCC,0xCC,0x00,
0xc0,0xCC,0xCC,0xCC,0xc0,
0x00,0x00,0x88,0x00,0x00,
};

View File

@ -36,3 +36,6 @@ extern unsigned char spool[];
extern unsigned char numbers[10][11];
extern unsigned char small_tree[];
extern unsigned char medium_tree[];
extern unsigned char big_tree[];