Previous 199869 Revisions Next

r33864 Sunday 14th December, 2014 at 00:04:03 UTC by hap
(MESS)Game promoted to working
------------------
Mathemagician [hap, Kevin Horton, incog]
[src/emu/cpu/tms0980]tms0980.c tms0980.h
[src/mess/drivers]mathmagi.c
[src/mess/layout]mathmagi.lay

trunk/src/emu/cpu/tms0980/tms0980.c
r242375r242376
159159// - RAM, ROM, and main instructions PLA is exactly the same as TMS0980
160160// - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling
161161// - 48-term output PLA above the RAM (rotate opla 90 degrees)
162const device_type TMC0270 = &device_creator<tmc0270_cpu_device>; // 40-pin DIP, 16 O pins, 8 R pins (the other R pins are internally hooked up to support more I/O)
162const device_type TMC0270 = &device_creator<tmc0270_cpu_device>; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O)
163163// TMC0260 is same? except opla is 32 instead of 48 terms
164164
165165
r242375r242376
250250
251251
252252tmc0270_cpu_device::tmc0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
253   : tms0980_cpu_device(mconfig, TMC0270, "TMC0270", tag, owner, clock, 16, 8, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tmc0270", __FILE__)
253   : tms0980_cpu_device(mconfig, TMC0270, "TMC0270", tag, owner, clock, 16, 16, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tmc0270", __FILE__)
254254{
255255}
256256
r242375r242376
396396   m_cs = 0;
397397   m_r = 0;
398398   m_o = 0;
399   m_o_latch = 0;
400   m_o_latch_low = 0;
399   m_o_index = 0;
401400   m_cki_bus = 0;
402401   m_c4 = 0;
403402   m_p = 0;
r242375r242376
422421   m_micro = 0;
423422   m_subcycle = 0;
424423
425   m_a_prev = m_a;
426   m_r_prev = m_r;
427   m_o_latch_prev = m_o_latch;
428
429424   // register for savestates
430425   save_item(NAME(m_pc));
431426   save_item(NAME(m_sr));
r242375r242376
439434   save_item(NAME(m_cs));
440435   save_item(NAME(m_r));
441436   save_item(NAME(m_o));
442   save_item(NAME(m_o_latch));
443   save_item(NAME(m_o_latch_low));
437   save_item(NAME(m_o_index));
444438   save_item(NAME(m_cki_bus));
445439   save_item(NAME(m_c4));
446440   save_item(NAME(m_p));
r242375r242376
465459   save_item(NAME(m_micro));
466460   save_item(NAME(m_subcycle));
467461
468   save_item(NAME(m_a_prev));
469   save_item(NAME(m_r_prev));
470   save_item(NAME(m_o_latch_prev));
471
472462   // register state for debugger
473463   state_add(TMS0980_PC,     "PC",     m_pc    ).formatstr("%02X");
474464   state_add(TMS0980_SR,     "SR",     m_sr    ).formatstr("%01X");
r242375r242376
485475   m_icountptr = &m_icount;
486476}
487477
478void tmc0270_cpu_device::device_start()
479{
480   // common init
481   tms1xxx_cpu_device::device_start();
488482
483   // zerofill
484   m_a_prev = 0;
485   m_r_prev = 0;
489486
487   m_o_latch_low = 0;
488   m_o_latch = 0;
489   m_o_latch_prev = 0;
490   
491   // register for savestates
492   save_item(NAME(m_a_prev));
493   save_item(NAME(m_r_prev));
494
495   save_item(NAME(m_o_latch_low));
496   save_item(NAME(m_o_latch));
497   save_item(NAME(m_o_latch_prev));
498}
499
500
501
490502//-------------------------------------------------
491503//  device_reset - device-specific reset
492504//-------------------------------------------------
r242375r242376
513525   // clear outputs
514526   m_r = 0;
515527   m_write_r(0, m_r & m_r_mask, 0xffff);
516   m_o_latch_low = 0;
517   m_o_latch = 0;
518528   write_o_output(0);
519529   m_write_r(0, m_r & m_r_mask, 0xffff);
520530   m_power_off(0);
r242375r242376
673683      m_micro_direct[op] = decode_micro(op);
674684}
675685
686void tmc0270_cpu_device::device_reset()
687{
688   // common reset
689   tms0980_cpu_device::device_reset();
676690
691   m_a_prev = m_a;
692   m_r_prev = m_r;
677693
694   m_o_latch_low = 0;
695   m_o_latch = 0;
696   m_o_latch_prev = 0;
697}
698
699
700
678701//-------------------------------------------------
679702//  program counter/opcode decode
680703//-------------------------------------------------
r242375r242376
731754   // RSTR is on the mpla
732755   if (m_micro & M_RSTR)
733756      m_fixed |= F_RSTR;
734   
735   // TODO: M_UNK1
736757}
737758
738759
r242375r242376
741762//  i/o handling
742763//-------------------------------------------------
743764
744void tms1xxx_cpu_device::write_o_output(UINT8 data)
765void tms1xxx_cpu_device::write_o_output(UINT8 index)
745766{
767   m_o_index = index;
768   
746769   // a hardcoded table is supported if the output pla is unknown
747   m_o = (c_output_pla == NULL) ? m_opla->read(data) : c_output_pla[data];
770   m_o = (c_output_pla == NULL) ? m_opla->read(index) : c_output_pla[index];
748771   m_write_o(0, m_o & m_o_mask, 0xffff);
749772}
750773
751void tms0970_cpu_device::write_o_output(UINT8 data)
774void tms0970_cpu_device::write_o_output(UINT8 index)
752775{
753   m_o = m_spla->read(data);
776   m_o_index = index;
777
778   m_o = m_spla->read(index);
754779   m_write_o(0, m_o & m_o_mask, 0xffff);
755780}
756781
r242375r242376
10031028   else
10041029      m_o_latch = m_o_latch_low | (m_a << 4 & 0x30);
10051030   
1006   // handled further in dynamic_output
1031   // write to output is done in dynamic_output
10071032}
10081033
1034void tmc0270_cpu_device::op_setr()
1035{
1036   // same as default, but handle write to output in dynamic_output
1037   m_r = m_r | (1 << m_y);
1038}
10091039
1040void tmc0270_cpu_device::op_rstr()
1041{
1042   // same as default, but handle write to output in dynamic_output
1043   m_r = m_r & ~(1 << m_y);
1044}
10101045
1046
1047
10111048//-------------------------------------------------
10121049//  execute_run
10131050//-------------------------------------------------
r242375r242376
10701107         }
10711108
10721109         // execute: k input valid, read ram, clear alu inputs
1110         dynamic_output();
10731111         set_cki_bus();
1074         dynamic_output();
10751112         m_ram_in = m_data->read_byte(m_ram_address) & 0xf;
10761113         m_dam_in = m_data->read_byte(m_ram_address | (0x10 << (m_x_bits-1))) & 0xf;
10771114         m_ram_out = -1;
trunk/src/emu/cpu/tms0980/tms0980.h
r242375r242376
6161   template<class _Object> static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast<tms1xxx_cpu_device &>(device).m_write_r.set_callback(object); }
6262   template<class _Object> static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast<tms1xxx_cpu_device &>(device).m_power_off.set_callback(object); }
6363   static void set_output_pla(device_t &device, const UINT16 *output_pla) { downcast<tms1xxx_cpu_device &>(device).c_output_pla = output_pla; }
64   
65   // driver debugging
66   UINT8 debug_peek_o_index() { return m_o_index; }
6467
6568protected:
6669   // device-level overrides
r242375r242376
6972
7073   // device_execute_interface overrides
7174   virtual UINT32 execute_min_cycles() const { return 1; }
72   virtual UINT32 execute_max_cycles() const { return 1; }
75   virtual UINT32 execute_max_cycles() const { return 6; }
7376   virtual UINT32 execute_input_lines() const { return 1; }
7477   virtual void execute_run();
7578
r242375r242376
8487
8588   void next_pc();
8689
87   virtual void write_o_output(UINT8 data);
90   virtual void write_o_output(UINT8 index);
8891   virtual UINT8 read_k_input();
8992   virtual void set_cki_bus();
9093   virtual void dynamic_output() { ; } // not used by default
r242375r242376
122125   UINT8   m_pa;        // 4-bit page address register
123126   UINT8   m_pb;        // 4-bit page buffer register
124127   UINT8   m_a;         // 4-bit accumulator
125   UINT8   m_a_prev;
126128   UINT8   m_x;         // 2,3,or 4-bit RAM X register
127129   UINT8   m_y;         // 4-bit RAM Y register
128130   UINT8   m_ca;        // chapter address bit
129131   UINT8   m_cb;        // chapter buffer bit
130132   UINT8   m_cs;        // chapter subroutine bit
131133   UINT16  m_r;
132   UINT16  m_r_prev;
133134   UINT16  m_o;
134   UINT8   m_o_latch;   // TMC0270 hold latch
135   UINT8   m_o_latch_low;
136   UINT8   m_o_latch_prev;
135   UINT8   m_o_index;
137136   UINT8   m_cki_bus;
138137   UINT8   m_c4;
139138   UINT8   m_p;         // 4-bit adder p(lus)-input
r242375r242376
252251   virtual void device_reset();
253252   virtual machine_config_constructor device_mconfig_additions() const;
254253
255   virtual void write_o_output(UINT8 data);
254   virtual void write_o_output(UINT8 index);
256255   
257256   virtual void op_setr();
258257   virtual void op_tdo();
r242375r242376
291290
292291protected:
293292   // overrides
293   virtual void device_start();
294   virtual void device_reset();
295
294296   virtual machine_config_constructor device_mconfig_additions() const;
295297
296   virtual void write_o_output(UINT8 data) { tms1xxx_cpu_device::write_o_output(data); }
298   virtual void write_o_output(UINT8 index) { tms1xxx_cpu_device::write_o_output(index); }
297299   virtual UINT8 read_k_input();
298300   virtual void dynamic_output();
299301   virtual void read_opcode();
300302   
301   virtual void op_setr() { tms1xxx_cpu_device::op_setr(); }
302   virtual void op_rstr() { tms1xxx_cpu_device::op_rstr(); }
303   virtual void op_setr();
304   virtual void op_rstr();
303305   virtual void op_tdo();
306
307private:
308   UINT8   m_a_prev;
309   UINT16  m_r_prev;
310
311   UINT8   m_o_latch_low;
312   UINT8   m_o_latch;
313   UINT8   m_o_latch_prev;
304314};
305315
306316
trunk/src/mess/drivers/mathmagi.c
r242375r242376
33/***************************************************************************
44
55  APF Mathemagician
6  * TMS1100 MP1030
6  * TMS1100 MP1030 - MCU
7  * 2 x DS8870N - Hex LED Digit Driver
8  * 2 x DS8861N - MOS-to-LED 5-Segment Driver
79 
10  This is a tabletop educational calculator. It came with plastic overlays
11  for playing different kind of games. Refer to the manual on how to use it.
12  In short, to start from scratch, press [SEL]. By default the device is in
13  calculator teaching mode. If [SEL] is followed with 1-6 and then [NXT],
14  one of the games is started.
15 
16  1) Number Machine
17  2) Countin' On
18  3) Walk The Plank
19  4) Gooey Gumdrop
20  5) Football
21  6) Lunar Lander
22
23
24  TODO:
25  - some of the led symbols are probably wrong, output pla is unknown
26 
827***************************************************************************/
928
1029#include "emu.h"
r242375r242376
2645      m_button_matrix(*this, "IN")
2746   { }
2847
29   required_device<cpu_device> m_maincpu;
30   optional_ioport_array<11> m_button_matrix;
48   required_device<tms1xxx_cpu_device> m_maincpu;
49   required_ioport_array<6> m_button_matrix;
3150
3251   UINT16 m_o;
3352   UINT16 m_r;
r242375r242376
4867
4968READ8_MEMBER(mathmagi_state::read_k)
5069{
51   printf("r");
52   
5370   UINT8 k = 0;
5471
5572   // read selected button rows
56   for (int i = 0; i < 11; i++)
57      if (m_r >> i & 1)
73   for (int i = 0; i < 6; i++)
74   {
75      const int ki[6] = { 3, 5, 6, 7, 9, 10 };
76      if (m_r >> ki[i] & 1)
5877         k |= m_button_matrix[i]->read();
78   }
5979
6080   return k;
6181}
6282
6383WRITE16_MEMBER(mathmagi_state::write_o)
6484{
85   // O1-O7: led segments A-G
6586   m_o = data;
66   
67   printf("\n%02X ",m_o);
68   for (int i=0;i<11;i++) printf("%d",m_r>>(10-i)&1);
6987}
7088
7189WRITE16_MEMBER(mathmagi_state::write_r)
7290{
91   // R3,R5-R7,R9,R10: input mux
92   // and outputs:
93   for (int i = 0; i < 11; i++)
94   {
95      if (data >> i & 1)
96      {
97         // R8: custom math symbols digit
98         // R9: custom equals digit
99         // R10: lamps
100         if (i >= 8)
101            for (int j = 0; j < 8; j++)
102               output_set_lamp_value(i*10 + j, m_o >> j & 1);
103         
104         // R0-R7: 7seg leds
105         else
106            output_set_digit_value(i, m_o >> 1 & 0x7f);
107      }
108   }
109
73110   m_r = data;
74
75   printf("\n%02X ",m_o);
76   for (int i=0;i<11;i++) printf("%d",m_r>>(10-i)&1);
77111}
78112
79113
r242375r242376
94128*/
95129
96130static INPUT_PORTS_START( mathmagi )
97   PORT_START("IN.0") // R0
98   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)
99   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)
100   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)
101   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)
131   PORT_START("IN.0") // R3
132   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1")
133   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2")
134   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3")
135   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-")
102136
103   PORT_START("IN.1") // R1
104   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)
105   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)
106   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)
107   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)
137   PORT_START("IN.1") // R5
138   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0")
139   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("_") // blank
140   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("r")
141   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+")
108142
109   PORT_START("IN.2") // R2
110   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)
111   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)
112   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)
113   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)
143   PORT_START("IN.2") // R6
144   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4")
145   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5")
146   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6")
147   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY)
114148
115   PORT_START("IN.3") // R3
116   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)
117   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)
118   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)
119   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)
149   PORT_START("IN.3") // R7
150   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("SEL")
151   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("NXT")
152   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("?") // check
153   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=")
120154
121   PORT_START("IN.4") // R4
122   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)
123   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)
124   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)
125   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)
155   PORT_START("IN.4") // R9
156   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7")
157   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8")
158   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9")
159   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE)
126160
127   PORT_START("IN.5") // R5
128   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)
129   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)
130   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)
131   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)
132
133   PORT_START("IN.6") // R6
134   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)
135   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)
136   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)
137   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)
138
139   PORT_START("IN.7") // R7
140   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)
141   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)
142   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)
143   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)
144
145   PORT_START("IN.8") // R8
146   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)
147   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)
148   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)
149   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)
150
151   PORT_START("IN.9") // R9
152   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD)
153   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD)
154   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD)
155   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD)
156
157   PORT_START("IN.10") // R10
158   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) // 1P/2P switch?
159   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD)
160   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD)
161   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD)
161   PORT_START("IN.5") // R10
162   PORT_CONFNAME( 0x01, 0x00, "Players")
163   PORT_CONFSETTING(    0x00, "1" )
164   PORT_CONFSETTING(    0x01, "2" )
165   PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
162166INPUT_PORTS_END
163167
164168
r242375r242376
178182   save_item(NAME(m_r));
179183}
180184
185// LED segments A-G
186enum
187{
188   lA = 0x02,
189   lB = 0x04,
190   lC = 0x08,
191   lD = 0x10,
192   lE = 0x20,
193   lF = 0x40,
194   lG = 0x80
195};
181196
182197static const UINT16 mathmagi_output_pla[0x20] =
183198{
184199   /* O output PLA configuration currently unknown */
185   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
186   0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
187   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
188   0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
200   lA+lB+lC+lD+lE+lF,      // 0
201   lB+lC,                  // 1
202   lA+lB+lG+lE+lD,         // 2
203   lA+lB+lG+lC+lD,         // 3
204   lF+lB+lG+lC,            // 4
205   lA+lF+lG+lC+lD,         // 5
206   lA+lF+lG+lC+lD+lE,      // 6
207   lA+lB+lC,               // 7
208   lA+lB+lC+lD+lE+lF+lG,   // 8
209   lA+lB+lG+lF+lC+lD,      // 9
210   lA+lB+lG+lE,            // question mark
211   lE+lG,                  // r
212   lD,                     // underscore?
213   lA+lF+lG+lE+lD,         // E
214   lG,                     // -
215   0,                      // empty
216   0,                      // empty
217   lG,                     // lamp 4 or MATH -
218   lD,                     // lamp 3
219   lF+lE+lD+lC+lG,         // b
220   lB,                     // lamp 2
221   lB+lG,                  // MATH +
222   lB+lC,                  // MATH mul
223   lF+lG+lB+lC+lD,         // y
224   lA,                     // lamp 1
225   lA+lG,                  // MATH div
226   lA+lD,                  // EQUALS
227   0,                      // ?
228   0,                      // ?
229   lE+lD+lC+lG,            // o
230   0,                      // ?
231   lA+lF+lE+lD+lC          // G
189232};
190233
191234
192235static MACHINE_CONFIG_START( mathmagi, mathmagi_state )
193236
194237   /* basic machine hardware */
195//   MCFG_CPU_ADD("maincpu", TMS1100, MASTER_CLOCK)
196   MCFG_CPU_ADD("maincpu", TMS1100, 10000) // temp
238   MCFG_CPU_ADD("maincpu", TMS1100, MASTER_CLOCK)
197239   MCFG_TMS1XXX_OUTPUT_PLA(mathmagi_output_pla)
198240   MCFG_TMS1XXX_READ_K_CB(READ8(mathmagi_state, read_k))
199241   MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mathmagi_state, write_o))
r242375r242376
225267ROM_END
226268
227269
228COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW | GAME_NOT_WORKING )
270COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW )
trunk/src/mess/layout/mathmagi.lay
r242375r242376
3131<!-- build screen -->
3232
3333   <view name="Internal Layout">
34      <bounds left="0" right="100" top="0" bottom="15" />
34      <bounds left="0" right="100" top="0" bottom="25" />
3535
3636      <bezel name="digit0" element="digit">
37         <bounds x="0" y="0" width="10" height="15" />
37         <bounds x="0" y="10" width="10" height="15" />
3838      </bezel>
3939      <bezel name="digit1" element="digit">
40         <bounds x="10" y="0" width="10" height="15" />
40         <bounds x="10" y="10" width="10" height="15" />
4141      </bezel>
4242
4343      <bezel name="digit2" element="digit">
44         <bounds x="30" y="0" width="10" height="15" />
44         <bounds x="30" y="10" width="10" height="15" />
4545      </bezel>
4646      <bezel name="digit3" element="digit">
47         <bounds x="40" y="0" width="10" height="15" />
47         <bounds x="40" y="10" width="10" height="15" />
4848      </bezel>
4949
5050      <bezel name="digit4" element="digit">
51         <bounds x="60" y="0" width="10" height="15" />
51         <bounds x="60" y="10" width="10" height="15" />
5252      </bezel>
5353      <bezel name="digit5" element="digit">
54         <bounds x="70" y="0" width="10" height="15" />
54         <bounds x="70" y="10" width="10" height="15" />
5555      </bezel>
5656      <bezel name="digit6" element="digit">
57         <bounds x="80" y="0" width="10" height="15" />
57         <bounds x="80" y="10" width="10" height="15" />
5858      </bezel>
5959      <bezel name="digit7" element="digit">
60         <bounds x="90" y="0" width="10" height="15" />
60         <bounds x="90" y="10" width="10" height="15" />
6161      </bezel>
6262
63<!-- math symbols custom digit -->
63   <!-- math symbols custom digit -->
6464
65      <bezel name="lamp65" element="lamp_dash"><bounds x="21.5" y="7.25" width="7" height="0.5" /></bezel>
65      <bezel name="lamp87" element="lamp_dash"><bounds x="21.5" y="17.25" width="7" height="0.5" /></bezel>
6666
67      <bezel name="lamp61" element="lamp_slash"><bounds x="24" y="-0.5" width="5" height="7.5" /></bezel>
68      <bezel name="lamp64" element="lamp_slash"><bounds x="21" y="7" width="5" height="7.5" /></bezel>
67      <bezel name="lamp82" element="lamp_slash"><bounds x="24" y="9.5" width="5" height="7.5" /></bezel>
68      <bezel name="lamp82" element="lamp_slash"><bounds x="21" y="17" width="5" height="7.5" /></bezel>
6969
70      <bezel name="lamp66" element="lamp_backslash"><bounds x="21" y="-0.5" width="5" height="7.5" /></bezel>
71      <bezel name="lamp62" element="lamp_backslash"><bounds x="24" y="7" width="5" height="7.5" /></bezel>
70      <bezel name="lamp83" element="lamp_backslash"><bounds x="21" y="9.5" width="5" height="7.5" /></bezel>
71      <bezel name="lamp83" element="lamp_backslash"><bounds x="24" y="17" width="5" height="7.5" /></bezel>
7272
73      <bezel name="lamp60" element="lamp_dot"><bounds x="24.25" y="2.25" width="1.5" height="1.5" /></bezel>
74      <bezel name="lamp63" element="lamp_dot"><bounds x="24.25" y="11.75" width="1.5" height="1.5" /></bezel>
73      <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="12.25" width="1.5" height="1.5" /></bezel>
74      <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="21.75" width="1.5" height="1.5" /></bezel>
7575
76<!-- equals sign custom digit -->
76   <!-- equals sign custom digit -->
7777
78      <bezel name="lamp91" element="lamp_dash"><bounds x="51.5" y="14.5" width="7" height="0.5" /></bezel>
79      <bezel name="lamp94" element="lamp_dash"><bounds x="51.5" y="20.0" width="7" height="0.5" /></bezel>
7880
81   <!-- other lamps -->
82
83      <bezel name="lamp101" element="lamp_dot"><bounds x="1" y="1" width="4" height="4" /></bezel>
84      <bezel name="lamp102" element="lamp_dot"><bounds x="26" y="1" width="4" height="4" /></bezel>
85      <bezel name="lamp104" element="lamp_dot"><bounds x="51" y="1" width="4" height="4" /></bezel>
86      <bezel name="lamp107" element="lamp_dot"><bounds x="76" y="1" width="4" height="4" /></bezel>
87
88
7989   </view>
8090</mamelayout>


Previous 199869 Revisions Next


© 1997-2024 The MAME Team