From c4c14419fe7f58c0c9e846a3dd6eda343b791832 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Tue, 15 Nov 2022 20:36:19 -0800 Subject: [PATCH] Tidy following previous --- README.md | 2 ++ fujinet/fn.clock.system.s | 9 ++++----- fujinet/smartport.inc | 32 ++++++++++++++++---------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 08ec448..29b33df 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ This repo includes the following drivers/modifications: * Cricket! * Applied Engineering DClock * ROMX Real-Time Clock + * FujiNet Clock * RAM Disk drivers * RAMWorks Driver by Glen E. Bredon * Quit dispatcher/selector (`BYE` routines) @@ -55,6 +56,7 @@ The intent is that you use a tool like Copy II Plus or [Apple II DeskTop](https: * `PRODOS` - the operating system, e.g. [ProDOS 2.4](https://prodos8.com/) * `NS.CLOCK.SYSTEM` - install No-Slot clock driver, if present * `ROMXRTC.SYSTEM` - install ROMX clock driver, if present +* `FN.CLOCK.SYSTEM` - install FujiNet clock driver, if present * `DCLOCK.SYSTEM` - install DClock clock driver, if present * `CRICKET.SYSTEM` - install Cricket! clock driver, if present * `RAM.DRV.SYSTEM` - install RamWorks RAM disk driver, if present diff --git a/fujinet/fn.clock.system.s b/fujinet/fn.clock.system.s index 69a8b8e..d4e7ba6 100644 --- a/fujinet/fn.clock.system.s +++ b/fujinet/fn.clock.system.s @@ -72,8 +72,7 @@ port: .byte $00 ; Smartport device .byte 'P' ; Get datetime in ProDDOS format .endproc - sizeof_driver := .sizeof(driver) - .assert sizeof_driver <= 125, error, "Clock code must be <= 125 bytes" + .assert .sizeof(driver) <= 125, error, "Clock code must be <= 125 bytes" ;;; ------------------------------------------------------------ @@ -81,7 +80,7 @@ port: .byte $00 ; Smartport device .proc detect_fujinet_clock - ;; Serch for smartport cards + ;; Search for smartport cards ldx #$C7 ; Start the search from slot 7 search_slot: jsr find_smartport @@ -92,7 +91,7 @@ search_slot: jsr device_count cpx #$0 beq continue_slot_search; no devices in the slot - + search_unit: jsr unit_type cmp #FN_CLOCK_DEVICE_TYPE @@ -150,7 +149,7 @@ not_found: ;; Copy code lda RWRAM1 lda RWRAM1 - ldy #sizeof_driver-1 + ldy #.sizeof(driver)-1 loop: lda driver,y sta (ptr),y diff --git a/fujinet/smartport.inc b/fujinet/smartport.inc index f55c197..97030e8 100644 --- a/fujinet/smartport.inc +++ b/fujinet/smartport.inc @@ -2,11 +2,11 @@ ;;; Smartport access functions ;;; Derived from: http://mirrors.apple2.org.za/ground.icaen.uiowa.edu/MiscInfo/Programming/smartport.statusexample -;;This function scans the slots to locate a SmartPort. -;;On entry, X=$Cx, where x is the first slot to be checked. -;;On exit, X=$Cy, where y is the highest numbered slot less than or -;;equal to x which contains SmartPort firmware. If no SmartPort -;;is found, C=1 and A=$00. +;;; This function scans the slots to locate a SmartPort. +;;; On entry, X=$Cx, where x is the first slot to be checked. +;;; On exit, X=$Cy, where y is the highest numbered slot less than or +;;; equal to x which contains SmartPort firmware. If no SmartPort +;;; is found, C=1 and A=$00. ptr := $A5 ; Generic pointer .proc find_smartport @@ -43,26 +43,26 @@ not_here: RTS .endproc -;; This function sets up the SP_CALL function for calling the -;; SmartPort driver. On entry, X=$Cx, where x is the slot number -;; containing a SmartPort driver. This should be checked via -;; FIND_SMARTPORT if necessary - don't assume there is a SmartPort -;; device in slot 5, for example! +;;; This function sets up the SP_CALL function for calling the +;;; SmartPort driver. On entry, X=$Cx, where x is the slot number +;;; containing a SmartPort driver. This should be checked via +;;; FIND_SMARTPORT if necessary - don't assume there is a SmartPort +;;; device in slot 5, for example! .proc setup_smartport LDA #$00 STA ptr ; Set up the pointer STX ptr+1 LDY #$FF LDA (ptr),Y ; Get the ProDOS driver entry point - CLC + CLC ADC #$03 ; Get the SmartPort driver entry point STA sp_call_lo ; Store in the JSR STX sp_call_hi ; also store the high byte RTS .endproc -;; This function return in X the number of devices available -;; on a SmartPort +;;; This function return in X the number of devices available +;;; on a SmartPort .proc device_count LDA #$00 STA st_unit @@ -76,7 +76,7 @@ device_count_error: RTS .endproc -;; This function returns in A the device type for a unit in X +;;; This function returns in A the device type for a unit in X .proc unit_type STX st_unit LDA #$03 @@ -94,7 +94,7 @@ unit_type_error: -;; Status command parameters +;;; Status command parameters sp_call: JSR $0000 sp_call_hi = *-1 sp_call_lo = *-2 @@ -103,7 +103,7 @@ params_address: .word st_params RTS -st_params: +st_params: .byte $3 ; Parameter count st_unit:.byte $0 .word st_list