]> git.sur5r.net Git - cc65/blob - libsrc/cbm/cbm_load.c
info about c1541 in docs, lowered highest available address to $6000 due to
[cc65] / libsrc / cbm / cbm_load.c
1 /*
2  * Marc 'BlackJack' Rintsch, 06.03.2001
3  *
4  * unsigned char cbm_load(const char* name, char device, unsigned int addr);
5  */
6
7 #include <cbm.h>
8
9 extern unsigned char _oserror;         
10
11 /* loads file "name" from given device to given address or to the load address
12  * of the file if addr is 0
13  */
14 unsigned char cbm_load(const char* name, unsigned char device,
15                        unsigned int addr)
16 {
17     /* LFN is set to 0 but it's not needed for loading.
18      * (BASIC V2 sets it to the value of the SA for LOAD) */
19     cbm_k_setlfs(0, device, addr == 0);
20     cbm_k_setnam(name);
21     return _oserror = cbm_k_load(0, addr);
22 }