Spent some time trying to tackle the notorious "Z80Ass error: label already defined!" error again. I still don't know what exactly is going wrong here. The .loop label is indeed set twice under some circumstances (at the start of a block, in any case). So for esex, it will output this:
.song
.loop
db #68,#00,#82,#e4,#82,#e4
.loop
db #01,#01,#01
db #00
dw .loop
Anyway, I found a possible fix. In the affected engines, you usually have something like this near the beginning of the Compile function:
row=startRow;
takeLoop=0;
if(oneShot==1)
{
len=1;
}
else
{
len=songLength-row;
loopRow=-1;
...
Initializing loopRow to -1 before the conditional instead (so it affects both branches) prevents the error from occuring. Not sure if it causes any problems further down the line. I haven't noticed any yet.
Btw it seems the assembler always runs twice. Is this intentional?