Skip to content

Commit

Permalink
The Cricket!: Reset Cricket before probing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
frankmilliron authored Jul 17, 2023
1 parent 5295338 commit d20b3dd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions clocks/cricket/cricket.system.s
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ init_ssc:
lda CONTROL
sta saved_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
sta COMMAND
Expand Down Expand Up @@ -114,11 +121,6 @@ digit: cmp #HI('0') ; < '0' ?
bcc :-

cricket_found:
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
plp
jmp install_driver

Expand Down

0 comments on commit d20b3dd

Please sign in to comment.