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