mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-28 20:43:36 +01:00
render-cg: allow VRAM in user stack
This is currently unused and has some artifacts in gintctl for reasons I haven't understood yet. Will have to investigate later.
This commit is contained in:
parent
f8ee9b7414
commit
ed30b2cb21
3 changed files with 31 additions and 16 deletions
8
configure
vendored
8
configure
vendored
|
@ -13,9 +13,9 @@ prefix=
|
||||||
cflags=
|
cflags=
|
||||||
|
|
||||||
# Behavior
|
# Behavior
|
||||||
boot_log=
|
|
||||||
no_syscalls=
|
no_syscalls=
|
||||||
static_gray=
|
static_gray=
|
||||||
|
user_vram=
|
||||||
|
|
||||||
# Size limits
|
# Size limits
|
||||||
atexit_max=
|
atexit_max=
|
||||||
|
@ -57,6 +57,7 @@ Library options (disabled by default):
|
||||||
Only use this option if you have a good idea of which.
|
Only use this option if you have a good idea of which.
|
||||||
--static-gray Allocate gray VRAMs in static RAM instead of the heap
|
--static-gray Allocate gray VRAMs in static RAM instead of the heap
|
||||||
May help when --no-syscalls is on.
|
May help when --no-syscalls is on.
|
||||||
|
--user-vram Allocate VRAM in user stack; takes 350k/512k [fxcg50]
|
||||||
|
|
||||||
Size limits:
|
Size limits:
|
||||||
--atexit-max=NUM Number of exit handlers in atexit()'s array [16]
|
--atexit-max=NUM Number of exit handlers in atexit()'s array [16]
|
||||||
|
@ -109,12 +110,12 @@ for arg; do case "$arg" in
|
||||||
--cflags=*)
|
--cflags=*)
|
||||||
cflags=${arg#*=};;
|
cflags=${arg#*=};;
|
||||||
|
|
||||||
--boot-log)
|
|
||||||
boot_log=true;;
|
|
||||||
--no-syscalls)
|
--no-syscalls)
|
||||||
no_syscalls=true;;
|
no_syscalls=true;;
|
||||||
--static-gray)
|
--static-gray)
|
||||||
static_gray=true;;
|
static_gray=true;;
|
||||||
|
--user-vram)
|
||||||
|
user_vram=true;;
|
||||||
|
|
||||||
--atexit-max=*)
|
--atexit-max=*)
|
||||||
n=${arg#*=}
|
n=${arg#*=}
|
||||||
|
@ -190,6 +191,7 @@ output_config()
|
||||||
echo -n " -D$(echo $target | tr 'a-z' 'A-Z')"
|
echo -n " -D$(echo $target | tr 'a-z' 'A-Z')"
|
||||||
[[ "$no_syscalls" ]] && echo -n " -DGINT_NO_SYSCALLS"
|
[[ "$no_syscalls" ]] && echo -n " -DGINT_NO_SYSCALLS"
|
||||||
[[ "$static_gray" ]] && echo -n " -DGINT_STATIC_GRAY"
|
[[ "$static_gray" ]] && echo -n " -DGINT_STATIC_GRAY"
|
||||||
|
[[ "$user_vram" ]] && echo -n " -DGINT_USER_VRAM"
|
||||||
[[ "$atexit_max" ]] && echo -n " -DATEXIT_MAX=$atexit_max"
|
[[ "$atexit_max" ]] && echo -n " -DATEXIT_MAX=$atexit_max"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
15
fxcg50.ld
15
fxcg50.ld
|
@ -68,18 +68,14 @@ SECTIONS
|
||||||
*(.text .text.*)
|
*(.text .text.*)
|
||||||
} > rom
|
} > rom
|
||||||
|
|
||||||
/* Interrupt handlers going to ROM:
|
/* gint's interrupt handler blocks (.gint.blocks)
|
||||||
- gint's interrupt handler blocks (.gint.blocks)
|
Although gint's blocks end up in VBR space, they are relocated at
|
||||||
|
|
||||||
Although gint's blocks end up in VBR space, they are installed at
|
|
||||||
startup by the library/drivers, so we store them here for now */
|
startup by the library/drivers, so we store them here for now */
|
||||||
.gint.blocks : {
|
.gint.blocks : {
|
||||||
KEEP(*(.gint.blocks));
|
KEEP(*(.gint.blocks));
|
||||||
} > rom
|
} > rom
|
||||||
|
|
||||||
/* Driver data going to ROM:
|
/* Exposed driver interfaces (.gint.drivers)
|
||||||
- Exposed driver interfaces (.gint.drivers)
|
|
||||||
|
|
||||||
The driver information is required to start and configure the
|
The driver information is required to start and configure the
|
||||||
driver, even if the symbols are not referenced */
|
driver, even if the symbols are not referenced */
|
||||||
.gint.drivers : {
|
.gint.drivers : {
|
||||||
|
@ -117,6 +113,7 @@ SECTIONS
|
||||||
.bss (NOLOAD) : {
|
.bss (NOLOAD) : {
|
||||||
_rbss = . ;
|
_rbss = . ;
|
||||||
|
|
||||||
|
*(.bss.vram)
|
||||||
*(.bss COMMON)
|
*(.bss COMMON)
|
||||||
|
|
||||||
. = ALIGN(16);
|
. = ALIGN(16);
|
||||||
|
@ -183,9 +180,7 @@ SECTIONS
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** gint-related sections
|
** gint-related sections (VBR space, .gint.data and .gint.bss)
|
||||||
** 8c160000:5k VBR space
|
|
||||||
** 8c161400:3k .gint.data and .gint.bss
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* VBR address: let's just start at the beginning of the RAM area.
|
/* VBR address: let's just start at the beginning of the RAM area.
|
||||||
|
|
|
@ -1,13 +1,31 @@
|
||||||
#include <gint/display.h>
|
#include <gint/display.h>
|
||||||
|
|
||||||
/* Put both VRAMs in the system stack! */
|
#ifdef GINT_USER_VRAM
|
||||||
|
/* We want to put the VRAM in the user section, however we can't use the
|
||||||
|
virtualized P0 address as this will mess up the DMA. As the static RAM is
|
||||||
|
always fully mapped at a fixed place, we can use the target P1 address. We
|
||||||
|
just need to allocate the space for the linker. This special section ensures
|
||||||
|
that the first address of the user stack will be used */
|
||||||
|
GALIGNED(4) GSECTION(".bss.vram") int8_t _gint_vram_buffers[396*224*2];
|
||||||
|
|
||||||
|
/* In this case, we can define pointers to our user stack directly, these will
|
||||||
|
be the physical address associated with _vram_buffers */
|
||||||
|
static uint16_t *main = (void *)0xac161400;
|
||||||
|
static uint16_t *scnd = (void *)0xac18c900;
|
||||||
|
|
||||||
|
/* Shared VRAM pointer, the one exposed by <gint/display.h> */
|
||||||
|
uint16_t *gint_vram = (void *)0xac161400;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* Otherwise, just put both VRAMs in the system stack! */
|
||||||
static uint16_t *main = (void *)0xac0f0000;
|
static uint16_t *main = (void *)0xac0f0000;
|
||||||
static uint16_t *scnd = (void *)0xac11b500;
|
static uint16_t *scnd = (void *)0xac11b500;
|
||||||
|
uint16_t *gint_vram = (void *)0xac0f0000;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* On Prizm: should be: 0xa80f0000 and 0xa811b500 */
|
/* On Prizm: should be: 0xa80f0000 and 0xa811b500 */
|
||||||
|
|
||||||
/* Shared VRAM pointer, the one exposed by <gint/display.h> */
|
|
||||||
uint16_t *gint_vram = (void *)0xac0f0000;
|
|
||||||
|
|
||||||
/* dsetvram() - Control video RAM address and triple buffering */
|
/* dsetvram() - Control video RAM address and triple buffering */
|
||||||
void dsetvram(uint16_t *new_main, uint16_t *new_secondary)
|
void dsetvram(uint16_t *new_main, uint16_t *new_secondary)
|
||||||
|
|
Loading…
Reference in a new issue