src/mess/layout/sitcom.lay
| r12950 | r12951 | |
| 4 | 4 | |
| 5 | 5 | <element name="a_led">
|
| 6 | 6 | <disk>
|
| 7 | | <color red="0.0" green="0.5" blue="0.0" />
|
| 7 | <color red="0.0" green="0.75" blue="0.0" />
|
| 8 | 8 | </disk>
|
| 9 | 9 | </element>
|
| 10 | 10 | |
| 11 | <element name="a_digit" defstate="0">
|
| 12 | <led16seg>
|
| 13 | <color red="1.0" green="0.0" blue="0.0" />
|
| 14 | </led16seg>
|
| 15 | </element>
|
| 16 | |
| 11 | 17 | <element name="background">
|
| 12 | 18 | <rect>
|
| 13 | 19 | <bounds left="0" top="0" right="1" bottom="1" />
|
| r12950 | r12951 | |
| 16 | 22 | </element>
|
| 17 | 23 | |
| 18 | 24 | <view name="Default Layout">
|
| 25 | <!-- Black background -->
|
| 19 | 26 | <bezel element="background">
|
| 20 | | <bounds left="0" top="0" right="10" bottom="13" />
|
| 21 | | </bezel> -->
|
| 27 | <bounds left="34" top="60" right="341" bottom="130" />
|
| 28 | </bezel>
|
| 22 | 29 | <bezel name="sod_led" element="a_led">
|
| 23 | | <bounds left="4" right="8" top="5" bottom="9" />
|
| 30 | <bounds left="46" right="56" top="90" bottom="100" />
|
| 24 | 31 | </bezel>
|
| 25 | | <screen index="0">
|
| 26 | | <bounds x="10" y="3" width="64" height="9" />
|
| 27 | | </screen>
|
| 32 | |
| 33 | <!-- DL1414 left -->
|
| 34 | <bezel name="digit3" element="a_digit">
|
| 35 | <bounds left="65" top="70" right="90" bottom="120" />
|
| 36 | </bezel>
|
| 37 | <bezel name="digit2" element="a_digit">
|
| 38 | <bounds left="99" top="70" right="124" bottom="120" />
|
| 39 | </bezel>
|
| 40 | <bezel name="digit1" element="a_digit">
|
| 41 | <bounds left="133" top="70" right="158" bottom="120" />
|
| 42 | </bezel>
|
| 43 | <bezel name="digit0" element="a_digit">
|
| 44 | <bounds left="167" top="70" right="192" bottom="120" />
|
| 45 | </bezel>
|
| 46 | |
| 47 | <!-- DL1414 right -->
|
| 48 | <bezel name="digit7" element="a_digit">
|
| 49 | <bounds left="204" top="70" right="229" bottom="120" />
|
| 50 | </bezel>
|
| 51 | <bezel name="digit6" element="a_digit">
|
| 52 | <bounds left="238" top="70" right="263" bottom="120" />
|
| 53 | </bezel>
|
| 54 | <bezel name="digit5" element="a_digit">
|
| 55 | <bounds left="272" top="70" right="297" bottom="120" />
|
| 56 | </bezel>
|
| 57 | <bezel name="digit4" element="a_digit">
|
| 58 | <bounds left="306" top="70" right="331" bottom="120" />
|
| 59 | </bezel>
|
| 60 | |
| 28 | 61 | </view>
|
| 29 | 62 | |
| 30 | | </mamelayout> |
| | No newline at end of file |
| 63 | </mamelayout>
|
src/mess/drivers/sitcom.c
| r12950 | r12951 | |
| 8 | 8 | http://www.sbprojects.com/sitcom/sitcom.htm |
| 9 | 9 | |
| 10 | 10 | The display consists of a LED connected to SOD, and a pair of |
| 11 | | DL1414 intelligent alphanumeric displays (not emulated). |
| 11 | DL1414 intelligent alphanumeric displays. |
| 12 | 12 | |
| 13 | | The DL1414 has its own character generator rom, and control logic |
| 14 | | to display 4 characters (choice of 64) on a tiny LED readout. |
| 15 | | |
| 16 | | The DL1414 is a slightly simplified version of the DL2416. |
| 17 | | |
| 18 | | To replace the displays, we use a small video screen of 1x8 chars. |
| 19 | | |
| 20 | 13 | The idea of this device is that you write a 8085 program with an |
| 21 | 14 | assembler on your PC. You then compile it, and then send it to |
| 22 | 15 | the SITCOM via a serial cable. The program then (hopefully) runs |
| r12950 | r12951 | |
| 38 | 31 | |
| 39 | 32 | #include "emu.h" |
| 40 | 33 | #include "cpu/i8085/i8085.h" |
| 34 | #include "video/dl1416.h" |
| 41 | 35 | #include "sitcom.lh" |
| 42 | 36 | |
| 43 | | #define VIDEO_START_MEMBER(name) void name::video_start() |
| 44 | | #define SCREEN_UPDATE_MEMBER(name) bool name::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 37 | #define MACHINE_RESET_MEMBER(name) void name::machine_reset() |
| 45 | 38 | |
| 46 | 39 | |
| 47 | 40 | class sitcom_state : public driver_device |
| r12950 | r12951 | |
| 49 | 42 | public: |
| 50 | 43 | sitcom_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | 44 | : driver_device(mconfig, type, tag), |
| 52 | | m_maincpu(*this, "maincpu") |
| 45 | m_maincpu(*this, "maincpu"), |
| 46 | m_ds0(*this, "ds0"), |
| 47 | m_ds1(*this, "ds1") |
| 53 | 48 | { } |
| 54 | 49 | |
| 55 | 50 | required_device<cpu_device> m_maincpu; |
| 51 | required_device<device_t> m_ds0; |
| 52 | required_device<device_t> m_ds1; |
| 56 | 53 | DECLARE_WRITE_LINE_MEMBER(sod_led); |
| 57 | 54 | DECLARE_READ_LINE_MEMBER(sid_line); |
| 58 | 55 | UINT8 *m_p_chargen; |
| 59 | 56 | UINT8 *m_p_videoram; |
| 60 | | virtual void video_start(); |
| 61 | | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 57 | virtual void machine_reset(); |
| 62 | 58 | }; |
| 63 | 59 | |
| 64 | 60 | static ADDRESS_MAP_START( sitcom_mem, AS_PROGRAM, 8, sitcom_state ) |
| r12950 | r12951 | |
| 71 | 67 | ADDRESS_MAP_UNMAP_HIGH |
| 72 | 68 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 73 | 69 | // AM_RANGE(0x00, 0x1f) 8255 for expansion only |
| 74 | | AM_RANGE(0xc0, 0xc3) AM_RAM AM_REGION("maincpu", 0x7004) //left display |
| 75 | | AM_RANGE(0xe0, 0xe3) AM_RAM AM_REGION("maincpu", 0x7000) //right display |
| 70 | AM_RANGE(0xc0, 0xc3) AM_DEVWRITE_LEGACY("ds0", dl1416_data_w) //left display |
| 71 | AM_RANGE(0xe0, 0xe3) AM_DEVWRITE_LEGACY("ds1", dl1416_data_w) //right display |
| 76 | 72 | ADDRESS_MAP_END |
| 77 | 73 | |
| 78 | 74 | /* Input ports */ |
| 79 | 75 | static INPUT_PORTS_START( sitcom ) |
| 80 | 76 | INPUT_PORTS_END |
| 81 | 77 | |
| 82 | | VIDEO_START_MEMBER( sitcom_state ) |
| 78 | MACHINE_RESET_MEMBER( sitcom_state ) |
| 83 | 79 | { |
| 84 | | m_p_chargen = machine().region("chargen")->base(); |
| 85 | | m_p_videoram = machine().region("maincpu")->base()+0x7000; |
| 80 | dl1416_ce_w(m_ds0, 0); // enable |
| 81 | dl1416_wr_w(m_ds0, 0); |
| 82 | dl1416_cu_w(m_ds0, 1); // no cursor |
| 83 | dl1416_ce_w(m_ds1, 0); |
| 84 | dl1416_wr_w(m_ds1, 0); |
| 85 | dl1416_cu_w(m_ds1, 1); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | | SCREEN_UPDATE_MEMBER( sitcom_state ) |
| 88 | void sitcom_update_ds0(device_t *device, UINT8 offset, int data) |
| 89 | 89 | { |
| 90 | | UINT8 ra,chr,gfx,x; |
| 90 | output_set_digit_value(offset, data); |
| 91 | } |
| 91 | 92 | |
| 92 | | for (ra = 0; ra < 9; ra++) |
| 93 | | { |
| 94 | | UINT16 *p = BITMAP_ADDR16(&bitmap, ra, 0); |
| 95 | | |
| 96 | | for (x = 0; x < 8; x++) |
| 97 | | { |
| 98 | | chr = m_p_videoram[7-x]; |
| 99 | | |
| 100 | | if ((chr < 32) || (chr > 95)) |
| 101 | | gfx = 0; |
| 102 | | else |
| 103 | | gfx = m_p_chargen[(chr<<4) | ra ]; |
| 104 | | |
| 105 | | *p++ = BIT(gfx, 7); |
| 106 | | *p++ = BIT(gfx, 6); |
| 107 | | *p++ = BIT(gfx, 5); |
| 108 | | *p++ = BIT(gfx, 4); |
| 109 | | *p++ = BIT(gfx, 3); |
| 110 | | *p++ = BIT(gfx, 2); |
| 111 | | *p++ = BIT(gfx, 1); |
| 112 | | *p++ = BIT(gfx, 0); |
| 113 | | } |
| 114 | | } |
| 115 | | return 0; |
| 93 | void sitcom_update_ds1(device_t *device, UINT8 offset, int data) |
| 94 | { |
| 95 | output_set_digit_value(4 + offset, data); |
| 116 | 96 | } |
| 117 | 97 | |
| 98 | |
| 118 | 99 | // SID line used as serial input from a pc |
| 119 | 100 | READ_LINE_MEMBER( sitcom_state::sid_line ) |
| 120 | 101 | { |
| r12950 | r12951 | |
| 142 | 123 | MCFG_CPU_CONFIG(sitcom_cpu_config) |
| 143 | 124 | |
| 144 | 125 | /* video hardware */ |
| 145 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 146 | | MCFG_SCREEN_REFRESH_RATE(60) |
| 147 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 148 | | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 149 | | MCFG_SCREEN_SIZE(64, 9) |
| 150 | | MCFG_SCREEN_VISIBLE_AREA(0, 63, 0, 8) |
| 151 | | MCFG_PALETTE_LENGTH(2) |
| 126 | MCFG_DL1416B_ADD("ds0", sitcom_update_ds0) |
| 127 | MCFG_DL1416B_ADD("ds1", sitcom_update_ds1) |
| 152 | 128 | MCFG_DEFAULT_LAYOUT(layout_sitcom) |
| 153 | 129 | MACHINE_CONFIG_END |
| 154 | 130 | |
| r12950 | r12951 | |
| 156 | 132 | ROM_START( sitcom ) |
| 157 | 133 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 158 | 134 | ROM_LOAD( "boot8085.bin", 0x0000, 0x06b8, CRC(1b5e3310) SHA1(3323b65f0c10b7ab6bb75ec824e6d5fb643693a8)) |
| 159 | | |
| 160 | | // dummy chargen to replace DL1414 displays |
| 161 | | ROM_REGION( 0x2000, "chargen", 0 ) |
| 162 | | ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf)) |
| 163 | 135 | ROM_END |
| 164 | 136 | |
| 165 | 137 | /* Driver */ |