mirror of
https://github.com/mgcaret/davex-mg-utils.git
synced 2024-12-30 09:29:29 +00:00
detab setyear.s
This commit is contained in:
parent
cdf2db65d3
commit
7372aad10e
40
setyear.s
40
setyear.s
@ -17,7 +17,7 @@ tmp = xczpage
|
|||||||
year = tmp+1
|
year = tmp+1
|
||||||
count = year+1
|
count = year+1
|
||||||
|
|
||||||
prbyte = $fdda
|
prbyte = $fdda
|
||||||
;cout = $fded
|
;cout = $fded
|
||||||
|
|
||||||
DX_start dx_mg_auto_origin ; load address
|
DX_start dx_mg_auto_origin ; load address
|
||||||
@ -43,29 +43,29 @@ prbyte = $fdda
|
|||||||
bcs :+ ; not given, do it
|
bcs :+ ; not given, do it
|
||||||
rts
|
rts
|
||||||
; see if we can patch the driver
|
; see if we can patch the driver
|
||||||
: lda $c08b
|
: lda $c08b
|
||||||
lda $c08b
|
lda $c08b
|
||||||
ldx #$03
|
ldx #$03
|
||||||
: lda $d7b4,x ; tdays table, at september
|
: lda $d7b4,x ; tdays table, at september
|
||||||
cmp tdaysv,x ; that what ProDOS has?
|
cmp tdaysv,x ; that what ProDOS has?
|
||||||
bne setyterr ; not the thunderclock driver
|
bne setyterr ; not the thunderclock driver
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
; go ahead and patch
|
; go ahead and patch
|
||||||
ldx #6
|
ldx #6
|
||||||
: lda yeartab,x
|
: lda yeartab,x
|
||||||
sta $d7b8,x ; address of year table in P8
|
sta $d7b8,x ; address of year table in P8
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
bit $c082 ; ROM back before exit
|
bit $c082 ; ROM back before exit
|
||||||
rts
|
rts
|
||||||
setyterr: bit $c082 ; ROM back before death
|
setyterr: bit $c082 ; ROM back before death
|
||||||
lda #$01
|
lda #$01
|
||||||
jsr xredirect
|
jsr xredirect
|
||||||
jsr xmess
|
jsr xmess
|
||||||
asc_hi "Can't patch clock driver!"
|
asc_hi "Can't patch clock driver!"
|
||||||
.byte $00
|
.byte $00
|
||||||
jmp exiterr
|
jmp exiterr
|
||||||
badparms: lda #$01
|
badparms: lda #$01
|
||||||
jsr xredirect
|
jsr xredirect
|
||||||
jsr xmess
|
jsr xmess
|
||||||
@ -149,7 +149,7 @@ dayidx: .byte 1,0,6,5,4,3,2 ; MonSunSatFriThuWedTue
|
|||||||
; Table we will copy into ProDOS
|
; Table we will copy into ProDOS
|
||||||
yeartab: .res 7,$ff
|
yeartab: .res 7,$ff
|
||||||
; table to validate the P8 tclock driver, 4 bytes at $d7b4
|
; table to validate the P8 tclock driver, 4 bytes at $d7b4
|
||||||
tdaysv: .byte 242,20,51,81
|
tdaysv: .byte 242,20,51,81
|
||||||
; adapted from http://6502.org/source/misc/dow.htm
|
; adapted from http://6502.org/source/misc/dow.htm
|
||||||
; inputs: y = year (0-255 = 1900-2155)
|
; inputs: y = year (0-255 = 1900-2155)
|
||||||
; x = month
|
; x = month
|
||||||
@ -175,6 +175,6 @@ march: eor #$7f ; invert a so carry works right
|
|||||||
mod7: adc #7 ; returns (a+3) modulo 7
|
mod7: adc #7 ; returns (a+3) modulo 7
|
||||||
bcc mod7 ; for a in 0..255
|
bcc mod7 ; for a in 0..255
|
||||||
rts
|
rts
|
||||||
mtab: .byte 1,5,6,3,1,5,3,0,4,2,6,4 ; month offsets
|
mtab: .byte 1,5,6,3,1,5,3,0,4,2,6,4 ; month offsets
|
||||||
.endproc
|
.endproc
|
||||||
DX_end
|
DX_end
|
||||||
|
Loading…
Reference in New Issue
Block a user