Previous 15994 Revisions Next

r9629 Monday 22nd November, 2010 at 08:59:50 UTC by Robbbert
[H8] It runs, keyboard works, you can enter data.
[src/mess/drivers]h8.c
[src/mess/layout]h8.lay

src/mess/layout/h8.lay
r9628r9629
1717      <bezel element="background">
1818         <bounds left="1" top="1" right="600" bottom="480" />
1919      </bezel>
20      <bezel name="digit0" element="digit">
20      <bezel name="digit1" element="digit">
2121         <bounds left="107" top="105" right="154" bottom="185" />
2222      </bezel>
23      <bezel name="digit1" element="digit">
23      <bezel name="digit2" element="digit">
2424         <bounds left="155" top="105" right="202" bottom="185" />
2525      </bezel>
26      <bezel name="digit2" element="digit">
26      <bezel name="digit3" element="digit">
2727         <bounds left="203" top="105" right="250" bottom="185" />
2828      </bezel>
29      <bezel name="digit3" element="digit">
29      <bezel name="digit4" element="digit">
3030         <bounds left="275" top="105" right="322" bottom="185" />
3131      </bezel>
32      <bezel name="digit4" element="digit">
32      <bezel name="digit5" element="digit">
3333         <bounds left="323" top="105" right="370" bottom="185" />
3434      </bezel>
35      <bezel name="digit5" element="digit">
35      <bezel name="digit6" element="digit">
3636         <bounds left="371" top="105" right="418" bottom="185" />
3737      </bezel>
38      <bezel name="digit6" element="digit">
38      <bezel name="digit7" element="digit">
3939         <bounds left="443" top="105" right="490" bottom="185" />
4040      </bezel>
41      <bezel name="digit7" element="digit">
41      <bezel name="digit8" element="digit">
4242         <bounds left="491" top="105" right="538" bottom="185" />
4343      </bezel>
44      <bezel name="digit8" element="digit">
44      <bezel name="digit9" element="digit">
4545         <bounds left="539" top="105" right="586" bottom="185" />
4646      </bezel>
4747   </view>
src/mess/drivers/h8.c
r9628r9629
44
55        12/05/2009 Skeleton driver.
66
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
717****************************************************************************/
818
919#include "emu.h"
1020#include "cpu/i8085/i8085.h"
1121#include "h8.lh"
1222
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
1327static UINT8 h8_digit;
1428static UINT8 h8_segment;
1529
16static void h8_display(void)
30
31static TIMER_DEVICE_CALLBACK( h8_irq_pulse )
1732{
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);
2234}
2335
2436static READ8_HANDLER( h8_f0_r )
r9628r9629
4355            data &= ~(i<<5);
4456      data &= 0xef;
4557   }
46   //printf("Key=%X ",data);
4758   return data;
4859}
4960
r9628r9629
5667    // d7 = beeper enable (hi)
5768
5869   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);
6273
63   //printf("f0=%X ",data);
74   cpu_set_input_line(space->machine->device("maincpu"), INPUT_LINE_IRQ0, CLEAR_LINE);
6475}
6576
6677static WRITE8_HANDLER( h8_f1_w )
r9628r9629
7485    //d1 segment a
7586    //d0 segment g
7687
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);
8090}
8191
8292static ADDRESS_MAP_START(h8_mem, ADDRESS_SPACE_PROGRAM, 8)
r9628r9629
122132
123133static MACHINE_RESET(h8)
124134{
125   cpu_set_input_line_and_vector(machine->device("maincpu"), INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf);
126135}
127136
128137static WRITE_LINE_DEVICE_HANDLER( h8_inte_callback )
129138{
130    // operate the ION LED
139        // operate the ION LED
131140}
132141
133142static WRITE8_DEVICE_HANDLER( h8_status_callback )
134143{
135144   if (data & I8085_STATUS_INTA)
136145   {
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
139147   }
140148   if (data & I8085_STATUS_M1)
141149   {
142      // operate the RUN LED
150        // operate the RUN LED
143151   }
144152}
145153
146static I8085_CONFIG( h8_i8080_config )
154static I8085_CONFIG( h8_cpu_config )
147155{
148156   DEVCB_HANDLER(h8_status_callback),      /* Status changed callback */
149157   DEVCB_LINE(h8_inte_callback),         /* INTE changed callback */
r9628r9629
153161
154162static MACHINE_CONFIG_START( h8, driver_device )
155163   /* basic machine hardware */
156   MDRV_CPU_ADD("maincpu", I8080, XTAL_12_288MHz / 6)
164   MDRV_CPU_ADD("maincpu", I8080, H8_CLOCK)
157165   MDRV_CPU_PROGRAM_MAP(h8_mem)
158166   MDRV_CPU_IO_MAP(h8_io)
159   MDRV_CPU_CONFIG(h8_i8080_config)
167   MDRV_CPU_CONFIG(h8_cpu_config)
160168
161169   MDRV_MACHINE_RESET(h8)
170   MDRV_TIMER_ADD_PERIODIC("h8_timer", h8_irq_pulse, HZ(H8_IRQ_PULSE) )
162171
163172   /* video hardware */
164173   MDRV_DEFAULT_LAYOUT(layout_h8)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team