Previous 15994 Revisions Next

r1225 Sunday 4th November, 2007 at 21:20:57 UTC by Stefano Priore
[ADAM] Added a link to a full schematics page
[src/mess/drivers]adam.c

src/mess/drivers/adam.c
r1224r1225
11/***************************************************************************
22
3Full schematics of anything Adam at http://drushel.cwru.edu/schematics/
4
35  adam.c
46
57  Driver file to handle emulation of the ColecoAdam.
r1224r1225
99101    Device 24 = Tape drive 2 (share DCB with Tape1)
100102    Device 25 = Tape drive 4 (projected, may have share DCB with Tape3)
101103    Device 26 = Expansion RAM disk drive (third party ID, not used by Coleco)
102   
104
103105  Terminology:
104106    EOS = Elementary Operating System
105107    DCB = Device Control Block Table (21bytes each DCB, DCB+16=dev#, DCB+0=Status Byte) (0xFD7C)
r1224r1225
128130            adam_pcb+0 = Status, 0=Request Status of Z80 -> must return 0x81..0x82 to sync Master 6801 clk with Z80 clk
129131            adam_pcb+1,adam_pcb+2 = address of adam_pcb start
130132            adam_pcb+3 = device #
131           
133
132134            - Writing to byte0:
133135                1   Synchronize the Z80 clock (should return 0x81)
134136                2   Synchronize the Master 6801 clock (should return 0x82)
r1224r1225
140142                0x82 -> Master 6801 clock in sync
141143                0x83 -> adam_pcb relocated
142144                0x9B -> Time Out
143           
145
144146    DEV_ID = Device id
145 
146 
147
148
147149    The ColecoAdam I/O map is contolled by the MIOC (Memory Input Output Controller):
148150
149151            20-3F (W) = Adamnet Writes
150152            20-3F (R) = Adamnet Reads
151153
152154            42-42 (W) = Expansion RAM page selection, only useful if expansion greater than 64k
153           
155
154156            40-40 (W) = Printer Data Out
155157            40-40 (R) = Printer (Returns 0x41)
156           
158
157159            5E-5E (RW)= Modem Data I/O
158160            5F-5F (RW)= Modem Data Control Status
159           
161
160162            60-7F (W) = Set Memory configuration
161163            60-7F (R) = Read Memory configuration
162164
r1224r1225
166168            A0-BF (W) = Video Chip (TMS9928A), A0=0 -> Write Register 0 , A0=1 -> Write Register 1
167169            A0-BF (R) = Video Chip (TMS9928A), A0=0 -> Read Register 0 , A0=1 -> Read Register 1
168170
169            C0-DF (W) = Set both controllers to joystick mode
171            C0-DF (W) = Set both controllers to joystick mode
170172            C0-DF (R) = Not Connected
171173
172174            E0-FF (W) = Sound Chip (SN76489A)
r1224r1225
239241    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON16) PORT_NAME("P1 Keypad *") PORT_CODE(KEYCODE_EQUALS)    PORT_PLAYER(1)
240242    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button 2 (SAC Red Button)")             PORT_PLAYER(1)
241243    PORT_BIT( 0xB0, IP_ACTIVE_LOW, IPT_UNUSED )
242
244
243245    PORT_START_TAG( "controller1_joystick" )  /* IN2 */
244246    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )                                                   PORT_PLAYER(1) PORT_8WAY
245247    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )                                                PORT_PLAYER(1) PORT_8WAY
r1224r1225
306308              PORT_RESET
307309
308310/* Keyboard with 75 Keys - TODO: Discover if the keys are actually organized this way on real hardware */
309   
311
310312   PORT_START_TAG("keyboard_1") /* IN9 0*/
311313   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Escape/WP")    PORT_CODE(KEYCODE_ESC)        PORT_CHAR(27)
312314   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_A)          PORT_CHAR('a') PORT_CHAR('A')
r1224r1225
366368   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_STOP)       PORT_CHAR('.') PORT_CHAR('>')
367369   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
368370   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_OPENBRACE)  PORT_CHAR('[') PORT_CHAR('{')
369   
371
370372   PORT_START_TAG("keyboard_7") /* IN15 6*/
371373   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA0") PORT_CODE(KEYCODE_F1)         PORT_CHAR(UCHAR_MAMEKEY(F1))
372374   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x85\xA1") PORT_CODE(KEYCODE_F2)         PORT_CHAR(UCHAR_MAMEKEY(F2))
r1224r1225
396398   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab")          PORT_CODE(KEYCODE_TAB)        PORT_CHAR(UCHAR_MAMEKEY(TAB))
397399   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left Shift")   PORT_CODE(KEYCODE_LSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
398400   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right Shift")  PORT_CODE(KEYCODE_RSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
399   
401
400402   PORT_START_TAG("keyboard_10") /* IN18 9*/
401403   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Control")      PORT_CODE(KEYCODE_LCONTROL)   PORT_CHAR(UCHAR_SHIFT_2)
402404   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Backspace")    PORT_CODE(KEYCODE_BACKSPACE)  PORT_CHAR(8)
403405   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Lock")         PORT_CODE(KEYCODE_CAPSLOCK)   PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE
404406   PORT_BIT(0xF8, IP_ACTIVE_LOW, IPT_UNUSED )
405   
407
406408INPUT_PORTS_END
407409
408410/***************************************************************************
r1224r1225
502504            memory_set_bankptr(2, BankBase+0x22000);
503505            memory_set_bankptr(3, BankBase+0x24000);
504506            memory_set_bankptr(4, BankBase+0x26000);
505               
507
506508            /* Write */
507509            memory_set_bankptr(6, BankBase+0x3A000); /* Write protecting ROM */
508510            memory_set_bankptr(7, BankBase+0x3A000); /* Write protecting ROM */
r1224r1225
516518         memory_set_bankptr(2, BankBase+0x02000);
517519         memory_set_bankptr(3, BankBase+0x04000);
518520         memory_set_bankptr(4, BankBase+0x06000);
519           
521
520522         /* Write */
521523         memory_set_bankptr(6, BankBase);
522524         memory_set_bankptr(7, BankBase+0x02000);
r1224r1225
542544         memory_set_bankptr(2, BankBase+0x02000);
543545         memory_set_bankptr(3, BankBase+0x04000);
544546         memory_set_bankptr(4, BankBase+0x06000);
545           
547
546548         /* Write */
547549         memory_set_bankptr(6, BankBase+0x3A000); /* Write protecting ROM */
548550         memory_set_bankptr(7, BankBase+0x02000);
r1224r1225
616618
617619   memset(&memory_region(REGION_CPU1)[0x0000], 0xFF, 0x20000); /* Initializing RAM */
618620   mame_timer_pulse(MAME_TIME_IN_MSEC(20), 0, adam_paddle_callback);
619}
621}
620622
621623static MACHINE_DRIVER_START( adam )
622624   /* Machine hardware */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team