Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for a C API. #152

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
578447f
Started working on a C API.
eaplatanios Apr 4, 2019
da13cf8
Added support for search structs to the C API.
eaplatanios Apr 4, 2019
beff4ca
Added support for some missing GameData functions to the C API.
eaplatanios Apr 4, 2019
132e1aa
Added support for memory view structs to the C API.
eaplatanios Apr 4, 2019
3f858d2
Added most of the missing functionality to the C API.
eaplatanios Apr 4, 2019
feb9509
Switched to using spaces for indentation.
eaplatanios Apr 4, 2019
d0881e9
Added support for some more of the missing functions to the C API.
eaplatanios Apr 5, 2019
fb4e05d
Added support for one more of the missing functions to the C API.
eaplatanios Apr 5, 2019
e45dea1
Added the last missing functions to the C API.
eaplatanios Apr 5, 2019
c994fb4
Made some fixes.
eaplatanios Apr 5, 2019
485cbe6
Avoided copies.
eaplatanios Apr 5, 2019
4510dc9
Exported the C API symbols.
eaplatanios Apr 5, 2019
5ade211
Changed exception handling in the C API (more principled approaching …
eaplatanios Apr 5, 2019
a1d2e73
Minor edits.
eaplatanios Apr 6, 2019
b9642fe
Minor edits.
eaplatanios Apr 6, 2019
3c12301
Minor edit.
eaplatanios Apr 6, 2019
82250d6
Another small update.
eaplatanios Apr 6, 2019
be16d35
Reproducible bug.
eaplatanios Apr 7, 2019
2b0413e
Made some memory bug fixes.
eaplatanios Apr 7, 2019
ab5a272
Fixed another memory issue.
eaplatanios Apr 7, 2019
c8a1b5f
Fixed yet another memory issue.
eaplatanios Apr 7, 2019
592ef22
Fixed yet another memory issue.
eaplatanios Apr 7, 2019
91512db
Fixed some more memory errors.
eaplatanios Apr 7, 2019
672e244
Fixed Linux compilation error.
eaplatanios Apr 7, 2019
8fd553b
Minor edit.
eaplatanios Apr 7, 2019
9f9b7d4
Some more minor edits.
eaplatanios Apr 8, 2019
d2b063f
Switched to using 'strdup'.
eaplatanios Apr 9, 2019
a3a075f
Made the 'add_definitions' shared across BUILD_PYTHON and BUILD_C.
eaplatanios Apr 13, 2019
706c238
Addressed some of @endrift's comments.
eaplatanios Apr 13, 2019
845a0ac
Addressed the remaining of @endrift's comments.
eaplatanios Apr 13, 2019
0a96f8c
Added support for deleting the obtained emulator screen.
eaplatanios Jul 20, 2019
92316e0
Added some more missing 'delete' functions.
eaplatanios Jul 20, 2019
d3f5b14
Added support for installing the retro C API using pkgconfig.
eaplatanios Jul 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added support for deleting the obtained emulator screen.
eaplatanios committed Jul 20, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
eaplatanios Anthony Platanios
commit 0a96f8c4eb6212f2585d582cfd6237af520bbdde
5 changes: 5 additions & 0 deletions src/retro-c.cpp
Original file line number Diff line number Diff line change
@@ -73,6 +73,11 @@ CEmulatorScreen* emulatorGetScreen(CEmulator* emulator) {
return new CEmulatorScreen {data, (size_t) w, (size_t) h, 3};
}

void emulatorScreenDelete(CEmulatorScreen* screen) {
delete screen->values;
delete screen;
}

double emulatorGetScreenRate(CEmulator* emulator) {
return static_cast<Emulator*>(emulator->emulator)->getFrameRate();
}
1 change: 1 addition & 0 deletions src/retro-c.h
Original file line number Diff line number Diff line change
@@ -117,6 +117,7 @@ void emulatorStep(CEmulator* emulator);
CBytes* emulatorGetState(CEmulator* emulator);
bool emulatorSetState(CEmulator* emulator, CBytes* state);
CEmulatorScreen* emulatorGetScreen(CEmulator* emulator);
void emulatorScreenDelete(CEmulatorScreen* screen);
double emulatorGetScreenRate(CEmulator* emulator);
CEmulatorAudio* emulatorGetAudio(CEmulator* emulator);
double emulatorGetAudioRate(CEmulator* emulator);