remove irrelevant tests on SH3

This commit is contained in:
Lephe 2021-01-31 17:08:28 +01:00
parent 601dc9ea79
commit d6345db414
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
5 changed files with 53 additions and 32 deletions

View File

@ -12,6 +12,14 @@
struct menuentry {
char const *name;
void (*function)(void);
int flags;
};
enum {
/* SH3-only */
MENU_SH3_ONLY,
/* SH4-only */
MENU_SH4_ONLY,
};
struct menu {
@ -27,6 +35,9 @@ struct menu {
};
/* menu_init(): Initialize a menu list
This function will initialize the menu data and remove entries that are not
available on the current platform?
@menu Any list menu, even uninitialized
@top Number of lines reserved on top (including title on fx9860g)
@bottom Number of lines reserved at bottom */

View File

@ -202,7 +202,7 @@ void gintctl_gint_ram(void)
{ NULL },
};
/* Region count (for the scrolling list on fx-9860G */
/* Region count (for the scrolling list on fx-9860G) */
GUNUSED int region_count = 9;
/* List scroll no fx-9860G */
GUNUSED int scroll = spu_zero();
@ -214,7 +214,7 @@ void gintctl_gint_ram(void)
#ifdef FX9860G
show_region(1, NULL);
for(int i = 0; i < 9; i++)
for(int i = 0; i < region_count; i++)
{
show_region(i+2-scroll, &r[i]);
}

View File

@ -33,46 +33,46 @@
struct menu menu_gint = {
_("gint tests", "gint features and driver tests"), .entries = {
{ "Hardware", gintctl_gint_hardware },
{ "RAM discovery", gintctl_gint_ram },
{ "Hardware", gintctl_gint_hardware, 0 },
{ "RAM discovery", gintctl_gint_ram, MENU_SH4_ONLY },
#ifdef FXCG50
{ "DSP processors", gintctl_gint_dsp },
{ "SPU memory", gintctl_gint_spuram },
{ "DSP processors", gintctl_gint_dsp, 0 },
{ "SPU memory", gintctl_gint_spuram, MENU_SH4_ONLY },
#endif
{ "Memory dump", gintctl_gint_dump },
{ "Switching to OS", gintctl_gint_switch },
{ "TLB management", gintctl_gint_tlb },
{ "Keyboard", gintctl_gint_keyboard },
{ "Timers", gintctl_gint_timer },
{ "Timer callbacks", gintctl_gint_timer_callbacks },
{ "Memory dump", gintctl_gint_dump, 0 },
{ "Switching to OS", gintctl_gint_switch, 0 },
{ "TLB management", gintctl_gint_tlb, 0 },
{ "Keyboard", gintctl_gint_keyboard, 0 },
{ "Timers", gintctl_gint_timer, 0 },
{ "Timer callbacks", gintctl_gint_timer_callbacks, 0 },
#ifdef FXCG50
{ "DMA control", gintctl_gint_dma },
{ "DMA control", gintctl_gint_dma, 0 },
#endif
{ "Real-time clock", gintctl_gint_rtc },
{ "Image rendering", gintctl_gint_bopti },
{ "Text rendering", gintctl_gint_topti },
{ "Real-time clock", gintctl_gint_rtc, 0 },
{ "Image rendering", gintctl_gint_bopti, 0 },
{ "Text rendering", gintctl_gint_topti, 0 },
#ifdef FX9860G
{ "Gray engine", gintctl_gint_gray },
{ "Gray rendering", gintctl_gint_grayrender },
{ "Gray engine", gintctl_gint_gray, 0 },
{ "Gray rendering", gintctl_gint_grayrender, 0 },
#endif
{ NULL, NULL },
{ NULL, NULL, 0 },
}};
/* Performance menu */
struct menu menu_perf = {
_("Performance", "Performance benchmarks"), .entries = {
{ "libprof basics", gintctl_perf_libprof },
{ "CPU and cache", gintctl_perf_cpucache },
{ "Interrupt stress", gintctl_perf_interrupts },
{ "libprof basics", gintctl_perf_libprof, 0 },
{ "CPU and cache", gintctl_perf_cpucache, 0 },
{ "Interrupt stress", gintctl_perf_interrupts, 0 },
#ifdef FXCG50
{ "Memory access speed", gintctl_perf_memory },
{ "Memory access speed", gintctl_perf_memory, 0 },
#endif
{ "Rendering functions", gintctl_perf_render },
{ "Rendering functions", gintctl_perf_render, 0 },
/* TODO: Comparison with MonochromeLib */
{ NULL, NULL },
{ NULL, NULL, 0 },
}};
/* External libraries */
@ -80,16 +80,16 @@ struct menu menu_libs = {
_("Libraries", "External and standard libraries"), .entries = {
{ "libc: " _("TinyMT32", "TinyMT random number generation"),
gintctl_libs_tinymt },
gintctl_libs_tinymt, 0 },
{ "libc: " _("printf family", "Formatted printing functions"),
gintctl_libs_printf },
gintctl_libs_printf, 0 },
{ "libc: " _("mem functions", "Core memory functions"),
gintctl_libs_memory },
gintctl_libs_memory, 0 },
{ "libm: " _("OpenLibm", "OpenLibm floating-point functions"),
gintctl_libs_openlibm },
gintctl_libs_openlibm, 0 },
{ "libimg" _("",": Image transforms"),
gintctl_libs_libimg },
{ NULL, NULL },
gintctl_libs_libimg, 0 },
{ NULL, NULL, 0 },
}};
//---

View File

@ -1,4 +1,5 @@
#include <gint/defs/util.h>
#include <gint/hardware.h>
#include <gintctl/menu.h>
#include <gintctl/util.h>
@ -7,7 +8,15 @@
void menu_init(struct menu *menu, int top, int bottom)
{
menu->len = 0;
while(menu->entries[menu->len].name) menu->len++;
for(int i = 0; menu->entries[i].name; i++)
{
int f = menu->entries[i].flags;
if(isSH3() && (f & MENU_SH4_ONLY)) continue;
if(isSH4() && (f & MENU_SH3_ONLY)) continue;
menu->entries[menu->len++] = menu->entries[i];
}
menu->offset = 0;
menu->pos = 0;

View File

@ -1,6 +1,7 @@
#include <gint/display.h>
#include <gint/keyboard.h>
#include <gint/clock.h>
#include <gint/std/stdio.h>
#include <gintctl/perf.h>
#include <gintctl/util.h>