1 /*
2 ** Marc 'BlackJack' Rintsch, 06.03.2001
3 **
4 ** unsigned int __fastcall__ cbm_load(const char* name,
5 ** unsigned char device,
6 ** const unsigned char* data);
7 */
8
9 #include <cbm.h>
10
11 /* loads file "name" from given device to given address or to the load address
12 ** of the file if "data" is 0
13 */
cbm_load(const char * name,unsigned char device,void * data)14 unsigned int __fastcall__ cbm_load(const char* name, unsigned char device, void* data)
15 {
16 /* LFN is set to 0; but, it's not needed for loading
17 ** (BASIC V2 sets it to the value of the SA for LOAD).
18 */
19 cbm_k_setlfs(0, device, data == 0);
20 cbm_k_setnam(name);
21 return (cbm_k_load(0, (unsigned int)data) - (unsigned int)data);
22 }
23