OpenCBM
|
Execution functions of the VDD. More...
#include "config.h"
#include <windows.h>
#include <vddsvc.h>
#include "arch.h"
#include "debug.h"
#include "vdd.h"
#include "opencbm.h"
Go to the source code of this file.
Macros | |
#define | DBG_USERMODE |
#define | DBG_PROGNAME "OPENCBMVDD.DLL" |
#define | NEW_IMPLEMENTATION_WITH_SETRELEASE |
@@@ More... | |
#define | retAX(_x_) setAX((WORD) _x_) |
@@@ More... | |
#define | FUNC_CHECKEDBUFFERACCESS(_offset_, _length_) |
@@@ More... | |
#define | CHECKEDBUFFERACCESS_PROLOG() |
@@@ More... | |
#define | CHECKEDBUFFERACCESS_EPILOG() |
@@@ More... | |
#define | CHECKEDBUFFERACCESS(_func_) |
@@@ More... | |
#define | PP_XE_ATN_OUT 0x01 |
The ATN OUT bit for XE cables. | |
#define | PP_XE_CLK_OUT 0x02 |
The CLOCK OUT bit for XE cables. | |
#define | PP_XE_RESET_OUT 0x04 |
The RESET OUT bit for XE cables. | |
#define | PP_XE_DATA_OUT 0x08 |
The DATA OUT bit for XE cables. | |
#define | PP_XE_OUTEOR 0x00 |
eor mask for output for XE cables | |
#define | PP_XE_ATN_IN 0x10 |
The ATN IN bit for XE cables. | |
#define | PP_XE_CLK_IN 0x20 |
The CLOCK IN bit for XE cables. | |
#define | PP_XE_RESET_IN 0x40 |
The RESET IN bit for XE cables. | |
#define | PP_XE_DATA_IN 0x80 |
The DATA IN bit for XE cables. | |
#define | PP_XM_ATN_OUT PP_XE_ATN_OUT |
The ATN OUT bit for XM cables. | |
#define | PP_XM_CLK_OUT PP_XE_CLK_OUT |
The CLOCK OUT bit for XM cables. | |
#define | PP_XM_DATA_OUT PP_XE_RESET_OUT |
The DATA OUT bit for XM cables. | |
#define | PP_XM_RESET_OUT PP_XE_DATA_OUT |
The RESET OUT bit for XM cables. | |
#define | PP_XM_OUTEOR 0x00 |
eor mask for output for XM cables | |
#define | PP_XM_ATN_IN PP_XE_ATN_IN |
The ATN IN bit for XM cables. | |
#define | PP_XM_CLK_IN PP_XE_CLK_IN |
The CLOCK IN bit for XM cables. | |
#define | PP_XM_DATA_IN PP_XE_RESET_IN |
The DATA IN bit for XM cables. | |
#define | PP_XM_RESET_IN PP_XE_DATA_IN |
The RESET IN bit for XM cables. | |
#define | PP_XA_ATN_OUT PP_XM_ATN_OUT |
The ATN OUT bit for XM cables. | |
#define | PP_XA_CLK_OUT PP_XM_CLK_OUT |
The CLOCK OUT bit for XM cables. | |
#define | PP_XA_DATA_OUT PP_XM_DATA_OUT |
The DATA OUT bit for XM cables. | |
#define | PP_XA_RESET_OUT PP_XM_RESET_OUT |
The RESET OUT bit for XM cables. | |
#define | PP_XA_OUTEOR 0x0F |
eor mask for output for XA cables | |
#define | PP_XA_ATN_IN PP_XM_ATN_IN |
The ATN IN bit for XM cables. | |
#define | PP_XA_CLK_IN PP_XM_CLK_IN |
The CLOCK IN bit for XM cables. | |
#define | PP_XA_DATA_IN PP_XM_DATA_IN |
The DATA IN bit for XM cables. | |
#define | PP_XA_RESET_IN PP_XM_RESET_IN |
The RESET IN bit for XM cables. | |
Functions | |
BOOLEAN | vdd_driver_open (VOID) |
Opens the driver. More... | |
BOOLEAN | vdd_driver_close (CBM_FILE HandleDevice) |
Closes the driver. More... | |
BOOLEAN | vdd_get_driver_name (VOID) |
Get the name of the driver for a specific parallel port. More... | |
BOOLEAN | vdd_raw_write (CBM_FILE HandleDevice) |
Write data to the IEC serial bus. More... | |
BOOLEAN | vdd_raw_read (CBM_FILE HandleDevice) |
Read data from the IEC serial bus. More... | |
BOOLEAN | vdd_listen (CBM_FILE HandleDevice) |
Send a LISTEN on the IEC serial bus. More... | |
BOOLEAN | vdd_talk (CBM_FILE HandleDevice) |
Send a TALK on the IEC serial bus. More... | |
BOOLEAN | vdd_open (CBM_FILE HandleDevice) |
Open a file on the IEC serial bus. More... | |
BOOLEAN | vdd_close (CBM_FILE HandleDevice) |
Close a file on the IEC serial bus. More... | |
BOOLEAN | vdd_unlisten (CBM_FILE HandleDevice) |
Send an UNLISTEN on the IEC serial bus. More... | |
BOOLEAN | vdd_untalk (CBM_FILE HandleDevice) |
Send an UNTALK on the IEC serial bus. More... | |
BOOLEAN | vdd_get_eoi (CBM_FILE HandleDevice) |
Get EOI flag after bus read. More... | |
BOOLEAN | vdd_clear_eoi (CBM_FILE HandleDevice) |
Reset the EOI flag. More... | |
BOOLEAN | vdd_reset (CBM_FILE HandleDevice) |
RESET all devices. More... | |
BOOLEAN | vdd_pp_read (CBM_FILE HandleDevice) |
Read a byte from a XP1541/XP1571 cable. More... | |
BOOLEAN | vdd_pp_write (CBM_FILE HandleDevice) |
Write a byte to a XP1541/XP1571 cable. More... | |
BOOLEAN | vdd_iec_poll (CBM_FILE HandleDevice) |
Read status of all bus lines. More... | |
BOOLEAN | vdd_iec_set (CBM_FILE HandleDevice) |
Activate a line on the IEC serial bus. More... | |
BOOLEAN | vdd_iec_release (CBM_FILE HandleDevice) |
Deactivate a line on the IEC serial bus. More... | |
BOOLEAN | vdd_iec_setrelease (CBM_FILE HandleDevice) |
Activate and deactive a line on the IEC serial bus. More... | |
BOOLEAN | vdd_iec_wait (CBM_FILE HandleDevice) |
Wait for a line to have a specific state. More... | |
BOOLEAN | vdd_iec_get (CBM_FILE HandleDevice) |
Get the (logical) state of a line on the IEC serial bus. More... | |
BOOLEAN | vdd_upload (CBM_FILE HandleDevice) |
Upload a program into a floppy's drive memory. More... | |
BOOLEAN | vdd_device_status (CBM_FILE HandleDevice) |
Read the drive status from a floppy. More... | |
BOOLEAN | vdd_exec_command (CBM_FILE HandleDevice) |
Executes a command in the floppy drive. More... | |
BOOLEAN | vdd_identify (CBM_FILE HandleDevice) |
Identify the connected floppy drive. More... | |
BOOLEAN | vdd_identify_xp1541 (CBM_FILE HandleDevice) |
Identify the cable connected to a specific floppy drive. More... | |
BOOLEAN | vdd_install_iohook (CBM_FILE HandleDevice) |
Install the I/O hook. More... | |
USHORT | vdd_uninstall_iohook_internal (VOID) |
Uninstall the I/O hook. More... | |
BOOLEAN | vdd_uninstall_iohook (CBM_FILE HandleDevice) |
Uninstall the I/O hook. More... | |
BOOLEAN | vdd_usleep (VOID) |
Sleep some microseconds. More... | |
#define CHECKEDBUFFERACCESS | ( | _func_ | ) |
@@@
<em>func</em> |
Definition at line 113 of file execute.c.
Referenced by vdd_device_status(), vdd_exec_command(), vdd_open(), vdd_raw_read(), vdd_raw_write(), and vdd_upload().
#define CHECKEDBUFFERACCESS_EPILOG | ( | ) |
@@@
Definition at line 102 of file execute.c.
Referenced by vdd_get_driver_name(), and vdd_identify().
#define CHECKEDBUFFERACCESS_PROLOG | ( | ) |
@@@
Definition at line 87 of file execute.c.
Referenced by vdd_get_driver_name(), and vdd_identify().
#define DBG_PROGNAME "OPENCBMVDD.DLL" |
#define DBG_USERMODE |
#define FUNC_CHECKEDBUFFERACCESS | ( | _offset_, | |
_length_ | |||
) |
@@@
<em>offset</em> | |
<em>length</em> |
Definition at line 74 of file execute.c.
Referenced by vdd_device_status(), vdd_exec_command(), vdd_get_driver_name(), vdd_identify(), vdd_open(), vdd_raw_read(), vdd_raw_write(), and vdd_upload().
#define NEW_IMPLEMENTATION_WITH_SETRELEASE |
#define retAX | ( | _x_ | ) | setAX((WORD) _x_) |
@@@
<em>x</em> |
Definition at line 66 of file execute.c.
Referenced by vdd_clear_eoi(), vdd_close(), vdd_driver_open(), vdd_get_eoi(), vdd_identify_xp1541(), vdd_iec_get(), vdd_iec_poll(), vdd_iec_wait(), vdd_listen(), vdd_reset(), vdd_talk(), vdd_unlisten(), and vdd_untalk().
BOOLEAN vdd_clear_eoi | ( | CBM_FILE | HandleDevice | ) |
Reset the EOI flag.
This function resets the EOI ("End of Information") flag which might be still set after reading the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 545 of file execute.c.
References cbm_clear_eoi(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_close | ( | CBM_FILE | HandleDevice | ) |
Close a file on the IEC serial bus.
This function closes a file on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (CH) The address of the device on the IEC serial bus. This is known as primary address, too. |
SecondaryAddress | (CL) The secondary address for the device on the IEC serial bus. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 429 of file execute.c.
References cbm_close(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_device_status | ( | CBM_FILE | HandleDevice | ) |
Read the drive status from a floppy.
This function reads the drive status of a connected floppy drive.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (DH) The address of the device on the IEC serial bus. This is known as primary address, too. |
Buffer | (ES:SI) Pointer to a buffer which will hold the drive's status after successfull calling, |
BufferLength | (CX) The length of the buffer pointed to by Buffer in bytes. |
This function will never write more than BufferLength bytes. Nevertheless, the buffer will always be terminated with a trailing zero.
If an error occurs, this function returns a "99, DRIVER ERROR,00,00\r" and the value 99.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 924 of file execute.c.
References cbm_device_status(), CHECKEDBUFFERACCESS, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_driver_close | ( | CBM_FILE | HandleDevice | ) |
Closes the driver.
Closes the driver, which has be opened with vdd_driver_open() before.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
vdd_driver_close() should be called to balance a previous call to vdd_driver_open().
If vdd_driver_open() did not succeed, it is illegal to call vdd_driver_close().
Definition at line 186 of file execute.c.
References cbm_driver_close(), FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().
BOOLEAN vdd_driver_open | ( | VOID | ) |
Opens the driver.
This function Opens the driver.
PortNumber | (DH) The port number of the driver to open. 0 means "default" driver, while values != 0 enumerate each driver. |
vdd_driver_open() should be balanced with vdd_driver_close().
Definition at line 141 of file execute.c.
References cbm_driver_close(), cbm_driver_open(), CBM_FILE, FUNC_ENTER, FUNC_LEAVE_BOOLEAN, retAX, and vdd_cbmfile_store().
Referenced by VDDDispatch().
BOOLEAN vdd_exec_command | ( | CBM_FILE | HandleDevice | ) |
Executes a command in the floppy drive.
This function Executes a command in the connected floppy drive.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (DH) The address of the device on the IEC serial bus. This is known as primary address, too. |
Command | (ES:SI) Pointer to a string which holds the command to be executed. |
Size | (CX) The length of the command in bytes. If zero, the Command has to be a null-terminated string. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 957 of file execute.c.
References cbm_exec_command(), CHECKEDBUFFERACCESS, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_get_driver_name | ( | VOID | ) |
Get the name of the driver for a specific parallel port.
Get the name of the driver for a specific parallel port.
PortNumber | (DH) The port number for the driver to open. 0 means "default" driver, while values != 0 enumerate each driver. |
Buffer | (ES:SI) Buffer which will hold a string which tells the name of the device. |
Length | (CX) Length of the buffer at ES:SI |
Definition at line 220 of file execute.c.
References cbm_get_driver_name(), CHECKEDBUFFERACCESS_EPILOG, CHECKEDBUFFERACCESS_PROLOG, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_get_eoi | ( | CBM_FILE | HandleDevice | ) |
Get EOI flag after bus read.
This function gets the EOI ("End of Information") flag after reading the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
If a previous read returned less than the specified number of bytes, there are two possible reasons: Either an error occurred on the IEC serial bus, or an EOI was signalled. To find out the cause, check with this function.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 520 of file execute.c.
References cbm_get_eoi(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_identify | ( | CBM_FILE | HandleDevice | ) |
Identify the connected floppy drive.
This function tries to identify a connected floppy drive. For this, it performs some M-R operations.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (DH) The address of the device on the IEC serial bus. This is known as primary address, too. |
CbmDeviceString | (ES:SI) Buffer which will hold a string which tells the name of the device. |
Length | (CX) Length of the buffer at ES:SI |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 995 of file execute.c.
References cbm_identify(), CHECKEDBUFFERACCESS_EPILOG, CHECKEDBUFFERACCESS_PROLOG, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_identify_xp1541 | ( | CBM_FILE | HandleDevice | ) |
Identify the cable connected to a specific floppy drive.
This function tries to identify if the given floppy drive has an XP1541 cable connected.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (DH) The address of the device on the IEC serial bus. This is known as primary address, too. |
CbmDeviceType | (DI) Enum which holds the type of the device. If this tells that the device is unknown, this function calls cbm_identify itself to find out the device type. If |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 1041 of file execute.c.
References cbm_identify_xp1541(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_iec_get | ( | CBM_FILE | HandleDevice | ) |
Get the (logical) state of a line on the IEC serial bus.
This function gets the (logical) state of a line on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Line | (CL) The line to be tested. This must be exactly one of IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 835 of file execute.c.
References cbm_iec_get(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_iec_poll | ( | CBM_FILE | HandleDevice | ) |
Read status of all bus lines.
This function reads the state of all lines on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
This function just reads the port. No handshaking is performed at all.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 674 of file execute.c.
References cbm_iec_poll(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_iec_release | ( | CBM_FILE | HandleDevice | ) |
Deactivate a line on the IEC serial bus.
This function deactivates (sets to 5V) a line on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Line | (CL) The line to be deactivated. This must be exactly one of IEC_DATA, IEC_CLOCK, or IEC_ATN. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 731 of file execute.c.
References cbm_iec_release(), FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().
BOOLEAN vdd_iec_set | ( | CBM_FILE | HandleDevice | ) |
Activate a line on the IEC serial bus.
This function activates (sets to 0V) a line on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Line | (CL) The line to be activated. This must be exactly one of IEC_DATA, IEC_CLOCK, or IEC_ATN. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 703 of file execute.c.
References cbm_iec_set(), FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().
BOOLEAN vdd_iec_setrelease | ( | CBM_FILE | HandleDevice | ) |
Activate and deactive a line on the IEC serial bus.
This function activates (sets to 0V, L) and deactivates (set to 5V, H) lines on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Set | (CH) The mask of which lines should be set. This has to be a bitwise OR between the constants IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET |
Release | (CL) The mask of which lines should be released. This has to be a bitwise OR between the constants IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 768 of file execute.c.
References cbm_iec_setrelease(), FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().
BOOLEAN vdd_iec_wait | ( | CBM_FILE | HandleDevice | ) |
Wait for a line to have a specific state.
This function waits for a line to enter a specific state on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Line | (CL) The line to be deactivated. This must be exactly one of IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET. |
State | (CH) If zero, then wait for this line to be deactivated. If not zero, then wait for this line to be activated. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 804 of file execute.c.
References cbm_iec_wait(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_install_iohook | ( | CBM_FILE | HandleDevice | ) |
Install the I/O hook.
This function installs the I/O hook for accessing the VDD via IN and OUT assembler instructions
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
IoBaseAddress | (CX) The I/O base address on which to install the I/O hook |
CableType | (DH) Decides if the emulated cable should be an XE cable (1), XM cable (2), or an XA cable (3). |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 1285 of file execute.c.
References FUNC_ENTER, FUNC_LEAVE_BOOLEAN, PP_XA_ATN_IN, PP_XA_ATN_OUT, PP_XA_CLK_IN, PP_XA_CLK_OUT, PP_XA_DATA_IN, PP_XA_DATA_OUT, PP_XA_OUTEOR, PP_XA_RESET_IN, PP_XA_RESET_OUT, PP_XE_ATN_IN, PP_XE_ATN_OUT, PP_XE_CLK_IN, PP_XE_CLK_OUT, PP_XE_DATA_IN, PP_XE_DATA_OUT, PP_XE_OUTEOR, PP_XE_RESET_IN, PP_XE_RESET_OUT, PP_XM_ATN_IN, PP_XM_ATN_OUT, PP_XM_CLK_IN, PP_XM_CLK_OUT, PP_XM_DATA_IN, PP_XM_DATA_OUT, PP_XM_OUTEOR, PP_XM_RESET_IN, PP_XM_RESET_OUT, and vdd_handle.
Referenced by VDDDispatch().
BOOLEAN vdd_listen | ( | CBM_FILE | HandleDevice | ) |
Send a LISTEN on the IEC serial bus.
This function sends a LISTEN on the IEC serial bus. This prepares a LISTENer, so that it will wait for our bytes we will write in the future.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (CH) The address of the device on the IEC serial bus. This is known as primary address, too. |
SecondaryAddress | (CL) The secondary address for the device on the IEC serial bus. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 329 of file execute.c.
References cbm_listen(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_open | ( | CBM_FILE | HandleDevice | ) |
Open a file on the IEC serial bus.
This function opens a file on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (CH) The address of the device on the IEC serial bus. This is known as primary address, too. |
SecondaryAddress | (CL) The secondary address for the device on the IEC serial bus. |
Filename | (ES:SI) Pointer to the filename of the file to be opened |
FilenameLength | (DI) The size of the Filename. If zero, the Filename has to be a null-terminated string. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 400 of file execute.c.
References cbm_open(), CHECKEDBUFFERACCESS, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_pp_read | ( | CBM_FILE | HandleDevice | ) |
Read a byte from a XP1541/XP1571 cable.
This function reads a single byte from the parallel portion of an XP1541/1571 cable.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
This function reads the current state of the port. No handshaking is performed at all.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 612 of file execute.c.
References cbm_pp_read(), FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().
BOOLEAN vdd_pp_write | ( | CBM_FILE | HandleDevice | ) |
Write a byte to a XP1541/XP1571 cable.
This function writes a single byte to the parallel portion of a XP1541/1571 cable.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Byte | (CL) the byte to be output on the parallel port |
This function just writes on the port. No handshaking is performed at all.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 643 of file execute.c.
References cbm_pp_write(), FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().
BOOLEAN vdd_raw_read | ( | CBM_FILE | HandleDevice | ) |
Read data from the IEC serial bus.
This function retrieves data after a vdd_talk().
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Buffer | (ES:SI) Pointer to a buffer which will hold the bytes read. |
Count | (CX) Number of bytes to be read at most. |
At most Count bytes are read.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 298 of file execute.c.
References cbm_raw_read(), CHECKEDBUFFERACCESS, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_raw_write | ( | CBM_FILE | HandleDevice | ) |
Write data to the IEC serial bus.
This function sends data after a vdd_listen().
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Buffer | (ES:SI) Pointer to a buffer which hold the bytes to write to the bus. |
Count | (CX) Number of bytes to be written. |
This function tries to write Count bytes. Anyway, if an error occurs, this function can stop prematurely.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 266 of file execute.c.
References cbm_raw_write(), CHECKEDBUFFERACCESS, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_reset | ( | CBM_FILE | HandleDevice | ) |
RESET all devices.
This function performs a hardware RESET of all devices on the IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
Don't overuse this function! Normally, an initial RESET should be enough.
Control is returned after a delay which ensures that all devices are ready again.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 576 of file execute.c.
References cbm_reset(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_talk | ( | CBM_FILE | HandleDevice | ) |
Send a TALK on the IEC serial bus.
This function sends a TALK on the IEC serial bus. This prepares a TALKer, so that it will prepare to send us some bytes in the future.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (CH) The address of the device on the IEC serial bus. This is known as primary address, too. |
SecondaryAddress | (CL) The secondary address for the device on the IEC serial bus. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 362 of file execute.c.
References cbm_talk(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_uninstall_iohook | ( | CBM_FILE | HandleDevice | ) |
Uninstall the I/O hook.
This function uninstalls the I/O hook for accessing the VDD via IN and OUT assembler instructions
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 1422 of file execute.c.
References DBG_PREFIX, DBG_PRINT, FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and vdd_uninstall_iohook_internal().
Referenced by VDDDispatch().
USHORT vdd_uninstall_iohook_internal | ( | VOID | ) |
Uninstall the I/O hook.
This function uninstalls the I/O hook for accessing the VDD via IN and OUT assembler instructions
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 1383 of file execute.c.
References FUNC_ENTER, FUNC_LEAVE_USHORT, and vdd_handle.
Referenced by vdd_uninstall_iohook(), and VDDInitialize().
BOOLEAN vdd_unlisten | ( | CBM_FILE | HandleDevice | ) |
Send an UNLISTEN on the IEC serial bus.
This function sends an UNLISTEN on the IEC serial bus. Other than LISTEN and TALK, an UNLISTEN is not directed to just one device, but to all devices on that IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
At least on a 1541 floppy drive, an UNLISTEN also undoes a previous TALK.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 459 of file execute.c.
References cbm_unlisten(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_untalk | ( | CBM_FILE | HandleDevice | ) |
Send an UNTALK on the IEC serial bus.
This function sends an UNTALK on the IEC serial bus. Other than LISTEN and TALK, an UNTALK is not directed to just one device, but to all devices on that IEC serial bus.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
At least on a 1541 floppy drive, an UNTALK also undoes a previous LISTEN.
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 489 of file execute.c.
References cbm_untalk(), FUNC_ENTER, FUNC_LEAVE_BOOLEAN, and retAX.
Referenced by VDDDispatch().
BOOLEAN vdd_upload | ( | CBM_FILE | HandleDevice | ) |
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.
HandleDevice | (BX) A CBM_FILE which contains the file handle of the driver. |
DeviceAddress | (DH) The address of the device on the IEC serial bus. This is known as primary address, too. |
DriveMemAddress | (DI) The address in the drive's memory where the program is to be stored. |
Program | (ES:SI) Pointer to a byte buffer which holds the program in the caller's address space. |
Size | (CX) The size of the program to be stored, in bytes. |
If vdd_driver_open() did not succeed, it is illegal to call this function.
Definition at line 881 of file execute.c.
References cbm_upload(), CHECKEDBUFFERACCESS, and FUNC_CHECKEDBUFFERACCESS.
Referenced by VDDDispatch().
BOOLEAN vdd_usleep | ( | VOID | ) |
Sleep some microseconds.
This function allows the DOS box to sleep a specified amount of microseconds.
Microseconds | (CX) The number of microseconds to sleep. |
This function only guarantees that the function sleeps at least the specified amount of microseconds! Because of the scheduler, we cannot know when the caller will get control back.
Definition at line 1447 of file execute.c.
References FUNC_ENTER, and FUNC_LEAVE_BOOLEAN.
Referenced by VDDDispatch().