Copy
is inclusive, so when it says Start to Finish
, that:
Finish
addressThis is correct:
CAT$="Meow" Reserve as Work 10,Len(CAT$) Copy Varptr(CAT$),Varptr(CAT$) + Len(CAT$) to Start(10)
You have to iterate through the entire list of system fonts using Font$()
to find the one you want.
Get Fonts ' This is 1-indexed F=1 FOUND_FONT=-1 While FOUND_FONT=-1 FONT_INFO$=Lower$(Font$(F)) ' FONT_INFO$ is empty string when you're out of fonts If FONT_INFO$="" ' Font not found Error 44 End If ' Instr is 0 on fail, 1+ on match, because BASIC If Instr(FONT_INFO$,"garnet")>0 and Instr(FONT_INFO$," 9")>0 FOUND_FONT=F End If F=F+1 Wend Set Font FOUND_FONT Text 100,100,"Wowow"
https://www.ultimateamiga.co.uk/HostedProjects/AMOSFactory/AMOSProManual/14/1414.html
Theoretically you can load an executable machine language thing and use it with Pload
.
Call
you unwind the same way as in an extension. You have to (A3)+
every parameter.wo
with AsmPro and not wl
.MOVEM.L A4-A6,-(SP)
. I was able to get away with just preserving A6
, though.LEA Label(pc),A0
. See note about Alignment below.
But, Call
seems to work unreliably when used in nested procedures, despite the program correctly resetting stacks and unwinding arguments. Inlining the code with Insert Program
into its own Procedure seems to work just fine.
Your code in your procedure is part of the tokenized stream of stuff. I'm guessing the AMOS interpreter “generates bytecode” as you're typing, and your machine language routine lives in that bytecode stream.
I was being bitten trying to use dos/Info to load data into a ds.l
structure. Sometimes, it worked and returned the correct data. Sometimes, it did not, and it made a difference as to how many tokens there were in the program. I had to forcibly long-align the address I was using. CNOP 0,4
will not save you. When the manual says “totally relocatable”, they mean it:
; long align the disk info area for dos/Info() LEA DiskInfoArea(pc),A0 MOVE.L A0,D0 AND.L #$2,D0 ADD.L D0,A0 MOVE.L D0,D2 CALLLIB _LVOInfo ; One normally only needs 9 longs for this, the extra is to ; handle realigning in cases this storage is not long-aligned. DiskInfoArea ds.l 10
You can't load an IFF that's shorter than 16px. AMOS will declare itself out of memory or outright crash.
AMOS seems to want bobs that are:
I needed to pad some sprites with background color before AMOS would use them properly.