add cx16.memory_decompress_from_func()

This commit is contained in:
Irmen de Jong
2025-04-05 23:15:59 +02:00
parent f1fec37c79
commit 05eb15d4f7
3 changed files with 20 additions and 1 deletions

View File

@@ -4,12 +4,16 @@
; NOTE: If you experience weird behavior with these routines and you are using them
; in the X16 emulator using HostFs, please try again with an SD-card image instead first.
; It is possible that there are still small differences between HostFS and actual CBM DOS in the emulator.
;
; About the secondary addresses:
; for writes (new files or overwrites), you can use 1 (without the mode string) or 2-14 (with the mode string)
; for reads (existing files) you can use 0 or 2-14 (mode string is optional)
; for modify mode (new files* or existing files), you must use 2-14, and the mode string ,s,m is required
; About the Dos/Drive error status message:
; The routines don't usually read/clear the dos/drive error status and message. ("blinking red led")
; In case of an error, you usually have to read/clear that yourself (with status() for example).
%import textio
%import conv
@@ -980,6 +984,7 @@ io_error:
sub exists(str filename) -> bool {
; -- returns true if the given file exists on the disk, otherwise false
; DON'T use this if you already have a file open with f_open!
; NOTE: doesn't clear the dos error status and message, you'll have to read/clear that yourself (with status() for example)
if f_open(filename) {
f_close()
return true

View File

@@ -558,6 +558,7 @@ const ubyte EXTAPI_mouse_set_position = $0C
const ubyte EXTAPI_scnsiz = $0D
const ubyte EXTAPI_kbd_leds = $0E
const ubyte EXTAPI_memory_decompress_from_func = $0F
const ubyte EXTAPI_default_palette = $10
; extapi16 call numbers
const ubyte EXTAPI16_test = $00
@@ -668,6 +669,13 @@ asmsub scnsiz(ubyte width @X, ubyte heigth @Y) clobbers(A,X,Y) {
}}
}
asmsub memory_decompress_from_func(uword datafunction @R4, uword output @R1) clobbers(A,X,Y) -> uword @R1 {
%asm {{
lda #EXTAPI_memory_decompress_from_func
jmp cx16.extapi
}}
}
asmsub get_charset() -> ubyte @A {
;Get charset mode. result: 0=unknown, 1=ISO, 2=PETSCII upper case/gfx, 3=PETSCII lowercase.
%asm {{

View File

@@ -1,5 +1,10 @@
; shared CBM (C64/C128) disk drive I/O routines.
; About the Dos/Drive error status message:
; The routines don't usually read/clear the dos/drive error status and message. ("blinking red led")
; In case of an error, you usually have to read/clear that yourself (with status() for example).
%import textio
%import conv
%import strings
@@ -679,6 +684,7 @@ io_error:
sub exists(str filename) -> bool {
; -- returns true if the given file exists on the disk, otherwise false
; DON'T use this if you already have a file open with f_open!
; NOTE: doesn't clear the dos error status and message, you'll have to read/clear that yourself (with status() for example)
if f_open(filename) {
f_close()
return true