src/mess/layout/cosmicos.lay
| r0 | r5976 | |
| 1 | <?xml version="1.0"?>
|
| 2 | <mamelayout version="2">
|
| 3 | <element name="digit" defstate="0">
|
| 4 | <led7seg>
|
| 5 | <color red="0.75" green="0" blue="0.0" />
|
| 6 | </led7seg>
|
| 7 | </element>
|
| 8 | |
| 9 | <element name="red_led" defstate="0">
|
| 10 | <disk state="1">
|
| 11 | <color red="0.75" green="0.0" blue="0.0" />
|
| 12 | </disk>
|
| 13 | <disk state="0">
|
| 14 | <color red="0.09375" green="0.0" blue="0.0" />
|
| 15 | </disk>
|
| 16 | </element>
|
| 17 | |
| 18 | <view name="Standard">
|
| 19 | <!-- Led address display -->
|
| 20 | <bezel name="digit0" element="digit">
|
| 21 | <bounds x="0" y="5" width="18" height="24" />
|
| 22 | </bezel>
|
| 23 | |
| 24 | <bezel name="digit1" element="digit">
|
| 25 | <bounds x="18" y="5" width="18" height="24" />
|
| 26 | </bezel>
|
| 27 | |
| 28 | <!-- G led -->
|
| 29 | <bezel name="led0" element="red_led">
|
| 30 | <bounds x="108" y="0" width="5" height="5" />
|
| 31 | </bezel>
|
| 32 | |
| 33 | <!-- L led -->
|
| 34 | <bezel name="led1" element="red_led">
|
| 35 | <bounds x="126" y="0" width="5" height="5" />
|
| 36 | </bezel>
|
| 37 | |
| 38 | <!-- S led -->
|
| 39 | <bezel name="led2" element="red_led">
|
| 40 | <bounds x="144" y="0" width="5" height="5" />
|
| 41 | </bezel>
|
| 42 | |
| 43 | <!-- R led -->
|
| 44 | <bezel name="led3" element="red_led">
|
| 45 | <bounds x="162" y="0" width="5" height="5" />
|
| 46 | </bezel>
|
| 47 | |
| 48 | <!-- 7 led -->
|
| 49 | <bezel name="led4" element="red_led">
|
| 50 | <bounds x="18" y="48" width="5" height="5" />
|
| 51 | </bezel>
|
| 52 | |
| 53 | <!-- 6 led -->
|
| 54 | <bezel name="led5" element="red_led">
|
| 55 | <bounds x="36" y="48" width="5" height="5" />
|
| 56 | </bezel>
|
| 57 | |
| 58 | <!-- 5 led -->
|
| 59 | <bezel name="led6" element="red_led">
|
| 60 | <bounds x="54" y="48" width="5" height="5" />
|
| 61 | </bezel>
|
| 62 | |
| 63 | <!-- 4 led -->
|
| 64 | <bezel name="led7" element="red_led">
|
| 65 | <bounds x="72" y="48" width="5" height="5" />
|
| 66 | </bezel>
|
| 67 | |
| 68 | <!-- 3 led -->
|
| 69 | <bezel name="led8" element="red_led">
|
| 70 | <bounds x="108" y="48" width="5" height="5" />
|
| 71 | </bezel>
|
| 72 | |
| 73 | <!-- 2 led -->
|
| 74 | <bezel name="led9" element="red_led">
|
| 75 | <bounds x="126" y="48" width="5" height="5" />
|
| 76 | </bezel>
|
| 77 | |
| 78 | <!-- 1 led -->
|
| 79 | <bezel name="led10" element="red_led">
|
| 80 | <bounds x="144" y="48" width="5" height="5" />
|
| 81 | </bezel>
|
| 82 | |
| 83 | <!-- 0 led -->
|
| 84 | <bezel name="led11" element="red_led">
|
| 85 | <bounds x="162" y="48" width="5" height="5" />
|
| 86 | </bezel>
|
| 87 | |
| 88 | <!-- Q led -->
|
| 89 | <bezel name="led12" element="red_led">
|
| 90 | <bounds x="54" y="0" width="5" height="5" />
|
| 91 | </bezel>
|
| 92 | </view>
|
| 93 | |
| 94 | <view name="CDP1864">
|
| 95 | <screen index="0">
|
| 96 | <bounds left="0" top="0" right="4" bottom="3" />
|
| 97 | </screen>
|
| 98 | </view>
|
| 99 | </mamelayout>
|
src/mess/drivers/cosmicos.c
| r0 | r5976 | |
| 1 | /*
|
| 2 | |
| 3 | COSMICOS
|
| 4 | |
| 5 | http://retro.hansotten.nl/index.php?page=1802-cosmicos
|
| 6 | |
| 7 | */
|
| 8 | |
| 9 | /*
|
| 10 | |
| 11 | TODO:
|
| 12 | |
| 13 | - type in ROM
|
| 14 | - switches
|
| 15 | - hex keypad
|
| 16 | - PPI 8255
|
| 17 | - Floppy WD1793
|
| 18 | - COM8017 UART to printer
|
| 19 | |
| 20 | */
|
| 21 | |
| 22 | #include "driver.h"
|
| 23 | #include "includes/cosmicos.h"
|
| 24 | #include "cpu/cdp1802/cdp1802.h"
|
| 25 | #include "devices/cassette.h"
|
| 26 | #include "video/dm9368.h"
|
| 27 | #include "cosmicos.lh"
|
| 28 | |
| 29 | /* Memory Maps */
|
| 30 | |
| 31 | static ADDRESS_MAP_START( cosmicos_mem, ADDRESS_SPACE_PROGRAM, 8 )
|
| 32 | AM_RANGE(0x0000, 0xbfff) AM_RAMBANK(1)
|
| 33 | AM_RANGE(0xc000, 0xcfff) AM_ROM
|
| 34 | ADDRESS_MAP_END
|
| 35 | |
| 36 | static ADDRESS_MAP_START( cosmicos_io, ADDRESS_SPACE_IO, 8 )
|
| 37 | // AM_RANGE(0x00, 0x00)
|
| 38 | // AM_RANGE(0x01, 0x01)
|
| 39 | // AM_RANGE(0x02, 0x02)
|
| 40 | // AM_RANGE(0x03, 0x03)
|
| 41 | // AM_RANGE(0x04, 0x04)
|
| 42 | // AM_RANGE(0x05, 0x05) AM_READWRITE(hex_keyboard_r, hex_keylatch_w)
|
| 43 | // AM_RANGE(0x06, 0x06) AM_READWRITE(reset_cathode_counter_r, segment_w)
|
| 44 | // AM_RANGE(0x07, 0x07) AM_READWRITE(data_r, display_w)
|
| 45 | ADDRESS_MAP_END
|
| 46 | |
| 47 | /* Input Ports */
|
| 48 | |
| 49 | static INPUT_PORTS_START( cosmicos )
|
| 50 | PORT_START("DATA")
|
| 51 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
|
| 52 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
|
| 53 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2')
|
| 54 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
|
| 55 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
|
| 56 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5')
|
| 57 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6')
|
| 58 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7')
|
| 59 | |
| 60 | PORT_START("SPECIAL")
|
| 61 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ENTER")
|
| 62 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SINGLE STEP")
|
| 63 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUN")
|
| 64 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOAD")
|
| 65 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PAUSE")
|
| 66 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESET")
|
| 67 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MEMORY PROTECT") PORT_TOGGLE
|
| 68 | INPUT_PORTS_END
|
| 69 | |
| 70 | static INPUT_PORTS_START( cosmicos_hex )
|
| 71 | PORT_START("X1")
|
| 72 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
|
| 73 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
|
| 74 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8')
|
| 75 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
|
| 76 | |
| 77 | PORT_START("X2")
|
| 78 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
|
| 79 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5')
|
| 80 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9')
|
| 81 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
|
| 82 | |
| 83 | PORT_START("X3")
|
| 84 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2')
|
| 85 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6')
|
| 86 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
|
| 87 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
|
| 88 | |
| 89 | PORT_START("X4")
|
| 90 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
|
| 91 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7')
|
| 92 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
|
| 93 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
|
| 94 | |
| 95 | PORT_START("SPECIAL")
|
| 96 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("RET") PORT_CODE(KEYCODE_F1)
|
| 97 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("DEC") PORT_CODE(KEYCODE_F2)
|
| 98 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("REQ") PORT_CODE(KEYCODE_F3)
|
| 99 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("SEQ") PORT_CODE(KEYCODE_F4)
|
| 100 | INPUT_PORTS_END
|
| 101 | |
| 102 | /* CDP1802 Configuration */
|
| 103 | |
| 104 | static CDP1802_MODE_READ( cosmicos_mode_r )
|
| 105 | {
|
| 106 | cdp1802_control_mode mode = CDP1802_MODE_RUN;
|
| 107 | |
| 108 | return mode;
|
| 109 | }
|
| 110 | |
| 111 | static CDP1802_EF_READ( cosmicos_ef_r )
|
| 112 | {
|
| 113 | /*
|
| 114 | EF1
|
| 115 | EF2 cassette input
|
| 116 | EF3
|
| 117 | EF4
|
| 118 | */
|
| 119 | |
| 120 | cosmicos_state *state = device->machine->driver_data;
|
| 121 | |
| 122 | UINT8 flags = 0x0f;
|
| 123 | |
| 124 | /* cassette input */
|
| 125 | if (cassette_input(state->cassette) < 0.0) flags -= EF2;
|
| 126 | |
| 127 | return flags;
|
| 128 | }
|
| 129 | |
| 130 | static CDP1802_SC_WRITE( cosmicos_sc_w )
|
| 131 | {
|
| 132 | }
|
| 133 | |
| 134 | static WRITE_LINE_DEVICE_HANDLER( cosmicos_q_w )
|
| 135 | {
|
| 136 | cosmicos_state *driver_state = device->machine->driver_data;
|
| 137 | |
| 138 | /* cassette */
|
| 139 | cassette_output(driver_state->cassette, state ? +1.0 : -1.0);
|
| 140 | }
|
| 141 | |
| 142 | static CDP1802_INTERFACE( cosmicos_config )
|
| 143 | {
|
| 144 | cosmicos_mode_r,
|
| 145 | cosmicos_ef_r,
|
| 146 | cosmicos_sc_w,
|
| 147 | DEVCB_LINE(cosmicos_q_w),
|
| 148 | DEVCB_NULL,
|
| 149 | DEVCB_NULL
|
| 150 | };
|
| 151 | |
| 152 | /* Machine Initialization */
|
| 153 | |
| 154 | static MACHINE_START( cosmicos )
|
| 155 | {
|
| 156 | cosmicos_state *state = machine->driver_data;
|
| 157 | const address_space *program = cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM);
|
| 158 | |
| 159 | /* find devices */
|
| 160 | state->dm9368 = devtag_get_device(machine, DM9368_TAG);
|
| 161 | state->cassette = devtag_get_device(machine, CASSETTE_TAG);
|
| 162 | |
| 163 | /* initialize LED display */
|
| 164 | dm9368_rbi_w(state->dm9368, 1);
|
| 165 | |
| 166 | /* setup memory banking */
|
| 167 | memory_configure_bank(machine, 1, 0, 1, memory_region(machine, CDP1802_TAG), 0);
|
| 168 | memory_set_bank(machine, 1, 0);
|
| 169 | |
| 170 | switch (mess_ram_size)
|
| 171 | {
|
| 172 | case 256:
|
| 173 | memory_install_readwrite8_handler(program, 0x0000, 0x00ff, 0, 0, SMH_BANK(1), SMH_BANK(1));
|
| 174 | memory_install_readwrite8_handler(program, 0x0100, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
| 175 | break;
|
| 176 | |
| 177 | case 4*1024:
|
| 178 | memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_BANK(1));
|
| 179 | memory_install_readwrite8_handler(program, 0x1000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
| 180 | break;
|
| 181 | |
| 182 | case 48*1024:
|
| 183 | memory_install_readwrite8_handler(program, 0x0000, 0xbfff, 0, 0, SMH_BANK(1), SMH_BANK(1));
|
| 184 | break;
|
| 185 | }
|
| 186 | |
| 187 | /* register for state saving */
|
| 188 | // state_save_register_global(machine, state->);
|
| 189 | }
|
| 190 | |
| 191 | /* Machine Driver */
|
| 192 | |
| 193 | static const cassette_config cosmicos_cassette_config =
|
| 194 | {
|
| 195 | cassette_default_formats,
|
| 196 | NULL,
|
| 197 | CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED
|
| 198 | };
|
| 199 | |
| 200 | static MACHINE_DRIVER_START( cosmicos )
|
| 201 | MDRV_DRIVER_DATA(cosmicos_state)
|
| 202 | |
| 203 | /* basic machine hardware */
|
| 204 | MDRV_CPU_ADD(CDP1802_TAG, CDP1802, XTAL_1_75MHz)
|
| 205 | MDRV_CPU_PROGRAM_MAP(cosmicos_mem)
|
| 206 | MDRV_CPU_IO_MAP(cosmicos_io)
|
| 207 | MDRV_CPU_CONFIG(cosmicos_config)
|
| 208 | |
| 209 | MDRV_MACHINE_START(cosmicos)
|
| 210 | |
| 211 | /* video hardware */
|
| 212 | MDRV_DEFAULT_LAYOUT( layout_cosmicos )
|
| 213 | MDRV_DM9368_ADD(DM9368_TAG, 0, NULL)
|
| 214 | |
| 215 | /* devices */
|
| 216 | MDRV_CASSETTE_ADD(CASSETTE_TAG, cosmicos_cassette_config)
|
| 217 | MACHINE_DRIVER_END
|
| 218 | |
| 219 | /* ROMs */
|
| 220 | |
| 221 | ROM_START( cosmicos )
|
| 222 | ROM_REGION( 0x10000, CDP1802_TAG, 0 )
|
| 223 | ROM_LOAD( "cosmicos.rom", 0xc000, 0x0800, NO_DUMP )
|
| 224 | ROM_END
|
| 225 | |
| 226 | /* System Configuration */
|
| 227 | |
| 228 | static SYSTEM_CONFIG_START( cosmicos )
|
| 229 | CONFIG_RAM_DEFAULT( 256 )
|
| 230 | CONFIG_RAM ( 4 * 1024 )
|
| 231 | CONFIG_RAM ( 48 * 1024 )
|
| 232 | SYSTEM_CONFIG_END
|
| 233 | |
| 234 | /* System Drivers */
|
| 235 | |
| 236 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */
|
| 237 | COMP( 1979, cosmicos, 0, 0, cosmicos, cosmicos, 0, cosmicos, "Radio Bulletin", "Cosmicos", GAME_NOT_WORKING )
|