home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
simtel
/
sigm
/
vols000
/
vol058
/
music1.sqc
/
MUSIC1.SRC
Wrap
Text File
|
1985-02-09
|
8KB
|
320 lines
; MUSIC - Musicraft Development System
; copyright 1981 by COMPUTERCRAFT
IF NOT TRS80
ORG 100H
ELSE
ORG 7000H
ENDIF
MAIN$LINE:
JMP RESTART
IF NOT TRS80
BOOTER:
LXI SP,RESTART
LXI D,80H
MVI C,26
CALL CPM
LXI D,FCB ; READ FIRST
MVI C,20 ; BLOCK AND
CALL CPM ; IGNORE IT
DMVI BI,180H
BLOOP1:
LXI D,FCB ; READ A
MVI C,20 ; PROGRAM
CALL CPM ; BLOCK
ORA A
JNZ BDONE
LHLD BI
LXI D,80H
MVI B,80H
BLOOP2:
LDAX D
MOV M,A
INX H
INX D
DCR B
JNZ BLOOP2
SHLD BI
JMP BLOOP1
BDONE:
LXI D,SONG$NAME-1 ; PASS
LXI H,80H
MVI B,13 ; ANY
BLOOP:
LDAX D ; SONG
MOV M,A
INX D ; NAME
INX H
DCR B ; GIVEN
JNZ BLOOP
JMP RESTART
BI: DW 0
DB 0,0
ENDIF
SONG$NAME:
DB 'copyright 1981 by computercraft'
ORG MAIN$LINE+80H
RESTART:
LXI SP,STACK
CALL GET$NAME
CALL BEGIN
MNLN01:
CALL CLR$SCR
WRTLN MAIN$MENU
GTCH CH
MOV B,A
MIFI 'E',EDIT,BOOTER
MIFI 'C',COMP,BOOTER
MIFI 'P',PLAY,BOOTER
MIFI 'W',WAVE,BOOTER
MIFI 'S',SETUP,BOOTER
MIFI 'U',UTIL,BOOTER
MIFI 'H',HELP,MNLN01
MIFI 'N',NEW$NAME,MNLN01
MIFI 'Q',0,MNLN01
JMP MNLN01
CH: DB 0
MAIN$MENU:
DB 13,10
DB 13,10
DB ' *** Welcome to Musicraft 1.3 ***'
DB 13,10
DB ' written by'
DB 13,10
DB ' Paul J. Medlock'
DB 13,10
DB 13,10
DB ' Type a...'
DB 13,10
DB 13,10
DB ' E to create or edit a song'
DB 13,10
DB ' C to compile an edited song'
DB 13,10
DB ' P to play a compiled song'
DB 13,10
DB ' W to synthesize a waveform'
DB 13,10
DB ' S to setup or modify your'
DB 13,10
DB ' configuration'
DB 13,10
DB ' U for jukebox edit, song '
DB 13,10
DB ' print, modem transfers'
DB 13,10
DB ' and other useful functions'
DB 13,10
DB ' H for helpful information'
DB 13,10
DB ' N to work with a new song'
DB 13,10
DB ' Q to quit the Musicraft system'
DB 13,10
DB 13,10
DB ' ...>'
DB '$'
NEW$NAME:
CALL CLR$SCR
WRTLN NWNML1
REDLN SONG$NAME,12
RET
NWNML1: DB 'Enter name of song >','$'
GET$NAME:
IF NOT TRS80
DMVI SONG$NAME-1,0
FCHI SONG$NAME,12,SPACE
LDA TBUF
ORA A
RZ
STA SONG$NAME-1
LXI H,TBUF+1
LXI D,SONG$NAME
CALL MOVELEFT
ENDIF
RET
EDIT:
RESET FCB,EDIT$NAME,'C','O','M'
RET
COMP:
RESET FCB,COMP$NAME,'C','O','M'
RET
PLAY:
RESET FCB,PLAY$NAME,'C','O','M'
RET
WAVE:
RESET FCB,WAVE$NAME,'C','O','M'
RET
SETUP:
RESET FCB,SETP$NAME,'C','O','M'
RET
UTIL:
RESET FCB,UTIL$NAME,'C','O','M'
RET
DB 4,4
EDIT$NAME:
DB 'EDIT'
DB 4,4
COMP$NAME:
DB 'COMP'
DB 4,4
PLAY$NAME:
DB 'PLAY'
DB 4,4
WAVE$NAME:
DB 'WAVE'
DB 5,5
SETP$NAME:
DB 'SETUP'
DB 4,4
UTIL$NAME:
DB 'UTIL'
HELP:
RESET FCB,HELP$NAME,'M','U','S'
CALL LOAD$TEXT
MOVI EXTKEY,'$'
FCHI HLDKEY,20,SPACE
CALL INTERACT
RET
DB 4,4
HELP$NAME:
DB 'HELP'
LOAD$TEXT:
CALL CLR$SCR
WRTLN LOAD$MSSG
DMVI LDI,0
LDLOOP:
READF FCB,CH
RC
XPUT TEXT$WORK,LDI
DINC LDI
JMP LDLOOP
LDI: DW 0
LOAD$MSSG:
DB 13,10
DB 'Loading..please stand by.'
DB '$'
INTERACT:
CALL NEXT$MSSG ; DISPLAY
CALL CLR$SCR ; NEXT
LHLD INTMSSG ; FRAME
CALL FWRTLN
GTCH CH
MCPI JMPKEY,SPACE ; TAKE
JZ INTDPR ; ANY
LMVI JMPKEY,CALKEY,20 ; JUMP
JMP INTERACT
INTDPR:
MCPI CH,0DH
JZ INTQUIT
LMVI HLDKEY,CALKEY,20
DMVI INTI,-1
INTLOOP:
DINC INTI ; DESCEND
XGET CALKEY,INTI
CPI SPACE ; INTO
JNZ INTLOOP
LDA CH ; THE
XPUT CALKEY,INTI
LMVI HLDKEY,EXTKEY,20 ; STRUCTURE
LMVI CALKEY,HLDKEY,20
JMP INTERACT
INTQUIT:
MCPI EXTKEY,'$' ; CHECK FOR
RZ ; RETURN
LMVI EXTKEY,CALKEY,20
LMVI EXTKEY,HLDKEY,20 ; ASCEND
DMVI INTI,20
INTQLOOP: ; OUT
DDEC INTI
DCPI INTI,0
JZ INTDLR
XGET EXTKEY-1,INTI ; OF
CPI SPACE
JZ INTQLOOP ; THE
MVI A,SPACE
XPUT EXTKEY-1,INTI ; STRUCTURE
JMP INTERACT
INTDLR:
MOVI EXTKEY,'$'
JMP INTERACT
INTI: DW 0
INTJ: DW 0
INTC1: DB 0
INTC2: DB 0
INTMSSG: DW 0
NEXT$MSSG:
MOVI JMPKEY,SPACE
DMVI INTI,-1
FNDLOP1:
DINC INTI ; FIND LINE FEED
XGET TEXT$WORK,INTI
CPI 0AH
JNZ FNDLOP1
DINC INTI ; FIND SCREEN MARK
XGET TEXT$WORK,INTI
CPI '$'
JNZ FNDLOP1
DINC INTI
XGET TEXT$WORK,INTI ; TEST FOR
CPI '$'
JZ INTQUIT ; END OF SCREENS
DDEC INTI
DMVI INTJ,-1
FNDLOP2:
DINC INTI
DINC INTJ
XGET CALKEY,INTJ
CPI SPACE
JZ FNDONE
STA INTC1
XGET TEXT$WORK,INTI
MOV B,A
LDA INTC1
CMP B
JNZ FNDLOP1
JMP FNDLOP2
FNDONE:
XGET TEXT$WORK,INTI
CPI ':'
JZ FNDJMP
CPI 0DH
JNZ FNDLOP1
FNDEXT:
DADI INTMSSG,INTI,TEXT$WORK+2
RET
FNDJMP:
DMVI INTJ,-1
FNDJLP:
DINC INTI
DINC INTJ
XGET TEXT$WORK,INTI
CPI 0DH
JZ FNDEXT
XPUT JMPKEY,INTJ
JMP FNDJLP