diff --git a/gr-sim/gr-sim.c b/gr-sim/gr-sim.c index d115852c..73a241e4 100644 --- a/gr-sim/gr-sim.c +++ b/gr-sim/gr-sim.c @@ -236,6 +236,30 @@ int scrn(unsigned char xcoord, unsigned char ycoord) { return 0; } +int scrn_page(unsigned char xcoord, unsigned char ycoord, int page) { + + unsigned char a,y,c; + + a=ycoord; + y=xcoord; + + c=a&1; + a=a>>1; + gbascalc(a); + ram[GBASH]+=page; + a=ram[y_indirect(GBASL,y)]; + + if (c) { + return a>>4; + } + else { + return a&0xf; + + } + + return 0; +} + static short gr_addr_lookup[24]={ 0x400,0x480,0x500,0x580,0x600,0x680,0x700,0x780, 0x428,0x4a8,0x528,0x5a8,0x628,0x6a8,0x728,0x7a8, diff --git a/gr-sim/gr-sim.h b/gr-sim/gr-sim.h index a5851c1f..eac56ee2 100644 --- a/gr-sim/gr-sim.h +++ b/gr-sim/gr-sim.h @@ -11,6 +11,7 @@ int basic_vlin(int y1, int y2, int at); int gr(void); int bload(char *filename, int address); int scrn(unsigned char xcoord, unsigned char ycoord); +int scrn_page(unsigned char xcoord, unsigned char ycoord, int page); int grsim_unrle(unsigned char *rle_data, int address); int home(void); int grsim_put_sprite_page(int page,unsigned char *sprite_data, int xpos, int ypos); diff --git a/gr-sim/kaleido_sparkle/rainbow.c b/gr-sim/kaleido_sparkle/rainbow.c index a075d125..a7ce99d8 100644 --- a/gr-sim/kaleido_sparkle/rainbow.c +++ b/gr-sim/kaleido_sparkle/rainbow.c @@ -20,11 +20,15 @@ int main(int argc, char **argv) { } color_equals(15); - basic_vlin(0,40,20); + basic_vlin(0,39,20); color_equals(0); - basic_hlin(0,40,20); + basic_hlin(0,39,20); + printf("0: %d, 1: %d, 2: %d, 3: %d\n", + scrn(0,0),scrn(1,1),scrn(2,2),scrn(3,3)); + printf("0: %d, 1: %d, 2: %d, 3: %d\n", + scrn_page(0,0,0),scrn_page(1,1,0),scrn_page(2,2,0),scrn_page(3,3,0)); while(1) { grsim_update(); diff --git a/gr-sim/tfv/tfv.c b/gr-sim/tfv/tfv.c index c1142dbe..377da3dc 100644 --- a/gr-sim/tfv/tfv.c +++ b/gr-sim/tfv/tfv.c @@ -21,7 +21,7 @@ unsigned char steps=0; /* location */ //unsigned char map_x=5; -char tfv_x=15,tfv_y=19; +char tfv_x=15,tfv_y=20; // tfv_y should always be even unsigned char ground_color; char nameo[9]; diff --git a/gr-sim/tfv/tfv_info.c b/gr-sim/tfv/tfv_info.c index b63525b5..5e8c53f7 100644 --- a/gr-sim/tfv/tfv_info.c +++ b/gr-sim/tfv/tfv_info.c @@ -83,8 +83,17 @@ void show_map(void) { //gr_copy(0x800,0x400); color_equals(COLOR_RED); + + printf("plot(%d,%d)\n", + 8+((map_location&0x3)*6)+(tfv_x/6), + 8+(((map_location&0xc)>>2)*6)+(tfv_y/6)); + basic_plot(8+((map_location&0x3)*6)+(tfv_x/6),8+(((map_location&0xc)>>2)*6)+(tfv_y/6)); + + +// basic_plot(8+((map_location&0x3)*6)+(tfv_x/6),8+(((map_location&0xc)>>2)*6)+(tfv_y/6)); + ram[CH]=20; ram[CV]=20; move_and_print(map_info[map_location].name); diff --git a/gr-sim/tfv/tfv_mapinfo.h b/gr-sim/tfv/tfv_mapinfo.h index 8d49bf5a..58076a27 100644 --- a/gr-sim/tfv/tfv_mapinfo.h +++ b/gr-sim/tfv/tfv_mapinfo.h @@ -61,7 +61,7 @@ struct map_info_type map_info[16] = { .e_exit=NOEXIT, .w_exit=ARCTIC_MOUNTAINS, .miny=4, - .ground_color=(COLOR_WHITE|(COLOR_WHITE<<4)), + .ground_color=(COLOR_LIGHTBLUE|(COLOR_LIGHTBLUE<<4)), .land_type=LAND_LIGHTNING, .scatter=SCATTER_NONE, .background_image=harfco_rle, diff --git a/gr-sim/tfv/tfv_worldmap.c b/gr-sim/tfv/tfv_worldmap.c index 5a9abf58..33e41151 100644 --- a/gr-sim/tfv/tfv_worldmap.c +++ b/gr-sim/tfv/tfv_worldmap.c @@ -15,10 +15,6 @@ unsigned char map_location=LANDING_SITE; - -/* In Town */ - - /* Puzzle Room */ /* Get through office */ /* Have to run away? What happens if die? No save game? Code? */ @@ -31,8 +27,6 @@ unsigned char map_location=LANDING_SITE; /* Play music, lightning effects? */ /* TFV only hit for one damage, susie for 100 */ -/* Walk through bushes, beach water */ -/* Make landing a sprite? Stand behind things? */ /* Load background to 0xc00 */ static int load_map_bg(void) { @@ -143,14 +137,6 @@ int world_map(void) { /* Landed */ /************************************************/ - // TODO: - // 4x4 grid of island? - // proceduraly generated? - // can only walk if feet on green/yellow - // should features be sprites? - - // rotate when attacked - gr(); color_equals(COLOR_BLACK); @@ -169,6 +155,11 @@ int world_map(void) { if ((ch=='q') || (ch==27)) break; + if ((ch=='t')) { + for(i=0;i<12;i++) printf("scrn(%d,%d)=%d\n", + tfv_x+1,tfv_y+i,scrn_page(tfv_x+1,tfv_y+i,8)); + } + if ((ch=='w') || (ch==APPLE_UP)) { newy=tfv_y-2; moved=1; @@ -223,7 +214,7 @@ int world_map(void) { if (newx>36) { if (map_info[map_location].e_exit!=NOEXIT) { map_location=map_info[map_location].e_exit; - tfv_x=0; + tfv_x=1; refresh=1; } } @@ -237,7 +228,7 @@ int world_map(void) { else if (newy