Previous 15994 Revisions Next

r15463 Thursday 14th June, 2012 at 16:06:27 UTC by Michael Zapf
ti99/tm990189: TM990/189 now using the new TMS9980A implementation; small mods in TI-99 systems. [Michael Zapf]
[src/emu/cpu]cpu.mak
[src/mess/drivers]geneve.c ti99_4p.c ti99_4x.c ti99_8.c tm990189.c
[src/mess/machine]tms9901.c

src/emu/cpu/cpu.mak
r15462r15463
16081608OBJDIRS += $(CPUOBJ)/tms9900
16091609CPUOBJS += $(CPUOBJ)/tms9900/tms9900.o
16101610CPUOBJS += $(CPUOBJ)/tms9900/tms9900l.o
1611CPUOBJS += $(CPUOBJ)/tms9900/tms9980a.o
16111612CPUOBJS += $(CPUOBJ)/tms9900/tms9980al.o
16121613CPUOBJS += $(CPUOBJ)/tms9900/tms9995.o
16131614CPUOBJS += $(CPUOBJ)/tms9900/tms9995l.o
r15462r15463
16231624                        $(CPUSRC)/tms9900/99xxcore.h \
16241625                        $(CPUSRC)/tms9900/99xxstat.h
16251626
1627$(CPUOBJ)/tms9900/tms9980a.o:   $(CPUSRC)/tms9900/tms9980a.c \
1628                        $(CPUSRC)/tms9900/tms9980a.h \
1629                        $(CPUSRC)/tms9900/tms9900.c \
1630                        $(CPUSRC)/tms9900/tms9900.h
1631
16261632$(CPUOBJ)/tms9900/tms9980al.o:   $(CPUSRC)/tms9900/tms9980al.c \
16271633                        $(CPUSRC)/tms9900/tms9900l.h \
16281634                        $(CPUSRC)/tms9900/99xxcore.h \
16291635                        $(CPUSRC)/tms9900/99xxstat.h
16301636
16311637$(CPUOBJ)/tms9900/tms9995.o:   $(CPUSRC)/tms9900/tms9995.c \
1632                        $(CPUSRC)/tms9900/tms9900.h
1638                        $(CPUSRC)/tms9900/tms9995.h
16331639
16341640$(CPUOBJ)/tms9900/tms9995l.o:   $(CPUSRC)/tms9900/tms9995l.c \
16351641                        $(CPUSRC)/tms9900/tms9900l.h \
src/mess/machine/tms9901.c
r15462r15463
126126         if (VERBOSE>8) LOG("tms9901: timer fires\n");
127127         current_ints |= TMS9901_INT3;
128128      }
129      else
129      else
130130      {
131131         if (VERBOSE>8) LOG("tms9901: timer clear\n");
132132         current_ints &= ~TMS9901_INT3;
src/mess/drivers/ti99_8.c
r15462r15463
924924   else
925925      driver->m_mecmouse = NULL;
926926
927   driver->m_cpu->set_hold(CLEAR_LINE);
928
927929   // Pulling down the line on RESET configures the CPU to insert one wait
928930   // state on external memory accesses
929931
src/mess/drivers/tm990189.c
r15462r15463
5858******************************************************************************************/
5959
6060#include "emu.h"
61#include "cpu/tms9900/tms9900l.h"
61#include "cpu/tms9900/tms9980a.h"
6262#include "machine/tms9901.h"
6363#include "machine/tms9902.h"
6464#include "video/tms9928a.h"
r15462r15463
7474public:
7575   tm990189_state(const machine_config &mconfig, device_type type, const char *tag)
7676      : driver_device(mconfig, type, tag),
77   m_maincpu(*this, "maincpu"),
77   m_tms9980a(*this, "maincpu"),
7878   m_speaker(*this, SPEAKER_TAG),
7979   m_cass(*this, CASSETTE_TAG),
8080   m_tms9918(*this, "tms9918" )
8181   { }
8282
83   required_device<cpu_device> m_maincpu;
83   required_device<tms9980a_device> m_tms9980a;
8484   required_device<device_t> m_speaker;
8585   required_device<cassette_image_device> m_cass;
8686   optional_device<tms9918_device> m_tms9918;
87   DECLARE_WRITE8_MEMBER(ext_instr_decode);
87
88   READ8_MEMBER( interrupt_level );
89
8890   DECLARE_READ8_MEMBER(video_vdp_r);
8991   DECLARE_WRITE8_MEMBER(video_vdp_w);
9092   DECLARE_READ8_MEMBER(video_joy_r);
r15462r15463
106108   emu_timer *m_rs232_input_timer;
107109   UINT8 m_bogus_read_save;
108110
111   DECLARE_WRITE8_MEMBER( external_operation );
112
109113   DECLARE_WRITE_LINE_MEMBER(usr9901_led0_w);
110114   DECLARE_WRITE_LINE_MEMBER(usr9901_led1_w);
111115   DECLARE_WRITE_LINE_MEMBER(usr9901_led2_w);
r15462r15463
152156
153157static MACHINE_RESET( tm990_189 )
154158{
159   tm990189_state *state = machine.driver_data<tm990189_state>();
160   state->m_tms9980a->set_ready(ASSERT_LINE);
161   state->m_tms9980a->set_hold(CLEAR_LINE);
155162   hold_load(machine);
156163}
157164
r15462r15463
182189
183190static MACHINE_RESET( tm990_189_v )
184191{
192   tm990189_state *state = machine.driver_data<tm990189_state>();
193   state->m_tms9980a->set_ready(ASSERT_LINE);
194   state->m_tms9980a->set_hold(CLEAR_LINE);
185195   hold_load(machine);
186196}
187197
188
189198/*
190    Interrupt handlers
199    Will be called back from the CPU when triggering an interrupt.
191200*/
192
193static void field_interrupts(running_machine &machine)
201READ8_MEMBER( tm990189_state::interrupt_level )
194202{
195   tm990189_state *state = machine.driver_data<tm990189_state>();
196   if (state->m_load_state)
197      cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, 2);
198   else
199      cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, state->m_ic_state);
203   return m_ic_state;
200204}
201205
202206/*
r15462r15463
207211{
208212   tm990189_state *state = machine.driver_data<tm990189_state>();
209213   state->m_load_state = FALSE;
210   field_interrupts(machine);
214   state->m_tms9980a->set_input_line(0, CLEAR_LINE);
211215}
212216
213217static void hold_load(running_machine &machine)
214218{
215219   tm990189_state *state = machine.driver_data<tm990189_state>();
216220   state->m_load_state = TRUE;
217   field_interrupts(machine);
221   state->m_ic_state = 2;      // LOAD interrupt
222   state->m_tms9980a->set_input_line(0, ASSERT_LINE);
218223   machine.scheduler().timer_set(attotime::from_msec(100), FUNC(clear_load));
219224}
220225
r15462r15463
237242   tm990189_state *state = timer.machine().driver_data<tm990189_state>();
238243   UINT8 i;
239244   char ledname[8];
240   field_interrupts(timer.machine());
241
242245    // since the segment data is cleared after being used, the old_segment is there
243246    // in case the segment data hasn't been refreshed yet.
244247   for (i = 0; i < 10; i++)
r15462r15463
263266
264267WRITE8_MEMBER( tm990189_state::usr9901_interrupt_callback )
265268{
266   m_ic_state = offset & 7;  // offset = IC0..IC3 (interrupt level)
269   // Triggered by internal timer (set by ROM to 1.6 ms cycle) on level 3
270   // or by keyboard interrupt (level 6)
271   m_ic_state = offset & 7;  // offset = IC0..IC2 (interrupt level)
267272   if (!m_load_state)
268      field_interrupts(machine());
273   {
274      m_tms9980a->set_input_line(0, ASSERT_LINE);
275   }
269276}
270277
271278void tm990189_state::led_set(int offset, bool state)
r15462r15463
518525/*
519526    External instruction decoding
520527*/
521WRITE8_MEMBER( tm990189_state::ext_instr_decode )
528WRITE8_MEMBER( tm990189_state::external_operation )
522529{
523   int ext_op_ID;
524
525   ext_op_ID = ((offset+0x800) >> 11) & 0x3;
526   if (data)
527      ext_op_ID |= 4;
528   switch (ext_op_ID)
530   switch (offset)
529531   {
530   case 2: /* IDLE: handle elsewhere */
532   case 2: // IDLE
533      if (data)
534         m_LED_state |= 0x40;
535      else
536         m_LED_state &= ~0x40;
531537      break;
532
533   case 3: /* RSET: not used in default board */
538   case 3:   // RSET
539      // Not used on the default board
534540      break;
535
536   case 5: /* CKON: set DECKCONTROL */
541   case 5: // CKON: set DECKCONTROL
537542      m_LED_state |= 0x20;
538543      m_cass->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
539544      break;
540
541   case 6: /* CKOF: clear DECKCONTROL */
545   case 6: // CKOF: clear DECKCONTROL
542546      m_LED_state &= ~0x20;
543547      m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
544548      break;
545
546   case 7: /* LREX: trigger LOAD */
549   case 7: // LREX: trigger LOAD
547550      hold_load(machine());
548551      break;
552   default: // undefined
553      break;
549554   }
550555}
551556
552static void idle_callback(device_t *device, int state)
553{
554   tm990189_state *drvstate = device->machine().driver_data<tm990189_state>();
555   if (state)
556      drvstate->m_LED_state |= 0x40;
557   else
558      drvstate->m_LED_state &= ~0x40;
559}
560
561557/*
562558    Video Board handling
563559*/
r15462r15463
774770            keyboard row)
775771        - CRU bits 20-27: SEGMENTA*-SEGMENTG* and SEGMENTP* (drives digit
776772            segments)
777        - CRU bit 28: DSPLYTRGR* (will generate a pulse to drive the digit
778            segments)
773        - CRU bit 28: DSPLYTRGR*: used as an alive signal for a watchdog circuit
774                      which turns off the display when the program hangs and
775                      LED segments would continuously emit light
776
779777        - bit 29: SHIFTLIGHT (controls shift light)
780778        - bit 30: SPKRDRIVE (controls buzzer)
781779        - bit 31: WDATA (tape out)
r15462r15463
812810   AM_RANGE(0x0000, 0x01ff) AM_DEVWRITE("tms9901_0", tms9901_device, write)   /* user I/O tms9901 */
813811   AM_RANGE(0x0200, 0x03ff) AM_DEVWRITE("tms9901_1", tms9901_device, write)   /* system I/O tms9901 */
814812   AM_RANGE(0x0400, 0x05ff) AM_DEVWRITE("tms9902", tms9902_device, cruwrite)   /* optional tms9902 */
815
816   AM_RANGE(0x0800, 0x1fff) AM_WRITE(ext_instr_decode)   /* external instruction decoding (IDLE, RSET, CKON, CKOF, LREX) */
817813ADDRESS_MAP_END
818814
819
820static const tms9980areset_param reset_params =
815static TMS99xx_CONFIG( cpuconf )
821816{
822   idle_callback
817   DEVCB_DRIVER_MEMBER(tm990189_state, external_operation),
818   DEVCB_DRIVER_MEMBER(tm990189_state, interrupt_level),
819   DEVCB_NULL,      // Instruction acquisition
820   DEVCB_NULL,      // Clock out
821   DEVCB_NULL,      // wait
822   DEVCB_NULL      // Hold acknowledge
823823};
824824
825825static MACHINE_CONFIG_START( tm990_189, tm990189_state )
826826   /* basic machine hardware */
827   MCFG_CPU_ADD("maincpu", TMS9980L, 2000000)   /* TMS9980 CPU @ 2.0 MHz */
828   MCFG_CPU_CONFIG(reset_params)
829   MCFG_CPU_PROGRAM_MAP(tm990_189_memmap)
830   MCFG_CPU_IO_MAP(tm990_189_cru_map)
827   MCFG_TMS99xx_ADD("maincpu", TMS9980A, 2000000, tm990_189_memmap, tm990_189_cru_map, cpuconf)
831828
832829   MCFG_MACHINE_START( tm990_189 )
833830   MCFG_MACHINE_RESET( tm990_189 )
r15462r15463
849846   MCFG_TMS9902_ADD("tms9902", tms9902_params, 2000000)
850847   MCFG_TM990_189_RS232_ADD("rs232")
851848   MCFG_TIMER_ADD_PERIODIC("display_timer", display_callback, attotime::from_hz(30))
849   // Need to delay the timer, or it will spoil the initial LOAD
850   // TODO: Fix this, probably inside CPU
851   MCFG_TIMER_START_DELAY(attotime::from_msec(150))
852852MACHINE_CONFIG_END
853853
854854static MACHINE_CONFIG_START( tm990_189_v, tm990189_state )
855855   /* basic machine hardware */
856   MCFG_CPU_ADD("maincpu", TMS9980L, 2000000)   /* TMS9980 CPU @ 2.0 MHz */
857   MCFG_CPU_CONFIG(reset_params)
858   MCFG_CPU_PROGRAM_MAP(tm990_189_v_memmap)
859   MCFG_CPU_IO_MAP(tm990_189_cru_map)
856   MCFG_TMS99xx_ADD("maincpu", TMS9980A, 2000000, tm990_189_v_memmap, tm990_189_cru_map, cpuconf)
860857
861858   MCFG_MACHINE_START( tm990_189_v )
862859   MCFG_MACHINE_RESET( tm990_189_v )
r15462r15463
881878   MCFG_TMS9902_ADD("tms9902", tms9902_params,   2000000)
882879   MCFG_TM990_189_RS232_ADD("rs232")
883880   MCFG_TIMER_ADD_PERIODIC("display_timer", display_callback, attotime::from_hz(30))
881   MCFG_TIMER_START_DELAY(attotime::from_msec(150))
884882MACHINE_CONFIG_END
885883
886884
src/mess/drivers/geneve.c
r15462r15463
745745
746746   // No automatic wait state (auto wait state is enabled with READY=CLEAR at RESET)
747747   driver->m_cpu->set_ready(ASSERT_LINE);
748   driver->m_cpu->set_hold(CLEAR_LINE);
748749
749750   driver->m_ready_line = driver->m_ready_line1 = ASSERT_LINE;
750751
src/mess/drivers/ti99_4p.c
r15462r15463
3535
3636*****************************************************************************/
3737
38
3938#include "emu.h"
4039#include "cpu/tms9900/tms9900.h"
4140#include "sound/wave.h"
r15462r15463
778777   0x70000                                    // Address bus prefix (AMA/AMB/AMC)
779778};
780779
781static TMS9900_CONFIG( sgcpu_cpuconf )
780static TMS99xx_CONFIG( sgcpu_cpuconf )
782781{
783782   DEVCB_DRIVER_MEMBER(ti99_4p, external_operation),
784783   DEVCB_DRIVER_MEMBER(ti99_4p, interrupt_level),
r15462r15463
829828{
830829   ti99_4p *driver = machine.driver_data<ti99_4p>();
831830   driver->m_tms9901->set_single_int(12, 0);
831
832   driver->m_cpu->set_ready(ASSERT_LINE);
833   driver->m_cpu->set_hold(CLEAR_LINE);
832834}
833835
834836TIMER_DEVICE_CALLBACK( sgcpu_hblank_interrupt )
r15462r15463
842844static MACHINE_CONFIG_START( ti99_4p_60hz, ti99_4p )
843845   /* basic machine hardware */
844846   /* TMS9900 CPU @ 3.0 MHz */
845   MCFG_TMS9900_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, sgcpu_cpuconf)
847   MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, sgcpu_cpuconf)
846848   MCFG_MACHINE_START( ti99_4p )
847849
848850   /* video hardware */
src/mess/drivers/ti99_4x.c
r15462r15463
807807   dmux_devices_ev
808808};
809809
810static TMS9900_CONFIG( ti99_cpuconf )
810static TMS99xx_CONFIG( ti99_cpuconf )
811811{
812812   DEVCB_DRIVER_MEMBER(ti99_4x, external_operation),
813813   DEVCB_DRIVER_MEMBER(ti99_4x, interrupt_level),
r15462r15463
852852      driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG));
853853   else
854854      driver->m_mecmouse = NULL;
855
856   driver->m_cpu->set_ready(ASSERT_LINE);
857   driver->m_cpu->set_hold(CLEAR_LINE);
855858}
856859
857860/*
r15462r15463
859862*/
860863static MACHINE_CONFIG_START( ti99_4_60hz, ti99_4x )
861864   /* CPU */
862   MCFG_TMS9900_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
865   MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
863866
864867   MCFG_MACHINE_START( ti99_4 )
865868   MCFG_MACHINE_RESET( ti99_4 )
r15462r15463
904907
905908static MACHINE_CONFIG_START( ti99_4_50hz, ti99_4x )
906909   /* CPU */
907   MCFG_TMS9900_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
910   MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
908911
909912   MCFG_MACHINE_START( ti99_4 )
910913   MCFG_MACHINE_RESET( ti99_4 )
r15462r15463
976979      driver->m_mecmouse = static_cast<mecmouse_device*>(machine.device(MECMOUSE_TAG));
977980   else
978981      driver->m_mecmouse = NULL;
982
983   driver->m_cpu->set_ready(ASSERT_LINE);
984   driver->m_cpu->set_hold(CLEAR_LINE);
979985}
980986
981987static MACHINE_CONFIG_START( ti99_4a_60hz, ti99_4x )
982988   /* CPU */
983   MCFG_TMS9900_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
989   MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
984990
985991   MCFG_MACHINE_START( ti99_4a )
986992   MCFG_MACHINE_RESET( ti99_4a )
r15462r15463
10231029
10241030static MACHINE_CONFIG_START( ti99_4a_50hz, ti99_4x )
10251031   /* CPU */
1026   MCFG_TMS9900_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
1032   MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
10271033
10281034   MCFG_MACHINE_START( ti99_4a )
10291035   MCFG_MACHINE_RESET( ti99_4a )
r15462r15463
10761082*/
10771083static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x )
10781084   /* CPU */
1079   MCFG_TMS9900_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
1085   MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map, ti99_cpuconf)
10801086
10811087   MCFG_MACHINE_START( ti99_4a )
10821088

Previous 15994 Revisions Next


© 1998-2018 The MESS Team