2 A stack access overwrote a value held in hl on gbz80.
7 #pragma disable_warning 283
9 typedef unsigned char UBYTE
;
11 #define MAX_PROJECTILES 2
12 #define MAX_ACTIVE_ACTORS 3
15 typedef struct _BankPtr
21 typedef struct _PROJECTILE
{
30 Projectile projectiles
[MAX_PROJECTILES
];
31 UBYTE actors_active
[MAX_ACTIVE_ACTORS
];
32 Actor actors
[MAX_ACTORS
];
34 void TestFn2(BankPtr
* events_ptr
) {
35 ASSERT (events_ptr
->bank
== 5 && events_ptr
->offset
== 0xFC00);
42 for (i
= 0; i
!= 1; i
++) {
43 hit
= actors_active
[0];
45 if (projectiles
[i
].col_group
== 2) {
46 TestFn2(&actors
[hit
].hit_1_ptr
);
47 } else if (projectiles
[i
].col_group
== 4) {
48 TestFn2(&actors
[hit
].hit_2_ptr
);
57 projectiles
[0].col_group
= 2;
59 actors
[0].hit_1_ptr
.bank
= 5;
60 actors
[0].hit_1_ptr
.offset
= 0xFC00;