mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-08-31 13:29:30 +00:00
Page:
File I O
Pages
CATalog files
COPY files
Chat Client Server
Command Line Argument Parsing
Console I O
DELete fles
Double Lo Res Graphics
Double Lo Res Test
Fiber Threads
File I O
Game Port SPI I O
Game Port SPI SD FAT
Game Port Wiring
HTTP Server
Hello World
Hi Res Graphics
Hi Res Test
Home
Installation Guide
Joystick and Buzz
Lo Res Graphics Library
Long Jump
Memory Manager
Music Player
Music Sequencer
NEWDIR
Network I O
PLASM compiler
PLASMA Byte Codes
PLASMA JIT Compiler Implementation
Porting Guide
REName files
ROGUE
RPN Calculator
Rod's Colors
SANE Floating Point
Sieve
System Library
TYPE file
Trivial FTP Daemon
Variable assignment and addressing explained
ZIPCHIP
Zero Page Usage (Apple IIe 64K )
code text Editor
17
File I O
4am edited this page 2020-07-09 20:08:50 -04:00
A library to interface to either SOS on the Apple /// or ProDOS on the Apple II.
Compatibility: 1*, II, ///
* Apple 1 only supports reading of entire file at once
Usage: include "inc/fileio.plh"
Values:
//
// Useful ProDOS values
//
// MACHID is defined in cmdsys.plh
// Which slot has a ROM
const SLTBYT = $BF99
// Prefix active
const PFIXPTR = $BF9A
// Memory alocate bitmap
const MEMTABL = $BF58
//
// SOS/ProDOS error codes
//
const FILE_ERR_OK = $00
const FILE_ERR_BAD_CALL_NUM = $01
const FILE_ERR_BAD_PARAM_CNT = $04
const FILE_ERR_INT_TBL_FULL = $25
const FILE_ERR_IO = $27
//
// File info struc
//
struc t_fileinfo
byte file_access
byte file_type
word aux_type
byte storage_type
word blocks_used
word mod_date
word mod_time
word create_date
word create_time
end
//
// Globally accessible error code
//
byte perr
API:
fileio:getpfx(path)
fileio:setpfx(path)
fileio:getfileinfo(path, fileinfo)
fileio:geteof(refnum)
fileio:open(path)
fileio:close(refnum)
fileio:read(refnum, buf, len)
fileio:write(refnum, buf, len)
fileio:create(path, type, aux)
fileio:destroy(path)
fileio:newline(refnum, emask, nlchar)
fileio:readblock(unit, buf, block)
fileio:writeblock(unit, buf, block)
Source Code: fileio.pla