more work on register preservation

This commit is contained in:
FeralChild64 committed 2019-07-25 18:12:39 +02:00
1 parent a2c02bde97
commit 893371733b
3 files changed
+22 -15

No files matched your search

+10 -3
View File
@@ -8,20 +8,27 @@
;; CPU registers that has to be preserved (see [RG64]): .Y
;;
;; XXX currently does not preserve register Y, to be fixed!
clall:
;; Store .Y register
tya
pha
;; Original routine probably just sets LDTND to 0, but this is not really safe,
;; so we actually close all the channels; at least IDE64 does the same for
;; it's channels, see CLALL description in the IDE64 User's Guide
*
ldy LDTND
beq +
dey
lda LAT, y
jsr close ; XXX jump through ICLOSE?
jmp clall
jmp -
*
;; Restore .Y register
pla
tay
;; 'C64 Programmers Reference Guide', page 281, claims it calls CLRCHN too
jmp clrchn