expose more platform-agnostic code

May be useful later on for libraries such as libprof.
pull/7/head
Lephe 3 years ago
parent b9cba1d00a
commit 61e68d01bb
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
  1. 4
      TODO
  2. 6
      include/gint/drivers.h
  3. 4
      src/core/hardware.c
  4. 6
      src/cpg/cpg.c
  5. 2
      src/rtc/rtc.c

@ -10,10 +10,12 @@ Tests to run.
* topti: all charsets
Complementary elements on existing code.
* core: make it possiblé to catch exceptions (gintctl's memory browser)
* core: check if -DX still works in GCC 9 and if not, put spaces
* gray: find good values for more models than the Graph 35+E II
* render: get rid of GINT_NEED_VRAM and #define vram gint_vram if you need
* dma: dma_memcpy() and dma_memset(), possibly requiring alignment
* core: find the #ifdef FX9860G|FXCG50 that have a cross-platform def
* dma: maybe relax the 4-byte size constraint for dma_memset()
* core: try to leave add-in without reset in case of fatal exception
* topti: support Unicode fonts
* hardware: fill in the HWMEM_FITTLB flag

@ -105,12 +105,10 @@ typedef struct
This macro makes its argument NULL on fxcg50, this way the named function
can be defined under #ifdef FX9860G while keeping the structure clean. */
#ifdef FX9860G
#define GINT_DRIVER_SH3(name) name
#endif
#ifdef FXCG50
#define GINT_DRIVER_SH3(name) NULL
#else
#define GINT_DRIVER_SH3(name) name
#endif
/* GINT_DRIVER_STATUS() - declare a function for status string generation

@ -16,7 +16,7 @@ GBSS uint32_t gint[HW_KEYS];
/* Product Register */
#define PRR (*((volatile uint32_t *)0xff000044))
#ifdef FX9860G
#if defined(FX9860G) || (!defined(FX9860G) && !defined(FXCG50))
/* mpu_detect() - detect the underlying MPU
Many thanks to Simon Lothar for relevant documentation.
@ -90,7 +90,7 @@ void hw_detect(void)
gint[HWROM] = (gint[HWCALC] == HWCALC_G35PE2) ? (4 << 20) : (8 << 20);
}
#endif /* FX9860G */
#endif /* FX9860G and platform-agnostic */
#ifdef FXCG50

@ -25,7 +25,7 @@ const clock_frequency_t *clock_freq(void)
// SH7705 Clock signals
//---
#ifdef FX9860G
#if defined(FX9860G) || (!defined(FX9860G) && !defined(FXCG50))
#define CPG SH7705_CPG
static void sh7705_probe(void)
@ -69,7 +69,7 @@ static void sh7705_probe(void)
}
#undef CPG
#endif /* FX9860G */
#endif /* FX9860G and platform-agnostic */
//---
// SH7305 clock signals
@ -144,7 +144,7 @@ static void init(void)
/* This avoids warnings about sh7705_probe() being undefined when
building for fxcg50 */
#ifdef FX9860G
#if defined(FX9860G) || (!defined(FX9860G) && !defined(FXCG50))
isSH3() ? sh7705_probe() :
#endif
sh7305_probe();

@ -125,7 +125,7 @@ void rtc_stop_timer(void)
// Driver initialization
//---
#ifdef FX9860G
#if defined(FX9860G) || (!defined(FX9860G) && !defined(FXCG50))
static void driver_sh3(void)
{
/* Adjust the address of the RTC */

Loading…
Cancel
Save