Browse Source

rpcs3: init

master
parent
commit
41173cea96
Signed by: govanify GPG Key ID: DE62E1E2A6145556
3 changed files with 31 additions and 1 deletions
  1. +8
    -0
      bindings/c/c_ffi.cpp
  2. +11
    -1
      bindings/c/c_ffi.h
  3. +12
    -0
      src/pine.h

+ 8
- 0
bindings/c/c_ffi.cpp View File

@ -6,6 +6,8 @@ static std::vector<PINE::Shared::BatchCommand *> batch_commands;
PINE::PCSX2 *pine_pcsx2_new() { return new PINE::PCSX2(); }
PINE::RPCS3 *pine_rpcs3_new() { return new PINE::RPCS3(); }
void pine_initialize_batch(PINE::Shared *v) { return v->InitializeBatch(); }
void pine_free_datastream(char *data) { delete[] data; }
@ -216,4 +218,10 @@ void pine_pcsx2_delete(PINE::PCSX2 *v) {
pine_free_batch_command(i);
delete v;
}
void pine_rpcs3_delete(PINE::RPCS3 *v) {
for (long unsigned int i = 0; i < batch_commands.size(); i++)
pine_free_batch_command(i);
delete v;
}
}

+ 11
- 1
bindings/c/c_ffi.h View File

@ -25,10 +25,15 @@ extern "C" {
#endif
/**
* @see PINE::Shared::PINE::Shared
* @see PINE::PCSX2
*/
EXPORT_LIB PINE::PCSX2 *pine_pcsx2_new();
/**
* @see PINE::RPCS3
*/
EXPORT_LIB PINE::RPCS3 *pine_rpcs3_new();
/**
* @see PINE::Shared::InitializeBatch
*/
@ -121,6 +126,11 @@ EXPORT_LIB void pine_write(PINE::Shared *v, uint32_t address, uint64_t val,
*/
EXPORT_LIB void pine_pcsx2_delete(PINE::PCSX2 *v);
/**
* @see PINE::~RPCS3
*/
EXPORT_LIB void pine_rpcs3_delete(PINE::RPCS3 *v);
/**
* Frees given PINE::Shared::BatchCommand through its int handle. @n
* As the C bindings handle structures for you, you have to tell them when to


+ 12
- 0
src/pine.h View File

@ -1134,4 +1134,16 @@ class PCSX2 : public Shared {
PCSX2(const unsigned int slot = 0)
: Shared((slot == 0) ? 28011 : slot, "pcsx2", (slot == 0)){};
};
class RPCS3 : public Shared {
public:
/**
* RPCS3 session Initializer with a specified slot.
* @param slot Slot to use for this IPC session.
* @see slot
*/
RPCS3(const unsigned int slot = 0)
: Shared((slot == 0) ? 28012 : slot, "rpcs3", (slot == 0)){};
};
}; // namespace PINE

Loading…
Cancel
Save