2001-03-13 22:48:19 +00:00
|
|
|
/*
|
2014-06-30 09:10:35 +00:00
|
|
|
** Marc 'BlackJack' Rintsch, 06.03.2001
|
|
|
|
**
|
|
|
|
** unsigned int cbm_load(const char* name,
|
|
|
|
** unsigned char device,
|
|
|
|
** const unsigned char* data);
|
|
|
|
*/
|
2001-03-13 22:48:19 +00:00
|
|
|
|
|
|
|
#include <cbm.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
|
2014-06-30 09:10:35 +00:00
|
|
|
** of the file if "data" is 0
|
|
|
|
*/
|
2002-12-13 00:30:40 +00:00
|
|
|
unsigned int cbm_load(const char* name, unsigned char device, void* data)
|
2001-03-13 22:48:19 +00:00
|
|
|
{
|
2014-06-30 09:10:35 +00:00
|
|
|
/* LFN is set to 0; but, it's not needed for loading
|
|
|
|
** (BASIC V2 sets it to the value of the SA for LOAD).
|
|
|
|
*/
|
2001-10-10 20:35:07 +00:00
|
|
|
cbm_k_setlfs(0, device, data == 0);
|
2001-03-13 22:48:19 +00:00
|
|
|
cbm_k_setnam(name);
|
2001-10-10 20:35:07 +00:00
|
|
|
return (cbm_k_load(0, (unsigned int)data) - (unsigned int)data);
|
2001-03-13 22:48:19 +00:00
|
|
|
}
|