mirror of
https://github.com/cc65/cc65.git
synced 2025-08-13 08:25:28 +00:00
Fixed the system banking in the cbm510 and the cbm610 targets' versions of clock_gettime() and clock_settime().
Their library function calls must run in the execution bank.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
;
|
;
|
||||||
; Stefan Haubenthal, 2009-07-27
|
; 2009-07-27, Stefan Haubenthal
|
||||||
; Ullrich von Bassewitz, 2009-09-24
|
; 2009-09-24, Ullrich von Bassewitz
|
||||||
; Oliver Schmidt, 2018-08-14
|
; 2018-08-18, Oliver Schmidt
|
||||||
|
; 2018-08-19, Greg King
|
||||||
;
|
;
|
||||||
; int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
; int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||||
;
|
;
|
||||||
@@ -21,10 +22,10 @@
|
|||||||
|
|
||||||
.proc _clock_gettime
|
.proc _clock_gettime
|
||||||
|
|
||||||
jsr sys_bank
|
|
||||||
jsr pushax
|
jsr pushax
|
||||||
jsr pushax
|
jsr pushax
|
||||||
|
|
||||||
|
jsr sys_bank
|
||||||
ldy #CIA::TODHR
|
ldy #CIA::TODHR
|
||||||
lda (cia2),y
|
lda (cia2),y
|
||||||
sed
|
sed
|
||||||
@@ -48,6 +49,10 @@
|
|||||||
lda (cia2),y
|
lda (cia2),y
|
||||||
jsr BCD2dec
|
jsr BCD2dec
|
||||||
sta TM + tm::tm_sec
|
sta TM + tm::tm_sec
|
||||||
|
ldy #CIA::TOD10
|
||||||
|
lda (cia2),y
|
||||||
|
jsr restore_bank
|
||||||
|
pha
|
||||||
lda #<TM
|
lda #<TM
|
||||||
ldx #>TM
|
ldx #>TM
|
||||||
jsr _mktime
|
jsr _mktime
|
||||||
@@ -57,19 +62,16 @@
|
|||||||
|
|
||||||
jsr load_tenth
|
jsr load_tenth
|
||||||
jsr pusheax
|
jsr pusheax
|
||||||
ldy #CIA::TOD10
|
pla
|
||||||
lda (cia2),y
|
|
||||||
ldx #>$0000
|
ldx #>$0000
|
||||||
jsr tosmul0ax
|
jsr tosmul0ax
|
||||||
|
|
||||||
ldy #timespec::tv_nsec
|
ldy #timespec::tv_nsec
|
||||||
jsr steaxspidx ; Pops address pushed by 1. pushax
|
jsr steaxspidx ; Pops address pushed by 1. pushax
|
||||||
|
|
||||||
jsr incsp1
|
lda #$00
|
||||||
|
|
||||||
lda #0
|
|
||||||
tax
|
tax
|
||||||
jmp restore_bank
|
jmp incsp1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
;
|
;
|
||||||
; Oliver Schmidt, 16.8.2018
|
; 2018-08-18, Oliver Schmidt
|
||||||
|
; 2018-08-19, Greg King
|
||||||
;
|
;
|
||||||
; int clock_settime (clockid_t clk_id, const struct timespec *tp);
|
; int clock_settime (clockid_t clk_id, const struct timespec *tp);
|
||||||
;
|
;
|
||||||
@@ -20,7 +21,6 @@
|
|||||||
|
|
||||||
.proc _clock_settime
|
.proc _clock_settime
|
||||||
|
|
||||||
jsr sys_bank
|
|
||||||
jsr pushax
|
jsr pushax
|
||||||
|
|
||||||
.assert timespec::tv_sec = 0, error
|
.assert timespec::tv_sec = 0, error
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
dey
|
dey
|
||||||
bpl @L1
|
bpl @L1
|
||||||
|
|
||||||
|
jsr sys_bank
|
||||||
lda TM + tm::tm_hour
|
lda TM + tm::tm_hour
|
||||||
jsr dec2BCD
|
jsr dec2BCD
|
||||||
tax ; Force flags
|
tax ; Force flags
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
jsr dec2BCD
|
jsr dec2BCD
|
||||||
ldy #CIA::TODSEC
|
ldy #CIA::TODSEC
|
||||||
sta (cia2),y
|
sta (cia2),y
|
||||||
|
jsr restore_bank
|
||||||
|
|
||||||
jsr ldax0sp
|
jsr ldax0sp
|
||||||
ldy #3+timespec::tv_nsec
|
ldy #3+timespec::tv_nsec
|
||||||
@@ -62,14 +64,15 @@
|
|||||||
jsr pusheax
|
jsr pusheax
|
||||||
jsr load_tenth
|
jsr load_tenth
|
||||||
jsr tosdiveax
|
jsr tosdiveax
|
||||||
|
|
||||||
|
jsr sys_bank
|
||||||
ldy #CIA::TOD10
|
ldy #CIA::TOD10
|
||||||
sta (cia2),y
|
sta (cia2),y
|
||||||
|
jsr restore_bank
|
||||||
|
|
||||||
jsr incsp3
|
lda #$00
|
||||||
|
|
||||||
lda #0
|
|
||||||
tax
|
tax
|
||||||
jmp restore_bank
|
jmp incsp3
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
;
|
;
|
||||||
; Stefan Haubenthal, 2009-07-27
|
; 2009-07-27, Stefan Haubenthal
|
||||||
; Ullrich von Bassewitz, 2009-09-24
|
; 2009-09-24, Ullrich von Bassewitz
|
||||||
; Oliver Schmidt, 2018-08-14
|
; 2018-08-18, Oliver Schmidt
|
||||||
|
; 2018-08-19, Greg King
|
||||||
;
|
;
|
||||||
; int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
; int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||||
;
|
;
|
||||||
@@ -21,10 +22,10 @@
|
|||||||
|
|
||||||
.proc _clock_gettime
|
.proc _clock_gettime
|
||||||
|
|
||||||
jsr sys_bank
|
|
||||||
jsr pushax
|
jsr pushax
|
||||||
jsr pushax
|
jsr pushax
|
||||||
|
|
||||||
|
jsr sys_bank
|
||||||
ldy #CIA::TODHR
|
ldy #CIA::TODHR
|
||||||
lda (cia),y
|
lda (cia),y
|
||||||
sed
|
sed
|
||||||
@@ -48,6 +49,10 @@
|
|||||||
lda (cia),y
|
lda (cia),y
|
||||||
jsr BCD2dec
|
jsr BCD2dec
|
||||||
sta TM + tm::tm_sec
|
sta TM + tm::tm_sec
|
||||||
|
ldy #CIA::TOD10
|
||||||
|
lda (cia),y
|
||||||
|
jsr restore_bank
|
||||||
|
pha
|
||||||
lda #<TM
|
lda #<TM
|
||||||
ldx #>TM
|
ldx #>TM
|
||||||
jsr _mktime
|
jsr _mktime
|
||||||
@@ -57,19 +62,16 @@
|
|||||||
|
|
||||||
jsr load_tenth
|
jsr load_tenth
|
||||||
jsr pusheax
|
jsr pusheax
|
||||||
ldy #CIA::TOD10
|
pla
|
||||||
lda (cia),y
|
|
||||||
ldx #>$0000
|
ldx #>$0000
|
||||||
jsr tosmul0ax
|
jsr tosmul0ax
|
||||||
|
|
||||||
ldy #timespec::tv_nsec
|
ldy #timespec::tv_nsec
|
||||||
jsr steaxspidx ; Pops address pushed by 1. pushax
|
jsr steaxspidx ; Pops address pushed by 1. pushax
|
||||||
|
|
||||||
jsr incsp1
|
lda #$00
|
||||||
|
|
||||||
lda #0
|
|
||||||
tax
|
tax
|
||||||
jmp restore_bank
|
jmp incsp1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
;
|
;
|
||||||
; Oliver Schmidt, 16.8.2018
|
; 2018-08-18, Oliver Schmidt
|
||||||
|
; 2018-08-19, Greg King
|
||||||
;
|
;
|
||||||
; int clock_settime (clockid_t clk_id, const struct timespec *tp);
|
; int clock_settime (clockid_t clk_id, const struct timespec *tp);
|
||||||
;
|
;
|
||||||
@@ -20,7 +21,6 @@
|
|||||||
|
|
||||||
.proc _clock_settime
|
.proc _clock_settime
|
||||||
|
|
||||||
jsr sys_bank
|
|
||||||
jsr pushax
|
jsr pushax
|
||||||
|
|
||||||
.assert timespec::tv_sec = 0, error
|
.assert timespec::tv_sec = 0, error
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
dey
|
dey
|
||||||
bpl @L1
|
bpl @L1
|
||||||
|
|
||||||
|
jsr sys_bank
|
||||||
lda TM + tm::tm_hour
|
lda TM + tm::tm_hour
|
||||||
jsr dec2BCD
|
jsr dec2BCD
|
||||||
tax ; Force flags
|
tax ; Force flags
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
jsr dec2BCD
|
jsr dec2BCD
|
||||||
ldy #CIA::TODSEC
|
ldy #CIA::TODSEC
|
||||||
sta (cia),y
|
sta (cia),y
|
||||||
|
jsr restore_bank
|
||||||
|
|
||||||
jsr ldax0sp
|
jsr ldax0sp
|
||||||
ldy #3+timespec::tv_nsec
|
ldy #3+timespec::tv_nsec
|
||||||
@@ -62,14 +64,15 @@
|
|||||||
jsr pusheax
|
jsr pusheax
|
||||||
jsr load_tenth
|
jsr load_tenth
|
||||||
jsr tosdiveax
|
jsr tosdiveax
|
||||||
|
|
||||||
|
jsr sys_bank
|
||||||
ldy #CIA::TOD10
|
ldy #CIA::TOD10
|
||||||
sta (cia),y
|
sta (cia),y
|
||||||
|
jsr restore_bank
|
||||||
|
|
||||||
jsr incsp3
|
lda #$00
|
||||||
|
|
||||||
lda #0
|
|
||||||
tax
|
tax
|
||||||
jmp restore_bank
|
jmp incsp3
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user