src/mess/layout/h8.lay
| r9628 | r9629 | |
| 17 | 17 | <bezel element="background">
|
| 18 | 18 | <bounds left="1" top="1" right="600" bottom="480" />
|
| 19 | 19 | </bezel>
|
| 20 | | <bezel name="digit0" element="digit">
|
| 20 | <bezel name="digit1" element="digit">
|
| 21 | 21 | <bounds left="107" top="105" right="154" bottom="185" />
|
| 22 | 22 | </bezel>
|
| 23 | | <bezel name="digit1" element="digit">
|
| 23 | <bezel name="digit2" element="digit">
|
| 24 | 24 | <bounds left="155" top="105" right="202" bottom="185" />
|
| 25 | 25 | </bezel>
|
| 26 | | <bezel name="digit2" element="digit">
|
| 26 | <bezel name="digit3" element="digit">
|
| 27 | 27 | <bounds left="203" top="105" right="250" bottom="185" />
|
| 28 | 28 | </bezel>
|
| 29 | | <bezel name="digit3" element="digit">
|
| 29 | <bezel name="digit4" element="digit">
|
| 30 | 30 | <bounds left="275" top="105" right="322" bottom="185" />
|
| 31 | 31 | </bezel>
|
| 32 | | <bezel name="digit4" element="digit">
|
| 32 | <bezel name="digit5" element="digit">
|
| 33 | 33 | <bounds left="323" top="105" right="370" bottom="185" />
|
| 34 | 34 | </bezel>
|
| 35 | | <bezel name="digit5" element="digit">
|
| 35 | <bezel name="digit6" element="digit">
|
| 36 | 36 | <bounds left="371" top="105" right="418" bottom="185" />
|
| 37 | 37 | </bezel>
|
| 38 | | <bezel name="digit6" element="digit">
|
| 38 | <bezel name="digit7" element="digit">
|
| 39 | 39 | <bounds left="443" top="105" right="490" bottom="185" />
|
| 40 | 40 | </bezel>
|
| 41 | | <bezel name="digit7" element="digit">
|
| 41 | <bezel name="digit8" element="digit">
|
| 42 | 42 | <bounds left="491" top="105" right="538" bottom="185" />
|
| 43 | 43 | </bezel>
|
| 44 | | <bezel name="digit8" element="digit">
|
| 44 | <bezel name="digit9" element="digit">
|
| 45 | 45 | <bounds left="539" top="105" right="586" bottom="185" />
|
| 46 | 46 | </bezel>
|
| 47 | 47 | </view>
|
src/mess/drivers/h8.c
| r9628 | r9629 | |
| 4 | 4 | |
| 5 | 5 | 12/05/2009 Skeleton driver. |
| 6 | 6 | |
| 7 | STATUS: |
| 8 | - It runs, keyboard works, you can enter data |
| 9 | |
| 10 | TODO: |
| 11 | - Proper artwork |
| 12 | - Add status LEDs |
| 13 | - Add beeper |
| 14 | - Add extra interrupt stuff |
| 15 | - Assign more appropriate keys |
| 16 | |
| 7 | 17 | ****************************************************************************/ |
| 8 | 18 | |
| 9 | 19 | #include "emu.h" |
| 10 | 20 | #include "cpu/i8085/i8085.h" |
| 11 | 21 | #include "h8.lh" |
| 12 | 22 | |
| 23 | #define H8_CLOCK (XTAL_12_288MHz / 6) |
| 24 | #define H8_BEEP_FRQ (H8_CLOCK / 1024) |
| 25 | #define H8_IRQ_PULSE (H8_BEEP_FRQ / 2) |
| 26 | |
| 13 | 27 | static UINT8 h8_digit; |
| 14 | 28 | static UINT8 h8_segment; |
| 15 | 29 | |
| 16 | | static void h8_display(void) |
| 30 | |
| 31 | static TIMER_DEVICE_CALLBACK( h8_irq_pulse ) |
| 17 | 32 | { |
| 18 | | UINT8 i; |
| 19 | | for (i = 0; i < 9; i++) |
| 20 | | if (h8_digit & (1 << i)) |
| 21 | | output_set_digit_value(8-i, h8_segment); |
| 33 | cpu_set_input_line_and_vector(timer.machine->device("maincpu"), INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); |
| 22 | 34 | } |
| 23 | 35 | |
| 24 | 36 | static READ8_HANDLER( h8_f0_r ) |
| r9628 | r9629 | |
| 43 | 55 | data &= ~(i<<5); |
| 44 | 56 | data &= 0xef; |
| 45 | 57 | } |
| 46 | | //printf("Key=%X ",data); |
| 47 | 58 | return data; |
| 48 | 59 | } |
| 49 | 60 | |
| r9628 | r9629 | |
| 56 | 67 | // d7 = beeper enable (hi) |
| 57 | 68 | |
| 58 | 69 | h8_digit = data & 15; |
| 59 | | if (h8_digit) h8_display(); |
| 60 | | if (~data & 0x40) cpu_set_input_line_and_vector(space->machine->device("maincpu"), INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); |
| 61 | | if (data & 0x10) cpu_set_input_line_and_vector(space->machine->device("maincpu"), INPUT_LINE_IRQ0, ASSERT_LINE, 0xd7); |
| 70 | if (h8_digit) output_set_digit_value(h8_digit, h8_segment); |
| 71 | //if (~data & 0x40) h8_irqset(space->machine, 160, 0xcf); |
| 72 | //if (data & 0x10) h8_irqset(space->machine, 160, 0xd7); |
| 62 | 73 | |
| 63 | | //printf("f0=%X ",data); |
| 74 | cpu_set_input_line(space->machine->device("maincpu"), INPUT_LINE_IRQ0, CLEAR_LINE); |
| 64 | 75 | } |
| 65 | 76 | |
| 66 | 77 | static WRITE8_HANDLER( h8_f1_w ) |
| r9628 | r9629 | |
| 74 | 85 | //d1 segment a |
| 75 | 86 | //d0 segment g |
| 76 | 87 | |
| 77 | | h8_segment = BITSWAP8(data, 7, 0, 6, 5, 4, 3, 2, 1); |
| 78 | | if (h8_digit) h8_display(); |
| 79 | | //printf("f1=%X ",data); |
| 88 | h8_segment = 0xff ^ BITSWAP8(data, 7, 0, 6, 5, 4, 3, 2, 1); |
| 89 | if (h8_digit) output_set_digit_value(h8_digit, h8_segment); |
| 80 | 90 | } |
| 81 | 91 | |
| 82 | 92 | static ADDRESS_MAP_START(h8_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r9628 | r9629 | |
| 122 | 132 | |
| 123 | 133 | static MACHINE_RESET(h8) |
| 124 | 134 | { |
| 125 | | cpu_set_input_line_and_vector(machine->device("maincpu"), INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); |
| 126 | 135 | } |
| 127 | 136 | |
| 128 | 137 | static WRITE_LINE_DEVICE_HANDLER( h8_inte_callback ) |
| 129 | 138 | { |
| 130 | | // operate the ION LED |
| 139 | // operate the ION LED |
| 131 | 140 | } |
| 132 | 141 | |
| 133 | 142 | static WRITE8_DEVICE_HANDLER( h8_status_callback ) |
| 134 | 143 | { |
| 135 | 144 | if (data & I8085_STATUS_INTA) |
| 136 | 145 | { |
| 137 | | // interrupt acknowledge |
| 138 | | cpu_set_input_line(device, INPUT_LINE_IRQ0, CLEAR_LINE); |
| 146 | // This is when the vector is presented to the CPU |
| 139 | 147 | } |
| 140 | 148 | if (data & I8085_STATUS_M1) |
| 141 | 149 | { |
| 142 | | // operate the RUN LED |
| 150 | // operate the RUN LED |
| 143 | 151 | } |
| 144 | 152 | } |
| 145 | 153 | |
| 146 | | static I8085_CONFIG( h8_i8080_config ) |
| 154 | static I8085_CONFIG( h8_cpu_config ) |
| 147 | 155 | { |
| 148 | 156 | DEVCB_HANDLER(h8_status_callback), /* Status changed callback */ |
| 149 | 157 | DEVCB_LINE(h8_inte_callback), /* INTE changed callback */ |
| r9628 | r9629 | |
| 153 | 161 | |
| 154 | 162 | static MACHINE_CONFIG_START( h8, driver_device ) |
| 155 | 163 | /* basic machine hardware */ |
| 156 | | MDRV_CPU_ADD("maincpu", I8080, XTAL_12_288MHz / 6) |
| 164 | MDRV_CPU_ADD("maincpu", I8080, H8_CLOCK) |
| 157 | 165 | MDRV_CPU_PROGRAM_MAP(h8_mem) |
| 158 | 166 | MDRV_CPU_IO_MAP(h8_io) |
| 159 | | MDRV_CPU_CONFIG(h8_i8080_config) |
| 167 | MDRV_CPU_CONFIG(h8_cpu_config) |
| 160 | 168 | |
| 161 | 169 | MDRV_MACHINE_RESET(h8) |
| 170 | MDRV_TIMER_ADD_PERIODIC("h8_timer", h8_irq_pulse, HZ(H8_IRQ_PULSE) ) |
| 162 | 171 | |
| 163 | 172 | /* video hardware */ |
| 164 | 173 | MDRV_DEFAULT_LAYOUT(layout_h8) |