33// thanks-to:Berger
44/* ******************************************************************************
55
6- Krypton Regency (model 933 )
6+ Krypton Challenge (model 5T-938 )
77
88It was manufactured by Timorite, Ltd. (Eric White's company), the chess engine is
99by Gyula Horváth, similar to the one in CXG Sphinx Legend.
1010
1111To start a new game, keep holding the NEW GAME button until the display says HELLO.
1212
13- Hardware notes (Systema Challenge fitted with Regency MCU):
14- - PCB label: LCD CHESS 938, JAN.1994, REV.1, EB-093801-01
15- - Hitachi H8/3256 MCU, 20MHz XTAL
16- - LCD with 5 7segs and custom segments
17- - piezo, 16 LEDs (optional), button sensors chessboard
18-
19- A26 MCU was used in:
20- - Krypton Regency (with or without LEDs)
21- - Excalibur Avenger (suspected, Excalibur brand Comet, with newer MCU)
22- - Excalibur Legend III (suspected, Excalibur brand Regency)
23- - Systema Challenge (1996 version)
24-
2513TODO:
2614- CXG Sphinx Legend may be on the same hardware? if so, move driver to cxg folder
2715- is Krypton a product brand, or a company alias for the Chinese factory behind it?
2816- it does a cold boot at every reset, so nvram won't work properly unless MAME
2917 adds some kind of auxillary autosave state feature at power-off
3018
19+ Hardware notes:
20+
21+ Systema Challenge:
22+ - PCB label: LCD CHESS 938, JAN.1994, REV.1, EB-093801-01
23+ - Hitachi H8/325 or H8/3256 MCU, 20MHz XTAL
24+ - LCD with 5 7segs and custom segments
25+ - piezo, 16 LEDs, button sensors chessboard
26+
27+ Krypton Regency (1995 version):
28+ - no main PCB label, LED PCB: TW933-E2, 996
29+ - Hitachi H8/325 MCU, 20MHz XTAL
30+ - rest is same as Challenge
31+
32+ Krypton Regency (1997 version):
33+ - PCB label: COPYRIGHT 1997 TIMORITE LTD., EB-93301-01 REV. 2.0
34+ - Hitachi H8/3256 MCU, 20MHz XTAL
35+ - no LEDs (cost reduction)
36+ - rest is same as Challenge
37+
38+ The H8/3256 MCU has Krypton Regency's model number (933) on the label, though
39+ it was also used in Challenge.
40+
41+ H8/325 A95 MCU is used in:
42+ - Krypton (or Systema) Challenge (black or gray, 1994 version)
43+ - Krypton Comet (suspected)
44+ - Krypton Regency (1995 version, with LEDs)
45+ - Excalibur Legend II (Excalibur brand Challenge)
46+
47+ H8/3256 A26 MCU is used in:
48+ - Krypton (or Systema) Challenge (1996 version)
49+ - Krypton Regency (1997 version, without LEDs)
50+ - Excalibur Avenger (suspected, Excalibur brand Comet, with newer MCU)
51+ - Excalibur Legend III (suspected, Excalibur brand Regency)
52+
3153*******************************************************************************/
3254
3355#include " emu.h"
@@ -41,15 +63,15 @@ A26 MCU was used in:
4163#include " speaker.h"
4264
4365// internal artwork
44- #include " krypton_regency .lh"
66+ #include " krypton_challenge .lh"
4567
4668
4769namespace {
4870
49- class regency_state : public driver_device
71+ class kchal_state : public driver_device
5072{
5173public:
52- regency_state (const machine_config &mconfig, device_type type, const char *tag) :
74+ kchal_state (const machine_config &mconfig, device_type type, const char *tag) :
5375 driver_device (mconfig, type, tag),
5476 m_maincpu (*this , " maincpu" ),
5577 m_board (*this , " board" ),
@@ -60,7 +82,10 @@ class regency_state : public driver_device
6082 m_out_lcd (*this , " s%u.%u" , 0U , 0U )
6183 { }
6284
63- void regency (machine_config &config);
85+ template <typename T> void cpu_config (T &maincpu);
86+ void shared (machine_config &config);
87+ void kchal (machine_config &config);
88+ void kchala (machine_config &config);
6489
6590 DECLARE_INPUT_CHANGED_MEMBER (in1_changed) { update_irq2 (); }
6691
@@ -69,7 +94,7 @@ class regency_state : public driver_device
6994
7095private:
7196 // devices/pointers
72- required_device<h83256_device > m_maincpu;
97+ required_device<h8_device > m_maincpu;
7398 required_device<sensorboard_device> m_board;
7499 required_device<pwm_display_device> m_led_pwm;
75100 required_device<pwm_display_device> m_lcd_pwm;
@@ -98,7 +123,7 @@ class regency_state : public driver_device
98123 void p7_w (u8 data);
99124};
100125
101- void regency_state ::machine_start ()
126+ void kchal_state ::machine_start ()
102127{
103128 m_out_lcd.resolve ();
104129
@@ -117,7 +142,7 @@ void regency_state::machine_start()
117142
118143// power
119144
120- void regency_state ::standby (int state)
145+ void kchal_state ::standby (int state)
121146{
122147 // clear display
123148 if (state)
@@ -127,7 +152,7 @@ void regency_state::standby(int state)
127152 }
128153}
129154
130- int regency_state ::update_irq2 ()
155+ int kchal_state ::update_irq2 ()
131156{
132157 // 2nd button row is tied to IRQ2 (used for on/off button)
133158 int state = (m_inp_mux2 & m_inputs[1 ]->read ()) ? ASSERT_LINE : CLEAR_LINE;
@@ -139,12 +164,12 @@ int regency_state::update_irq2()
139164
140165// LCD
141166
142- void regency_state ::lcd_pwm_w (offs_t offset, u8 data)
167+ void kchal_state ::lcd_pwm_w (offs_t offset, u8 data)
143168{
144169 m_out_lcd[offset & 0x3f ][offset >> 6 ] = data;
145170}
146171
147- void regency_state ::update_lcd ()
172+ void kchal_state ::update_lcd ()
148173{
149174 u32 lcd_segs = bitswap<24 >(m_lcd_segs,1 ,0 , 15 ,14 ,13 ,12 ,11 ,10 ,9 ,8 , 16 ,17 ,23 ,22 ,21 ,20 ,19 ,18 , 25 ,26 ,27 ,28 ,29 ,31 );
150175
@@ -157,7 +182,7 @@ void regency_state::update_lcd()
157182}
158183
159184template <int N>
160- void regency_state ::lcd_segs_w (u8 data)
185+ void kchal_state ::lcd_segs_w (u8 data)
161186{
162187 // P1x, P3x, P4x, P6x: LCD segments
163188 const u8 shift = 8 * N;
@@ -168,14 +193,14 @@ void regency_state::lcd_segs_w(u8 data)
168193
169194// misc
170195
171- void regency_state ::p2_w (u8 data)
196+ void kchal_state ::p2_w (u8 data)
172197{
173198 // P20-P27: input mux (chessboard), LED data
174199 m_inp_mux = (m_inp_mux & 0x300 ) | (data ^ 0xff );
175200 m_led_pwm->write_mx (~data);
176201}
177202
178- void regency_state ::p5_w (offs_t offset, u8 data, u8 mem_mask)
203+ void kchal_state ::p5_w (offs_t offset, u8 data, u8 mem_mask)
179204{
180205 // P50: LCD common 2
181206 m_lcd_com = (m_lcd_com & 5 ) | (data << 1 & 2 ) | (mem_mask << 3 & 8 );
@@ -191,7 +216,7 @@ void regency_state::p5_w(offs_t offset, u8 data, u8 mem_mask)
191216 m_led_pwm->write_my (~data >> 4 & 3 );
192217}
193218
194- u8 regency_state ::p6_r ()
219+ u8 kchal_state ::p6_r ()
195220{
196221 // P65: battery status
197222 u8 data = m_inputs[2 ]->read () << 5 & 0x20 ;
@@ -203,7 +228,7 @@ u8 regency_state::p6_r()
203228 return ~data;
204229}
205230
206- void regency_state ::p6_w (offs_t offset, u8 data, u8 mem_mask)
231+ void kchal_state ::p6_w (offs_t offset, u8 data, u8 mem_mask)
207232{
208233 // P60,P61: LCD segs
209234 lcd_segs_w<0 >(data & 3 );
@@ -216,7 +241,7 @@ void regency_state::p6_w(offs_t offset, u8 data, u8 mem_mask)
216241 m_inp_mux = (m_inp_mux & 0x1ff ) | (BIT (~data, 6 ) << 9 );
217242}
218243
219- u8 regency_state ::p7_r ()
244+ u8 kchal_state ::p7_r ()
220245{
221246 // P70-P77: multiplexed inputs
222247 u8 data = 0 ;
@@ -234,7 +259,7 @@ u8 regency_state::p7_r()
234259 return ~data;
235260}
236261
237- void regency_state ::p7_w (u8 data)
262+ void kchal_state ::p7_w (u8 data)
238263{
239264 // P70-P77: input mux (other way around)
240265 m_inp_mux2 = ~data;
@@ -248,18 +273,18 @@ void regency_state::p7_w(u8 data)
248273*******************************************************************************/
249274
250275#define PORT_CHANGED_IN1 () \
251- PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(regency_state ::in1_changed), 0 )
276+ PORT_CHANGED_MEMBER (DEVICE_SELF, FUNC(kchal_state ::in1_changed), 0 )
252277
253- static INPUT_PORTS_START ( regency )
278+ static INPUT_PORTS_START ( kchal )
254279 PORT_START(" IN.0" )
255- PORT_BIT(0x01 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME(" Knight / Lose " )
280+ PORT_BIT(0x01 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME(" Knight" )
256281 PORT_BIT(0x02 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME(" Queen" )
257282 PORT_BIT(0x04 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME(" Set-Up / Features" )
258283 PORT_BIT(0x08 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME(" Level" )
259284 PORT_BIT(0x10 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME(" Step Forward" )
260285 PORT_BIT(0x20 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME(" Multi-Move / Analysis" )
261- PORT_BIT(0x40 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME(" Rook / Win " )
262- PORT_BIT(0x80 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME(" Pawn / Rating " )
286+ PORT_BIT(0x40 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME(" Rook" )
287+ PORT_BIT(0x80 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME(" Pawn" )
263288
264289 PORT_START(" IN.1" )
265290 PORT_BIT(0x01 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_F1) PORT_NAME(" On / Off" )
@@ -268,7 +293,7 @@ static INPUT_PORTS_START( regency )
268293 PORT_BIT(0x08 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_O) PORT_NAME(" Sound / Style" )
269294 PORT_BIT(0x10 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_T) PORT_NAME(" Take Back" )
270295 PORT_BIT(0x20 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_H) PORT_NAME(" Hint / Info" )
271- PORT_BIT(0x40 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME(" Bishop / Draw " )
296+ PORT_BIT(0x40 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME(" Bishop" )
272297 PORT_BIT(0x80 , IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CHANGED_IN1() PORT_CODE(KEYCODE_N) PORT_NAME(" New Game / Clear Board" )
273298
274299 PORT_START(" IN.2" )
@@ -283,59 +308,85 @@ INPUT_PORTS_END
283308 Machine Configs
284309*******************************************************************************/
285310
286- void regency_state::regency(machine_config &config)
311+ template <typename T>
312+ void kchal_state::cpu_config(T &maincpu)
287313{
288- // basic machine hardware
289- H83256 (config, m_maincpu, 20_MHz_XTAL);
290- m_maincpu->nvram_enable_backup (true );
291- m_maincpu->standby_cb ().set (m_maincpu, FUNC (h83256_device::nvram_set_battery));
292- m_maincpu->standby_cb ().append (FUNC (regency_state::standby));
293- m_maincpu->write_port1 ().set (FUNC (regency_state::lcd_segs_w<2 >));
294- m_maincpu->read_port2 ().set_constant (0xef ); // hardware config?
295- m_maincpu->write_port2 ().set (FUNC (regency_state::p2_w));
296- m_maincpu->write_port3 ().set (FUNC (regency_state::lcd_segs_w<1 >));
297- m_maincpu->write_port4 ().set (FUNC (regency_state::lcd_segs_w<3 >));
298- m_maincpu->read_port5 ().set_constant (0xff );
299- m_maincpu->write_port5 ().set (FUNC (regency_state::p5_w));
300- m_maincpu->read_port6 ().set (FUNC (regency_state::p6_r));
301- m_maincpu->write_port6 ().set (FUNC (regency_state::p6_w));
302- m_maincpu->read_port7 ().set (FUNC (regency_state::p7_r));
303- m_maincpu->write_port7 ().set (FUNC (regency_state::p7_w));
314+ maincpu.nvram_enable_backup (true );
315+ maincpu.standby_cb ().set (maincpu, FUNC (T::nvram_set_battery));
316+ maincpu.standby_cb ().append (FUNC (kchal_state::standby));
317+ maincpu.write_port1 ().set (FUNC (kchal_state::lcd_segs_w<2 >));
318+ maincpu.read_port2 ().set_constant (0xef ); // hardware config?
319+ maincpu.write_port2 ().set (FUNC (kchal_state::p2_w));
320+ maincpu.write_port3 ().set (FUNC (kchal_state::lcd_segs_w<1 >));
321+ maincpu.write_port4 ().set (FUNC (kchal_state::lcd_segs_w<3 >));
322+ maincpu.read_port5 ().set_constant (0xff );
323+ maincpu.write_port5 ().set (FUNC (kchal_state::p5_w));
324+ maincpu.read_port6 ().set (FUNC (kchal_state::p6_r));
325+ maincpu.write_port6 ().set (FUNC (kchal_state::p6_w));
326+ maincpu.read_port7 ().set (FUNC (kchal_state::p7_r));
327+ maincpu.write_port7 ().set (FUNC (kchal_state::p7_w));
328+ }
304329
330+ void kchal_state::shared (machine_config &config)
331+ {
305332 SENSORBOARD (config, m_board).set_type (sensorboard_device::BUTTONS);
306333 m_board->init_cb ().set (m_board, FUNC (sensorboard_device::preset_chess));
307334 m_board->set_delay (attotime::from_msec (150 ));
308335 // m_board->set_nvram_enable(true);
309336
310337 // video hardware
311338 PWM_DISPLAY (config, m_lcd_pwm).set_size (2 , 24 );
312- m_lcd_pwm->output_x ().set (FUNC (regency_state ::lcd_pwm_w));
339+ m_lcd_pwm->output_x ().set (FUNC (kchal_state ::lcd_pwm_w));
313340
314341 screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_SVG));
315342 screen.set_refresh_hz (60 );
316343 screen.set_size (1920 /5 , 697 /5 );
317344 screen.set_visarea_full ();
318345
319346 PWM_DISPLAY (config, m_led_pwm).set_size (2 , 8 );
320- config.set_default_layout (layout_krypton_regency );
347+ config.set_default_layout (layout_krypton_challenge );
321348
322349 // sound hardware
323350 SPEAKER (config, " speaker" ).front_center ();
324351 DAC_1BIT (config, m_dac).add_route (ALL_OUTPUTS, " speaker" , 0.25 );
325352}
326353
354+ void kchal_state::kchal (machine_config &config)
355+ {
356+ H83256 (config, m_maincpu, 20_MHz_XTAL);
357+ cpu_config<h83256_device>(downcast<h83256_device &>(*m_maincpu));
358+
359+ shared (config);
360+ }
361+
362+ void kchal_state::kchala (machine_config &config)
363+ {
364+ H8325 (config, m_maincpu, 20_MHz_XTAL);
365+ cpu_config<h8325_device>(downcast<h8325_device &>(*m_maincpu));
366+
367+ shared (config);
368+ }
369+
327370
328371
329372/* ******************************************************************************
330373 ROM Definitions
331374*******************************************************************************/
332375
333- ROM_START ( regency )
376+ ROM_START ( kchal )
334377 ROM_REGION16_BE ( 0xc000 , " maincpu" , 0 )
335378 ROM_LOAD (" 1996_933_timorite_hd6433256a26p.ic1" , 0x0000 , 0xc000 , CRC(72eb3f2b) SHA1(30e4166e351210475cf9709b0feb717d9d3ac747) )
336379
337380 ROM_REGION ( 109652 , " screen" , 0 )
338- ROM_LOAD (" regency.svg" , 0 , 109652 , CRC(6840c49e) SHA1(a9c91143c5bea5ab41fe323e719da4a46ab9d631) )
381+ ROM_LOAD (" kchal.svg" , 0 , 109652 , CRC(6840c49e) SHA1(a9c91143c5bea5ab41fe323e719da4a46ab9d631) )
382+ ROM_END
383+
384+ ROM_START ( kchala )
385+ ROM_REGION16_BE ( 0x8000 , " maincpu" , 0 )
386+ ROM_LOAD (" 1993_vil_v938_hd6433258a95p.ic1" , 0x0000 , 0x8000 , CRC(9277d7d4) SHA1(0ba5129846c11bb7bf02dade1b934e21c45316c8) )
387+
388+ ROM_REGION ( 109652 , " screen" , 0 )
389+ ROM_LOAD (" kchal.svg" , 0 , 109652 , CRC(6840c49e) SHA1(a9c91143c5bea5ab41fe323e719da4a46ab9d631) )
339390ROM_END
340391
341392} // anonymous namespace
@@ -346,5 +397,6 @@ ROM_END
346397 Drivers
347398*******************************************************************************/
348399
349- // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
350- SYST ( 1996 , regency, 0 , 0 , regency, regency, regency_state, empty_init, " Krypton / Timorite" , " Regency" , MACHINE_SUPPORTS_SAVE )
400+ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
401+ SYST ( 1996 , kchal, 0 , 0 , kchal, kchal, kchal_state, empty_init, " Krypton / Timorite" , " Challenge (1996 version)" , MACHINE_SUPPORTS_SAVE )
402+ SYST( 1994 , kchala, kchal, 0 , kchala, kchal, kchal_state, empty_init, " Krypton / Timorite" , " Challenge (1994 version)" , MACHINE_SUPPORTS_SAVE )
0 commit comments