Fixed memory leak in spm package
This commit is contained in:
parent
2e7b1bb480
commit
44ea8baea8
@ -31,6 +31,8 @@
|
||||
_system->setNewFrameCallback([frameBufferSize, self](auto frameBuffer) {
|
||||
_runEmulation = NO;
|
||||
|
||||
CGImageRelease(_frame);
|
||||
|
||||
CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, (void*)frameBuffer, frameBufferSize, NULL);
|
||||
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
|
||||
CGImageRef image = CGImageCreate(nes::Ppu::SCREEN_WIDTH,
|
||||
@ -42,7 +44,7 @@
|
||||
kCGImageAlphaPremultipliedLast,
|
||||
dataProvider,
|
||||
NULL,
|
||||
true,
|
||||
false,
|
||||
kCGRenderingIntentDefault);
|
||||
CGDataProviderRelease(dataProvider);
|
||||
CGColorSpaceRelease(colorspace);
|
||||
|
||||
@ -15,4 +15,8 @@ namespace nes {
|
||||
_data <<= 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
void Controller::poll() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ namespace nes {
|
||||
public:
|
||||
Controller();
|
||||
uint8_t read();
|
||||
virtual void poll() = 0;
|
||||
virtual void poll();
|
||||
|
||||
protected:
|
||||
uint8_t _data;
|
||||
|
||||
@ -51,9 +51,10 @@ namespace nes {
|
||||
// All visible scanlines
|
||||
if (_scanline >= -1 && _scanline < 240) {
|
||||
|
||||
if(_scanline == 0 && _column == 0) {
|
||||
_column = 1;
|
||||
}
|
||||
// ???
|
||||
//if(_scanline == 0 && _column == 0) {
|
||||
// _column = 1;
|
||||
//}
|
||||
|
||||
if (_scanline == -1 && _column == 1) {
|
||||
_status.verticalBlank = 0;
|
||||
|
||||
@ -23,6 +23,7 @@ namespace nes {
|
||||
_cpu = std::make_unique<Cpu>(this);
|
||||
_ppu = std::make_unique<Ppu>();
|
||||
_dma = std::make_unique<Dma>(this, _ppu.get());
|
||||
_controller1 = std::make_shared<Controller>();
|
||||
}
|
||||
|
||||
void System::insertCartridge(const fs::path &path, std::optional<uint16_t> address) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user