Compare commits

...

3 Commits

Author SHA1 Message Date
Joshua Bell a519d0c619 Cricket: Make SET.TIME/SET.DATETIME time inputs 24-hour by default
The Cricket! can accept both 12-hour (with AM/PM suffix) and 24-hour
times. Unify with the No-Slot Clock UI and prompt for 24-hour.
2023-07-17 08:11:50 -07:00
frankmilliron b182a53dfa
The Cricket!: fix hang on Total Replay (#19)
* The Cricket!: fix hang on Total Replay

The Cricket reset command sends Total Replay into an endless loop when launched, presumably because of an interrupt situation (TR just does RTI on an interrupt). Toggling the COMMAND and CONTROL settings seems to allow TR to function properly, while also allowing the Cricket initialization code to silence any playing notes.

* The Cricket!: Reset Cricket before probing

Finds the Cricket every single time this way. Occasionally the driver would miss finding it due to it being in a wait state. Sending a reset first fixes that.

* The Cricket!: make sure registers are toggled for TR
2023-07-17 08:11:30 -07:00
frankmilliron 9401723f0d
The Cricket!: further refinements to 'SSC init' (#18)
//c technical reference includes a 'hardware reset' for three of the ACIA registers. Here we reset all three.
2023-07-16 13:30:04 -07:00
3 changed files with 41 additions and 18 deletions

View File

@ -77,12 +77,17 @@ ssc_not_found:
init_ssc:
php
sei
lda COMMAND ; save status of SSC registers
sta saved_command
lda CONTROL
sta saved_control
;; Reset SSC
sta KBDSTRB ; Port 2 DSR line connected to KBDSTRB
lda #0
sta COMMAND
sta CONTROL
;; Reset the Cricket (stops any playing notes & ensures Cricket is listening)
jsr restore_cmd_ctl ; have to change registers for this to work
jsr reset_cricket
jsr restore_cmd_ctl
jsr reset_cricket ; does it twice in original Cricket driver
jsr restore_cmd_ctl
;; Configure SSC
lda #%00001011 ; no parity/echo/interrupts, RTS low, DTR low
@ -90,15 +95,6 @@ init_ssc:
lda #%10011110 ; 9600 baud, 8 data bits, 2 stop bits
sta CONTROL
;; Reset Cricket
jsr readbyte ; done on original disk
lda #HI(ASCII_CR) ; two carriage returns
jsr sendbyte
lda #HI(ASCII_CR)
jsr sendbyte
lda #HI('!') ; Reset Cricket (everything but time/date)
jsr sendbyte
;; Read Cricket ID code: 00 ($00)
lda #0
jsr sendbyte
@ -125,10 +121,12 @@ digit: cmp #HI('0') ; < '0' ?
bcc :-
cricket_found:
jsr restore_cmd_ctl
plp
jmp install_driver
cricket_not_found:
jsr restore_cmd_ctl
plp
;; fall through...
@ -144,6 +142,31 @@ not_found:
sec ; failure
rts
reset_cricket:
lda #%00001011 ; no parity/echo/interrupts, RTS low, DTR low
sta COMMAND
lda #%10011110 ; 9600 baud, 8 data bits, 2 stop bits
sta CONTROL
jsr readbyte ; done on original disk
lda #HI(ASCII_CR) ; two carriage returns
jsr sendbyte
lda #HI(ASCII_CR)
jsr sendbyte
lda #HI('!') ; Reset Cricket (everything but time/date)
jsr sendbyte
rts
restore_cmd_ctl:
lda saved_control
sta CONTROL
lda saved_command
sta COMMAND
rts
saved_command: .byte 0
saved_control: .byte 0
.endproc
;; Write byte in A

View File

@ -61,7 +61,7 @@
;; Time
jsr zstrout
scrcode "\rTime: HH:MM:SS XM\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08"
scrcode "\rTime: HH:MM:SS\x08\x08\x08\x08\x08\x08\x08\x08"
.byte 0
jsr GETLN2
@ -82,7 +82,7 @@
sta CONTROL
;; Clock Commands
;; Set Time "ST HH:MM:SS:XM"
;; Set Time "ST HH:MM:SS"
lda #HI('S')
jsr sendbyte
lda #HI('T')

View File

@ -16,7 +16,7 @@
.proc main
jsr zstrout
scrcode "\rTime: HH:MM:SS XM\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08"
scrcode "\rTime: HH:MM:SS\x08\x08\x08\x08\x08\x08\x08\x08"
.byte 0
jsr GETLN2
@ -37,7 +37,7 @@
sta CONTROL
;; Clock Commands
;; Set Time "ST HH:MM:SS:XM"
;; Set Time "ST HH:MM:SS"
lda #HI('S')
jsr sendbyte
lda #HI('T')