diff --git a/gr-sim/split_screen/split_screen.c b/gr-sim/split_screen/split_screen.c index 6af8bd17..d8843e85 100644 --- a/gr-sim/split_screen/split_screen.c +++ b/gr-sim/split_screen/split_screen.c @@ -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; + } } diff --git a/gr-sim/tfv/tfv_sprites.c b/gr-sim/tfv/tfv_sprites.c index a38d11a5..fc6f84cc 100644 --- a/gr-sim/tfv/tfv_sprites.c +++ b/gr-sim/tfv/tfv_sprites.c @@ -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, +}; diff --git a/gr-sim/tfv/tfv_sprites.h b/gr-sim/tfv/tfv_sprites.h index bb5839c5..fb081a23 100644 --- a/gr-sim/tfv/tfv_sprites.h +++ b/gr-sim/tfv/tfv_sprites.h @@ -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[];