... and here's information about extensions for AMOS 1.3 (and earlier?). Again, the ASM sourcecode has had chunks removed to make it easier to get the gist of the layout.
AMOS 1.3 Extension - Basic Layout
==========================
(NB: Any macros, or variables set up at start of extension will NOT offset the Default/Cold Start code)
1) Default/Cold Start code
2) Custom: Custom error routine
3) ASM code for commands
4) Tk: Token syntax, finished off with by a word with a value of 0
5) MusWel: Welcome text
6) MusErr: Error messages used by Custom:, finished off by a longword with a value of 0
AMOS - The Creator Extension (1.3) - Example ASM Code
=====================================================
(Source: MUSIC.S from AMOS1_23.ZIP)
Include "Equ.s"
Translate equ -30
******************************************************************
* ** * * **** **** *** ** **** *** ***
* * * ** ** * * * * * * * * * *
* **** * ** * * * **** **** **** **** * *
* * * * * * * * * * * * * * *
* * * * * **** **** **** * * **** *** ***
******************************************************************
*
* AMOS MUSICAL ROUTINES
*
* Version 1.3
* By Francois Lionet
* AMOS (c) Mandarin / Jawx 1990
*
* This source code is public domain
*
* Last change 21/01/1991
*
******************************************************************
******* COLD START
* This must be at the beginning of your program!
* It is called just after loading...
movem.l a4-a6,-(sp)
lea MusInt(pc),a1 * Interrupt routine
move.l a1,VBLRout(a5) * Branch
lea MusAdr(pc),a1
move.l a0,(a1) * Store address of BRANCH TABLE
lea MB(pc),a3 * Base of music parameters
lea BkCheck(pc),a0 * Address of CHECK MUSIC BANK
move.l a0,d2
lea AdMB(pc),a1
move.l a3,(a1)
* 50/60 herz?
move.l #3546895,MusClock-MB(a3)
move.w #100,TempoBase-MB(a3)
EcCall NTSC * Is system NTSC?
tst.w d1
beq.s ItsPAL
move.w #120,TempoBase-MB(a3)
move.l #3579545,MusClock-MB(a3)
* Go on!
ItsPAL lea Tk(pc),a0 * Address of TOKEN TABLE
lea MusWel(pc),a1 * Address of WELCOME MESSAGE
lea MusDef(pc),a2 * Address of SCREEN RESET
lea MusEnd(pc),a3 * Address of QUIT
moveq #0,d1 * Returns NUMBER OF EXTENSION
movem.l (sp)+,a4-a6
moveq #0,d0 * NO ERRORS
rts
******* SCREEN RESET
MusDef:
lea MB(pc),a3
* Init narrator
bsr NarInit
* Init musique
bsr RazWave * Reset waves
move.l Buffer(a5),a0 * Draw square wave
move.l a0,a1
moveq #127,d0
MuDf1 move.b #-127,128(a0)
move.b #127,(a0)+
dbra d0,MuDf1
moveq #0,d1 * 0-> Noise
bsr NeWave
moveq #1,d1 * 1-> Square wave
bsr NeWave
move.w #LNoise/2-1,d2 * Draw first noise
move.w BSeed-MB(a3),d1
move.l WaveBase-MB(a3),a0
lea WaveDeb(a0),a0
MuDf2 add.w Circuits+6,d1
mulu #$3171,d1
lsr.l #8,d1
move.w d1,(a0)+
dbra d2,MuDf2
move.w d1,BSeed-MB(a3)
moveq #56,d0 * Default settings
moveq #%1111,d1
bsr Vol
bsr MVol
move.w #5,SamBank-MB(a3) * Sample bank=5
moveq #0,d0 * Sam loop off
moveq #-1,d1
bsr SL0
bsr MuInit
rts
******* Call normal error messages
OOMem moveq #24,d0 * Out of mem
bra.s IError
IFonc: moveq #23,d0 * Function call
IError: move.l MusAdr(pc),a0 * No need to care about SP!
jmp 4(a0)
******* Call customized error messages
WNDef moveq #0,d0
bra.s Custom
SNDef moveq #1,d0
bra.s Custom
BNSam moveq #2,d0
bra.s Custom
STSho moveq #3,d0
bra.s Custom
W0Res moveq #4,d0
bra.s Custom
MnRes moveq #5,d0
bra.s Custom
MNDef moveq #6,d0
Custom: moveq #0,d1 * Error can be trapped
lea MusErr(pc),a0 * Your list
move.l MusAdr(pc),a1
jmp 8(a1)
IBug: move.l MusAdr(pc),a0
jmp (a0)
******************************************************************
* MUSIC
******* MUSIC OFF-> Stops all musics
IMuSOff movem.l a0-a3/d0-d1,-(sp)
lea MB(pc),a3
clr.l MuBase-MB(a3)
clr.w MuNumber-MB(a3)
bsr MOff
movem.l (sp)+,a0-a3/d0-d1
rts
******* VOICE ON/OFF Voices
IVoice move.l (a3)+,d0
and.w #$000F,d0
move.l a3,-(sp)
lea MB(pc),a3
bsr VOnOf
movem.l (sp)+,a3
rts
***********************************************************
* =VU METRE(v)
FVu move.l (a3)+,d0
cmp.l #4,d0
bcc IFonc
lea MB(pc),a0
moveq #0,d3
move.b 0(a0,d0.w),d3
clr.b 0(a0,d0.w)
moveq #0,d2
rts
***********************************************************
* =MU BASE
FMB lea MB(pc),a0
move.l a0,d3
moveq #0,d2
rts
***********************************************************
* MUSIC TOKEN TABLE
* The next two lines NEED to be there...
Tk: dc.w 1,0
dc.b $80,-1
dc.w 1,FMB-Tk
dc.b "mubas","e"+$80,"0",-1
dc.w 1,FVu-Tk
dc.b "vumete","r"+$80,"00",-1
dc.w IVoice-Tk,1
dc.b "voic","e"+$80,"I0",-1
dc.w IMusOff-Tk,1
dc.b "music of","f"+$80,"I",-1
* You MUST finish the table by a ZERO
dc.w 0
*************** Welcome message
* 27 Y,position is like locate ,position...
MusWel: dc.b 27,"Y8Music player V 1.3",0
*************** ERROR MESSAGES
MusErr: dc.b "Wave not defined",0 *0
dc.b "Sample not defined",0 *1
dc.b "Sample bank not found",0 *2
dc.b "256 characters for a wave",0 *3
dc.b "Wave 0 and 1 are reserved",0 *4
dc.b "Music bank not found",0 *5
dc.b "Music not defined",0 *6
dc.b "Can't open narrator",0 *7
*************** That's it!
dc.l 0
I hope this will be useful to someone... that's 4 hours I won't get back!!
Regards,
Lonewolf10