-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathloader_api.h
More file actions
35 lines (26 loc) · 1.94 KB
/
loader_api.h
File metadata and controls
35 lines (26 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// FloppyBuilder/Loader system
// Compatible with both C and Assembler modules
//
#include "../build/floppy_description.h"
#define LOADER_SYSTEM_TYPE_MICRODISC 0
#define LOADER_SYSTEM_TYPE_JASMIN 1
#ifdef ASSEMBLER // 6502 Assembler API
#define LoadFileAt(fileIndex,address) lda #fileIndex:sta _LoaderApiEntryIndex:lda #<address:sta _LoaderApiAddressLow:lda #>address:sta _LoaderApiAddressHigh:jsr _LoadApiLoadFileFromDirectory
#define SaveFileAt(fileIndex,address) lda #fileIndex:sta _LoaderApiEntryIndex:lda #<address:sta _LoaderApiAddressLow:lda #>address:sta _LoaderApiAddressHigh:jsr _LoadApiSaveFileFromDirectory
#define InitializeFileAt(fileIndex,address) lda #fileIndex:sta _LoaderApiEntryIndex:lda #<address:sta _LoaderApiAddressLow:lda #>address:sta _LoaderApiAddressHigh:jsr _LoadApiInitializeFileFromDirectory
#else // C Compiler API
extern unsigned char LoaderApiSystemType; // 0=Microdisc, 1=Jasmin
extern unsigned char LoaderApiEntryIndex;
extern unsigned char LoaderApiAddressLow;
extern unsigned char LoaderApiAddressHigh;
extern void* LoaderApiAddress;
extern unsigned char LoaderApiFileSizeLow;
extern unsigned char LoaderApiFileSizeHigh;
extern unsigned int LoaderApiFileSize;
extern unsigned char LoaderApiFileStartSector;
#define LoadFileAt(fileIndex,address) LoaderApiEntryIndex=fileIndex;LoaderApiAddress=(void*)address;LoadApiLoadFileFromDirectory();
#define SaveFileAt(fileIndex,address) LoaderApiEntryIndex=fileIndex;LoaderApiAddress=(void*)address;LoadApiSaveFileFromDirectory();
#define InitializeFileAt(fileIndex,address) LoaderApiEntryIndex=fileIndex;LoaderApiAddress=(void*)address;LoadApiInitializeFileFromDirectory();
#define LoadFileUncompressedAt(fileIndex,address,compressedSize) LoaderApiEntryIndex=fileIndex;LoadApiInitializeFileFromDirectory();LoaderApiAddress=(void*)address;LoaderApiFileSize=compressedSize;LoaderApiFileStartSector&=127;LoaderApiLoadFile();
#endif