Skip to content

Commit

Permalink
prov: video kind of working
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Mattello <[email protected]>
  • Loading branch information
JoeMatt committed Dec 6, 2022
1 parent 265ebb3 commit abe6824
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions FreeDOGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit abe6824

Please sign in to comment.