Previous 15994 Revisions Next

r13773 Thursday 29th December, 2011 at 07:12:14 UTC by Robbbert
SC1 - minor wip
[src/mess]mess.mak
[src/mess/drivers]sc1.c
[src/mess/layout]sc1.lay*

src/mess/layout/sc1.lay
r0r13773
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="g_led" defstate="0">
4      <disk>
5         <color red="0.0" green="0.75" blue="0.0" />
6      </disk>
7   </element>
8   <element name="g_digit" defstate="0">
9      <led7seg>
10         <color red="0.75" green="0.5" blue="0.0" />
11      </led7seg>
12   </element>
13   <element name="r_digit" defstate="0">
14      <led7seg>
15         <color red="0.75" green="0.0" blue="0.0" />
16      </led7seg>
17   </element>
18   <element name="background">
19      <rect>
20         <bounds left="0" top="0" right="1" bottom="1" />
21         <color red="0.0" green="0.0" blue="0.0" />
22      </rect>
23   </element>
24 
25   <view name="Default Layout">
26      <!-- Black background -->
27      <bezel element="background">
28         <bounds left="64" top="95" right="453" bottom="195" />
29      </bezel>
30      <bezel name="busy_led" element="g_led">
31         <bounds left="76" right="96" top="130" bottom="150" />
32      </bezel>
33 
34      <bezel name="digit0" element="r_digit">
35         <bounds left="107" top="105" right="155" bottom="185" />
36      </bezel>
37      <bezel name="digit6" element="r_digit">
38         <bounds left="155" top="105" right="203" bottom="185" />
39      </bezel>
40      <bezel name="digit5" element="r_digit">
41         <bounds left="203" top="105" right="251" bottom="185" />
42      </bezel>
43      <bezel name="digit4" element="r_digit">
44         <bounds left="251" top="105" right="299" bottom="185" />
45      </bezel>
46      <bezel name="digit3" element="g_digit">
47         <bounds left="347" top="105" right="395" bottom="185" />
48      </bezel>
49      <bezel name="digit1" element="g_digit">
50         <bounds left="395" top="105" right="443" bottom="185" />
51      </bezel>
52   </view>
53</mamelayout>
src/mess/mess.mak
r13772r13773
19291929$(MESS_DRIVERS)/px4.o:      $(MESS_LAYOUT)/px4.lh
19301930$(MESS_DRIVERS)/px8.o:      $(MESS_LAYOUT)/px8.lh
19311931$(MESS_DRIVERS)/savia84.o:   $(MESS_LAYOUT)/savia84.lh
1932$(MESS_DRIVERS)/sc1.o:      $(MESS_LAYOUT)/sc1.lh
19321933$(MESS_DRIVERS)/sc2.o:      $(MESS_LAYOUT)/sc2.lh
19331934$(MESS_DRIVERS)/sdk85.o:   $(MESS_LAYOUT)/sdk85.lh
19341935$(MESS_DRIVERS)/sdk86.o:   $(MESS_LAYOUT)/sdk86.lh
src/mess/drivers/sc1.c
r13772r13773
1010#include "emu.h"
1111#include "cpu/z80/z80.h"
1212#include "sound/speaker.h"
13#include "sc1.lh"
1314
1415
1516class sc1_state : public driver_device
r13772r13773
2526   required_device<device_t> m_speaker;
2627   DECLARE_WRITE8_MEMBER(sc1_fc_w);
2728   DECLARE_WRITE8_MEMBER(sc1v2_07_w);
29   DECLARE_WRITE8_MEMBER(sc1v2_io_w);
30   DECLARE_READ8_MEMBER(sc1v2_io_r);
31private:
32   UINT8 m_digit;
2833};
2934
35/***************************************************************************
36
37    Display
38
39***************************************************************************/
40
41WRITE8_MEMBER( sc1_state::sc1v2_io_w )
42{
43   bool segonoff = BIT(data, 7);
44   //bool busyled = BIT(data, 4);
45   data &= 15;
46
47   if (data < 8)
48      m_digit = data;
49   else
50   if (data < 12)
51   {
52      speaker_level_w(m_speaker, BIT(data, 1) );
53      return;
54   }
55   else
56   if (offset == 0x2f07)
57      return;
58
59   UINT8 segdata = output_get_digit_value(m_digit);
60   UINT8 segnum  = offset & 7;
61   UINT8 segmask = 1 << segnum;
62
63   if (segonoff)
64      segdata |= segmask;
65   else
66      segdata &= ~segmask;
67
68   output_set_digit_value(m_digit, segdata);
69
70   //output_set_value("busyled", busyled);
71}
72
73
74/***************************************************************************
75
76    Keyboard
77
78***************************************************************************/
79
80READ8_MEMBER( sc1_state::sc1v2_io_r )
81{
82   UINT8 data = 0xff, upper = (offset >> 8) & 7;
83
84   if (upper == 3)
85      data &= input_port_read(machine(), "X0");
86   else
87   if (upper == 4)
88      data &= input_port_read(machine(), "X1");
89   else
90   if (upper == 5)
91      data &= input_port_read(machine(), "X2");
92
93   return data;
94}
95
3096WRITE8_MEMBER( sc1_state::sc1_fc_w )
3197{
3298//  if (BIT(data, 3))
r13772r13773
54120
55121static ADDRESS_MAP_START(sc1v2_io, AS_IO, 8, sc1_state)
56122   ADDRESS_MAP_UNMAP_HIGH
57   ADDRESS_MAP_GLOBAL_MASK(0xff)
58   AM_RANGE( 0x07, 0x07) AM_WRITE(sc1v2_07_w)
123   //ADDRESS_MAP_GLOBAL_MASK(0xff)
124   AM_RANGE( 0x0000, 0xffff) AM_WRITE(sc1v2_io_w)
59125ADDRESS_MAP_END
60126
61127/* Input ports */
62128static INPUT_PORTS_START( sc1 )
129   PORT_START("X0")
130   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
131   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D4 T") PORT_CODE(KEYCODE_4)
132   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3 L") PORT_CODE(KEYCODE_3)
133   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2 S") PORT_CODE(KEYCODE_2)
134   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A1 B") PORT_CODE(KEYCODE_1)
135
136   PORT_START("X1")
137   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
138   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5 D") PORT_CODE(KEYCODE_5)
139   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F6 K") PORT_CODE(KEYCODE_6)
140   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G7")   PORT_CODE(KEYCODE_7)
141   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H8")   PORT_CODE(KEYCODE_8)
142
143   PORT_START("X2")
144   PORT_BIT(0x0f, IP_ACTIVE_LOW, IPT_UNUSED)
145   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C")    PORT_CODE(KEYCODE_C)
146   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A")    PORT_CODE(KEYCODE_A)
147   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("St")   PORT_CODE(KEYCODE_S)
148   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z")    PORT_CODE(KEYCODE_Z)
63149INPUT_PORTS_END
64150
65151
r13772r13773
67153{
68154}
69155
70static VIDEO_START( sc1 )
71{
72}
73
74static SCREEN_UPDATE( sc1 )
75{
76   return 0;
77}
78
79156static MACHINE_CONFIG_START( sc1, sc1_state )
80157   /* basic machine hardware */
81158   MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
r13772r13773
85162   MCFG_MACHINE_RESET(sc1)
86163
87164   /* video hardware */
88   MCFG_SCREEN_ADD("screen", RASTER)
89   MCFG_SCREEN_REFRESH_RATE(50)
90   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
91   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
92   MCFG_SCREEN_SIZE(640, 480)
93   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
94   MCFG_VIDEO_START(sc1)
95   MCFG_SCREEN_UPDATE(sc1)
96   MCFG_PALETTE_LENGTH(2)
97   MCFG_PALETTE_INIT(black_and_white)
165   MCFG_DEFAULT_LAYOUT(layout_sc1)
98166
99167   /* sound hardware */
100168   MCFG_SPEAKER_STANDARD_MONO("mono")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team