2020-11-22 09:36:28 +00:00
|
|
|
#include "linux/videobuffer.h"
|
|
|
|
|
|
|
|
#include "StdAfx.h"
|
|
|
|
#include "Video.h"
|
|
|
|
#include "Frame.h"
|
|
|
|
#include "NTSC.h"
|
|
|
|
|
|
|
|
void VideoBufferInitialize()
|
|
|
|
{
|
2020-11-30 13:38:56 +00:00
|
|
|
static_assert(sizeof(bgra_t) == 4, "Invalid size of bgra_t");
|
2020-11-22 09:36:28 +00:00
|
|
|
VideoResetState();
|
2020-11-30 13:38:56 +00:00
|
|
|
|
|
|
|
const int numberOfPixels = GetFrameBufferWidth() * GetFrameBufferHeight();
|
|
|
|
g_pFramebufferbits = static_cast<uint8_t *>(calloc(sizeof(bgra_t), numberOfPixels));
|
2020-11-22 09:36:28 +00:00
|
|
|
NTSC_VideoInit(g_pFramebufferbits);
|
|
|
|
}
|
|
|
|
|
|
|
|
void VideoBufferDestroy()
|
|
|
|
{
|
|
|
|
free(g_pFramebufferbits);
|
|
|
|
g_pFramebufferbits = nullptr;
|
|
|
|
NTSC_Destroy();
|
|
|
|
}
|