Update pvbemu

This commit is contained in:
Simon Gellis 2024-10-11 20:17:07 -04:00
parent 1b0d2d61b3
commit 062ea1c19a
3 changed files with 4 additions and 7 deletions

View File

@ -3,7 +3,6 @@ build:
@gcc main.c cmdbuf.c hex.c request.c response.c server.c pvbemu/core/vb.c \ @gcc main.c cmdbuf.c hex.c request.c response.c server.c pvbemu/core/vb.c \
-I include -I pvbemu/core \ -I include -I pvbemu/core \
-Werror -std=c90 -Wall -Wextra -Wpedantic \ -Werror -std=c90 -Wall -Wextra -Wpedantic \
-Wno-unused-parameter -Wno-unused-function \
-D _POSIX_C_SOURCE=199309L \ -D _POSIX_C_SOURCE=199309L \
-o ./build/rdb -o ./build/rdb
clean: clean:

2
pvbemu

@ -1 +1 @@
Subproject commit d4ae5f3909fa8f372ff70d11236cb38e4bd43732 Subproject commit 5f563e6cac80d799f6c0251f9f601321e3603ea5

View File

@ -69,11 +69,9 @@ const uint32_t SYSTEM_REGISTERS[] = {
const uint32_t PC_INDEX = 32 + 13; const uint32_t PC_INDEX = 32 + 13;
/* TODO: this should use userdata */
static void *SERVER_POINTER;
static int onExecute(VB *sim, uint32_t address, const uint16_t *code, int length) { static int onExecute(VB *sim, uint32_t address, const uint16_t *code, int length) {
uint32_t i; uint32_t i;
RdbServer *srv = SERVER_POINTER; RdbServer *srv = (RdbServer *)vbGetUserData(sim);
(void)sim; (void)sim;
(void)code; (void)code;
@ -120,8 +118,8 @@ void rdbServerInit(RdbServer *srv, VB *sim) {
srv->running = false; srv->running = false;
srv->brkslen = 0; srv->brkslen = 0;
srv->stopreason = stop_reason_none; srv->stopreason = stop_reason_none;
SERVER_POINTER = srv; vbSetUserData(sim, srv);
vbSetCallback(sim, VB_EXECUTE, (void*)(uint64_t)&onExecute); vbSetExecuteCallback(sim, onExecute);
} }
int rdbServerHandleCommand(RdbServer *srv, CommandBuf *cmd, RdbResponse *res) { int rdbServerHandleCommand(RdbServer *srv, CommandBuf *cmd, RdbResponse *res) {