OpenCBM
Macros | Enumerations | Functions
upload.c File Reference

Shared library / DLL for accessing the driver. More...

#include "debug.h"
#include <stdlib.h>
#include "opencbm.h"
#include "archlib.h"

Go to the source code of this file.

Macros

#define DBG_USERMODE
 
#define DBG_PROGNAME   "OPENCBM.DLL"
 
#define DLL
 mark: We are building the DLL */
 

Enumerations

enum  { TRANSFER_SIZE_DOWNLOAD = 0x100u }
 Download data from a floppy's drive memory. More...
 

Functions

int CBMAPIDECL cbm_upload (CBM_FILE HandleDevice, unsigned char DeviceAddress, int DriveMemAddress, const void *Program, size_t Size)
 Upload a program into a floppy's drive memory. More...
 
int CBMAPIDECL cbm_download (CBM_FILE HandleDevice, unsigned char DeviceAddress, int DriveMemAddress, void *const Buffer, size_t Size)
 

Detailed Description

Shared library / DLL for accessing the driver.



Author
Michael Klein, Spiro Trikaliotis

Definition in file upload.c.

Macro Definition Documentation

#define DBG_PROGNAME   "OPENCBM.DLL"

The name of the executable

Definition at line 24 of file upload.c.

#define DBG_USERMODE

Mark: We are in user-space (for debug.h)

Definition at line 21 of file upload.c.

Enumeration Type Documentation

anonymous enum

Download data from a floppy's drive memory.

This function reads data from the drive's memory via use of "M-R" commands.

Parameters
HandleDeviceA CBM_FILE which contains the file handle of the driver.
DeviceAddressThe address of the device on the IEC serial bus. This is known as primary address, too.
DriveMemAddressThe address in the drive's memory where the program is to be stored.
BufferPointer to a byte buffer where the data from the drive's memory is stored.
SizeThe size of the data block to be stored, in bytes.
Returns
Returns the number of bytes written into the storage buffer. If it does not equal Size, than an error occurred. Specifically, -1 is returned on transfer errors.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 240 of file upload.c.

Function Documentation

int CBMAPIDECL cbm_upload ( CBM_FILE  HandleDevice,
unsigned char  DeviceAddress,
int  DriveMemAddress,
const void *  Program,
size_t  Size 
)

Upload a program into a floppy's drive memory.

This function writes a program into the drive's memory via use of "M-W" commands.

Parameters
HandleDeviceA CBM_FILE which contains the file handle of the driver.
DeviceAddressThe address of the device on the IEC serial bus. This is known as primary address, too.
DriveMemAddressThe address in the drive's memory where the program is to be stored.
ProgramPointer to a byte buffer which holds the program in the caller's address space.
SizeThe size of the program to be stored, in bytes.
Returns
Returns the number of bytes written into program memory. If it does not equal Size, than an error occurred. Specifically, -1 is returned on transfer errors.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 133 of file upload.c.

References cbm_listen(), cbm_raw_write(), cbm_unlisten(), DBG_ASSERT, FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_upload().