S12v4 smart dispatcher baked

This commit is contained in:
SashegDev
2026-09-13 12:16:43 +00:00
parent 47e78ee42f
commit 68fab44137
3 changed files with 26 additions and 12 deletions
+14 -5
View File
@@ -732,13 +732,22 @@ static void saimaa_machine_init(MachineState *machine)
uint32_t v = 0x47702000;
cpu_physical_memory_write(0x00221EF8, &v, 4);
}
/* S12-stub (b25, 28B @0x08006964, ARM): blx-to-padding
* becomes ldr ip,[sp,#4] (=pushed lr, for B66 bx-ip chain)
* + ACK peripheral bit1 ([0x073A100], literal pool after
* code) + bx lr. PBL would place the real ARM helper here. */
/* S12-stub (b27, 84B @0x08006964, ARM): blx-to-padding
* becomes smart dispatcher: ldr ip,[sp,#4] (=pushed lr);
* ip==STUBV/even/non-code => ip=poll resumption 0x8007779;
* else keep pushed-lr; then ACK peripheral bit1
* ([literal 0x073A100]); bx lr.
* PBL would place the real ARM helper here. */
{
static const uint8_t s12[] = {
0x04, 0xc0, 0x9d, 0xe5, 0x0c, 0x30, 0x9f, 0xe5,
0x04, 0xc0, 0x9d, 0xe5, 0x8d, 0x3b, 0x06, 0xe3,
0x00, 0x38, 0x40, 0xe3, 0x03, 0x00, 0x5c, 0xe1,
0x07, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x1c, 0xe3,
0x05, 0x00, 0x00, 0x0a, 0x2c, 0x3c, 0xa0, 0xe1,
0x08, 0x00, 0x53, 0xe3, 0x04, 0x00, 0x00, 0x0a,
0x2c, 0x3e, 0xa0, 0xe1, 0x08, 0x00, 0x53, 0xe3,
0x01, 0x00, 0x00, 0x0a, 0x79, 0xc7, 0x07, 0xe3,
0x00, 0xc8, 0x40, 0xe3, 0x0c, 0x30, 0x9f, 0xe5,
0x00, 0x20, 0x93, 0xe5, 0x02, 0x20, 0x82, 0xe3,
0x00, 0x20, 0x83, 0xe5, 0x1e, 0xff, 0x2f, 0xe1,
0x00, 0xa1, 0x73, 0x00,