From abe68243be152b0238b2d488eeeba0a218688759 Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Tue, 6 Dec 2022 08:02:28 -0500 Subject: [PATCH] prov: video kind of working Signed-off-by: Joseph Mattello --- FreeDOGameCore.mm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/FreeDOGameCore.mm b/FreeDOGameCore.mm index 1d2e8a5..d970239 100644 --- a/FreeDOGameCore.mm +++ b/FreeDOGameCore.mm @@ -295,6 +295,10 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error [self loadBIOSes]; [self initVideo]; + videoBufferA = (uint32_t*)malloc(videoWidth * videoHeight * 4); + videoBufferB = (uint32_t*)malloc(videoWidth * videoHeight * 4); + videoBuffer = videoBufferA; + memset(sampleBuffer, 0, sizeof(int32_t) * TEMP_BUFFER_SIZE); _freedo_Interface(FDP_INIT, (void*)*fdcCallback); @@ -467,14 +471,17 @@ - (void)swapBuffers { } -(BOOL)isDoubleBuffered { - return YES; + return NO; } - - (CGRect)screenRect { return CGRectMake(0, 0, videoWidth, videoHeight); } +- (CGSize)aspectSize { + return CGSizeMake(videoWidth, videoHeight); +} + - (CGSize)bufferSize { return CGSizeMake(videoWidth, videoHeight); } @@ -483,11 +490,19 @@ - (GLenum)pixelFormat { return GL_BGRA; } +- (GLenum)internalPixelFormat { + return GL_BGRA; +} + - (GLenum)pixelType { - return GL_UNSIGNED_INT; + return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; // return GL_UNSIGNED_INT_8_8_8_8_REV; } +- (const void *)videoBuffer { + return [self getVideoBufferWithHint:nil]; +} + #pragma mark - Audio - (double)audioSampleRate { return 44100;