From 7336daffbf816c78a8754b8a36e6cefaf55b136d Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 6 Jan 2020 19:44:51 -0500 Subject: [PATCH] fix y2k overflow. _ReadTimeHex returns the year as an offset from 1900, so 2020 is 120, which overflows ('0' + 12 is ascii '<') subtract 100, repeatedly, until it fits in 2 digits. Should last into 2100. --- src/asm/asm.opcodes.s | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/asm/asm.opcodes.s b/src/asm/asm.opcodes.s index 5b24291..e13a724 100644 --- a/src/asm/asm.opcodes.s +++ b/src/asm/asm.opcodes.s @@ -3941,7 +3941,11 @@ datop rep $30 pla xba and #$ff - jsr :num +]y2k cmp #100 + bcc :yy + sbc #100 + bne ]y2k +:yy jsr :num sta :buffer1+7 lda 1,s and #$ff