Mercurial > hg > Members > kono > os9 > sbc09
changeset 112:348d062ee8de
game09 load command
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 31 Dec 2018 21:26:53 +0900 |
parents | c4e909f21b25 |
children | a8b7dfc1baf5 |
files | game09/game09.asm |
diffstat | 1 files changed, 65 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/game09/game09.asm Mon Dec 31 17:51:27 2018 +0900 +++ b/game09/game09.asm Mon Dec 31 21:26:53 2018 +0900 @@ -29,11 +29,11 @@ DP4B equ $4B DP4E equ $4E "%" DP4F equ $4F -DP50 equ $50 "&" program top +DP50 equ $50 "&" program end DP52 equ $52 DP58 equ $58 program max -DP7C equ $7C "=" program current end -DP7E equ $7E program current end +DP7C equ $7C +DP7E equ $7E "=" program top DP82 equ $82 "@" DP83 equ $83 DP84 equ $84 @@ -54,7 +54,7 @@ lineend rmb 2 $A2 ustack rmb 128 linebuf rmb 252 -program rmb $2000 +program rmb $8000 size equ . name fcs "Game09" @@ -669,7 +669,7 @@ CLR <$8C LBSR LC373 BCS LC4A0 - LDD #LC3E8 + LDD #1000 LC4A0 STD <$88 LDB ,X CMPB #$2C @@ -926,9 +926,22 @@ STX +$03,S LC6A2 BITA #$DF BEQ LC6B0 - CMPA #$2C + CMPA #$2C , BEQ LC6AE - BSR LC6C9 + CMPA #$22 " + BNE LCXXX + leax 1,x + PSHS X + LDA #$22 +LXX1 tst ,x + beq LXX2 + cmpa ,x+ + bne LXX1 + clr -1,x + leax 1,x +LXX2 PULS D + BRA LC6B3 +LCXXX BSR LC6C9 BRA LC6B3 LC6AE LEAX +$01,X LC6B0 LDD #$FFFF @@ -1009,6 +1022,8 @@ FDB CAUTO-* FCB 'R','N',3 RENUM first line no,inc,renum start FDB RENUM-* + FCB 'L','D',1 load file-name + FDB pload-* * FCB 'R','D',3 DISK READ address,track,sector * FDB GETDK-* * FCB 'W','R',3 DISK WRITE @@ -1030,7 +1045,7 @@ LDD #$00A LC770 LDY ,U++ BPL LC779 - LDY #LC3E8 + LDY #1000 LC779 STY ,X++ LBSR LC173 LEAY D,Y @@ -1047,7 +1062,7 @@ LDD ,U BEQ LC79E BPL LC79C - LDD #LC3E8 + LDD #1000 LC79C STD <$88 LC79E CLR <$8C RTS @@ -1068,6 +1083,47 @@ SYSTEM clrb os9 F$Exit rts + +pload pshs a,x,y + ldx ,u + lda #1 + os9 I$Open + bcs ploaderr + sta ,s +ploadloop + lda ,s + ldx <DPWORK + leax linebuf,x + ldy #252 + os9 I$ReadLn + bcs ploaderr + lbsr LC373 + bcc ploadloop + ldy <$50 + std ,y++ + lda ,x+ + cmpa #$20 + bne ploaderr +pl01 lda ,x+ + beq pl02 + cmpa #$d + beq pl02 + cmpa #$a + beq pl02 + sta ,y+ + bra pl01 +pl02 clra + sta ,y+ + ldd #-1 + std ,y + sty <$50 + bra ploadloop +ploaderr + lda ,s + os9 I$Close + puls a,x,y + lbra warmst + emod eom equ * end