C# Класс TweetWall.Apple2

Class for handling communications with Apple II.

The physical interface uses an FTDI USB cable running in bitbang mode to drive 3 lines connected to TTL button inputs on the Apple II game connector.

The 3 lines are used to implement an SPI protocol. 2 of the lines are standard DATA and CLK signals and the 3rd (ATTN) is used for framing the start of a command sequence.

The Apple II code is contained in the file TwitterII.m65

Показать файл Открыть проект

Открытые методы

Метод Описание
Apple2 ( ) : System

Initializes the FT_XXX API driver and opens the device.

ClearHires ( ) : void

Erase the Apple II high-res screen

ScrollLores ( ) : void

Scrolls in GR2 screen to GR screen.

SendBuffer ( int address, byte buffer, int length ) : void

High-level utility to transfer an arbirarily-sized buffer to the Apple II at a given address. Uses the fast SendPage() protocol for as much as possible and then fills up stragglers with the slower byte-by-byte transfer.

SendByte ( int address, byte data ) : void

Transfer a byte to the Apple II. If you need to store more than a byte or two, this is a very inefficient way of doing so and you should use the SendBuffer() or SendPage() methods.

SendPage ( byte page, byte data ) : void

Transfer a complete 256-byte page to the Apple II as fast as we can.

TickleAddress ( int address ) : void

Uses the SendByte method to write the value of $00 to a given address. This is used to access the Apple II's memory-mapped soft-switches to do things like change graphics modes, etc.

Приватные методы

Метод Описание
BitBang ( int data ) : void

Writes a byte of data containing pin states.

FT_CreateDeviceInfoList ( int &deviceCount ) : int
FT_GetDeviceInfoDetail ( int index, int &flags, int &type, int &id, int &locid, IntPtr serialNumber, IntPtr description, int &handle ) : int
FT_GetDeviceInfoList ( IntPtr buffer, int &bufferSize ) : int
FT_Open ( int deviceNumber, int &handle ) : int
FT_OpenEx ( IntPtr comString, int flags, int &handle ) : int
FT_SetBaudRate ( int handle, int baud ) : int
FT_SetBitMode ( int handle, byte Mask, byte enable ) : int
FT_Write ( int handle, byte data, int byteCount, int &bytesWritten ) : int
SendByte ( byte data ) : int

Описание методов

Apple2() публичный Метод

Initializes the FT_XXX API driver and opens the device.
public Apple2 ( ) : System
Результат System

ClearHires() публичный Метод

Erase the Apple II high-res screen
public ClearHires ( ) : void
Результат void

ScrollLores() публичный Метод

Scrolls in GR2 screen to GR screen.
public ScrollLores ( ) : void
Результат void

SendBuffer() публичный Метод

High-level utility to transfer an arbirarily-sized buffer to the Apple II at a given address. Uses the fast SendPage() protocol for as much as possible and then fills up stragglers with the slower byte-by-byte transfer.
public SendBuffer ( int address, byte buffer, int length ) : void
address int Start address. The Apple II is 16-bit /// address bus so only values from $0000 to $FFFF make sense
buffer byte The data to copy to the Apple II
length int How many bytes to copy from buffer
Результат void

SendByte() публичный Метод

Transfer a byte to the Apple II. If you need to store more than a byte or two, this is a very inefficient way of doing so and you should use the SendBuffer() or SendPage() methods.
public SendByte ( int address, byte data ) : void
address int The address to store the byte
data byte The byte to store.
Результат void

SendPage() публичный Метод

Transfer a complete 256-byte page to the Apple II as fast as we can.
public SendPage ( byte page, byte data ) : void
page byte High byte of destinatio address. For example, /// to transfer data to addresses $800..$8FF this parameter will be 0x08
data byte 256 bytes to send
Результат void

TickleAddress() публичный Метод

Uses the SendByte method to write the value of $00 to a given address. This is used to access the Apple II's memory-mapped soft-switches to do things like change graphics modes, etc.
public TickleAddress ( int address ) : void
address int
Результат void