diff --git a/docs.py b/docs.py index 3e61aa7..a5f24fb 100644 --- a/docs.py +++ b/docs.py @@ -20,7 +20,7 @@ TOC_HTAG_LEVELS = {"1", "2"} HOST = "https://bsnk.me" TEMPLATES = "templates" PAGES_BASE = "pages" -STATIC = ["images", "static"] +STATIC = ["images", "static", "mice"] ROOT = os.environ.get("EA_ROOT", "") @@ -43,21 +43,10 @@ SEGA_CONTENTS = { "intro.html": ("Introduction to RingEdge 2", ()), "hardware": ("Hardware", ()), "software": ("Software", { - "pcp.html": "PCP", + "pcp": ("PCP", {"libpcp.html": "libpcp"}), "jvs.html": "JVS", "touch.html": "Touchscreen", - "drivers": ("Device drivers", - #{ - # "columba.html": "columba", - # "mxsram.html": "mxsram", - # "mxhwreset.html": "mxhwreset", - # "mxsuperio.html": "mxsuperio", - # "mxjvs.html": "mxjvs", - # "mxparallel.html": "mxparallel", - # "mxsmbus.html": "mxsmbus", - #} - None - ), + "drivers": ("Device drivers", None), "security": ("Security", { "game.html": "Game encryption", "dongle.html": "Dongles", diff --git a/mice/libpcp.lib b/mice/libpcp.lib new file mode 100644 index 0000000..cf42b74 Binary files /dev/null and b/mice/libpcp.lib differ diff --git a/templates/pages/sega/software/pcp.html b/templates/pages/sega/software/pcp/index.html similarity index 100% rename from templates/pages/sega/software/pcp.html rename to templates/pages/sega/software/pcp/index.html diff --git a/templates/pages/sega/software/pcp/libpcp.html b/templates/pages/sega/software/pcp/libpcp.html new file mode 100644 index 0000000..a019e09 --- /dev/null +++ b/templates/pages/sega/software/pcp/libpcp.html @@ -0,0 +1,74 @@ +{% extends "sega.html" %} +{% block title %}libpcp{% endblock %} +{% block body %} +

libpcp

+

A download for a precompiled libpcp can be found here: libpcp.lib + (7b31fa7a5145b6a945655a970022df8d). The required headers can be found in the micetools source code. +

+ +

Main server section

+

Server setup

+ +

e_pcpa_t pcpaInitStream(pcpa_t *stream)

+

Initialise a pcp stream, allocating memory as needed.

+ +

e_pcpa_t pcpaSetCallbackFuncBuffer(pcpa_t *stream, pcpa_cb_table_t *callback_table, uint callbacks_max) +

+

Assign a callback table to the stream in preperation for callback registration.

+ +

e_pcpa_t pcpaSetCallbackFunc(pcpa_t *stream, char *keyword, pcpa_callback *callback, void *data) +

+

Register a callback. If a command is received where the first keyword matches keyword, + callback is called to process it. The stream is passed as the first argument to the callback, and + data as the second. +

+ +

e_pcpa_t pcpaOpenServerWithBinary(pcpa_t *stream, int open_mode, u_short port, u_short binary_port, + undefined4 param_5)

+

Open the pcp server on port, and prepare to use binary_port for data transfer.

+

Binds to 0.0.0.0 if open_mode is 0, 127.0.0.1 if it is + 1. +

+

param_5 is currently unknown. Pass 300000 for now; I think it's some sort of timeout.

+ +

void pcpaClose(pcpa_t *stream)

+

Close a pcp stream

+ +

Server mainloop

+

e_pcpa_t pcpaServer(pcpa_t *stream, timeout_t timeout_ms)

+

Perform one tick of the server. If no events occure within timeout_ms, this returns.

+ +

Within callbacks

+

Reading commands

+

char* pcpaGetCommand(pcpa_t* pcpa, char* command)

+

Fetch the value for a given key. Returns NULL if the key is not found.

+ +

char* pcpaGetKeyword(pcpa_t* stream, uint keyword_num)

+

Request the keyword at a given index. Useful for fetching the 0-index keyword when the same callback is registered to + multiple keywords.

+ +

Sending responses

+

pcp_send_data_t *pcpaSetSendPacket(pcpa_t *stream, char *keyword, char *value)

+

Begin a response, setting the initial key-value pair.

+ +

pcp_send_data_t *pcpaAddSendPacket(pcpa_t *stream, char *keyword, char *value)

+

Add an additional key-value pair onto the packet being generated.

+ +

e_pcpa_t pcpaSetBinaryMode(pcpa_t *stream, binary_mode_t binary_mode)

+

Set the binary mode to either disabled, receiving, or transmitting data.

+ +

e_pcpa_t pcpaSetBeforeBinaryModeCallBackFunc(pcpa_t *stream, pcpa_callback *callback, void *data)

+

Register a callback to be called before a data transfer commences.

+ +

e_pcpa_t pcpaSetSendBinaryBuffer(pcpa_t *stream, byte *send_buffer, size_t len)

+

Set the buffer to transmit from when performing a server->consumer data transfer. Should usually be called in the + before callback.

+ +

e_pcpa_t pcpaSetRecvBinaryBuffer(pcpa_t *stream, byte *recv_buffer, size_t len)

+

Set the buffer to receive into when performing a consumer->server data transfer. Should usually be called in the + before callback.

+ +

e_pcpa_t pcpaSetAfterBinaryModeCallBackFunc(pcpa_t *stream, pcpa_callback *callback, void *data)

+

Register a callback to be called after a data transfer completes.

+ +{% endblock %} \ No newline at end of file