make time zone work

This commit is contained in:
rumbledethumps
2025-12-02 21:37:14 -08:00
parent dbcfa91089
commit a6a91349bc
5 changed files with 77 additions and 22 deletions

View File

@@ -1,9 +0,0 @@
#include <rp6502.h>
#include <time.h>
int clock_gettimezone (time_t time, clockid_t clock_id, struct _timezone* tz);
void ria_tzset (unsigned long time)
{
clock_gettimezone (time, CLOCK_REALTIME, &_tz);
}

View File

@@ -0,0 +1,29 @@
; tzset_time.s
;
; This file is part of
; cc65 - a freeware C compiler for 6502 based systems
;
; https://cc65.github.io
;
; See "LICENSE" file for legal information.
;
; void __fastcall__ tzset_time (time_t* time);
;
.export _tzset_time
.import _clock_gettimezone, __tz
.import pushax, ldax0sp, ldeaxi, pusheax, pusha, incsp2
.include "time.inc"
_tzset_time:
jsr pushax
jsr ldax0sp
jsr ldeaxi
jsr pusheax
lda #CLOCK_REALTIME
jsr pusha
lda #<(__tz)
ldx #>(__tz)
jsr _clock_gettimezone
jmp incsp2