b8 P D°J€€@€P€þÿü@Ï€.text€€pL .rdatapL€pL€`pl.dataÐM€ÐM€pÐm@.sdata@O€@O€À@o.sbssP€P€.bss P€ P€øP€C 1 #define BRA 2 #define SKID_CONST 1 #define CAM_PAN_SPEED 3 #define CAM_RETURN_SPEED 7 #define CAR_MEM_ADDR 0x80090000 #define ROAD_TEX_MEM_ADDR 0x800923A0 #define GRASS_TEX_MEM_ADDR 0x800943E0 #define CORNER_OUT_TEX_MEM_ADDR 0x80096420 #define CORNER_IN_TEX_MEM_ADDR 0x80098460 #define ROAD_MEM_ADDR 0x8009A4A0 #define GRASS_MEM_ADDR 0x8009A510 #define CORNER1_MEM_ADDR 0x8009A580 #define CORNER2_MEM_ADDR 0x8009A5F0 #define CORNER3_MEM_ADDR 0x8009A660 #define CORNER4_MEM_ADDR 0x8009A6D0 #define CORNER1a_MEM_ADDR 0x8009A740 #define CORNER2a_MEM_ADDR 0x8009A7B0 #define CORNER3a_MEM_ADDR 0x8009A820 #define CORNER4a_MEM_ADDR 0x8009A890 #define ARROW_TEX_MEM_ADDR 0x8009A900 //#define FLAG_TEX_MEM_ADDR 0x8009B140 #define ARROW1_R_MEM_ADDR 0x8009B180 #define ARROW1_L_MEM_ADDR 0x8009B2B0 #define ARROW2_R_MEM_ADDR 0x8009B3E0 #define ARROW2_L_MEM_ADDR 0x8009B510 #define START_FLAG_MEM_ADDR 0x8009B640 #define VH_MEM_ADDR (u_char *)0x8009B770 #define VB_MEM_ADDR (u_char *)0x8009CD90 #define SPRITE_TEX_MEM_ADDR 0x800A5890 #define BG_TEX_MEM_ADDR 0x800A78D0 #define CARROT_MEM_ADDR 0x800AFAF0 #define APPLE_MEM_ADDR 0x800B1584 #define TITLE_TEX_MEM_ADDR 0x800B2680 #define BG2_TEX_MEM_ADDR 0x800BA9A0 #define FLAG_TEX_MEM_ADDR 0x800C2BC0 void StoreScreen (void); // stores screen as bona fide TIM file; // use siocons Dsave command to transfer directly to PC file // This stolen directly from sample\japanese\sscreen void StoreScreen (void) { //#if STORING_SCREEN u_long* destination; int x, y, w, h; RECT rect; destination = (u_long *) 0x80100000; x = y = 0; // top left of frame buffer w = SCREEN_WIDTH; h = SCREEN_HEIGHT; *(destination+0) = 0x00000010; /* ID */ *(destination+1) = 0x00000002; /* FLAG(15bit Direct,No Clut) */ *(destination+2) = (w*h/2+3)*4; /* pixel bnum */ *(destination+3) = ((0 & 0xffff) << 16) | (640 & 0xffff); /* pixel DX,DY: at 640, 0 */ *(destination+4) = ((h & 0xffff) << 16) | (w & 0xffff); /* pixel W,H */ // NO CLUT since 16-bit mode used rect.x = x; rect.y = y; rect.w = w; rect.h = h; DrawSync(0); StoreImage(&rect, destination+5); printf("\n\nPress [F10][F4] for dsave, to get screen picture\n"); printf("Dsave[0]: filename %08x %x\n\n\n", destination, (w*h/2+5)*4); DrawSync(0); VSync(0); //#endif } /******************************** STRUCTURES ********************************/ typedef struct { GsDOBJ2 gsObjectHandler; GsCOORDINATE2 gsObjectCoord; SVECTOR rotation; long accel; long lapCount; long startLapTimer; long resetLapTimer; long lapTimer; long lapTimeSec; long lapTimeTSec; long lastLapTimeSec; long lastLapTimeTSec; long fastestLapTimeSec; long fastestLapTimeTSec; long totalTSecLast; long totalTSecFastest; long diffSec; long diffTSec; }PlayerStructType0; typedef struct { GsDOBJ2 gsObjectHandler[MAX_Z][MAX_X]; GsCOORDINATE2 gsObjectCoord[MAX_Z][MAX_X]; unsigned long * lObjectPointer[MAX_Z][MAX_X]; int nTotalModels; }WorldStructType0; /***************************** GLOBAL VARIABLES *******************************/ PlayerStructType0 theCar; PlayerStructType0 theOpponent; WorldStructType0 theWorld; GsSPRITE testSprite; GsSPRITE bgSpriteA; GsSPRITE bgSpriteB; GsSPRITE bg2SpriteA; GsSPRITE bg2SpriteB; GsSPRITE titleSprite; GsBOXF speedBox; GsBOXF speedBar; GsBOXF skidBar; unsignÈÿ½'4¿¯0¾¯!ð €<¯À¯À¯@$¯ð$ ¯Â$C¬Ãb$$C¬Ãb$à ÄdÃ'Â/! eCd$!€€ D¬à b$€$C¬Ãb$ Ãÿÿd0Åÿÿ¤0%dC¬—(§—*§—,§ —.§S  ! (Â'ă$! @ö  !(`€$ $€<ÄL„$?– !(@€‚$C¯>$ $8€„'?– !(@v• ÿÿ$S  ! šò ! H† €<PBŒ! @€!b€€<ð c$!C! !(!0… !8@€<PBŒ! @€!b€€<ð c$!CЉ ! @!èÀ¿¾à½'àÿ½'¿¯¾¯!ð À¯Â@Mn 4€‚¯4€ƒb0@$¯O… €<P"¬€<PBŒ! @€!bÀ ! ‚€!b€€<ðwc$!C˜Š ! @€<PBŒ! @€!b€€<ð c$!C! !(“‰ !0@€<€˜BŒ$ C€<ÔL„$€<€˜¥Œ€ ›¥$$€‚¯w €<@PcŒb$!@€ ›¥$$€‚¯w w €‚@Ì !@ac$ƒ! `€#C€<Ì P"¬UU €‚@Wx g €‚@Uß € ›¥$€‚$C$€<> ›¥$O… €<P"¬€<¹  € „$€<PBŒ! @@!b€ ! ‚@€<PcŒ!(`@ ! ƒ€(!(£À€< ›„$!d!C€<™c$£¯€<ÐP„$€=4096)) segment=1; if(theCar.rotation.vy <-2560 && rotation >=-3548) segment=2; if(theCar.rotation.vy <-1536 && rotation >=-2560) segment=3; if(theCar.rotation.vy <-512 && rotation >=-1536) segment=4; } int LoadTexture (long addr) { RECT um; GsIMAGE tim; GsGetTimInfo((u_long*)(addr+4),&tim); um.x=tim.px; um.y=tim.py; um.w=tim.pw; um.h=tim.ph; LoadImage(&um,tim.pixel); if((tim.pmode>>3)&0x01) { um.x=tim.cx; um.y=tim.cy; um.w=tim.cw; um.h=tim.ch; LoadImage(&um,tim.clut); } DrawSync(0); return 0; } void CollisionTest() { long carPos_x, carPos_z; long carPos2_x, carPos2_z; long oppPos_x, oppPos_z; char c; carPos_x=(theCar.gsObjectCoord.coord.t[0]+1000)/SEPERATION; carPos_z=(theCar.gsObjectCoord.coord.t[2]+1000)/SEPERATION; carPos2_x=(theCar.gsObjectCoord.coord.t[0])/1000; carPos2_z=(theCar.gsObjectCoord.coord.t[2])/1000; oppPos_x=(theOpponent.gsObjectCoord.coord.t[0])/1000; oppPos_z=(theOpponent.gsObjectCoord.coord.t[2])/1000; c=worldGroundData[carPos_x][carPos_z]; if(c=='1' || c=='e' || c=='f' || c=='g' || c=='h') { if(theCar.accel>70) { theCar.accel=theCar.accel/2; if(theCar.accel>70) theCar.accel=70; } } if(carPos2_x == oppPos_x && carPos2_z == oppPos_z) { theCar.accel=theCar.accel/2; if(crashMute==0) { SsUtKeyOff(crashVoice, VAB, 2, 0, 52 ); crashVoice = SsUtKeyOn(VAB, 2, 0, 52, 0, 127, 127); crashMute=1; } } } void LapTimer() { long carPos_x, carPos_z; char c; carPos_x=(theCar.gsObjectCoord.coord.t[0]+1000)/SEPERATION; carPos_z=(theCar.gsObjectCoord.coord.t[2]+1000)/SEPERATION; c=worldGroundData[carPos_x][carPos_z]; if(c=='s' && theCar.lapTimeSec > 10) { theCar.resetLapTimer=1; theCar.lapCount++; } if(theCar.lapCount==1) { theCar.fastestLapTimeSec = theCar.lapTimeSec; theCar.fastestLapTimeTSec = theCar.lapTimeTSec; } if(theCar.resetLapTimer) { theCar.lastLapTimeSec=theCar.lapTimeSec; theCar.lastLapTimeTSec=theCar.lapTimeTSec; theCar.diffSec = theCar.lastLapTimeSec-theCar.fastestLapTimeSec; theCar.diffTSec = theCar.lastLapTimeTSec-theCar.fastestLapTimeTSec; if(theCar.diffTSec < 0) theCar.diffTSec = theCar.diffTSec * -1; if(theCar.lastLapTimeSec < theCar.fastestLapTimeSec) { theCar.fastestLapTimeSec = theCar.lastLapTimeSec; theCar.fastestLapTimeTSec = theCar.lastLapTimeTSec; } else if(theCar.lastLapTimeTSec < theCar.fastestLapTimeTSec && theCar.lastLapTimeSec <= theCar.fastestLapTimeSec) { theCar.fastestLapTimeSec = theCar.lastLapTimeSec; theCar.fastestLapTimeTSec = theCar.lastLapTimeTSec; } theCar.totalTSecLast = (theCar.lastLapTimeSec*10)+theCar.lastLapTimeTSec; theCar.totalTSecFastest = (theCar.fastestLapTimeSec*10)+theCar.fastestLapTimeTSec; theCar.lapTimer=0; theCar.lapTimeSec=0; theCar.lapTimeTSec=0; theCar.resetLapTimer=0; } if(raceStart) { theCar.lapTimer++; if(theCar.lapTimer%5==0) theCar.lapTimeTSec++; if(theCar.lapTimeTSec==10) { theCar.lapTimeSec++; theCar.lapTimeTSec=0; } } FntLoad(960, 256); FntOpen(-150, 100, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 512); //-150,100 if(PLAYING) { FntPrint("lap time %d.%d ",theCar.lapTimeSec, theCar.lapTimeTSec); FntPrint("fastest lap %d.%d ",theCar.fastestLapTimeSec, theCar.fastestLapTimeTSec); if(theCar.totalTSecLast > theCar.totalTSecFastest) FntPrint("+%d.%d", theCar.diffSec, theCar.diffTSec); else FntPrint("%d.%d", theCar.diffSec, theCar.diffTSec); } FntFlush(-1); } void OpponentAI() { //le Press [F10][F4] for dsave, to get screen picture Dsave[0]: filename %08x %x %c StartGame White wins : %d - %d Blue wins : %d - %d \,€ˆ,€°,€Ø,€-€Œ-€¸-€à-€.€0.€D0€d0€¤0€ 1€,1€l1€ì9€„<€=€Œ=€>€(A€”>€(A€(A€(A€(A€(A€(A€(A€(A€(A€(A€(A€(A€(A€?€œ?€ @€¤@€E555H217142777421714F333Gÿÿÿÿ%c Quit ÿÿÿÿÿÿÿÿ@Ï€¡€b