Skip to content

Commit fb221e9

Browse files
committed
Use 32BPP
1 parent 272d29e commit fb221e9

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

FreeDOGameCore.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030

3131
@class OERingBuffer;
3232

33-
#define SCREEN_WIDTH 320
34-
#define SCREEN_HEIGHT 240
35-
36-
3733
struct VolumeHeader // 132 bytes
3834
{
3935
Byte recordType; // 1 byte
@@ -137,13 +133,4 @@ unsigned char nvramhead[]=
137133

138134
OE_EXPORTED_CLASS
139135
@interface FreeDOGameCore : OEGameCore
140-
{
141-
@public
142-
char *videoBuffer;
143-
int videoWidth, videoHeight;
144-
NSString *romName;
145-
double sampleRate;
146-
}
147-
148-
149136
@end

FreeDOGameCore.mm

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)