mirror of
https://github.com/cc65/cc65.git
synced 2025-01-29 21:31:53 +00:00
Merge pull request #2032 from jedeoric/telestrat_lseek
[Telestrat Target] Add fseek to telestrat target (Orix)
This commit is contained in:
commit
8692630369
@ -277,6 +277,8 @@ XRECLK = $3C ; Reset clock
|
||||
XCLCL = $3D ; Close clock
|
||||
XWRCLK = $3E ; Displays clock in the address in A & Y registers
|
||||
|
||||
XFSEEK = $3F ; Only in Orix
|
||||
|
||||
; Sound primitives
|
||||
XSONPS = $40 ; Send data to PSG register (14 values)
|
||||
XOUPS = $42 ; Send Oups sound into PSG
|
||||
|
39
libsrc/telestrat/lseek.s
Normal file
39
libsrc/telestrat/lseek.s
Normal file
@ -0,0 +1,39 @@
|
||||
;
|
||||
; Jede (jede@oric.org), 2023-03-13
|
||||
;
|
||||
|
||||
; off_t __fastcall__ lseek(int fd, off_t offset, int whence);
|
||||
|
||||
.export _lseek
|
||||
|
||||
.include "telestrat.inc"
|
||||
.include "zeropage.inc"
|
||||
|
||||
.import popax
|
||||
|
||||
.proc _lseek
|
||||
; Save whence
|
||||
sta tmp1
|
||||
; Skip X
|
||||
|
||||
; Get offset and store
|
||||
|
||||
jsr popax
|
||||
sta tmp2
|
||||
stx tmp3
|
||||
|
||||
jsr popax
|
||||
sta RESB
|
||||
stx RESB+1
|
||||
|
||||
; Get FD
|
||||
jsr popax
|
||||
; Does not need X
|
||||
sta RES ; Save FD
|
||||
|
||||
lda tmp2
|
||||
ldy tmp3
|
||||
ldx tmp1 ; Get whence
|
||||
BRK_TELEMON XFSEEK
|
||||
rts
|
||||
.endproc
|
Loading…
x
Reference in New Issue
Block a user