Adding more documentation.
This commit is contained in:
parent
9a72365994
commit
663a7622ff
|
@ -9,28 +9,72 @@
|
|||
|
||||
struct msMultiplayerController;
|
||||
|
||||
/**
|
||||
* The struct representing the controller for a single mgba instance.
|
||||
*/
|
||||
struct msCoreController {
|
||||
//! The multiplayer instance. (Unused currently.)
|
||||
struct msMultiplayerController *multiplayer;
|
||||
//! The mCoreThread containing the current game.
|
||||
struct mCoreThread threadContext;
|
||||
//! The output image buffer.
|
||||
color_t *outputBuffer;
|
||||
//! The width of the buffer.
|
||||
unsigned int stride;
|
||||
//! The savestate to load on boot.
|
||||
struct VFile *saveState;
|
||||
};
|
||||
|
||||
/**
|
||||
* Loads a game and returns a msCoreController
|
||||
* @param rom The byte array of the rom.
|
||||
* @param rom_len The size of the previous parameter.
|
||||
* @param state The savestate byte array.
|
||||
* @param state_len The size of the savestate.
|
||||
* @param data The session object.
|
||||
* @return The created controller.
|
||||
*/
|
||||
struct msCoreController *
|
||||
msCoreControllerLoadGame (const unsigned char *rom, size_t rom_len,
|
||||
const unsigned char *state, size_t state_len,
|
||||
struct msClientConnectionData *const data);
|
||||
|
||||
/**
|
||||
* Ends the life of msCoreController.
|
||||
* @param controllerPtr The pointer to the pointer to msCoreController.
|
||||
*/
|
||||
void
|
||||
msCoreControllerDestroy(struct msCoreController **controller_ptr);
|
||||
msCoreControllerDestroy(struct msCoreController **controllerPtr);
|
||||
|
||||
/**
|
||||
* Creates a new msCoreController.
|
||||
* @param core The mCore to load in the threadContext.
|
||||
* @param data The current session.
|
||||
* @return The created controller.
|
||||
*/
|
||||
struct msCoreController *
|
||||
msCoreControllerNew (struct mCore *core, struct msClientConnectionData *const data);
|
||||
|
||||
/**
|
||||
* Starts the thread for this coreController
|
||||
* @param coreController This object.
|
||||
*/
|
||||
void
|
||||
msCoreControllerThreadStart (struct msCoreController *const core_controller);
|
||||
msCoreControllerThreadStart (struct msCoreController *const coreController);
|
||||
|
||||
/**
|
||||
* Sets a callback to be executed on every frame.
|
||||
* @param self This object.
|
||||
* @param callback The subroutine to execute.
|
||||
*/
|
||||
void
|
||||
msCoreControllerSetFrameCallback(struct msCoreController *const self, void(*callback)(struct mCoreThread *));
|
||||
|
||||
/**
|
||||
* Sets a subroutine to be executed on the start of the threadContext.
|
||||
* @param self This object.
|
||||
* @param callback The subroutine to be executed.
|
||||
*/
|
||||
void
|
||||
msCoreControllerSetStartCallback(struct msCoreController *const self, void(*callback)(struct mCoreThread *));
|
||||
#endif
|
||||
|
|
|
@ -46,11 +46,11 @@ msPacketHelloHandle(const struct msPacket *packet, struct msPacketHello *hello,
|
|||
/**
|
||||
* Retrieves the msPacketHello contained in the packet raw_data.
|
||||
* @param packet The packet containing msPacketHello, should have PACKET_GET_HELLO as its id.
|
||||
* @param client_fd The source of this packet.
|
||||
* @param clientFd The source of this packet.
|
||||
* @param data This session.
|
||||
* @return The success status.
|
||||
*/
|
||||
bool
|
||||
msPacketHelloGet(const struct msPacket *packet, int client_fd,
|
||||
msPacketHelloGet(const struct msPacket *packet, int clientFd,
|
||||
struct msClientConnectionData *const data);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue