diff --git a/gr-sim/gr-sim.c b/gr-sim/gr-sim.c index 84a188a3..80e0dcf4 100644 --- a/gr-sim/gr-sim.c +++ b/gr-sim/gr-sim.c @@ -766,6 +766,8 @@ int grsim_put_sprite(unsigned char *sprite_data, int xpos, int ypos) { ram[CV]=*ptr; ptr++; + ypos=ypos&0xfe; + while(1) { address=gr_addr_lookup[ypos/2]; address+=xpos; @@ -787,7 +789,7 @@ int grsim_put_sprite(unsigned char *sprite_data, int xpos, int ypos) { ptr++; address++; } - ypos++; + ypos+=2; ram[CV]--; if (ram[CV]==0) break; } @@ -1100,3 +1102,29 @@ void basic_normal(void) { return; } + + +int hlin(int page, int x1, int x2, int at) { + + unsigned short addr; + int i,hi; + + addr=gr_addr_lookup[at/2]; + hi=at&1; + + addr+=(page*4)<<8; + + for(i=x1;i0) y-=2; + if ((ch=='i') || (ch==APPLE_UP)) if (y>20) y-=2; if ((ch=='m') || (ch==APPLE_DOWN)) if (y<39) y+=2; - if ((ch=='j') || (ch==APPLE_LEFT)) if (x>0) x--; - if ((ch=='k') || (ch==APPLE_RIGHT)) if (x<39) x++; + if ((ch=='j') || (ch==APPLE_LEFT)) { + direction--; + if (direction<-1) direction=-1; + } + if ((ch=='k') || (ch==APPLE_RIGHT)) { + direction++; + if (direction>1) direction=1; + } gr_copy(0x800,0x400); - grsim_put_sprite(test_sprite,x,y); + + if (direction==0) grsim_put_sprite(ship_forward,x,y); + if (direction==-1) grsim_put_sprite(ship_left,x,y); + if (direction==1) grsim_put_sprite(ship_right,x,y); grsim_update();