From e3df1fea4a18b97997d55ac33c20e4de4851c6ac Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 31 Mar 2005 07:24:01 +0000 Subject: [PATCH] Update from Oliver Schmidt git-svn-id: svn://svn.cc65.org/cc65/trunk@3439 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/apple2/Makefile | 2 ++ libsrc/apple2/dioopen.s | 16 ++++++++++------ libsrc/apple2/diosectcount.s | 12 ++++++++++++ libsrc/apple2/diosectsize.s | 12 ++++++++++++ libsrc/apple2enh/Makefile | 8 ++++++++ 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 libsrc/apple2/diosectcount.s create mode 100644 libsrc/apple2/diosectsize.s diff --git a/libsrc/apple2/Makefile b/libsrc/apple2/Makefile index c59428871..697459bee 100644 --- a/libsrc/apple2/Makefile +++ b/libsrc/apple2/Makefile @@ -53,6 +53,8 @@ OBJS= _scrsize.o \ diocommon.o \ dioopen.o \ dioread.o \ + diosectcount.o \ + diosectsize.o \ diowrite.o \ dosdetect.o \ get_ostype.o \ diff --git a/libsrc/apple2/dioopen.s b/libsrc/apple2/dioopen.s index 1d114f312..16269daa2 100644 --- a/libsrc/apple2/dioopen.s +++ b/libsrc/apple2/dioopen.s @@ -6,7 +6,7 @@ ; drive_id = (slot * 2) + (drive - 1) .export _dio_open - .import decaxy, return0 + .import return0 .include "zeropage.inc" .include "errno.inc" @@ -21,15 +21,19 @@ _dio_open: asl asl asl + tay ; Save handle + + ; Set handle sta mliparam + MLI::ON_LINE::UNIT_NUM ; Alloc 16-byte buffer just below stack - ldy #16 lda sp - ldx sp+1 - jsr decaxy + sec + sbc #16 sta mliparam + MLI::ON_LINE::DATA_BUFFER - stx mliparam + MLI::ON_LINE::DATA_BUFFER+1 + lda sp+1 + sbc #$00 + sta mliparam + MLI::ON_LINE::DATA_BUFFER+1 ; Get device state lda #ON_LINE_CALL @@ -43,7 +47,7 @@ _dio_open: bcc oserr ; Return success -: lda mliparam + MLI::ON_LINE::UNIT_NUM +: tya ; Restore handle ldx #$00 stx __oserror rts diff --git a/libsrc/apple2/diosectcount.s b/libsrc/apple2/diosectcount.s new file mode 100644 index 000000000..299314278 --- /dev/null +++ b/libsrc/apple2/diosectcount.s @@ -0,0 +1,12 @@ +; +; Oliver Schmidt, 31.03.2005 +; +; sectnum_t __fastcall__ dio_query_sectcount(dhandle_t handle); +; + + .export _dio_query_sectcount + +_dio_query_sectcount: + lda #<280 + ldx #>280 + rts diff --git a/libsrc/apple2/diosectsize.s b/libsrc/apple2/diosectsize.s new file mode 100644 index 000000000..16287a2ec --- /dev/null +++ b/libsrc/apple2/diosectsize.s @@ -0,0 +1,12 @@ +; +; Oliver Schmidt, 31.03.2005 +; +; sectsize_t __fastcall__ dio_query_sectsize(dhandle_t handle); +; + + .export _dio_query_sectsize + +_dio_query_sectsize: + lda #<512 + ldx #>512 + rts diff --git a/libsrc/apple2enh/Makefile b/libsrc/apple2enh/Makefile index ba7d3a787..7d91d049c 100644 --- a/libsrc/apple2enh/Makefile +++ b/libsrc/apple2enh/Makefile @@ -49,12 +49,20 @@ OBJS= _scrsize.o \ crt0.o \ ctype.o \ cvline.o \ + dioclose.o \ + diocommon.o \ + dioopen.o \ + dioread.o \ + diosectcount.o \ + diosectsize.o \ + diowrite.o \ dosdetect.o \ get_ostype.o \ getenv.o \ joy_stddrv.o \ kbhit.o \ mainargs.o \ + mli.o \ oserrlist.o \ randomize.o \ rcout.o \ -- 2.39.5