mirror of
https://github.com/irmen/prog8.git
synced 2025-02-16 22:30:46 +00:00
add cx16diskio.vload_raw() to load headerless files into vram
This commit is contained in:
parent
8f9d1cfa30
commit
da8eb464b8
@ -37,14 +37,19 @@ cx16diskio {
|
||||
asmsub vload(str name @R0, ubyte device @Y, ubyte bank @A, uword address @R1) -> ubyte @A {
|
||||
; -- like the basic command VLOAD "filename",device,bank,address
|
||||
; loads a file into Vera's video memory in the given bank:address, returns success in A
|
||||
; the file has to have the usual 2 byte header (which will be skipped)
|
||||
%asm {{
|
||||
; -- load a file into video ram
|
||||
clc
|
||||
internal_vload:
|
||||
phx
|
||||
pha
|
||||
tya
|
||||
tax
|
||||
lda #1
|
||||
ldy #0
|
||||
bcc +
|
||||
ldy #%00000010 ; headerless load mode
|
||||
bne ++
|
||||
+ ldy #0 ; normal load mode
|
||||
+ lda #1
|
||||
jsr c64.SETLFS
|
||||
lda cx16.r0
|
||||
ldy cx16.r0+1
|
||||
@ -71,6 +76,15 @@ cx16diskio {
|
||||
}}
|
||||
}
|
||||
|
||||
asmsub vload_raw(str name @R0, ubyte device @Y, ubyte bank @A, uword address @R1) -> ubyte @A {
|
||||
; -- like the basic command BVLOAD "filename",device,bank,address
|
||||
; loads a file into Vera's video memory in the given bank:address, returns success in A
|
||||
; the file is read fully including the first two bytes.
|
||||
%asm {{
|
||||
sec
|
||||
jmp vload.internal_vload
|
||||
}}
|
||||
}
|
||||
|
||||
; replacement function that makes use of fast block read capability of the X16
|
||||
; use this in place of regular diskio.f_read()
|
||||
|
@ -365,6 +365,7 @@ cx16diskio (cx16 only)
|
||||
-----------------------
|
||||
Available for the Cx16 target. Contains extensions to the load and load_raw routines from the regular
|
||||
diskio module, to deal with loading of potentially large files in to banked ram (HiRam).
|
||||
Routines to directly load data into video ram are also present (vload and vload_raw).
|
||||
Also contains a helper function to calculate the file size of a loaded file (although that is truncated
|
||||
to 16 bits, 64Kb)
|
||||
|
||||
|
@ -4,7 +4,6 @@ TODO
|
||||
For next release
|
||||
^^^^^^^^^^^^^^^^
|
||||
- ir: asmsub contents remains blank in IR file
|
||||
- add cx16diskio.vload_raw() to load headerless files into vram
|
||||
- mention the syntax highlighting files in the readme and the docs, and add note to the IDEA one that it can also be used in Rider
|
||||
|
||||
...
|
||||
|
Loading…
x
Reference in New Issue
Block a user