mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
A thank you to everyone who helped test the RC to ensure stability. I've uploaded the official v064 release to Google Code. The most important change in this release is the cycle-based PPU renderer; but due to performance reasons the scanline-based renderer remains the default in the Windows binary. If you want to try out the cycle-based renderer, you will need to compile from source for now. Another major change is the introduction of libsnes, which allows one to build bsnes as a shared library that can be used from other programming languages. It is intended both to create a regression testing framework, and to provide API stability for the various projects that use the bsnes core. While I can't guarantee the API to libsnes won't change, I will properly revision it and do everything I can to avoid changing it if possible.
68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
#include "supergameboy.hpp"
|
|
|
|
#ifdef _WIN32
|
|
#define dllexport __declspec(dllexport)
|
|
#else
|
|
#define dllexport
|
|
#endif
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include <interface/interface.cpp>
|
|
|
|
dllexport void sgb_rom(uint8_t *data, unsigned size) {
|
|
supergameboy.romdata = data;
|
|
supergameboy.romsize = size;
|
|
}
|
|
|
|
dllexport void sgb_ram(uint8_t *data, unsigned size) {
|
|
supergameboy.ramdata = data;
|
|
supergameboy.ramsize = size;
|
|
}
|
|
|
|
dllexport void sgb_rtc(uint8_t *data, unsigned size) {
|
|
supergameboy.rtcdata = data;
|
|
supergameboy.rtcsize = size;
|
|
}
|
|
|
|
dllexport bool sgb_init(bool version) {
|
|
return supergameboy.init(version);
|
|
}
|
|
|
|
dllexport void sgb_term() {
|
|
supergameboy.term();
|
|
}
|
|
|
|
dllexport void sgb_power() {
|
|
supergameboy.power();
|
|
}
|
|
|
|
dllexport void sgb_reset() {
|
|
supergameboy.reset();
|
|
}
|
|
|
|
dllexport void sgb_row(unsigned row) {
|
|
supergameboy.row(row);
|
|
}
|
|
|
|
dllexport uint8_t sgb_read(uint16_t addr) {
|
|
return supergameboy.read(addr);
|
|
}
|
|
|
|
dllexport void sgb_write(uint16_t addr, uint8_t data) {
|
|
supergameboy.write(addr, data);
|
|
}
|
|
|
|
dllexport unsigned sgb_run(uint32_t *samplebuffer, unsigned clocks) {
|
|
return supergameboy.run(samplebuffer, clocks);
|
|
}
|
|
|
|
dllexport void sgb_save() {
|
|
supergameboy.save();
|
|
}
|
|
|
|
dllexport void sgb_serialize(nall::serializer &s) {
|
|
supergameboy.serialize(s);
|
|
}
|