diff --git a/assets/font8x9.png b/assets/font8x9.png new file mode 100644 index 0000000..7eb2dbb Binary files /dev/null and b/assets/font8x9.png differ diff --git a/assets/font8x9.xcf b/assets/font8x9.xcf new file mode 100644 index 0000000..b80d437 Binary files /dev/null and b/assets/font8x9.xcf differ diff --git a/assets/vxconv.toml b/assets/vxconv.toml new file mode 100644 index 0000000..b132db8 --- /dev/null +++ b/assets/vxconv.toml @@ -0,0 +1,9 @@ +[font8x9] +path = 'font8x9.png' +type = 'font' +charset = 'print' +grid.size = '8x12' +grid.padding = 1 +grid.border = 1 +proportional = 1 +line_height = 9 diff --git a/board/fxcg50/fxcg50.ld b/board/fxcg50/fxcg50.ld index 4801d82..682f57a 100644 --- a/board/fxcg50/fxcg50.ld +++ b/board/fxcg50/fxcg50.ld @@ -20,6 +20,8 @@ SECTIONS /* Code */ .text : { + PROVIDE(___kernel_reloc_start = .); + *(.text); *(.text.*); diff --git a/src/drivers/mpu/sh/sh7305/tmu/tmu.c b/src/drivers/mpu/sh/sh7305/tmu/tmu.c index 245f157..29d60d6 100644 --- a/src/drivers/mpu/sh/sh7305/tmu/tmu.c +++ b/src/drivers/mpu/sh/sh7305/tmu/tmu.c @@ -277,7 +277,7 @@ static void __tmu_configure(struct tmu_ctx *s) } /* install the TMUs interupt handler */ - extern void *sh7305_inth_tmu; + extern uint32_t sh7305_inth_tmu; sh7305_intc_install_inth(0x400, &sh7305_inth_tmu, 96); /* install all ETMUx interrupt handler @@ -291,13 +291,13 @@ static void __tmu_configure(struct tmu_ctx *s) We know that the ETMU4 (which have the interrupt vector 0xd00) is followed by excatly 3 free gates (where not interrupt exist). We will use this place to store all the ETMUx interrupt logic. */ - extern void *sh7305_inth_etmu4; - extern void *sh7305_inth_etmux; + extern uint32_t sh7305_inth_etmu4; + extern uint32_t sh7305_inth_etmux; void *h4; void *h; - uint16_t etmu_event[6] = { 0x9e0, 0xc20, 0xc40, 0x900, 0xd00, 0xfa0 }; - h4 = sh7305_intc_install_inth(etmu_event[4], sh7305_inth_etmu4, 96); + uint16_t etmu_evt[6] = { 0x9e0, 0xc20, 0xc40, 0x900, 0xd00, 0xfa0 }; + h4 = sh7305_intc_install_inth(etmu_evt[4], &sh7305_inth_etmu4, 96); for (int i = 0; i < 6; ++i) { /* skip the core ETMUx core handler */ @@ -305,7 +305,7 @@ static void __tmu_configure(struct tmu_ctx *s) continue; /* install the default interrupt handler */ - h = sh7305_intc_install_inth(etmu_event[i], sh7305_inth_etmux, 32); + h = sh7305_intc_install_inth(etmu_evt[i], &sh7305_inth_etmux, 32); /* Distance from VBR handler to ETMU4, used to jump */ *(uint32_t *)(h + 20) += (uintptr_t)h4 - (uintptr_t)cpu_get_vbr(); @@ -376,7 +376,6 @@ static void __tmu_hrestore(struct tmu_ctx *s) /* declare the TMU driver */ -#if 0 struct vhex_driver drv_tmu = { .name = "TMU", .hsave = (void*)&__tmu_hsave, @@ -399,4 +398,3 @@ struct vhex_driver drv_tmu = { } }; VHEX_DECLARE_DRIVER(03, drv_tmu); -#endif diff --git a/src/kernel/exch.c b/src/kernel/exch.c index 43c0337..7818626 100644 --- a/src/kernel/exch.c +++ b/src/kernel/exch.c @@ -4,8 +4,7 @@ //TODO: add relocation information void vhex_kernel_exch_panic(void) { -#if 0 - extern uint16_t vhex_vram[]; + extern uint32_t __kernel_reloc_start; uint32_t PC; uint32_t TEA; uint32_t TRA; @@ -21,8 +20,8 @@ void vhex_kernel_exch_panic(void) dclear(C_WHITE); dtext(6, 3, C_BLACK, "An exception occured! (System ERROR)"); - uint32_t *long_vram = (void *)vhex_vram; - for(int i = 0; i < 198 * 16; i++) long_vram[i] = ~long_vram[i]; +// uint32_t *long_vram = (void *)vhex_vram; +// for(int i = 0; i < 198 * 16; i++) long_vram[i] = ~long_vram[i]; char const *name = ""; if(code == 0x040) name = "TLB miss (nonexisting address) on read"; @@ -36,7 +35,7 @@ void vhex_kernel_exch_panic(void) dprint(6, 25, C_BLACK, "%03x %s", code, name); dtext( 6, 45, C_BLACK, "PC"); - dprint(38, 45, C_BLACK, "= %08x", PC); + dprint(38, 45, C_BLACK, "= %08x", PC - (uintptr_t)&__kernel_reloc_start); dtext(261, 45, C_BLACK, "(Error location)"); dtext( 6, 60, C_BLACK, "TEA"); @@ -47,10 +46,11 @@ void vhex_kernel_exch_panic(void) dprint(38, 75, C_BLACK, "= %#x", TRA); dtext(281, 75, C_BLACK, "(Trap number)"); - dtext(6, 95, C_BLACK, "An unrecoverable error occurred in the add-in."); - dtext(6, 108, C_BLACK, "Please press the RESET button to restart the"); - dtext(6, 121, C_BLACK, "calculator."); + dprint( 6, 90, C_BLACK, "reloc base = %p", &__kernel_reloc_start); + + dtext(6, 120, C_BLACK, "An unrecoverable error occurred in the add-in."); + dtext(6, 135, C_BLACK, "Please press the RESET button to restart the"); + dtext(6, 150, C_BLACK, "calculator."); dupdate(); -#endif while (1) { __asm__ volatile ("sleep"); } }