diff --git a/Config/CLOCK.S b/Config/CLOCK.S new file mode 100644 index 0000000..593e4fc --- /dev/null +++ b/Config/CLOCK.S @@ -0,0 +1,135 @@ + LST OFF + TR + TR ADR +*------------------------------- +* reconfigure clocks +*------------------------------- + + REL +point0 = $11 +point1 = $14 +clkdrv = $a00 + + DSK REL/CLOCK + +TopBox EXT ; routines external to this file +print EXT +cls EXT +start EXT +escape EXT +inpnum EXT +chinit EXT +wrtchg EXT + +gsclock EXT ;gs clock driver +serialpro EXT ;serialpro driver +thunder EXT ;thunderclock/timemaster driver +iicsys EXT ;iic system clock +mountain EXT ;mountain clock +prodos EXT ;standard prodos stuff +nullclk EXT ;no clock +noslot EXT ;no slot clock +versa EXT ;prometheus versacard +ultra EXT ;ultra clock driver + +re_clk ENT + JSR TopBox + JSR print + DB 1,2,30 + ASC '- Reconfigure Clock -' + DB 1,4,5 + ASC 'Please refer to Appendix C of your user' + ASC ' manual for more information.'00 + + JSR cls + LDX #start + JSR escape + + LDA #clkdrv + STA point1+1 + +IIeClk JSR print + DB 1,7,0 + + ASC ' 1 - Thunderclock Compatible ' + ASC ' 7 - ProDOS Compatible Clock'0D + ASC ' 2 - A.E. Timemaster II H.O. ' + ASC ' 8 - Mountain Hardware Clock'0D + ASC ' 3 - A.E. Serial Pro ' + ASC ' 9 - Prometheus Versacard'0D + ASC ' 4 - A.E. //c Ultra Clock ' + ASC '10 - Apple IIgs System Clock'0D + ASC ' 5 - A.E. //c System Clock ' + ASC '11 - No Clock in System'0D + ASC ' 6 - SMT No-Slot Clock'0D0D + + ASC 'Which? [1-11] '00 + + LDX #11 + JSR inpnum + + PHA + ASL + TAX + LDA :clktbl,X + STA point0 + INX + LDA :clktbl,X + STA point0+1 + + PLA + CMP #4 ;no slot clock + BEQ :noslot + CMP #5 ;no slot clock + BEQ :noslot + CMP #6 ;no clock in system + BEQ :noslot + CMP #10 + BEQ :noslot + CMP #11 + BNE :slot + PHA ; save fake slot + PHA ; save fake mode + JMP :done + +:slot JSR print + DB 1,16,0 + ASC 'Which slot/port does the clock use? [1-7] ',00 + + LDX #7 ; get slot + JSR inpnum + ASL + ASL + ASL + ASL +:noslot PHA ;save slot + +:done LDY #0 ;move the single page +:loop LDA (point0),Y ;source + STA (point1),Y ;destination + INY + BNE :loop + + LDY #0 + PLA ;get the slot back + STA (point1),Y + + JSR chinit ; check for init + JMP wrtchg ; write the changes + +:clktbl DA 0 + DA thunder + DA thunder + DA serialpro + DA ultra + DA noslot + DA iicsys + DA prodos + DA mountain + DA versa + DA gsclock + DA nullclk + diff --git a/Config/CLOCKS/CLK.IIC.SYS.S b/Config/CLOCKS/CLK.IIC.SYS.S new file mode 100644 index 0000000..266c8d0 --- /dev/null +++ b/Config/CLOCKS/CLK.IIC.SYS.S @@ -0,0 +1,155 @@ + LST OFF + TR + TR ADR +*------------------------------- +* //c System Clock - 24 hr +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + rel + dsk rel/iicsys + +lnbuf equ $200 + +ZBUF EQU $41 +PTR EQU $42 + +stat1 equ $c099 +comm1 equ $c09a +stat2 equ $c0a9 +comm2 equ $c0aa + +bytcnt equ $0e03 +nullptr equ $0a + + +iicsys ent + + org $0a00 + +*------------------------------- + +slot hex 20 + + jmp getdate + jmp gettime + jmp setdate + +; get the date in prodos/gbbs format +getdate jsr $bf00 ; read date from MLI + hex 82 + hex 0000 + + ldx $bf90 + lda $bf91 + +setdate rts + +; get the current time +gettime jsr rdclock ; read the clock + + lda #':' + sta timestr+2 ; put time dividers in + sta timestr+5 + + ldx #timestr + rts + +; read the date time from clock +rdclock lda slot + cmp #$10 + beq init1 + + lda #timestr + rts + +* read time from clock +*------------------------------- + +rdtime jsr rdclock ; read the clock + + lda #':' + sta timestr+2 ; put time dividers in + sta timestr+5 + + ldx #timestr + rts + +; read the date time from clock +rdclock lda #64 +init1_1 pha +init1_2 sbc #1 + bne init1_2 + pla + sbc #1 ; give plenty of setup delay + bne init1_1 + + php + sei +init1_3 lda comm1 ; get current setting + pha + + ldy #3 + ldx #22 + lda #8 +init2 sta comm1 ; send init sequence to clock + +init2_1 dex ; intra-bit delay + bne init2_1 + + eor #$0a ; toggle back and forth + ldx #11 + dey + bne init2 ; keep looping + + ldy #4 + ldx #8 + bne init3_2 ; skip initial delay + +init3 lda #$34 + sta timer ; delay while clock sets up +init3_1 dec timer ; to send the date/time + bne init3_1 + +init3_2 lda stat1 ; shift bit data into nibble + rol + rol + rol + ror datestr + dex + bne init3 ; go back to delay + + lda datestr + eor #0 ; save the nibble + sta datestr,y + + ldx #8 + dey + bpl init3 + + pla +init3_3 sta comm1 ; retore uart to initial settings + + ldy #15 + ldx #4 + +init4 lda datestr,x + pha + and #$0f ; process digit (make into ascii) + ora #$30 + sta datestr,y + + dey + pla + lsr + lsr + lsr ; process top of nibble + lsr + ora #$30 ; turn into ascii + sta datestr,y + + dey + dey + dex + bpl init4 + plp + rts + +* convert time to 12hr format +*---------------------------- + +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +timer hex 00 +datestr asc '00 00 00' +timestr asc '00:00:00 ' + + ds \ + diff --git a/Config/CLOCKS/IIGS.S b/Config/CLOCKS/IIGS.S new file mode 100644 index 0000000..59b9f76 --- /dev/null +++ b/Config/CLOCKS/IIGS.S @@ -0,0 +1,170 @@ + LST OFF + TR + TR ADR +*------------------------------- +* GS Clock driver bios +* Written by Andy Nicholas - 07/30/87 +* rewritten by Andy 3/11/88 +*------------------------------- + + xc ; goto 65816 mode + + rel + dsk CLOCKS/rel/gsclock + +gsclock ent + + org $A00 + +* Jump Table +*------------------------------- + +dow db 0 +mode db 0 + + jmp getdate ;call to get the date + jmp gettime ;call to get the time (formatted) + jmp setdate ;known return point + +* Read Clock from ProDOS +*------------------------------- + +mli equ $bf00 +date equ $bf90 + +getdate jsr mli ;read the clock into + hex 82 ;buffer at $200 + da 0 + + ldx date ;read date in compressed form + lda date+1 ;into A & X +setdate rts + +* get the current time +*------------------------------- + +gettime jsr rdtime + ldy #8 + lda mode + bpl gtime1 + jsr convert + ldy #11 + +gtime1 ldx #timestr + rts + +* read time from clock +*------------------------------- + +rdtime clc ;go to native mode + xce + rep #'0' ;and 16 bit A, X, and Y + + pha ;stack space for results + pha + pha + pha + ldx #$D03 ;ReadTimeHex + jsl $E10000 ;Tool Locater + sec + xce ;emulation mode + + pla ; seconds + jsr bindec8 ; convert to two byte + sta timestr+6 + stx timestr+7 + pla ; minutes + jsr bindec8 ; convert to two byte + sta timestr+3 + stx timestr+4 + pla ; hour + jsr bindec8 ; convert to two byte + sta timestr + stx timestr+1 + pla ; year + pla ; day of month + pla ; month + pla ; unused byte + pla ; day of the week + sta dow + + lda #' ' + sta timestr+9 + sta timestr+10 + + rts ;bye.. + +* convert time to 12hr format +*---------------------------- + +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$F + tay + txa + and #$F + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +* translate a binary to text [0-99] +*------------------------------- + +bindec8 cmp #60 ; put limit of 59 + bcc bin8 + lda #59 + +bin8 ldy #0 ; start 10's counter +bin8a cmp #10 + bcc bin8b ; less than 10, were done + + sbc #10 ; minus 10 + iny ; add 1 to the 10's counter + bne bin8a ; loop + +bin8b adc #'0' ; make 1's into text + tax ; save + tya + adc #'0' ; make 10's into text + rts ; were done + +* '01234567890 +timestr asc '12:00:00 ' + diff --git a/Config/CLOCKS/MAKE.CLOCKS.S b/Config/CLOCKS/MAKE.CLOCKS.S new file mode 100644 index 0000000..bee8405 --- /dev/null +++ b/Config/CLOCKS/MAKE.CLOCKS.S @@ -0,0 +1,40 @@ + asm thunder + ds \ + asm serialpro + ds \ + asm no.slot + ds \ + asm iic.sys + ds \ + asm iigs + ds \ + asm ultra + ds \ + asm prodos + ds \ + asm mountain + ds \ + asm versa + ds \ + asm null + + link rel/thunder + ds \ + link rel/serialpro + ds \ + link rel/no.slot + ds \ + link rel/iic.sys + ds \ + link rel/iigs + ds \ + link rel/ultra + ds \ + link rel/prodos + ds \ + link rel/mountain + ds \ + link rel/versa + ds \ + link rel/null + diff --git a/Config/CLOCKS/MOUNTAIN.S b/Config/CLOCKS/MOUNTAIN.S new file mode 100644 index 0000000..39019e7 --- /dev/null +++ b/Config/CLOCKS/MOUNTAIN.S @@ -0,0 +1,160 @@ + LST OFF + TR + TR ADR +*------------------------------- +* Mountian Hardware Driver +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + rel + dsk CLOCKS/rel/mountain + +mountain ent + + org $0a00 + +mli equ $bf00 +date equ $bf90 +time equ $bf92 +get_time equ $82 + + +slot hex 40 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr mli ; mli call + db get_time ; get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + lda mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* get time routine +*------------------- +rdtime jsr rdclock + lda #':' ; clean up format + sta timestr+2 + sta timestr+5 + rts + +* read time from clock +*---------------------- +rdclock lda $38 + pha + lda $39 ; save zp addresses + pha + lda slot + lsr + lsr + lsr + lsr + ora #$c0 + sta $39 ; point to clock entry + sta callclk+2 +callclk jsr $c000 ; call clock + pla + sta $39 + pla ; restore zp + sta $38 + + ldx #$0d + ldy #0 +movtime lda $286,x ; move returned string + and #$7f + sta datestr,y + iny + dex + bpl movtime + rts + +* convert time to 12hr format +*---------------------------- + +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +; convert a 2 byte decimal number to binary +decbin8 and #$7f + sec + sbc #'0' + sta decbyte ; save 10's digit + txa ; move 1's into A + and #$7f + sec + sbc #'0' + + ldy #10 +dec8a clc + adc decbyte ; add the 10's digit, 10 times + dey + bne dec8a + rts ; return with result + +decbyte hex 00 +datestr asc '00/00/00' +timestr asc '00:00:00 ' + + ds \ + diff --git a/Config/CLOCKS/NO.SLOT.S b/Config/CLOCKS/NO.SLOT.S new file mode 100644 index 0000000..4f29938 --- /dev/null +++ b/Config/CLOCKS/NO.SLOT.S @@ -0,0 +1,191 @@ + LST OFF + TR + TR ADR +*------------------------------- +* No Slot Clock - 24 hr +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + rel + dsk CLOCKS/rel/noslot + +ZBUF EQU $41 +PTR EQU $42 + +YEAR EQU $44 +HOURS EQU $48 +TEMP EQU $2F0 + +date equ $bf90 +get_time equ $82 + + +noslot ent + + org $0a00 + +*------------------------------- + + db $00 +MODE dfb $00 + JMP getdate + JMP getime + JMP setdate + +* +* TIME OUTPUT BUFFER +* + +TIME ASC '00:00:00 ' +* +* DEFINE RECOGNITION SEQUENCE FOR NO-SLOT CLOCK +* + +RECSEQ db $5C,$A3,$3A,$C5,$5C,$A3,$3A,$C5 + +* +* FORMAT NO-SLOT CLOCK DATE +* + +* get the date in prodos gbbs format +*------------------------------- + +getdate jsr $bf00 ; mli call + db get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* +* FORMAT NO-SLOT CLOCK TIME +* + +getime JSR RDCLOCK + LDY HOURS + LDA MODE + BEQ FMT24 + LDA #'M' + STA TIME+10 + LDX #'A' + SED + SEC + TYA + SBC #$12 + CLD + BCC SETHOUR + TAY + BNE NOTNOON + LDY #$12 +NOTNOON LDX #'P' +SETHOUR STX TIME+9 + TYA + BNE FMT24 + LDY #$12 +FMT24 TYA + LDY #0 + LDX #0 +FMT PHA + AND #$F0 + LSR + LSR + LSR + LSR + CLC + ADC #'0' + STA TIME,Y + INY + PLA + AND #$F + ADC #'0' + STA TIME,Y + INY + INY + INX + LDA HOURS,X + CPX #3 + BNE FMT + JSR ZRECALL +* + LDX #