Well shiver me timbers. I never thought VBCC's 1.3 target would be getting updates.
Before I saw that, this is what I ended up doing. As far as I can tell, it's working: no more muforce hit, and VBR is getting a non-zero number (and music still plays).
Code:
// get VBR value that PTPlayer requires
// this code is based on code provided by AmigaGeek (on EAB):
// https://github.com/amigageek/modsurfer/blob/4bdebbdc6162cc79af394c3caee40d5867808401/system.c#L391
// Supervisor() is not available in VBCC KS 1.3, so trying with SuperState() and UserState().
static ULONG App_GetVBR(void)
{
// VBR is 0 on 68000, supervisor register on 68010+.
ULONG vbr = 0;
LONG userstack;
if (SysBase->AttnFlags & (1U << AFB_68010))
{
// enter supervisor mode and get user stack
userstack = SuperState();
vbr = mt_get_vbr();
// restore user stack
UserState((char*)userstack);
}
return vbr;
}
added a mini function to the ptplayer.asm file:
Code:
; lich king hack
; little hack function to return VBR value
;unsigned long ASM mt_get_vbr(void);
xdef _mt_get_vbr
_mt_get_vbr:
movec vbr,d0
rts
; end lich king hack