fix ST RAM values for initial SP & PC to allow FreeMint reboots on CTRL-ALT-DELETE

This commit is contained in:
Markus Fröschle
2016-04-02 10:39:26 +00:00
parent a4581785d3
commit ccbe9da4cb
2 changed files with 11 additions and 1 deletions

View File

@@ -529,6 +529,16 @@ void BaS(void)
FireTOS(); // Should never return
}
/*
* fix initial pc/sp in ST RAM for FreeMiNT. It expects valid values there
* like on original STs (where these values reside in ROM) and uses them on
* CTRL-ALT-DELETE reboots.
*/
struct rom_header *bas_header = (struct rom_header *) TARGET_ADDRESS;
struct rom_header *stram_header = (struct rom_header *) 0x0;
*stram_header = *bas_header;
xprintf("call EmuTOS\r\n");
struct rom_header *os_header = (struct rom_header *) TOS;
os_header->initial_pc();