Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- axe = 1
- #define bcall(x) rst 28h \ .dw x
- .db $BB,$6D
- .org $9D95
- di
- xor a
- out (8),a
- call getsync
- ret nc
- call getb \ ld l,a
- ld h,0
- ; call getb \ ld h,a
- bcall(4792h)
- bcall(4156h
- bcall(4ABFh)
- ret
- getsync:
- ld a,$FE
- out (1),a
- in a,(1)
- and 40h
- ret z
- in a,(0)
- dec a
- jp nz,$-8
- scf
- ret
- getb:
- ;;I wrote a routine for a significant overhaul of Axe's routine.
- ;;The core part is a completely different design and algorithm, (much faster and somewhat smaller, just as accurate)
- ;;the syncing part at the beginning is mostly the same (but completely rewritten for this application).
- or a
- in a,(0)
- dec a
- ret nz ;If not, then go back
- inc a
- out (0),a ;Relay a confirmation
- ex (sp),hl ;Wait at until confirmation is read (59 T-states minimum)
- ex (sp),hl
- push bc
- dec a ;Store received byte in l
- ld bc,$08AA ;Bit counter in b, bit mask in c
- out (0),a ;Reset the ports to receive data
- _:
- in a,(0)
- xor c
- rra
- jr c,-_
- in a,(0)
- rra
- rra
- rr c
- djnz -_
- ld a,c
- pop bc
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement