Compare commits
3 Commits
15757c40c7
...
b1d566e589
Author | SHA1 | Date |
---|---|---|
Lephenixnoir | b1d566e589 | |
Lephenixnoir | 29fbc5cd8a | |
redoste | 21b261d0c9 |
|
@ -26,6 +26,8 @@ set(SOURCES
|
|||
src/gint/dsp.c
|
||||
src/gint/dsp.s
|
||||
src/gint/dump.c
|
||||
src/gint/gdb.S
|
||||
src/gint/gdb.c
|
||||
src/gint/gray.c
|
||||
src/gint/image.c
|
||||
src/gint/keyboard.c
|
||||
|
@ -75,6 +77,7 @@ set(ASSETS_fx
|
|||
assets-fx/img/opt_gint_cpumem.png
|
||||
assets-fx/img/opt_gint_dma.png
|
||||
assets-fx/img/opt_gint_drivers.png
|
||||
assets-fx/img/opt_gint_gdb.png
|
||||
assets-fx/img/opt_gint_gray.png
|
||||
assets-fx/img/opt_gint_keyboard.png
|
||||
assets-fx/img/opt_gint_kmalloc.png
|
||||
|
@ -122,7 +125,7 @@ fxconv_declare_assets(${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
|
|||
|
||||
add_executable(gintctl ${SOURCES} ${ASSETS_${FXSDK_PLATFORM}})
|
||||
target_compile_options(gintctl PRIVATE
|
||||
-Wall -Wextra -Os)
|
||||
-Wall -Wextra -Os -g)
|
||||
target_link_options(gintctl PRIVATE
|
||||
-Wl,-Map=map -Wl,--print-memory-usage)
|
||||
target_include_directories(gintctl PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
|
@ -28,6 +28,7 @@ extern bopti_image_t
|
|||
img_opt_gint_bopti,
|
||||
img_opt_gint_cpumem,
|
||||
img_opt_gint_drivers,
|
||||
img_opt_gint_gdb,
|
||||
img_opt_gint_gray,
|
||||
img_opt_gint_keyboard,
|
||||
img_opt_gint_kmalloc,
|
||||
|
|
|
@ -71,4 +71,7 @@ void gintctl_gint_gray(void);
|
|||
void gintctl_gint_grayrender(void);
|
||||
|
||||
|
||||
/* gintctl_gint_gdb(): GDB remote serial protocol */
|
||||
void gintctl_gint_gdb(void);
|
||||
|
||||
#endif /* GINTCTL_GINT */
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
.text
|
||||
.global _gintctl_gint_gdb_bank1_test
|
||||
|
||||
_gintctl_gint_gdb_bank1_test:
|
||||
// SR.RB = 0
|
||||
stc sr, r2
|
||||
mov r2, r1
|
||||
mov.l .sr_mask, r0
|
||||
or r0, r1
|
||||
ldc r1, sr
|
||||
|
||||
// Now SR.RB = 1
|
||||
mov #0x13, r3
|
||||
mov #0x37, r4
|
||||
shll8 r3
|
||||
or r3, r4
|
||||
ldc r4, R0_BANK
|
||||
|
||||
stc R2_BANK, r2
|
||||
ldc r2, sr
|
||||
// Now SR.RB = 0
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 4
|
||||
.sr_mask: .long (1 << 29)
|
|
@ -0,0 +1,106 @@
|
|||
#include <gint/display.h>
|
||||
#include <gint/gdb.h>
|
||||
#include <gint/mpu/power.h>
|
||||
#include <gint/mpu/ubc.h>
|
||||
#include <gint/ubc.h>
|
||||
#include <gint/config.h>
|
||||
|
||||
#include <gintctl/assets.h>
|
||||
#include <gintctl/gint.h>
|
||||
#include <gintctl/util.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef FXCG50
|
||||
static void val(int y, const char *name, uint32_t value)
|
||||
{
|
||||
dtext(4, 20 + y*12, C_BLACK, name);
|
||||
dprint(92, 20 + y*12, C_BLACK, "%08X", value);
|
||||
}
|
||||
#else
|
||||
static void val(int y, const char *name, uint32_t value)
|
||||
{
|
||||
int px = 64 * (y / 8);
|
||||
int py = 8 + 6 * (y % 8);
|
||||
dtext(px, py, C_BLACK, name);
|
||||
dprint(px+30, py, C_BLACK, "%08X", value);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define reg(y,n,v) val(y,n,v.lword)
|
||||
|
||||
extern int (*gint_exc_catcher)(uint32_t code);
|
||||
|
||||
int gintctl_gint_gdb_bank1_test(void);
|
||||
|
||||
void gintctl_gdb_dbgprint(void)
|
||||
{
|
||||
fprintf(stderr, "debug=%d\n", 73);
|
||||
}
|
||||
|
||||
void gintctl_gint_gdb(void)
|
||||
{
|
||||
int key = 0;
|
||||
int ret = -1;
|
||||
|
||||
gdb_start_on_exception();
|
||||
gdb_redirect_streams(false, true);
|
||||
|
||||
while (key != KEY_EXIT) {
|
||||
dclear(C_WHITE);
|
||||
row_title(GINT_HW_SWITCH("GDB", "GDB remote serial protocol"));
|
||||
|
||||
#if GINT_RENDER_MONO
|
||||
dimage(0, 56, &img_opt_gint_gdb);
|
||||
#elif GINT_RENDER_RGB
|
||||
fkey_action(6, "TRAP");
|
||||
fkey_action(5, "PANICR");
|
||||
fkey_action(4, "PANICW");
|
||||
fkey_action(3, "I/O");
|
||||
fkey_action(1, "BANK 1");
|
||||
#endif
|
||||
|
||||
font_t const *old_font = dfont(_(&font_mini, dfont_default()));
|
||||
reg(0, _("MSTP...", "MSTPCR0"), SH7305_POWER.MSTPCR0);
|
||||
reg(1, "CBR0", SH7305_UBC.CBR0);
|
||||
reg(2, "CRR0", SH7305_UBC.CRR0);
|
||||
val(3, "CAR0", SH7305_UBC.CAR0);
|
||||
val(4, "CAMR0", SH7305_UBC.CAMR0);
|
||||
reg(5, "CBR1", SH7305_UBC.CBR1);
|
||||
reg(6, "CRR1", SH7305_UBC.CRR1);
|
||||
val(7, "CAR1", SH7305_UBC.CAR1);
|
||||
val(8, "CAMR1", SH7305_UBC.CAMR1);
|
||||
val(9, "CDR1", SH7305_UBC.CDR1);
|
||||
val(10, "CDMR1", SH7305_UBC.CDMR1);
|
||||
reg(11, "CETR1", SH7305_UBC.CETR1);
|
||||
reg(12, "CCMFR", SH7305_UBC.CCMFR);
|
||||
reg(13, "CBCR", SH7305_UBC.CBCR);
|
||||
val(14, "DBR", (uint32_t) ubc_getDBR());
|
||||
|
||||
#ifdef FX9860G
|
||||
val(15, "ret", ret);
|
||||
#endif
|
||||
#ifdef FXCG50
|
||||
dprint(176, 20, C_BLACK, "ret: %d", ret);
|
||||
dprint(176, 32, C_BLACK, "exc_catcher: %p", gint_exc_catcher);
|
||||
#endif
|
||||
|
||||
dfont(old_font);
|
||||
dupdate();
|
||||
|
||||
key_event_t ev = gintctl_getkey();
|
||||
key = ev.key;
|
||||
|
||||
volatile uint32_t* miss = (void*)0x41414140;
|
||||
if (key == KEY_F6) {
|
||||
__asm__("trapa #42");
|
||||
} else if (key == KEY_F5) {
|
||||
ret = *miss;
|
||||
} else if (key == KEY_F4) {
|
||||
*miss = 0x1337;
|
||||
} else if (key == KEY_F3) {
|
||||
fprintf(stderr, "debug=%d\n", 42);
|
||||
} else if (key == KEY_F1) {
|
||||
ret = gintctl_gint_gdb_bank1_test();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
#define __BSD_VISIBLE 1
|
||||
#include <gint/display.h>
|
||||
#include <gint/keyboard.h>
|
||||
#include <gint/config.h>
|
||||
#include <gint/video.h>
|
||||
#include <gintctl/util.h>
|
||||
#include <math.h>
|
||||
|
||||
|
@ -29,7 +31,7 @@ void gintctl_gint_render(void)
|
|||
dclear(C_WHITE);
|
||||
drect_border(1, 1, DWIDTH-2, DHEIGHT-2, C_NONE, 1, C_BLACK);
|
||||
|
||||
#ifdef FXCG50
|
||||
#if GINT_RENDER_RGB
|
||||
drect_border(3, 3, DWIDTH-4, DHEIGHT-4, C_NONE, 1, C_BLACK);
|
||||
#endif
|
||||
|
||||
|
@ -79,6 +81,12 @@ void gintctl_gint_render(void)
|
|||
dcircle(x4+w1/2, y3, r, fill2, C_NONE);
|
||||
|
||||
dupdate();
|
||||
|
||||
#if GINT_HW_CG
|
||||
extern image_t gint_gdb_icons_rgb565;
|
||||
video_update(0, 0, &gint_gdb_icons_rgb565, 0);
|
||||
#endif
|
||||
|
||||
if(getkey().key == KEY_EXIT)
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ struct menu menu_gint = {
|
|||
#if GINT_RENDER_MONO
|
||||
{ "Gray rendering", gintctl_gint_grayrender, 0 },
|
||||
#endif
|
||||
{ "GDB", gintctl_gint_gdb, MENU_SH4_ONLY },
|
||||
{ NULL, NULL, 0 },
|
||||
}};
|
||||
|
||||
|
|
Loading…
Reference in New Issue