2001-03-13 22:48:19 +00:00
|
|
|
/*
|
|
|
|
* Marc 'BlackJack' Rintsch, 06.03.2001
|
|
|
|
*
|
2001-03-20 21:06:04 +00:00
|
|
|
* unsigned char cbm_load(const char* name, char device, unsigned int addr);
|
2001-03-13 22:48:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cbm.h>
|
2001-09-15 23:39:47 +00:00
|
|
|
#include <errno.h>
|
2001-03-30 18:18:40 +00:00
|
|
|
|
2001-03-13 22:48:19 +00:00
|
|
|
/* loads file "name" from given device to given address or to the load address
|
|
|
|
* of the file if addr is 0
|
|
|
|
*/
|
2001-03-20 21:06:04 +00:00
|
|
|
unsigned char cbm_load(const char* name, unsigned char device,
|
|
|
|
unsigned int addr)
|
2001-03-13 22:48:19 +00:00
|
|
|
{
|
|
|
|
/* LFN is set to 0 but it's not needed for loading.
|
2001-03-30 18:18:40 +00:00
|
|
|
* (BASIC V2 sets it to the value of the SA for LOAD) */
|
2001-03-20 21:06:04 +00:00
|
|
|
cbm_k_setlfs(0, device, addr == 0);
|
2001-03-13 22:48:19 +00:00
|
|
|
cbm_k_setnam(name);
|
2001-03-30 18:18:40 +00:00
|
|
|
return _oserror = cbm_k_load(0, addr);
|
2001-03-13 22:48:19 +00:00
|
|
|
}
|