22
It’s Game Time Matt Jenkins <[email protected]> OzKFest April 2015

It's game time

Embed Size (px)

Citation preview

It’s Game TimeMatt Jenkins <[email protected]>

OzKFest April 2015

ScramWorks• Design has evolved to higher capacity SRAM

• 1 or 2 chips for 8MB or 16MB capacity

• 3.3V circuitry

• 100% RamWorks compatibility

• AE and Nishida Radio video connectors

• Soon, and with brothers

Serial Segue• Communicates between computer systems

• Or between parts within a computer system

• Increasing replacing parallel communications

• USB

• Serial ATA

• PCI-e slots are serial busses

Serial Style• Asynchronous

• Rely on accurate timing on each end point

• Synchronous

• Clock is provided on the bus

• Flow Control

• In band

• Out of band

Serial - RS232• Super Serial Card, Apple IIc, 6551 ACIA

• Asynchronous

• In band and out of band flow control

• XON/XOFF, RTS/CTS

• Logic level and line level.

• 115,200Kbps to many megabits

Serial - intercomponent• Widely used in Arduino

• RTC, Stepper Motor, GPIO, Servo

• i2c

• SPI

• 1-wire

i2c• Inter-Integrated Circuit

• 2-wire, synchronous, half-duplex

• 10Khz, 100Khz, 400Khz modes

• Open-drain

• Multi-master capable

i2c• Data line - SDA

• Clock line - SCL

• Master drives clock

• All devices share data line

• Actual speed can be variable (0-100Khz)

i2c

(Image from Wikipedia)

Apple II - i2c ?

• Can it be done ?

• i2c allows slower speeds

• Ought to be easy!

• Where do we plug it in ?

Apple II Game Port

• 4 Annunciator outputs

• 3 Pushbutton inputs

• 4 Paddle Inputs

• 1 Utility Strobe

Apple II Game Port

Apple II Game Port

• Inputs and outputs are TTL

• But i2c is open drain

• Going to need some electronics!

Emitter Follower

Open Drain

Apple i2c - Schematic

• Two MOSFETs

• Two Resistors

• Two sets required to do both SDA and SCL

Apple i2c - SDA schematic

1243774

Apple i2c - Code• Some simple assembly language

• Merlin 8/16 (32?)

• Macros should help

• Ampersand extensions for Applesoft

Apple i2c - Code

AN0OFF EQU $C058 AN0ON EQU $C059 AN1OFF EQU $C05A AN1ON EQU $C05B

PB0 EQU $C061 PB1 EQU $C062 PB2 EQU $C063

Apple i2c - Code

SDAOFF MAC BIT AN0ON <<< SDAON MAC BIT AN0OFF <<< SCLOFF MAC BIT AN1ON <<< SCLON MAC BIT AN1OFF <<<

Apple i2c - CodeSCLSTAT MAC LDA PB1 <<< SCLWAIT MAC

WAIT SCLSTAT BMI WAIT

NOP <<< I2CSTART MAC

SDAOFF NOP NOP NOP NOP

SCLOFF <<< I2CCLOCK MAC

SCLON NOP NOP

SCLOFF NOP <<<

Summary

• Not working yet (sorry!)

• Questions ?