Problems with fat August 09, 2010 04:18PM | Registered: 13 years ago Posts: 54 |
Re: Problems with fat August 09, 2010 07:14PM | Admin Registered: 14 years ago Posts: 5,132 |
Re: Problems with fat August 10, 2010 04:35AM | Registered: 14 years ago Posts: 444 |
Re: Problems with fat August 10, 2010 09:22PM | Registered: 13 years ago Posts: 54 |
FILE* file= NULL; fichero = fopen("sd:/apps/robo_tank/saves/data1.save", "r"); if (file != NULL) { rewind(file); fread(&lev, sizeof(float), 1, file); fclose(file); }
void ini(){ fb = 0; first_frame = 1; VIDEO_Init(); CONF_Init(); rmode = VIDEO_GetPreferredMode(NULL); if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) { rmode->viWidth = VI_MAX_WIDTH_PAL - 12; rmode->viXOrigin = ((VI_MAX_WIDTH_PAL - rmode->viWidth) / 2) + 2; } // configure video VIDEO_Configure(rmode); // allocate 2 framebuffers for double buffering frameBuffer[0] =(u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(rmode)); frameBuffer[1] =(u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(rmode)); if(frameBuffer[0] == NULL || frameBuffer[1] == NULL) return; VIDEO_SetNextFramebuffer(frameBuffer[0]); VIDEO_SetBlack(FALSE); VIDEO_Flush(); VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); if(gpfifo == NULL) return; memset(gpfifo,0,DEFAULT_FIFO_SIZE); // init the flipper GX_Init(gpfifo,DEFAULT_FIFO_SIZE); // clears the bg to color and clears the z buffer GXColor background = { 0, 0, 0, 0xff }; GX_SetCopyClear (background, GX_MAX_Z24); // other gx setup yscale = GX_GetYScaleFactor(rmode->efbHeight,rmode->xfbHeight); xfbHeight = GX_SetDispCopyYScale(yscale); GX_SetScissor(0,0,rmode->fbWidth,rmode->efbHeight); GX_SetDispCopySrc(0,0,rmode->fbWidth,rmode->efbHeight); GX_SetDispCopyDst(rmode->fbWidth,xfbHeight); GX_SetCopyFilter(rmode->aa,rmode->sample_pattern,GX_TRUE,rmode->vfilter); GX_SetFieldMode(rmode->field_rendering,((rmode->viHeight==2*rmode->xfbHeight)?GX_ENABLE:GX_DISABLE)); if (rmode->aa) GX_SetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR); else GX_SetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR); GX_SetCullMode(GX_CULL_NONE); GX_CopyDisp(frameBuffer[fb],GX_TRUE); GX_SetDispCopyGamma(GX_GM_1_0); GX_SetViewport(0,0,rmode->fbWidth,rmode->efbHeight,0,1); GX_SetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_CLEAR); GX_SetColorUpdate(GX_ENABLE); GX_SetAlphaUpdate(GX_ENABLE); GX_SetZCompLoc(GX_FALSE); GX_SetClipMode(GX_CLIP_DISABLE); GX_SetZMode (GX_FALSE, GX_LEQUAL, GX_TRUE); GX_SetNumChans(1); GX_SetNumTexGens(1); GX_SetTevOp (GX_TEVSTAGE0, GX_PASSCLR); GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY); VIDEO_ClearFrameBuffer (rmode, frameBuffer[0], COLOR_BLACK); VIDEO_ClearFrameBuffer (rmode, frameBuffer[1], COLOR_BLACK); VIDEO_SetNextFramebuffer (frameBuffer[0]); VIDEO_SetBlack(false); }
Re: Problems with fat August 10, 2010 09:53PM | Moderator Registered: 13 years ago Posts: 5,075 |
Re: Problems with fat August 11, 2010 01:48AM | Registered: 14 years ago Posts: 444 |
Re: Problems with fat August 14, 2010 10:04PM | Registered: 13 years ago Posts: 98 |
I could beat you are not using that - exact - code but just in case... why did you write "fichero" there? Once again I don't think that's the problem, specially because of your description of the problem.Quote
copete23
I don`t know, the code is very simple, to load the file i`m using this:FILE* file= NULL; fichero = fopen("sd:/apps/robo_tank/saves/data1.save", "r"); if (file != NULL) { rewind(file); fread(&lev, sizeof(float), 1, file); fclose(file); }
Re: Problems with fat August 19, 2010 04:18AM | Registered: 13 years ago Posts: 54 |
Re: Problems with fat August 19, 2010 05:21PM | Registered: 14 years ago Posts: 444 |
Re: Problems with fat August 19, 2010 07:19PM | Registered: 13 years ago Posts: 54 |