Closed tehKaiN closed 2 years ago
@BartmanAbyss fixed it! There's a problem in the header files.
in resources/cia.h there's:
#define AbleICR(___resource, ___mask) \
LP2NB(0x12, WORD, AbleICR , struct Library *, ___resource, a6, WORD, ___mask, d0)
and in macros.h:
/* Only cia.resource/AbleICR() and cia.resource/SetICR() */
#define LP2UB(offs, rt, name, t1, v1, r1, t2, v2, r2) \
({ \
t1 _##name##_v1 = (v1); \
t2 _##name##_v2 = (v2); \
rt _##name##_re2 = \
({ \
register volatile int _d1 __asm("d1"); \
register volatile int _a0 __asm("a0"); \
register volatile int _a1 __asm("a1"); \
register rt _##name##_re __asm("d0"); \
register volatile t1 _n1 __asm(#r1) = _##name##_v1; \
register volatile t2 _n2 __asm(#r2) = _##name##_v2; \
__asm volatile ("jsr %%a6@(-"#offs":W)" \
: "=r" (_##name##_re), "=r" (_d1), "=r" (_a0), "=r" (_a1) \
: "r"(_n1), "rf"(_n2) \
: "fp0", "fp1", "cc", "memory"); \
_##name##_re; \
}); \
_##name##_re2; \
})
changing name in macros.h to LP2NB fixed it. I looked at Bebbo's macros.h and he uses the exactly same macros but with NB names. Same with remaining UB macros in macros.h - changing to NB fixes the issue.
Consider following code:
It results with compiler error, because AbleICR is defined as LP2NB macro call, which isn't defined anywhere. All cia.h functions are affected (AddICRVector, RemICRVector, AbleICR, SetICR) because LP3NB and LP3NRNB aren't defined too.