diff options
| author | Oxore <oxore@protonmail.com> | 2023-05-05 23:11:08 +0300 |
|---|---|---|
| committer | Oxore <oxore@protonmail.com> | 2023-05-05 23:11:08 +0300 |
| commit | 3cafce9623ec79738555c647b79afa65ccebb5a5 (patch) | |
| tree | 878c7657906a8e057c790275ba6d4fcd31dc3f0d /1_hello_world/startup.c | |
| parent | d3905c1297bd042b5934c387a58dabcaaaa6bfd5 (diff) | |
Add true start and end ROM addresses
Diffstat (limited to '1_hello_world/startup.c')
| -rw-r--r-- | 1_hello_world/startup.c | 9 |
1 files changed, 7 insertions, 2 deletions
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"); |
