From 3cafce9623ec79738555c647b79afa65ccebb5a5 Mon Sep 17 00:00:00 2001 From: Oxore Date: Fri, 5 May 2023 23:11:08 +0300 Subject: Add true start and end ROM addresses --- 1_hello_world/startup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '1_hello_world/startup.c') diff --git a/1_hello_world/startup.c b/1_hello_world/startup.c index 06ca39e..e743214 100644 --- a/1_hello_world/startup.c +++ b/1_hello_world/startup.c @@ -29,6 +29,8 @@ static __attribute__((interrupt)) void VSYNC_handler(void); static __attribute__((interrupt)) void CPUException_handler(void); extern unsigned __stacktop; +extern unsigned __rom_start; +extern unsigned __rom_end; __attribute__((section(".stack"), used)) unsigned *__stack_init = &__stacktop; @@ -106,8 +108,8 @@ __attribute__((section(".smd_header"), used)) struct smd_header __smd_header = { .version = "GM XXXXXXXX-XX", .checksum = 0x0000, .io_support = "J ", - .rom_start = 0, - .rom_end = 0xfffff, + .rom_start = (unsigned long)&__rom_start, + .rom_end = (unsigned long)&__rom_end-1, .ram_start = 0xff0000, .ram_end = 0xffffff, .sram_enabled = 0x00000000, @@ -124,8 +126,11 @@ static void __start(void) { main(); } + static void HSYNC_handler(void) {} + static void VSYNC_handler(void) {} + static void CPUException_handler(void) { asm inline volatile (" stop #2700"); -- cgit v1.2.3