-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp the protocol between the GUI and the emulator.
This commit also provides a new graphical pipeline with shaders for the color correction, and a lot of small improvements here and there.
- Loading branch information
Showing
57 changed files
with
4,508 additions
and
3,613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************\ | ||
** | ||
** This file is part of the Hades GBA Emulator, and is made available under | ||
** the terms of the GNU General Public License version 2. | ||
** | ||
** Copyright (C) 2021-2023 - The Hades Authors | ||
** | ||
\******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "hades.h" | ||
|
||
struct event_header { | ||
int32_t kind; | ||
size_t size; | ||
}; | ||
|
||
struct channel { | ||
struct event_header *events; // An array of events. | ||
size_t length; // The number of event in `events` | ||
size_t size; // The sum of the size of all the events in `events` | ||
size_t allocated_size; // The size of the allocation of `events` | ||
|
||
pthread_mutex_t lock; | ||
pthread_cond_t ready; | ||
}; | ||
|
||
struct channels { | ||
struct channel messages; // Sent by the frontned to the emulator | ||
struct channel notifications; // Sent by the emulator to the frontend | ||
#ifdef WITH_DEBUGGER | ||
struct channel debug; // Sent by the emulator to the debugger | ||
#endif | ||
}; | ||
|
||
/* channel.c */ | ||
void channel_init(struct channel *channel); | ||
void channel_lock(struct channel *channel); | ||
void channel_release(struct channel *channel); | ||
void channel_push(struct channel *channel, struct event_header const *event); | ||
void channel_wait(struct channel *channel); | ||
struct event_header const *channel_next(struct channel const *channel, struct event_header const *event); | ||
void channel_clear(struct channel *channel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/******************************************************************************\ | ||
** | ||
** This file is part of the Hades GBA Emulator, and is made available under | ||
** the terms of the GNU General Public License version 2. | ||
** | ||
** Copyright (C) 2021-2023 - The Hades Authors | ||
** | ||
\******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "hades.h" | ||
#include "gba/gba.h" | ||
|
||
/* | ||
** Messages | ||
*/ | ||
|
||
enum message_kind { | ||
MESSAGE_EXIT, | ||
MESSAGE_RESET, | ||
MESSAGE_RUN, | ||
MESSAGE_PAUSE, | ||
MESSAGE_STOP, | ||
MESSAGE_KEY, | ||
MESSAGE_SPEED, | ||
MESSAGE_QUICKSAVE, | ||
MESSAGE_QUICKLOAD, | ||
|
||
#ifdef WITH_DEBUGGER | ||
MESSAGE_FRAME, | ||
MESSAGE_TRACE, | ||
MESSAGE_STEP_IN, | ||
MESSAGE_STEP_OVER, | ||
MESSAGE_SET_BREAKPOINTS_LIST, | ||
MESSAGE_SET_WATCHPOINTS_LIST, | ||
#endif | ||
|
||
MESSAGE_MAX, | ||
MESSAGE_MIN = 0, | ||
MESSAGE_LEN = MESSAGE_MAX + 1, | ||
}; | ||
|
||
struct message { | ||
struct event_header header; | ||
}; | ||
|
||
struct message_reset { | ||
struct event_header header; | ||
struct launch_config config; | ||
}; | ||
|
||
struct message_speed { | ||
struct event_header header; | ||
uint32_t speed; | ||
}; | ||
|
||
struct message_key { | ||
struct event_header header; | ||
enum keys key; | ||
bool pressed; | ||
}; | ||
|
||
struct message_quickload { | ||
struct event_header header; | ||
uint8_t *data; | ||
size_t size; | ||
}; | ||
|
||
#ifdef WITH_DEBUGGER | ||
|
||
struct message_step { | ||
struct event_header header; | ||
size_t count; | ||
}; | ||
|
||
struct message_trace { | ||
struct event_header header; | ||
size_t count; | ||
void (*tracer_cb)(void *); | ||
void *arg; | ||
}; | ||
|
||
struct message_set_breakpoints_list { | ||
struct event_header header; | ||
struct breakpoint *breakpoints; | ||
size_t len; | ||
}; | ||
|
||
struct message_set_watchpoints_list { | ||
struct event_header header; | ||
struct watchpoint *watchpoints; | ||
size_t len; | ||
}; | ||
|
||
#endif | ||
|
||
/* | ||
** Notifications | ||
*/ | ||
|
||
enum notification_kind { | ||
NOTIFICATION_RESET, | ||
NOTIFICATION_RUN, | ||
NOTIFICATION_PAUSE, | ||
NOTIFICATION_STOP, | ||
|
||
// Only sent to the frontend | ||
NOTIFICATION_QUICKSAVE, | ||
NOTIFICATION_QUICKLOAD, | ||
|
||
// Only sent to the debuger | ||
#ifdef WITH_DEBUGGER | ||
NOTIFICATION_BREAKPOINT, | ||
NOTIFICATION_WATCHPOINT, | ||
NOTIFICATION_BREAKPOINTS_LIST_SET, | ||
NOTIFICATION_WATCHPOINTS_LIST_SET, | ||
#endif | ||
|
||
NOTIFICATION_MAX, | ||
NOTIFICATION_MIN = 0, | ||
NOTIFICATION_LEN = NOTIFICATION_MAX + 1, | ||
}; | ||
|
||
struct notification { | ||
struct event_header header; | ||
}; | ||
|
||
struct notification_quicksave { | ||
struct event_header header; | ||
uint8_t *data; | ||
size_t size; | ||
}; | ||
|
||
#ifdef WITH_DEBUGGER | ||
|
||
struct notification_breakpoint { | ||
struct event_header header; | ||
uint32_t addr; | ||
}; | ||
|
||
struct notification_watchpoint { | ||
struct event_header header; | ||
uint32_t addr; | ||
struct { | ||
uint32_t addr; | ||
uint32_t val; | ||
uint32_t size; | ||
bool write; | ||
} access; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.