Yeah... not sure if my current AMOS configuration is at fault but...
- Sam Stop causes a syntax error (twice!) at lines 670 and 725
- Once they are commented out it runs, but then crashes! (8000 0004 error)
The animation itself is pretty cool and did make me smile. The explosion is fine, then the other stuff is good. After that thing stops being lowered it crashes...
Thanks for the feedback (I think
) Lonewolf10.
That's a bit worrying as I thought there was only one version of AMOSPro_Music.Lib out there. Looks like you may have another!
The AMOS program I posted is stored tokenised (as they all are). So it's essential that the tokens don't change in an AMOS installation. Each token is just a 16-bit number, which is the number of bytes from the start of a token table to the start of that token's details. So the Sam Stop instruction in the source +Music.s:
dc.w L_InSamStop0,L_Nul
dc.b "!sam sto","p"+$80,"I",-2
dc.w L_InSamStop1,L_Nul
dc.b $80,"I0",-1
would have a token representing the number of bytes to the start of that code fragment above (=$246).
A set of tokens for a library looks like this (from +Equ.s, the tokens at the start of AMOSPro.Lib):
_TkVar equ $00000006
_TkLab equ $0000000C
_TkPro equ $00000012
_TkLGo equ $00000018
_TkBin equ $0000001E
_TkCh1 equ $00000026
_TkCh2 equ $0000002ENot to be confused with the Instruction Numbers used when you're calling a library's code from your own asm code. I.e. they're not just 1, 2, 3, ...
Any change to a library's token table that changes the length of an entry will mean that an existing (i.e. already tokenised) AMOS program using that library won't find some of the tokens.
For example, just one of the bugs in the +Music.s token table is this one (there are others):
dc.w L_InSamLoopOff0,L_Nul
dc.b "sam loop of","f"+$80,"I",-2
dc.w L_InSamLoopOff1,L_Nul
dc.b $80,"I0",-1It's missing the exclamation mark "!" at the start to indicate it's got multiple parameter formats. Inserting the missing "!" and reassembling would work okay for all tokens up to that point, but any following tokens would be one byte out. Any existing program (i.e. any saved before the change) using those tokens would fail at the Test stage when it was run. Note that any new programs typed in and saved would be fine as they would be tokenised with the new token values. The same goes for any existing programs saved in ASCII - AMOS tokenises them fresh as it loads them.
Which is a nightmare for AMOSPro_Music.Lib's bugs as fixing them does affect its token table. The solution I've been working on is an AMOS program that will examine the files in a directory picking up any *.AMOS ones. It then hunts through the tokens looking for calls to extension libraries (token $004E) that use AMOSPro_Music.Lib (extension 1). Having found one, I can then substitute new for old (see, I knew all that work on tokens wasn't wasted
). I can find them okay, but I haven't decided how best (= fastest) to do the substitution check yet to prevent trying to retokenise a file twice (in theory, shouldn't matter as long as I check each possible token value (= slowest)). Life wasn't meant to be easy...
Anyway, that's a possible cause, as the verification code throws Syntax Error for most things it doesn't understand when checking.
The guru 8000 0004 is a CPU trap for the illegal instruction. The AMOS team used it extensively for debugging. The +Lib.s source has one that someone left behind by mistake after a debugging session. It was only in the source though, not the binary. There are some others in the source in some bug traps, so I'll check those out and also check for the instruction in the V2.00 binaries.
In the sources distribution, the file +Debug.s also has:
Debug set 2which puts a load of these traps into the binaries if the sources are just assembled 'as is'.
In the meantime, could I ask you to post your copies of:
- AMOSPro:AMOSPro
- AMOSPro:AMOSPro_Interpreter_Config
- AMOSPro:APSystem/AMOSPro.Lib
- AMOSPro:APSystem/AMOSPro_Music.Lib
so I can do a compare of the binaries against the AMOS Pro V2.00 versions?
If your AMOSPro_Interpreter_Config isn't in the directory above, the one in S: will be the one AMOS's using.