Mercurial > hg > Members > kono > nitros9-code
changeset 488:39bffcae0383
gfx, inkey and syscall are now linked from the Basic09 source directory
author | boisy |
---|---|
date | Wed, 09 Oct 2002 14:37:56 +0000 |
parents | 6e9b939a2272 |
children | c9cad71c4605 |
files | level1/cmds/gfx.asm level1/cmds/inkey.asm level1/cmds/makefile level1/cmds/syscall.asm |
diffstat | 4 files changed, 4 insertions(+), 425 deletions(-) [+] |
line wrap: on
line diff
--- a/level1/cmds/gfx.asm Wed Oct 09 14:32:49 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,283 +0,0 @@ -******************************************************************** -* GFX - CoCo 2 graphics subroutine module -* -* $Id$ -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ -* 1 Original Tandy/Microware version - - nam GFX - ttl CoCo 2 graphics subroutine module - -* Disassembled 98/09/25 21:47:16 by Disasm v1.6 (C) 1988 by RML - - ifp1 - use defsfile - endc - -tylg set Sbrtn+Objct -atrv set ReEnt+rev -rev set $01 -edition set 1 - - mod eom,name,tylg,atrv,start,size -u0000 rmb 0 -size equ . - -name fcs /GFX/ - fcb edition - -FuncTbl fdb Alpha-FuncTbl - fcc "Alpha" - fcb $FF - fdb Circle-FuncTbl - fcc "Circle" - fcb $FF - fdb Clear-FuncTbl - fcc "Clear" - fcb $FF - fdb CColor-FuncTbl - fcc "Color" - fcb $FF - fdb GColr-FuncTbl - fcc "GColr" - fcb $FF - fdb GLoc-FuncTbl - fcc "GLoc" - fcb $FF - fdb JoyStk-FuncTbl - fcc "JoyStk" - fcb $FF - fdb Line-FuncTbl - fcc "Line" - fcb $FF - fdb Mode-FuncTbl - fcc "Mode" - fcb $FF - fdb Move-FuncTbl - fcc "Move" - fcb $FF - fdb Point-FuncTbl - fcc "Point" - fcb $FF - fdb Quit-FuncTbl - fcc "Quit" - fcb $FF - fdb $0000 - -stkdepth set 9 - -start leas -stkdepth,s - ldd 2+stkdepth,s get parameter count - beq BadFunc - tsta param count greater than 255? - bne BadFunc yep, branch to error - leau >FuncTbl,pcr point to function pointer table -L007D ldy ,u++ get pointer to function - beq NoFunc - -* Compare passed function name to our list - ldx 4+stkdepth,s -L0084 lda ,x+ get passed param char - eora ,u+ XOR it with compared param char - anda #$DF make case same - beq L0094 branch if equal - leau -1,u back up one -L008E tst ,u+ - bpl L008E - bra L007D -L0094 tst -1,u - bpl L0084 - tfr y,d put funcion pointer in D - leay >FuncTbl,pcr point Y to table - leay d,y get function address - leax ,s - leau <$11,s - ldd stkdepth+2,s put parameter count in D - jmp ,y - -NoFunc ldb #E$NoRout - bra L00AF -BadFunc ldb #E$ParmEr $38 -L00AF coma - leas stkdepth,s - rts - -* Each subroutine enters with the following parameters -* B = parameter count -* X = temporary stack -* U = pointer to size of first parameter - -Mode lda #$0F - bra L00B9 - -Move lda #$15 -L00B9 cmpb #$03 correct number of params? - bne BadFunc - bra L010B - -CColor lda #$11 - bra L00DE - -Point cmpb #$03 correct number of params? - beq L00D4 - cmpb #$04 - bne BadFunc - leau <$19,s - lbsr L015E - leau <$11,s -L00D4 lda #$18 - bra L010B - -Clear cmpb #$01 correct number of params? - beq L00E4 - lda #$10 -L00DE cmpb #$02 - bne BadFunc - bra L0136 - -L00E4 lda #$13 - bra L0142 - -Line cmpb #$06 correct number of params? - bhi BadFunc - cmpb #$03 - bcs L015B - bitb #$01 - bne L0103 - leau <$19,s - cmpb #$04 - beq L00FE - leau <$21,s -L00FE bsr L015E - leau <$11,s -L0103 cmpb #$04 - bls L0109 - bsr L0164 -L0109 lda #$16 -L010B sta ,x+ - bsr L016E - bsr L016E - bra L0144 - -Circle cmpb #$05 correct number of params? - bhi L015B - cmpb #$02 - bcs L015B - bitb #$01 - beq L012E - leau <$15,s - cmpb #$03 - beq L0129 - leau <$1D,s -L0129 bsr L015E - leau <$11,s -L012E cmpb #$03 - bls L0134 - bsr L0164 -L0134 lda #$1A -L0136 sta ,x+ - bsr L016E - bra L0144 - -Alpha lda #$0E - bra L0142 - -Quit lda #$12 -L0142 sta ,x+ -L0144 bsr L0149 - leas stkdepth,s - rts - -L0149 tfr x,d - leax 2,s - pshs x - subd ,s++ - tfr d,y - lda #1 - os9 I$Write - rts - -L0159 leas $06,s -L015B lbra BadFunc -L015E lda #$11 - sta ,x+ - bra L016E -L0164 puls y - lda #$15 - sta ,x+ - bsr L016E - pshs y -L016E pshs y,b,a - ldd [,u++] - sta ,x+ - pulu y - leay -$01,y - beq L0183 - leay -$01,y - bne L0159 - tsta - bne L0159 - stb -$01,x -L0183 puls pc,y,b,a - -GLoc cmpb #$02 correct number of params? - bne L015B - ldx <$13,s - leax -$02,x - bne L015B - lda #1 standard out - ldb #SS.DStat - os9 I$GetStt - bcs L019C - stx [<$11,s] -L019C leas stkdepth,s - rts - -GColr cmpb #2 correct number of params? - beq L01AD - cmpb #$04 - bne L015B - bsr L0164 - bsr L0149 - bcs L019C -L01AD lda #$01 - ldb #$12 - os9 I$GetStt - bcs L019C - tfr a,b - bra L01ED -L01BA leau $04,u - pshs u,x - ldx -$02,u - ldu -$04,u - leax -$01,x - beq L01CC - leax -$01,x - bne L0159 - clr ,u+ -L01CC stb ,u+ - puls pc,u,x - -JoyStk cmpb #5 correct number of params? - bne L015B - clr ,x+ - bsr L016E - ldx -2,x - lda #1 - ldb #SS.Joy - os9 I$GetStt - bcs L019C - tfr a,b - bsr L01BA - tfr x,d - bsr L01BA - tfr y,d -L01ED bsr L01BA - leas stkdepth,s - rts - - emod -eom equ * - end
--- a/level1/cmds/inkey.asm Wed Oct 09 14:32:49 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -******************************************************************** -* Inkey - Key detect subroutine -* -* $Id$ -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ -* ? Original Tandy/Microware version -* 1 Put a proper edition number after the name BGP 98/10/26 - - nam Inkey - ttl Key detect subroutine - -* Disassembled 98/09/11 11:55:29 by Disasm v1.6 (C) 1988 by RML - - ifp1 - use defsfile - endc - -tylg set Sbrtn+Objct -atrv set ReEnt+rev -rev set $01 -edition set 1 - - mod eom,name,tylg,atrv,start,size - -u0000 rmb 0 -size equ . - -name fcs /Inkey/ - fcb edition - -start leax $04,s - ldd $02,s - cmpd #$0001 - beq L0033 - cmpd #$0002 - bne L0057 - ldd [<$04,s] - ldx $06,s - leax -$01,x - beq L0031 - leax -$01,x - bne L0057 - tfr b,a -L0031 leax $08,s -L0033 ldu $02,x - ldx ,x - ldb #$FF - stb ,x - cmpu #$0002 - bcs L0043 - stb $01,x -L0043 ldb #SS.Ready - os9 I$GetStt - bcs L0052 - ldy #0001 - os9 I$Read - rts -L0052 cmpb #E$NotRdy - bne L0059 - rts -L0057 ldb #E$ParmEr -L0059 coma - rts - - emod -eom equ * - end -
--- a/level1/cmds/makefile Wed Oct 09 14:32:49 2002 +0000 +++ b/level1/cmds/makefile Wed Oct 09 14:37:56 2002 +0000 @@ -2,6 +2,7 @@ DEPENDS = ./Makefile +BASIC09FILES = gfx.asm inkey.asm syscall.asm COCOCMDS_D1 = attr backup binex build cmp copy date \ dcheck debug deiniz del deldir dir display dsave dump \ echo edit error exbin free help ident iniz link \ @@ -37,3 +38,6 @@ showdragonobjs: @$(ECHO) $(CMDS) $(DRAGONCMDS) + +$(BASIC09FILES): $(BASEDIR)/3rdparty/packages/basic09/$@ + -$(SOFTLINK) $(BASEDIR)/3rdparty/packages/basic09/$@
--- a/level1/cmds/syscall.asm Wed Oct 09 14:32:49 2002 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -******************************************************************** -* SysCall - system call subroutine module -* -* $Id$ -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ -* 2 From OS-9 Level Two Vr. 2.00.01 Basic09 disk - - nam SysCall - ttl system call subroutine module - -* Disassembled 02/07/06 13:11:18 by Disasm v1.6 (C) 1988 by RML - - ifp1 - use defsfile - endc - -tylg set Sbrtn+Objct -atrv set ReEnt+rev -rev set $01 -edition set 2 - - mod eom,name,tylg,atrv,start,size - -u0000 rmb 0 -size equ . - -name fcs /SysCall/ - fcb edition - -start ldd $02,s get number of parameters - cmpd #$0002 two? - bne L005C if not, error - ldd $0A,s get size of second parameter - cmpd #R$PC appropriate registers? - bne L005C branch if not - ldd [<$04,s] get address of first parameter - ldx $06,s get size of first parameter - leax -$01,x - beq L0034 - leax -$01,x - bne L005C - tfr b,a -L0034 ldb #$39 get rts - pshs b,a put it and os9 func code on stack - ldd #$103F get SWI2 instruction - pshs b,a put on stack - ldu $0C,s get pointer to caller's registers on stack - ldd R$D,u - ldx R$X,u - ldy R$Y,u - ldu R$U,u - jsr ,s branch to subroutine - pshs u,cc - ldu $0F,s - leau R$U,u - pshu y,x,dp,b,a - puls x,a - sta ,-u - stx $08,u - leas $04,s - clrb - rts - -L005C comb - ldb #E$ParmEr - rts - - emod -eom equ * - end