@@ -74,6 +74,8 @@ @implementation FreeDOGameCore
7474
7575 int fver1,fver2;
7676
77+ uint32_t *videoBuffer;
78+ int videoWidth, videoHeight;
7779 // uintptr_t sampleBuffer[TEMP_BUFFER_SIZE];
7880 int32_t sampleBuffer[TEMP_BUFFER_SIZE];
7981 uint sampleCurrent;
@@ -298,7 +300,7 @@ - (const void *)videoBuffer
298300 struct BitmapCrop bmpcrop;
299301 ScalingAlgorithm sca;
300302 int rw, rh;
301- Get_Frame_Bitmap ((VDLFrame *)frame, videoBuffer, 0 , &bmpcrop, SCREEN_WIDTH, SCREEN_HEIGHT , false , false , false , sca, &rw, &rh);
303+ Get_Frame_Bitmap ((VDLFrame *)frame, videoBuffer, 0 , &bmpcrop, videoWidth, videoHeight , false , true , false , sca, &rw, &rh);
302304 fver1++;
303305 }
304306 }
@@ -308,12 +310,12 @@ - (const void *)videoBuffer
308310
309311- (OEIntRect)screenRect
310312{
311- return OEIntRectMake (0 , 0 , SCREEN_WIDTH, SCREEN_HEIGHT );
313+ return OEIntRectMake (0 , 0 , videoWidth, videoHeight );
312314}
313315
314316- (OEIntSize)bufferSize
315317{
316- return OEIntSizeMake (SCREEN_WIDTH, SCREEN_HEIGHT );
318+ return OEIntSizeMake (videoWidth, videoHeight );
317319}
318320
319321
@@ -351,17 +353,17 @@ - (void)stopEmulation
351353
352354- (GLenum)pixelFormat
353355{
354- return GL_BGR ;
356+ return GL_BGRA ;
355357}
356358
357359- (GLenum)pixelType
358360{
359- return GL_UNSIGNED_BYTE ;
361+ return GL_UNSIGNED_INT_8_8_8_8_REV ;
360362}
361363
362364- (GLenum)internalPixelFormat
363365{
364- return GL_RGB ;
366+ return GL_RGB8 ;
365367}
366368
367369- (NSTimeInterval )frameInterval
@@ -606,7 +608,10 @@ - (void) initVideo
606608 if (videoBuffer)
607609 free (videoBuffer);
608610
609- videoBuffer = (char *)malloc (SCREEN_WIDTH * SCREEN_HEIGHT * 4 );
611+ // HightResMode = 1;
612+ videoWidth = 320 ;
613+ videoHeight = 240 ;
614+ videoBuffer = (uint32_t *)malloc (videoWidth * videoHeight * 4 );
610615 frame = new VDLFrame;
611616 fver2=fver1=0 ;
612617}
0 commit comments