diff --git a/src/onbeyond/onbeyond.system.s b/src/onbeyond/onbeyond.system.s index 5272c6a..c0766c3 100644 --- a/src/onbeyond/onbeyond.system.s +++ b/src/onbeyond/onbeyond.system.s @@ -62,19 +62,21 @@ quit jsr $bf00 bne quit ;select interpreter by auxtype - ;3, 4, 5, "$55" (special case) + ;1, 3, 4, 5, "$55" (special case) lda c4_parms+5 + cmp #1 + beq + cmp #3 bcc quit cmp #$55 - beq + + beq ++ cmp #6 bcs quit - dec filename ++ dec filename ora #$30 sta version -+ +++ ;get volume name diff --git a/src/onbeyond/z1/0800-21ff.org b/src/onbeyond/z1/0800-21ff.org new file mode 100644 index 0000000..a825d1f Binary files /dev/null and b/src/onbeyond/z1/0800-21ff.org differ diff --git a/src/onbeyond/z1/0800-21ff.pak b/src/onbeyond/z1/0800-21ff.pak new file mode 100644 index 0000000..00269b9 Binary files /dev/null and b/src/onbeyond/z1/0800-21ff.pak differ diff --git a/src/onbeyond/z1/z1.s b/src/onbeyond/z1/z1.s new file mode 100644 index 0000000..839b79d --- /dev/null +++ b/src/onbeyond/z1/z1.s @@ -0,0 +1,582 @@ +;license:MIT +;(c) 2017-2018 by qkumba + +!cpu 6502 +!to "build/ONBEYONDZ1",plain +*=$3000 + +!macro version {!scrxor $80, "1/180221"} + + ;user-defined options + verbose_info = 0 ;set to 1 to enable display of memory usage + +gamename=$2940 +savename=$2980 +scrpname=$29C0 + +;unpacker variables, no need to change these +src = $0 +dst = $2 +ecx = $4 +last = $6 +tmp = $8 + +- jsr $bf00 +op_c7 + + !byte $c7 + !word c7_parms + ldx $200 + bne + + lda $bf30 + sta c5_parms+1 + jsr $bf00 + !byte $c5 + !word c5_parms + ldx $201 + inx + txa + and #$0f + sta $200 + lda #$2f + sta $201 + dec op_c7 + bne - ++ + + ldy $2006 + lda #'1' + sta gamename,y + lda #'Z' + sta gamename-1,y + lda #'V' + sta savename+1,y + lda #'A' + sta savename,y + lda #'S' + sta savename-1,y + lda #'G' + sta scrpname+1,y + lda #'O' + sta scrpname,y + lda #'L' + sta scrpname-1,y + dey + dey +- lda $2006,y + sta gamename,y + sta savename,y + sta scrpname,y + dey + bpl - + inc savename + inc scrpname + + lda $306 + eor $305 + eor $304 + eor $303 + eor $302 + eor $301 + eor $300 + eor #$a5 + beq + + ldx #0 + stx $303 ;no script + stx $304 + dex + stx $302 ;no load ++ + + jsr $fe93 + jsr $fc58 + lda #$17 + sta $25 + lda #0 + sta $24 + sta $57b + jsr $fc22 + ldy #0 + beq + +- jsr $fdf0 + iny ++ lda brandtext,y + bne - + + lda #>pakoff + sta src + 1 + lda #print + sta $1c40 + lda #printer + sta $1d95 + + lda $304 + beq + + lda #callbackprn1 + sta $1d7d ++ + ldx $302 + inx + beq + + lda $1d7c + sta loadcall1+1 + lda $1d7d + sta loadcall2+1 + lda #callback1 + sta $1d7d ++ + + lda #savefile + sta $206a + lda #loadfile + sta $2103 + lda #closefile + sta $20eb + sta $20f1 + sta $2197 + sta $219d + lda #quit + sta $1bc1 + + jsr closefile + lda #$60 + sta $7c ;! + jmp $800 + +brandtext + !scrxor $80, "ON BEYOND Z-MACHINE! REVISION " + +version + !byte 0 + +c7_parms + !byte 1 + !word $200 + +c5_parms + !byte 2 + !byte 0 + !word $201 + +unrelochdd +!pseudopc $2800 { + clc + adc #$c9 + sta pro_op + lda #0 + sta ce_parms+2 + lda $e2 + sta ce_parms+3 + lda $e3 + sta ce_parms+4 + lda $e5 + sta ca_parms+3 + +- jsr $bf00 + !byte $ce ;seek + !word ce_parms + bcc + + jsr $bf00 + !byte $d0 ;set EOF + !word ce_parms + bcc - + ++ + jsr $bf00 +pro_op + !byte $ca ;read file + !word ca_parms + bcs quit + rts + +printer + ldx $ed + lda #$8d + sta $200,x + inx + stx cb_parms+4 + lda #printer + sta $1c40 + + lda #