Previous 15994 Revisions Next

r9486 Sunday 31st October, 2010 at 16:30:11 UTC by Michael Zapf
TI-99 family architecture refactoring. All components are rewritten as
devices.
[src/mess]mess.mak messcore.mak
[src/mess/drivers]geneve.c ti99_4p.c ti99_4x.c ti99_8.c
[src/mess/machine]at29040a.c* at29040a.h* smc92x4.c smc92x4.h

src/mess/messcore.mak
r9485r9486
4646MESS_MACHINE = $(MESSOBJ)/machine
4747MESS_VIDEO = $(MESSOBJ)/video
4848
49
5049OBJDIRS += \
5150   $(EMU_AUDIO) \
5251   $(EMU_MACHINE) \
r9485r9486
6463   $(MESS_MACHINE) \
6564   $(MESS_VIDEO) \
6665
66# System-specific directories
6767
68OBJDIRS += $(MESS_MACHINE)/ti99 \
69
6870#-------------------------------------------------
6971# MESS core objects
7072#-------------------------------------------------
src/mess/machine/at29040a.c
r0r9486
1/*
2    Atmel at29c040a flash EEPROM
3
4    512k*8 FEEPROM, organized in pages of 256 bytes.
5
6    References:
7    Datasheets were found on Atmel's site (www.atmel.com)
8
9    Raphael Nabet 2003
10   
11    Rewritten as device
12    Michael Zapf, September 2010
13*/
14
15#include "emu.h"
16#include "at29040a.h"
17
18#define FEEPROM_SIZE        0x80000
19#define SECTOR_SIZE         0x00100
20#define BOOT_BLOCK_SIZE     0x04000
21
22#define ADDRESS_MASK        0x7ffff
23#define SECTOR_ADDRESS_MASK 0x7ff00
24#define BYTE_ADDRESS_MASK   0x000ff
25
26/*
27    at29c40a state
28
29    Command states (s_cmd_0 is the initial state):
30    s_cmd_0: default state
31    s_cmd_1: state after writing aa to 5555
32    s_cmd_2: state after writing 55 to 2aaa
33
34    Programming states (s_programming_0 is the initial state):
35    s_programming_0: default state
36    s_programming_1: a program and enable/disable lock command  has been
37        executed, but programming has not actually started.
38    s_programming_2: the programming buffer is being written to
39    s_programming_3: the programming buffer is being burnt to flash ROM
40*/
41enum  s_cmd_t
42{
43   s_cmd_0 = 0x0,
44   s_cmd_1 = 0x1,
45   s_cmd_2 = 0x2
46};
47
48enum  s_pgm_t
49{
50   s_pgm_0 = 0x0,
51   s_pgm_1 = 0x1,
52   s_pgm_2 = 0x2,
53   s_pgm_3 = 0x3
54};
55
56
57typedef struct _at29c040a_state
58{
59   UINT8       *memptr;
60   
61   int       s_lower_bbl;      /* set when lower boot block lockout is enabled */
62   int       s_higher_bbl;      /* set when upper boot block lockout is enabled */
63   int       s_sdp;            /* set when in software data protect mode */
64   
65   int       s_id_mode;         /* set when in chip id mode */
66   s_cmd_t      s_cmd;            /* command state */
67   int       s_enabling_bbl;      /* set when a boot block lockout command is expecting its parameter */
68   int       s_cmd_0x80_flag;   /* set if 0x80 command has just been executed (some command require this prefix) */
69   s_pgm_t    s_pgm;            /* programming state */
70   int       s_enabling_sdb;      /* set when a sdp enable command is in progress */
71   int       s_disabling_sdb;   /* set when a sdp disable command is in progress */
72   int       s_dirty;         /* set when the memory contents should be set */
73   UINT8       toggle_bit;
74   UINT8       programming_buffer[SECTOR_SIZE];
75   int       programming_last_offset;
76   emu_timer    *programming_timer;
77} at29c040a_state;
78
79INLINE at29c040a_state *get_safe_token(running_device *device)
80{
81   assert(device != NULL);
82   return (at29c040a_state *)downcast<legacy_device_base *>(device)->token();
83}
84
85INLINE const at29c040a_config *get_config(running_device *device)
86{
87   assert(device != NULL);
88   assert(device->type() == AT29C040A);
89   return (const at29c040a_config *) downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
90}
91
92/*
93    programming timer callback
94*/
95static TIMER_CALLBACK(at29c040a_programming_timer_callback)
96{
97   running_device *device = (running_device *)ptr;
98   at29c040a_state *feeprom = get_safe_token(device);
99   
100   switch (feeprom->s_pgm)
101   {
102   case s_pgm_1:
103      /* programming cycle timeout */
104      feeprom->s_pgm = s_pgm_0;
105      break;
106
107   case s_pgm_2:
108      /* programming cycle start */
109      feeprom->s_pgm = s_pgm_3;
110      /* max delay 10ms, typical delay 5 to 7 ms */
111      timer_adjust_oneshot(feeprom->programming_timer, ATTOTIME_IN_MSEC(5), 0);
112      break;
113
114   case s_pgm_3:
115      /* programming cycle end */
116      memcpy(feeprom->memptr + (feeprom->programming_last_offset & ~0xff), feeprom->programming_buffer, SECTOR_SIZE);
117
118      if (feeprom->s_enabling_sdb)
119         feeprom->s_sdp = TRUE;
120
121      if (feeprom->s_disabling_sdb)
122         feeprom->s_sdp = FALSE;
123
124      feeprom->s_pgm = s_pgm_0;
125      feeprom->s_enabling_sdb = FALSE;
126      feeprom->s_disabling_sdb = FALSE;
127
128      feeprom->s_dirty = TRUE;
129      break;
130
131   default:
132      logerror("internal error in %s %d\n", __FILE__, __LINE__);
133      break;
134   }
135}
136
137int at29c040a_is_dirty(running_device *device)
138{
139   at29c040a_state *feeprom = get_safe_token(device);
140   return feeprom->s_dirty;
141}
142
143static void sync_flags(running_device *device)
144{
145   at29c040a_state *feeprom = get_safe_token(device);
146   if (feeprom->s_lower_bbl) feeprom->memptr[1] |= 0x04;
147   else feeprom->memptr[1] &= ~0x04;
148     
149   if (feeprom->s_higher_bbl) feeprom->memptr[1] |= 0x02;
150   else feeprom->memptr[1] &= ~0x02;
151
152   if (feeprom->s_sdp) feeprom->memptr[1] |= 0x01;
153   else feeprom->memptr[1] &= ~0x01;
154}
155
156/*
157    read a byte from FEEPROM
158*/
159READ8_DEVICE_HANDLER( at29c040a_r )
160{
161   at29c040a_state *feeprom = get_safe_token(device);
162   int reply;
163
164   offset &= ADDRESS_MASK;
165
166   /* reading in the midst of any command sequence cancels it (right???) */
167   feeprom->s_cmd = s_cmd_0;
168   feeprom->s_cmd_0x80_flag = FALSE;
169   feeprom->s_higher_bbl = TRUE;
170   sync_flags(device);
171
172   /* reading before the start of a programming cycle cancels it (right???) */
173   if (feeprom->s_pgm == s_pgm_1)
174   {
175      // attempty to access a locked out boot block: cancel programming
176      // command if necessary
177      feeprom->s_pgm = s_pgm_0;
178      feeprom->s_enabling_sdb = FALSE;
179      feeprom->s_disabling_sdb = FALSE;
180      timer_adjust_oneshot(feeprom->programming_timer, attotime_never, 0);
181   }
182
183
184   if (feeprom->s_id_mode)
185   {
186      switch (offset)
187      {
188      case 0:
189         reply = 0x1f;
190         break;
191
192      case 1:
193         reply = 0xa4;
194         break;
195
196      case 2:
197         reply = feeprom->s_lower_bbl ? 0xff : 0xfe;
198         break;
199
200      case 0x7fff2:
201         reply = feeprom->s_higher_bbl ? 0xff : 0xfe;
202         break;
203
204      default:
205         reply = 0;
206         break;
207      }
208   }
209   else if ((feeprom->s_pgm == s_pgm_2) || (feeprom->s_pgm == s_pgm_3))
210   {
211      if (feeprom->s_pgm == s_pgm_2)
212      {   /* data polling starts the programming cycle (right???) */
213         feeprom->s_pgm = s_pgm_3;
214         /* max delay 10ms, typical delay 5 to 7 ms */
215         timer_adjust_oneshot(feeprom->programming_timer, ATTOTIME_IN_MSEC(5), 0);
216      }
217
218      reply = feeprom->toggle_bit;
219      feeprom->toggle_bit ^= 0x02;
220      if ((offset == feeprom->programming_last_offset) && (! (feeprom->programming_buffer[feeprom->programming_last_offset & 0xff] & 0x01)))
221         reply |= 0x01;
222   }
223   else
224      reply = feeprom->memptr[offset];
225
226   return reply;
227}
228
229/*
230    Write a byte to FEEPROM
231*/
232WRITE8_DEVICE_HANDLER( at29c040a_w )
233{
234   at29c040a_state *feeprom = get_safe_token(device);
235
236   offset &= ADDRESS_MASK;
237
238   /* The special CFI commands assume a smaller address space according */
239   /* to the specification ("address format A14-A0") */
240   offs_t cfi_offset = offset & 0x7fff;
241
242   if (feeprom->s_enabling_bbl)
243   {
244      feeprom->s_enabling_bbl = FALSE;
245
246      if ((offset == 0x00000) && (data == 0x00))
247      {
248         feeprom->s_lower_bbl = TRUE;
249         feeprom->s_dirty = TRUE;
250         sync_flags(device);
251         return;
252      }
253      else if ((offset == 0x7ffff) && (data == 0xff))
254      {
255         feeprom->s_higher_bbl = TRUE;
256         feeprom->s_dirty = TRUE;
257         sync_flags(device);
258         return;
259      }
260   }
261
262   switch (feeprom->s_cmd)
263   {
264   case s_cmd_0:
265      if ((cfi_offset == 0x5555) && (data == 0xaa))
266         feeprom->s_cmd = s_cmd_1;
267      else
268      {
269         feeprom->s_cmd = s_cmd_0;
270         feeprom->s_cmd_0x80_flag = FALSE;
271      }
272      break;
273
274   case s_cmd_1:
275      if ((cfi_offset == 0x2aaa) && (data == 0x55))
276         feeprom->s_cmd = s_cmd_2;
277      else
278      {
279         feeprom->s_cmd = s_cmd_0;
280         feeprom->s_cmd_0x80_flag = FALSE;
281      }
282      break;
283
284   case s_cmd_2:
285      if (cfi_offset == 0x5555)
286      {
287         /* exit programming mode */
288         feeprom->s_pgm = s_pgm_0;
289         feeprom->s_enabling_sdb = FALSE;
290         feeprom->s_disabling_sdb = FALSE;
291         timer_adjust_oneshot(feeprom->programming_timer, attotime_never, 0);
292
293         /* process command */
294         switch (data)
295         {
296         case 0x10:
297            /*  Software chip erase */
298            if (feeprom->s_cmd_0x80_flag)
299            {
300               if (feeprom->s_lower_bbl || feeprom->s_higher_bbl)
301                  logerror("If the boot block lockout feature has been enabled, the 6-byte software chip erase algorithm will not function.\n");
302               else
303               {
304                  memset(feeprom->memptr, 0xff, 524288);
305                  feeprom->s_dirty = TRUE;
306               }
307            }
308            break;
309
310         case 0x20:
311            /* Software data protection disable */
312            if (feeprom->s_cmd_0x80_flag)
313            {
314               feeprom->s_pgm = s_pgm_1;
315               feeprom->s_disabling_sdb = TRUE;
316               /* set command timeout (right???) */
317               //timer_adjust_periodic(feeprom->programming_timer, ATTOTIME_IN_USEC(150), id, 0.);
318            }
319            break;
320
321         case 0x40:
322            /* Boot block lockout enable */
323            if (feeprom->s_cmd_0x80_flag)
324               feeprom->s_enabling_bbl = TRUE;
325            break;
326
327         case 0x90:
328            /* Software product identification entry */
329            feeprom->s_id_mode = TRUE;
330            break;
331
332         case 0xa0:
333            /* Software data protection enable */
334            feeprom->s_pgm = s_pgm_1;
335            feeprom->s_enabling_sdb = TRUE;
336            /* set command timeout (right???) */
337            //timer_adjust_periodic(feeprom->programming_timer, ATTOTIME_IN_USEC(150), id, 0.);
338            break;
339
340         case 0xf0:
341            /* Software product identification exit */
342            feeprom->s_id_mode = FALSE;
343            break;
344         }
345         feeprom->s_cmd = s_cmd_0;
346         feeprom->s_cmd_0x80_flag = FALSE;
347         if (data == 0x80)
348            feeprom->s_cmd_0x80_flag = TRUE;
349
350         /* return, because we don't want to write the EEPROM with the command byte */
351         return;
352      }
353      else
354      {
355         feeprom->s_cmd = s_cmd_0;
356         feeprom->s_cmd_0x80_flag = FALSE;
357      }
358   }
359   if ((feeprom->s_pgm == s_pgm_2)
360         && ((offset & ~0xff) != (feeprom->programming_last_offset & ~0xff)))
361   {
362      /* cancel current programming cycle */
363      feeprom->s_pgm = s_pgm_0;
364      feeprom->s_enabling_sdb = FALSE;
365      feeprom->s_disabling_sdb = FALSE;
366      timer_adjust_oneshot(feeprom->programming_timer, attotime_never, 0);
367   }
368
369   if (((feeprom->s_pgm == s_pgm_0) && !feeprom->s_sdp)
370         || (feeprom->s_pgm == s_pgm_1))
371   {
372      if (((offset < BOOT_BLOCK_SIZE) && feeprom->s_lower_bbl)
373         || ((offset >= FEEPROM_SIZE-BOOT_BLOCK_SIZE) && feeprom->s_higher_bbl))
374      {
375         // attempty to access a locked out boot block: cancel programming
376         // command if necessary
377         feeprom->s_pgm = s_pgm_0;
378         feeprom->s_enabling_sdb = FALSE;
379         feeprom->s_disabling_sdb = FALSE;
380      }
381      else
382      {   /* enter programming mode */
383         memset(feeprom->programming_buffer, 0xff, SECTOR_SIZE);
384         feeprom->s_pgm = s_pgm_2;
385      }
386   }
387   if (feeprom->s_pgm == s_pgm_2)
388   {
389      /* write data to programming buffer */
390      feeprom->programming_buffer[offset & 0xff] = data;
391      feeprom->programming_last_offset = offset;
392      timer_adjust_oneshot(feeprom->programming_timer, ATTOTIME_IN_USEC(150), 0);
393   }
394}
395
396static DEVICE_START( at29c040a )
397{
398   at29c040a_state *feeprom = get_safe_token(device);
399   feeprom->programming_timer = timer_alloc(device->machine, at29c040a_programming_timer_callback, (void *)device);
400}
401
402static DEVICE_STOP( at29c040a )
403{
404
405}
406
407static DEVICE_RESET( at29c040a )
408{
409   at29c040a_state *feeprom = get_safe_token(device);
410   const at29c040a_config* atconf = (const at29c040a_config*)get_config(device);
411   feeprom->memptr = (*atconf->get_memory)(device->owner()) + atconf->offset;
412
413   if (feeprom->memptr[0] != 0)
414   {
415      logerror("AT29040A: Version mismatch; expected 0 but found %x for %s\n", feeprom->memptr[0], device->tag());
416      return;
417   }
418     
419   feeprom->s_lower_bbl = (feeprom->memptr[1] >> 2) & 1;
420   feeprom->s_higher_bbl = (feeprom->memptr[1] >> 1) & 1;
421   feeprom->s_sdp = feeprom->memptr[1] & 1;
422   feeprom->s_dirty = FALSE;
423
424   feeprom->memptr += 2;
425}
426
427static const char DEVTEMPLATE_SOURCE[] = __FILE__;
428
429#define DEVTEMPLATE_ID(p,s)             p##at29c040a##s
430#define DEVTEMPLATE_FEATURES            DT_HAS_START | DT_HAS_STOP | DT_HAS_RESET | DT_HAS_INLINE_CONFIG
431#define DEVTEMPLATE_NAME                "ATMEL 29c040a"
432#define DEVTEMPLATE_FAMILY              "Flash Memory"
433#include "devtempl.h"
434
435DEFINE_LEGACY_DEVICE( AT29C040A, at29c040a );
src/mess/machine/at29040a.h
r0r9486
1/*
2   ATMEL 29040a
3   
4   Rewritten as device
5   Michael Zapf, September 2010
6*/
7
8/* device interface */
9#ifndef __AT29040__
10#define __AT29040__
11
12typedef struct _at29c040a_config
13{
14   UINT8               *(*get_memory)(running_device *device);
15   offs_t               offset;
16
17} at29c040a_config;
18
19READ8_DEVICE_HANDLER( at29c040a_r );
20WRITE8_DEVICE_HANDLER( at29c040a_w );
21
22int at29c040a_is_dirty(running_device *device);
23
24DECLARE_LEGACY_DEVICE( AT29C040A, at29c040a );
25
26#define MDRV_AT29C040_ADD_P(_tag, _memptr, _offset)   \
27   MDRV_DEVICE_ADD(_tag, AT29C040A, 0)   \
28   MDRV_DEVICE_CONFIG_DATAPTR(at29c040a_config, get_memory, _memptr) \
29   MDRV_DEVICE_CONFIG_DATA32(at29c040a_config, offset, _offset)
30
31#endif
32
src/mess/machine/smc92x4.c
r9485r9486
319319{
320320   //assert(! (w->status & ST_DONE))
321321   smc92x4_state *w = get_safe_token(device);
322   //printf("smc92x4 command %02x done, flags=%02x\n", w->command, flags);
322   //logerror("smc92x4 command %02x done, flags=%02x\n", w->command, flags);
323323
324324   w->register_r[INT_STATUS] |= ST_DONE;
325325   w->register_r[INT_STATUS] &= ~ST_TERMCOD; /* clear the previously set flags */
r9485r9486
337337{
338338   //assert(! (w->status & ST_DONE))
339339   smc92x4_state *w = get_safe_token(device);
340   //printf("smc92x4 command %02x done\n", w->command);
340   //logerror("smc92x4 command %02x done\n", w->command);
341341
342342   w->register_r[INT_STATUS] |= ST_DONE;
343343
r9485r9486
394394
395395   prev = w->register_r[DRIVE_STATUS];
396396   w->register_r[DRIVE_STATUS] = devcb_call_read_line(&w->in_auxbus_func);
397
397   
398398   /* Raise interrupt if ready changes. TODO: Check this more closely. */
399//  printf("disk status = %02x\n", reply);
399//  logerror("disk status = %02x\n", reply);
400400   if (((w->register_r[DRIVE_STATUS] & DS_READY) != (prev & DS_READY))
401401      & (w->register_r[INT_STATUS] & ST_RDYCHNG))
402402   {
r9485r9486
590590
591591   if (w->selected_drive_type & TYPE_FLOPPY)
592592   {
593      current_floppy = (*w->intf->current_floppy)();
593      current_floppy = (*w->intf->current_floppy)(device);
594594      if (current_floppy==NULL)
595595      {
596596         logerror("smc92x4 error: seek callback: no floppy\n");
r9485r9486
598598      }
599599      else
600600      {
601         // printf("smc92x4 step %s direction %d\n", current_floppy->tag(), w->step_direction);
601         logerror("smc92x4 step %s direction %d\n", current_floppy->tag(), w->step_direction);
602602         floppy_drive_seek(current_floppy, w->step_direction);
603603      }
604604   }
605605   else
606606   {
607      // printf("smc92x4 step harddisk direction %d\n", w->step_direction);
608      (*w->intf->mfmhd_seek)(w->step_direction);
607      // logerror("smc92x4 step harddisk direction %d\n", w->step_direction);
608      (*w->intf->mfmhd_seek)(device, w->step_direction);
609609   }
610610   sync_status_in(device);
611611
r9485r9486
691691   if (w->selected_drive_type & TYPE_FLOPPY)
692692   {
693693      chrn_id idflop;
694      running_device *disk_img = (*w->intf->current_floppy)();
694      running_device *disk_img = (*w->intf->current_floppy)(device);
695695      if (flopimg_get_image(disk_img) == NULL)
696696      {
697697         logerror("smc92x4 warn: No disk in drive\n");
r9485r9486
722722   }
723723   else
724724   {
725      (*w->intf->mfmhd_get_next_id)(w->register_w[DESIRED_HEAD]&0x0f, id);
725      (*w->intf->mfmhd_get_next_id)(device, w->register_w[DESIRED_HEAD]&0x0f, id);
726726      sync_status_in(device);
727727      if (!(w->register_r[DRIVE_STATUS]& DS_READY))
728728      {
r9485r9486
767767      *direction = -1;
768768   }
769769
770   //printf("smc92x4 seek required: %d steps\n", *steps);
770   //logerror("smc92x4 seek required: %d steps\n", *steps);
771771
772772   w->register_r[INT_STATUS] &= ~ST_TC_RDIDERR;
773773   return;
r9485r9486
796796      if (w->selected_drive_type & TYPE_FLOPPY)
797797      {
798798         chrn_id idflop;
799         running_device *disk_img = (*w->intf->current_floppy)();
799         running_device *disk_img = (*w->intf->current_floppy)(device);
800800         found = floppy_drive_get_next_id(disk_img, w->register_w[DESIRED_HEAD]&0x0f, &idflop);
801801         copyid(idflop, id);
802802         if (/* pass==1 && */!found)
r9485r9486
808808      }
809809      else
810810      {
811         (*w->intf->mfmhd_get_next_id)(w->register_w[DESIRED_HEAD]&0x0f, id);
811         (*w->intf->mfmhd_get_next_id)(device, w->register_w[DESIRED_HEAD]&0x0f, id);
812812         sync_status_in(device);
813813         if (!(w->register_r[DRIVE_STATUS]& DS_READY))
814814         {
r9485r9486
830830      {
831831         des_cylinder = ((w->register_w[DESIRED_HEAD] & 0x70)<<4) | w->register_w[DESIRED_CYLINDER];
832832      }
833//      printf("smc92x4 check id: current = (%d,%d,%d), required = (%d,%d,%d)\n", id->C, id->H, id->R, des_cylinder, w->register_w[DESIRED_HEAD] & 0x0f, w->register_w[DESIRED_SECTOR]);
833//      logerror("smc92x4 check id: current = (%d,%d,%d), required = (%d,%d,%d)\n", id->C, id->H, id->R, des_cylinder, w->register_w[DESIRED_HEAD] & 0x0f, w->register_w[DESIRED_SECTOR]);
834834      if ((des_cylinder == id->C)
835835         && ((w->register_w[DESIRED_HEAD] & 0x0f) == id->H))
836836      {
r9485r9486
864864   sync_latches_out(device);
865865   sync_status_in(device);
866866
867   current_floppy = (*w->intf->current_floppy)();
867   current_floppy = (*w->intf->current_floppy)(device);
868868
869869   // Set command termination code. The error code is set first, and
870870   // on success, it is cleared.
r9485r9486
901901   else
902902   {
903903      /* buf is allocated within the function, and sector_len is also set */
904      (*w->intf->mfmhd_read_sector)(id.C, id.H, id.R, &buf, &sector_len);
904      (*w->intf->mfmhd_read_sector)(device, id.C, id.H, id.R, &buf, &sector_len);
905905   }
906906   sync_status_in(device);
907907
r9485r9486
913913      smc92x4_set_dip(device, TRUE);
914914      for (i=0; i < sector_len; i++)
915915      {
916         (*w->intf->dma_write_callback)(buf[i]);
916         (*w->intf->dma_write_callback)(device, buf[i]);
917917      }
918918      smc92x4_set_dip(device, FALSE);
919919   }
r9485r9486
960960   sync_latches_out(device);
961961   sync_status_in(device);
962962
963   current_floppy = (*w->intf->current_floppy)();
963   current_floppy = (*w->intf->current_floppy)(device);
964964
965965   // Set command termination code. The error code is set first, and
966966   // on success, it is cleared.
r9485r9486
985985   smc92x4_set_dip(device, TRUE);
986986   for (i=0; i<sector_len; i++)
987987   {
988      buf[i] = (*w->intf->dma_read_callback)();
988      buf[i] = (*w->intf->dma_read_callback)(device);
989989   }
990990   smc92x4_set_dip(device, FALSE);
991991
r9485r9486
10001000   }
10011001   else
10021002   {
1003      (*w->intf->mfmhd_write_sector)(id.C, id.H, id.R, buf, sector_len);
1003      (*w->intf->mfmhd_write_sector)(device, id.C, id.H, id.R, buf, sector_len);
10041004   }
10051005   free(buf);
10061006   sync_status_in(device);
r9485r9486
11011101   /* Needed for the two ways of re-entry: during the seek process, and during sector read */
11021102   if (!w->after_seek)
11031103   {
1104      // printf("smc92x4 continue with sector read\n");
1104      // logerror("smc92x4 continue with sector read\n");
11051105      w->seek_count--;
11061106      if (w->seek_count > 0)
11071107      {
r9485r9486
11541154   else
11551155   {
11561156      set_command_done(device, ST_TC_SUCCESS);
1157      //printf("smc92x4 read sector command done\n");
1157      //logerror("smc92x4 read sector command done\n");
11581158   }
11591159}
11601160
r9485r9486
12211221   else
12221222   {
12231223      set_command_done(device, ST_TC_SUCCESS);
1224      // printf("smc92x4 write sector command done\n");
1224      // logerror("smc92x4 write sector command done\n");
12251225   }
12261226}
12271227
r9485r9486
12861286   w->buffered = buffered;
12871287
12881288   smc92x4_timed_seek_request(device);
1289   //printf("smc92x4 waiting for drive step\n");
1289   //logerror("smc92x4 waiting for drive step\n");
12901290}
12911291
12921292static void step_continue(running_device *device)
12931293{
12941294   smc92x4_state *w = get_safe_token(device);
1295   //printf("smc92x4 step continue\n");
1295   //logerror("smc92x4 step continue\n");
12961296   w->to_be_continued = FALSE;
12971297   set_command_done(device,  ST_TC_SUCCESS);
12981298}
r9485r9486
14981498
14991499   sync_status_in(device);
15001500
1501   current_floppy = (*w->intf->current_floppy)();
1501   current_floppy = (*w->intf->current_floppy)(device);
15021502   floppy = flopimg_get_image(current_floppy);
15031503
15041504   if (floppy != NULL)
r9485r9486
15901590      buffer[index++] = 0xfe;
15911591
15921592      smc92x4_set_dip(device, TRUE);
1593      if (!fm) curr_ident = (*w->intf->dma_read_callback)();
1594      curr_cyl = (*w->intf->dma_read_callback)();
1595      curr_head = (*w->intf->dma_read_callback)();
1596      curr_sect = (*w->intf->dma_read_callback)();
1597      curr_size = (*w->intf->dma_read_callback)();
1593      if (!fm) curr_ident = (*w->intf->dma_read_callback)(device);
1594      curr_cyl = (*w->intf->dma_read_callback)(device);
1595      curr_head = (*w->intf->dma_read_callback)(device);
1596      curr_sect = (*w->intf->dma_read_callback)(device);
1597      curr_size = (*w->intf->dma_read_callback)(device);
15981598      smc92x4_set_dip(device, FALSE);
15991599
16001600      buffer[index++] = curr_cyl;
r9485r9486
16021602      buffer[index++] = curr_sect;
16031603      buffer[index++] = curr_size;
16041604
1605      // if (j==0) printf("current_floppy=%s, format track %d, head %d\n",  current_floppy->tag(), curr_cyl, curr_head);
1605      // if (j==0) logerror("current_floppy=%s, format track %d, head %d\n",  current_floppy->tag(), curr_cyl, curr_head);
16061606
16071607      /* Calculate CRC16 (5 bytes for ID) */
16081608      crc = ccitt_crc16(0xffff, &buffer[index-5], 5);
r9485r9486
16961696      buffer[index++] = 0xa1;
16971697
16981698      smc92x4_set_dip(device, TRUE);
1699      curr_ident = (*w->intf->dma_read_callback)();
1700      curr_cyl = (*w->intf->dma_read_callback)();
1701      curr_head = (*w->intf->dma_read_callback)();
1702      curr_sect = (*w->intf->dma_read_callback)();
1703      curr_size = (*w->intf->dma_read_callback)();
1699      curr_ident = (*w->intf->dma_read_callback)(device);
1700      curr_cyl = (*w->intf->dma_read_callback)(device);
1701      curr_head = (*w->intf->dma_read_callback)(device);
1702      curr_sect = (*w->intf->dma_read_callback)(device);
1703      curr_size = (*w->intf->dma_read_callback)(device);
17041704      smc92x4_set_dip(device, FALSE);
17051705
17061706      buffer[index++] = curr_ident;
r9485r9486
17381738   /* GAP 4 */
17391739   for (i=0; i < gap4; i++) buffer[index++] = gap_byte;
17401740
1741   (*w->intf->mfmhd_write_track)(w->register_w[DESIRED_HEAD]&0x0f, buffer, data_count);
1741   (*w->intf->mfmhd_write_track)(device, w->register_w[DESIRED_HEAD]&0x0f, buffer, data_count);
17421742   free(buffer);
17431743   sync_status_in(device);
17441744}
r9485r9486
17641764static void read_floppy_track(running_device *device, int transfer_only_ids)
17651765{
17661766   smc92x4_state *w = get_safe_token(device);
1767   running_device *current_floppy = (*w->intf->current_floppy)();
1767   running_device *current_floppy = (*w->intf->current_floppy)(device);
17681768
17691769   floppy_image *floppy;
17701770   /* Determine the track size. We cannot allow different sizes in this design. */
r9485r9486
18051805   smc92x4_set_dip(device, TRUE);
18061806   for (i=0; i < data_count; i++)
18071807   {
1808      (*w->intf->dma_write_callback)(buffer[i]);
1808      (*w->intf->dma_write_callback)(device, buffer[i]);
18091809   }
18101810   smc92x4_set_dip(device, FALSE);
18111811
r9485r9486
18241824   sync_latches_out(device);
18251825
18261826   /* buffer and data_count are allocated and set by the function. */
1827   (*w->intf->mfmhd_read_track)(w->register_w[DESIRED_HEAD]&0x0f, &buffer, &data_count);
1827   (*w->intf->mfmhd_read_track)(device, w->register_w[DESIRED_HEAD]&0x0f, &buffer, &data_count);
18281828   sync_status_in(device);
18291829
18301830   if (!(w->register_r[DRIVE_STATUS] & DS_READY))
r9485r9486
18451845   smc92x4_set_dip(device, TRUE);
18461846   for (i=0; i < data_count; i++)
18471847   {
1848      (*w->intf->dma_write_callback)(buffer[i]);
1848      (*w->intf->dma_write_callback)(device, buffer[i]);
18491849   }
18501850   smc92x4_set_dip(device, FALSE);
18511851
r9485r9486
20772077   {
20782078      /* data register */
20792079      reply = w->register_r[w->register_pointer];
2080      // printf("smc92x4 register_r[%d] -> %02x\n", w->register_pointer, reply);
2081
2080      // logerror("smc92x4 register_r[%d] -> %02x\n", w->register_pointer, reply);
20822081      /* Autoincrement until DATA is reached. */
20832082      if (w->register_pointer < DATA)
20842083         w->register_pointer++;
r9485r9486
20892088      reply = w->register_r[INT_STATUS];
20902089      // Spec (p.3) : The interrupt pin is reset to its inactive state
20912090      // when the UDC interrupt status register is read.
2092      // printf("smc92x4 interrupt status read = %02x\n", reply);
2091      // logerror("smc92x4 interrupt status read = %02x\n", reply);
20932092      smc92x4_clear_interrupt(device);
20942093      /* Clear the bits due to int status register read. */
20952094      w->register_r[INT_STATUS] &= ~(ST_INTPEND | ST_RDYCHNG);
r9485r9486
21092108   if ((offset & 1) == 0)
21102109   {
21112110      /* data register */
2112      // printf("smc92x4 register_w[%d] <- %X\n", w->register_pointer, data);
2111      // logerror("smc92x4 register_w[%d] <- %X\n", w->register_pointer, data);
21132112      w->register_w[w->register_pointer] = data;
21142113
21152114      // The DMA registers and the sector register for read and
src/mess/machine/smc92x4.h
r9485r9486
7373
7474   /* Get the currently selected floppy disk. This is determined by the
7575       circuitry on the controller board, not within the controller itself.
76       The device is this controller.
7677    */
77   running_device *(*current_floppy)(void);
78   running_device *(*current_floppy)(running_device *device);
7879
7980   /* Callback to read the contents of the external RAM via the data bus.
8081       Note that the address must be set and automatically increased
8182       by external circuitry. */
82   UINT8 (*dma_read_callback)(void);
83   UINT8 (*dma_read_callback)(running_device *device);
8384
8485   /* Callback to write the contents of the external RAM via the data bus.
8586       Note that the address must be set and automatically increased
8687       by external circuitry. */
87   void (*dma_write_callback)(UINT8 data);
88   void (*dma_write_callback)(running_device *device, UINT8 data);
8889
8990   /* Preliminary MFM hard disk interface. Gets next id. */
90   void (*mfmhd_get_next_id)(int head, chrn_id_hd *id);
91   void (*mfmhd_get_next_id)(running_device *device, int head, chrn_id_hd *id);
9192
9293   /* Preliminary MFM hard disk interface. Performs a seek. */
93   void (*mfmhd_seek)(int direction);
94   void (*mfmhd_seek)(running_device *device, int direction);
9495
9596   /* Preliminary MFM hard disk interface. Reads a sector. */
96   void (*mfmhd_read_sector)(int cylinder, int head, int sector, UINT8 **buf, int *sector_length);
97   void (*mfmhd_read_sector)(running_device *device, int cylinder, int head, int sector, UINT8 **buf, int *sector_length);
9798
9899   /* Preliminary MFM hard disk interface. Writes a sector. */
99   void (*mfmhd_write_sector)(int cylinder, int head, int sector, UINT8 *buf, int sector_length);
100   void (*mfmhd_write_sector)(running_device *device, int cylinder, int head, int sector, UINT8 *buf, int sector_length);
100101
101102   /* Preliminary MFM hard disk interface. Reads a track. */
102   void (*mfmhd_read_track)(int head, UINT8 **buffer, int *data_count);
103   void (*mfmhd_read_track)(running_device *device, int head, UINT8 **buffer, int *data_count);
103104
104105   /* Preliminary MFM hard disk interface. Writes a track. */
105   void (*mfmhd_write_track)(int head, UINT8 *buffer, int data_count);
106   void (*mfmhd_write_track)(running_device *device, int head, UINT8 *buffer, int data_count);
106107} smc92x4_interface;
107108
108109void smc92x4_reset(running_device *device);
src/mess/mess.mak
r9485r9486
131131#CPUS += MN10200
132132CPUS += COSMAC
133133CPUS += UNSP
134CPUS += COSMAC
134135
135136#-------------------------------------------------
136137# specify available sound cores; some of these are
r9485r9486
15311532   $(MESS_VIDEO)/ti85.o      \
15321533   $(MESS_MACHINE)/ti85.o      \
15331534   $(MESS_DRIVERS)/ti89.o      \
1534   $(MESS_DEVICES)/ti99cart.o   \
15351535   $(MESS_MACHINE)/tms9901.o   \
15361536   $(MESS_MACHINE)/tms9902.o   \
1537   $(MESS_MACHINE)/ti99_4x.o   \
15381537   $(MESS_MACHINE)/990_hd.o   \
15391538   $(MESS_MACHINE)/990_tap.o   \
15401539   $(MESS_MACHINE)/ti990.o      \
1541   $(MESS_MACHINE)/994x_ser.o   \
1542   $(MESS_MACHINE)/99_dsk.o   \
1543   $(MESS_MACHINE)/99_ide.o   \
1544   $(MESS_MACHINE)/99_hsgpl.o   \
1545   $(MESS_MACHINE)/99_usbsm.o   \
1546   $(MESS_MACHINE)/ti99pcod.o   \
1540   $(MESS_MACHINE)/at29040a.o   \
1541   $(MESS_MACHINE)/ti99/hsgpl.o   \
1542   $(MESS_MACHINE)/ti99/p_code.o   \
1543   $(MESS_MACHINE)/ti99/crubus.o   \
1544   $(MESS_MACHINE)/ti99/datamux.o   \
1545   $(MESS_MACHINE)/ti99/peribox.o   \
1546   $(MESS_MACHINE)/ti99/grom.o   \
1547   $(MESS_MACHINE)/ti99/gromport.o   \
1548   $(MESS_MACHINE)/ti99/ti32kmem.o   \
1549   $(MESS_MACHINE)/ti99/samsmem.o   \
1550   $(MESS_MACHINE)/ti99/myarcmem.o   \
1551   $(MESS_MACHINE)/ti99/ti_fdc.o   \
1552   $(MESS_MACHINE)/ti99/hfdc.o   \
1553   $(MESS_MACHINE)/ti99/bwg.o   \
1554   $(MESS_MACHINE)/ti99/ti_rs232.o   \
1555   $(MESS_MACHINE)/ti99/tn_usbsm.o   \
1556   $(MESS_MACHINE)/ti99/tn_ide.o   \
1557   $(MESS_MACHINE)/ti99/spchsyn.o  \
1558   $(MESS_MACHINE)/ti99/evpc.o     \
1559   $(MESS_MACHINE)/ti99/videowrp.o \
1560   $(MESS_MACHINE)/ti99/mapper8.o  \
1561   $(MESS_MACHINE)/ti99/speech8.o  \
1562   $(MESS_MACHINE)/ti99/mecmouse.o  \
1563   $(MESS_MACHINE)/ti99/handset.o  \
1564   $(MESS_MACHINE)/ti99/sgcpu.o  \
1565   $(MESS_MACHINE)/ti99/genboard.o  \
1566   $(MESS_MACHINE)/ti99/tiboard.o  \
15471567   $(MESS_MACHINE)/strata.o   \
1548   $(MESS_MACHINE)/geneve.o   \
15491568   $(MESS_MACHINE)/990_dk.o   \
15501569   $(MESS_DRIVERS)/ti990_4.o   \
15511570   $(MESS_DRIVERS)/ti99_4x.o   \
r9485r9486
15541573   $(MESS_DRIVERS)/tm990189.o   \
15551574   $(MESS_DRIVERS)/ti99_8.o   \
15561575   $(MESS_DEVICES)/ti99_hd.o   \
1557   $(MESS_DEVICES)/ti99_peb.o   \
15581576   $(MESS_VIDEO)/911_vdt.o      \
15591577   $(MESS_VIDEO)/733_asr.o      \
15601578   $(MESS_DRIVERS)/ti990_10.o   \
src/mess/drivers/ti99_8.c
r9485r9486
157157- Extended Basic II gets stuck with OLD MINIMEM. MiniMemory may be incompatible
158158  due to the different memory layout. SAVE/OLD only works if the machine is
159159  neither reset nor restarted.
160*/
161160
162#include "emu.h"
161  ROM file contents:
162  0000-1fff ROM0            0x0000 (logical address)
163  2000-3fff ROM1                0xffa000 - 0xffbfff
164  4000-5fff DSR1            0xff4000 (TTS)
165  6000-7fff ROM1a               0xffc000 - 0xffdfff
166  8000-9fff DSR2            0xff4000 (missing; Hexbus?)
167  */
163168
164#include "machine/ti99_4x.h"
165#include "machine/tms9901.h"
166#include "audio/spchroms.h"
167#include "devices/ti99_peb.h"
168#include "machine/994x_ser.h"
169#include "machine/99_dsk.h"
170#include "machine/99_ide.h"
169#include "emu.h"
171170#include "cpu/tms9900/tms9900.h"
172#include "devices/flopdrv.h"
173#include "devices/cassette.h"
174#include "devices/cartslot.h"
175#include "machine/smartmed.h"
176171#include "sound/sn76496.h"
177#include "sound/tms5220.h"
172//#include "video/tms9928a.h"
178173#include "sound/wave.h"
179#include "devices/harddriv.h"
180#include "machine/idectrl.h"
181#include "machine/smc92x4.h"
182#include "machine/mm58274c.h"
183#include "devices/ti99cart.h"
184#include "machine/rtc65271.h"
185#include "formats/ti99_dsk.h"
186#include "devices/ti99_hd.h"
174#include "machine/tms9901.h"
175#include "devices/cassette.h"
187176
177#include "machine/ti99/tiboard.h"
178
179#include "machine/ti99/videowrp.h"
180#include "machine/ti99/speech8.h"
181
182#include "machine/ti99/peribox.h"
183#include "machine/ti99/crubus.h"
184#include "machine/ti99/mapper8.h"
185#include "machine/ti99/grom.h"
186#include "machine/ti99/gromport.h"
187#include "machine/ti99/mecmouse.h"
188
188189/*
189190    Memory map - see description above
190191*/
191192
192193static ADDRESS_MAP_START(ti99_8_memmap, ADDRESS_SPACE_PROGRAM, 8)
193   /* There is a mapper device involved, so we need to handle the range mapping in a bit more complicated way. */
194   AM_RANGE(0x0000, 0xffff) AM_READWRITE(ti99_8_r, ti99_8_w)
194   AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("mapper", ti99_mapper8_r, ti99_mapper8_w )
195195ADDRESS_MAP_END
196196
197197
r9485r9486
200200*/
201201
202202static ADDRESS_MAP_START(ti99_8_cru_map, ADDRESS_SPACE_IO, 8)
203//  AM_RANGE(0x0000, 0x00ff) AM_DEVREAD("tms9901", tms9901_cru_r)
204203   AM_RANGE(0x0000, 0x007f) AM_DEVREAD("tms9901", tms9901_cru_r)
205   AM_RANGE(0x0080, 0x00ff) AM_DEVREAD("ti99_multicart", ti99_multicart_cru_r)     /* SuperSpace cartridge */
206   AM_RANGE(0x0100, 0x02ff) AM_DEVREAD("per_exp_box", ti99_8_peb_cru_r)
204   AM_RANGE(0x0000, 0x02ff) AM_DEVREAD("crubus", ti99_crubus_r )
207205
208//      AM_RANGE(0x0000, 0x07ff) AM_DEVWRITE("tms9901", tms9901_cru_w)
209206   AM_RANGE(0x0000, 0x03ff) AM_DEVWRITE("tms9901", tms9901_cru_w)
210   AM_RANGE(0x0400, 0x07ff) AM_DEVWRITE("ti99_multicart", ti99_multicart_cru_w)    /* SuperSpace cartridge */
211   AM_RANGE(0x0800, 0x17ff) AM_DEVWRITE("per_exp_box", ti99_8_peb_cru_w)
212
207   AM_RANGE(0x0000, 0x17ff) AM_DEVWRITE("crubus", ti99_crubus_w )
213208ADDRESS_MAP_END
214209
215
216210/* ti99/8 : 54-key keyboard */
217211static INPUT_PORTS_START(ti99_8)
218   PORT_START( "SPEECH" )
219   PORT_CONFNAME( 0x01, 0x01, "Speech synthesizer" )
220      PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
221      PORT_CONFSETTING( 0x01, DEF_STR( On ) )
222
223212   PORT_START( "DISKCTRL" )
224213   PORT_CONFNAME( 0x07, 0x00, "Disk controller" )
225214      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
226215      PORT_CONFSETTING(    0x01, "TI SD Floppy Controller" )
227216      PORT_CONFSETTING(    0x02, "SNUG BwG Controller" )
228217      PORT_CONFSETTING(    0x03, "Myarc HFDC" )
229//      PORT_CONFSETTING(    0x04, "Corcomp" )
230218
231219   PORT_START( "HDCTRL" )
232220   PORT_CONFNAME( 0x03, 0x00, "HD controller" )
233221      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
234//      PORT_CONFSETTING(    0x01, "Nouspikel IDE Controller" )
222      PORT_CONFSETTING(    0x01, "Nouspikel IDE Controller" )
235223//      PORT_CONFSETTING(    0x02, "WHTech SCSI Controller" )
236224   PORT_CONFNAME( 0x08, 0x00, "USB-SM card" )
237225      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
r9485r9486
242230      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
243231      PORT_CONFSETTING(    0x01, "TI RS-232 card" )
244232
245   /* Flash setting is used to flash an empty HSGPL DSR ROM */
246   PORT_START( "EXTCARD" )
247   PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" ) PORT_CHANGED( hsgpl_changed, NULL)
248      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
249      PORT_CONFSETTING(    0x01, "Flash" )
250      PORT_CONFSETTING(    0x02, DEF_STR( On ) )
251   PORT_CONFNAME( 0x04, 0x00, "P-Code card" )
252      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
253      PORT_CONFSETTING(    0x04, DEF_STR( On ) )
254
255233   PORT_START( "HCI" )
256234   PORT_CONFNAME( 0x01, 0x00, "Mouse support" )
257235      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
r9485r9486
264242      PORT_DIPSETTING(    0x02, "Slot 2" )
265243      PORT_DIPSETTING(    0x03, "Slot 3" )
266244      PORT_DIPSETTING(    0x04, "Slot 4" )
267      PORT_DIPSETTING(    0x0f, "GRAM Kracker" )
268245
269   /* GRAM Kracker Support */
270   PORT_START( "GKSWITCH1" )
271   PORT_DIPNAME( 0x01, 0x01, "GK switch 1" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)1)
272      PORT_DIPSETTING(    0x00, "GK Off" )
273      PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
274
275   PORT_START( "GKSWITCH2" )
276   PORT_DIPNAME( 0x01, 0x01, "GK switch 2" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)2)
277      PORT_DIPSETTING(    0x00, "GRAM 0" )
278      PORT_DIPSETTING(    0x01, "Op Sys" )
279
280   PORT_START( "GKSWITCH3" )
281   PORT_DIPNAME( 0x01, 0x01, "GK switch 3" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)3)
282      PORT_DIPSETTING(    0x00, "GRAM 1-2" )
283      PORT_DIPSETTING(    0x01, "TI BASIC" )
284
285   PORT_START( "GKSWITCH4" )
286   PORT_DIPNAME( 0x03, 0x01, "GK switch 4" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)4)
287      PORT_DIPSETTING(    0x00, "Bank 1" )
288      PORT_DIPSETTING(    0x01, "W/P" )
289      PORT_DIPSETTING(    0x02, "Bank 2" )
290
291   PORT_START( "GKSWITCH5" )
292   PORT_DIPNAME( 0x01, 0x00, "GK switch 5" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)5)
293      PORT_DIPSETTING(    0x00, "Loader On" )
294      PORT_DIPSETTING(    0x01, "Loader Off" )
295
296246   PORT_START( "HFDCDIP" )
297247   PORT_DIPNAME( 0xff, 0x55, "HFDC drive config" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
298248      PORT_DIPSETTING( 0x00, "40 track, 16 ms")
r9485r9486
490440GFXDECODE_END
491441
492442
493/*
494    TMS5220 speech synthesizer
495*/
496static const tms5220_interface ti99_8_tms5220interface =
497{
498   DEVCB_NULL,               /* no IRQ callback */
499   DEVCB_NULL,               /* no Ready callback */
500   spchroms_read,            /* speech ROM read handler */
501   spchroms_load_address,      /* speech ROM load address handler */
502   spchroms_read_and_branch   /* speech ROM read and branch handler */
503};
504
505
506
507443static const TMS9928a_interface tms9118_interface =
508444{
509445   TMS99x8A,
r9485r9486
512448   tms9901_set_int2
513449};
514450
515static MACHINE_START(ti99_8_60hz)
516{
517   ti99_common_init(machine, &tms9118_interface);
518}
519
520451static const TMS9928a_interface tms9129_interface =
521452{
522453   TMS9929A,
r9485r9486
525456   tms9901_set_int2
526457};
527458
528static MACHINE_START(ti99_8_50hz)
529{
530   ti99_common_init(machine, &tms9129_interface);
531}
532
533459static const struct tms9995reset_param ti99_8_processor_config =
534460{
535461   1,   /* enable automatic wait state generation */
r9485r9486
540466   1   /* MP9537 mask */
541467};
542468
543static const mm58274c_interface floppy_mm58274c_interface =
469/*
470   Format:
471   Name, mode, stop, mask, select, write, read8z function, write8 function
472   
473   Multiple devices may have the same select pattern; as in the real hardware,
474   care must be taken that only one device actually responds. In the case of
475   GROMs, each chip has an internal address counter and an ID, and the chip
476   only responds when the ID and the most significant 3 bits match.
477*/
478static const mapper8_dev_config mapper_devices[] =
544479{
545   1,   /*  mode 24*/
546   0   /*  first day of week */
480   // TI-99/8 mode
481   { SRAMNAME,         0, 1, 0xf800, 0xf000, 0x0000, NULL,          NULL },
482   { "soundgen",      0, 1, 0xfff0, 0xf800, 0x0000, NULL,            sn76496_w },
483   { "video",         0, 1, 0xfffd, 0xf810, 0x0000, ti8_tms991x_rz,   ti8_tms991x_w },
484   { "speech",         0, 1, 0xfff0, 0xf820, 0x0000, ti998spch_rz,    ti998spch_w },
485   { "grom_0",        0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz,       ti99grom_w },
486   { "grom_1",        0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz,      ti99grom_w },
487   { "grom_2",         0, 0, 0xfff1, 0xf830, 0x0000, ti99grom_rz,     ti99grom_w },
488   { "gromport",      0, 0, 0xfff1, 0xf830, 0x0400, gromportg_rz,      gromportg_w, },
489//   { "grom_tts_0",      2, 0, 0xfff1, 0xf840, 0x0000, 0, 0, ti99grom_rz,     ti99grom_w },  // up to 6 GROMs; no good dumps known
490//   { "grom_pcode1_0",    2, 0, 0xfff1, 0xf850, 0x0000, 0, 0, ti99grom_rz,     ti99grom_w },  // up to 6 GROMs; no good dumps known
491//   { "grom_pcode2_0",    2, 0, 0xfff1, 0xf860, 0x0000, 0, 0, ti99grom_rz,     ti99grom_w },  // up to 6 GROMs; no good dumps known
492   { "mapper",         0, 1, 0xfff0, 0xf870, 0x0000, NULL,         ti99_mapreg_w },
493
494   // TI-99/4A mode
495   // GROM: 1001 1000 0000 xxa0
496   { ROM0NAME,         1, 1, 0xe000, 0x0000, 0x0000, NULL,          NULL },
497   { "grom_0",        1, 0, 0xfff1, 0x9800, 0x0400, ti99grom_rz,     ti99grom_w },
498   { "grom_1",        1, 0, 0xfff1, 0x9800, 0x0400, ti99grom_rz,     ti99grom_w },
499   { "grom_2",        1, 0, 0xfff1, 0x9800, 0x0400, ti99grom_rz,     ti99grom_w },
500   { "gromport",      1, 0, 0xfff1, 0x9800, 0x0400, gromportg_rz,      gromportg_w, },
501   
502   { "mapper",         1, 1, 0xfff0, 0x8810, 0x0000, NULL,             ti99_mapreg_w },
503   { "soundgen",      1, 1, 0xfff0, 0x8400, 0x0000, NULL,            sn76496_w },
504   { "video",         1, 1, 0xfffd, 0x8800, 0x0400, ti8_tms991x_rz,    ti8_tms991x_w },
505   { "speech",         1, 1, 0xfff0, 0x9000, 0x0400, ti998spch_rz,    ti998spch_w },
506   { SRAMNAME,         1, 1, 0xf800, 0x8000, 0x0000, NULL,            NULL }, // write at the end; soundgen must be found earlier
507
508   // Physical (need to pack this into here as well)
509   { DRAMNAME,       3, 1, 0xff0000, 0x000000, 0x000000, NULL, NULL },
510   { "mapper",         3, 1, 0xffe000, 0xff4000, 0x000000, ti998dsr_rz, NULL },   // DSR
511   { "gromport",       3, 1, 0xffe000, 0xff6000, 0x000000, gromportr_rz, gromportr_w  },
512   { "gromport",       3, 1, 0xffe000, 0xff8000, 0x000000, gromportr_rz, gromportr_w  },
513   { ROM1NAME,       3, 1, 0xffe000, 0xffa000, 0x000000, NULL, NULL },
514   { ROM1ANAME,       3, 1, 0xffe000, 0xffc000, 0x000000, NULL, NULL },
515   { INTSNAME,       3, 1, 0xfffff0, 0xffe000, 0x000000, NULL, NULL },   
516
517   { NULL, 0, 0, 0, 0, 0, NULL, NULL  }
547518};
548519
549static const floppy_config ti99_8_floppy_config =
520static const cruconf_device cru_devices[] =
550521{
551   DEVCB_NULL,
552   DEVCB_NULL,
553   DEVCB_NULL,
554   DEVCB_NULL,
555   DEVCB_NULL,
556   FLOPPY_STANDARD_5_25_DSHD,
557   FLOPPY_OPTIONS_NAME(ti99),
558   NULL
522   { "mapper",    0xfff0, 0x2700, NULL, mapper8c_w },
523   { "gromport",    0xf800, 0x0800, gromportc_rz, gromportc_w },            // Check: Is this really limited?
524   { "peribox",     0x0000, 0x0000, ti99_peb_cru_rz, ti99_peb_cru_w },    // Peribox needs all addresses
525   { NULL,       0, 0, NULL, NULL }
559526};
560527
528MACHINE_RESET( ti99_8 )
529{
530}
531
561532static MACHINE_CONFIG_START( ti99_8_60hz, driver_device )
562533   /* basic machine hardware */
563534   /* TMS9995-MP9537 CPU @ 10.7 MHz */
r9485r9486
567538   MDRV_CPU_IO_MAP(ti99_8_cru_map)
568539   MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt)
569540
570   MDRV_MACHINE_START( ti99_8_60hz )
571541   MDRV_MACHINE_RESET( ti99_8 )
572542
573   /* For HSGPL */
574   MDRV_NVRAM_HANDLER( ti99 )
575
576543   /* video hardware */
577   MDRV_FRAGMENT_ADD(tms9928a)
578   MDRV_SCREEN_MODIFY("screen")
579   MDRV_SCREEN_REFRESH_RATE(60)
580   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
544   MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9118_interface)   
545
581546   MDRV_GFXDECODE(ti99_8)
582547
583548   /* sound hardware */
584549   MDRV_SPEAKER_STANDARD_MONO("mono")
585550   MDRV_SOUND_WAVE_ADD("wave", "cassette")
586551   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
587   MDRV_SOUND_ADD("sn76496", SN76496, 3579545)   /* 3.579545 MHz */
552   MDRV_SOUND_ADD("soundgen", SN76496, 3579545)   /* 3.579545 MHz */
588553   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
589   MDRV_SOUND_ADD("tms5220", TMS5220, 680000L)
590   MDRV_SOUND_CONFIG(ti99_8_tms5220interface)
591   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
592554
593   /* devices */
594   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
555   MDRV_TISPEECH_ADD("speech")
595556
596   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt
597   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback)
557   MDRV_TI998_BOARD_ADD( "ti_board" )
558   MDRV_MAPPER8_ADD( "mapper", mapper_devices )
598559
599   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
600
601   /* rtc */
602   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
603
604560   /* tms9901 */
605   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_8)
561   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_8)
606562
607   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
608   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
563   MDRV_CRUBUS_ADD( "crubus", cru_devices)
609564
610   MDRV_FLOPPY_4_DRIVES_ADD(ti99_8_floppy_config)
611   MDRV_MFMHD_3_DRIVES_ADD()
565   MDRV_GROM_ADD( "grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
566   MDRV_GROM_ADD( "grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
567   MDRV_GROM_ADD( "grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
612568
613   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
614   MDRV_SMARTMEDIA_ADD("smartmedia")
615   MDRV_TI99_4_RS232_CARD_ADD("rs232")
569   MDRV_PBOX8_ADD( "peribox", console_extint, console_notconnected, console_ready )
570   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
571
572   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
573   MDRV_MECMOUSE_ADD( "mecmouse" )
616574MACHINE_CONFIG_END
617575
618576
r9485r9486
625583   MDRV_CPU_IO_MAP(ti99_8_cru_map)
626584   MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt)
627585
628   MDRV_MACHINE_START( ti99_8_50hz )
629586   MDRV_MACHINE_RESET( ti99_8 )
630587
631588   /* video hardware */
632   MDRV_FRAGMENT_ADD(tms9928a)
633   MDRV_SCREEN_MODIFY("screen")
634   MDRV_SCREEN_REFRESH_RATE(50)
635   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
589   MDRV_TI_TMS991x_ADD("video", tms9928a, 50, "screen", 2500, &tms9129_interface)   
590
636591   MDRV_GFXDECODE(ti99_8)
637592
638593   /* sound hardware */
639594   MDRV_SPEAKER_STANDARD_MONO("mono")
640   MDRV_SOUND_ADD("sn76496", SN76496, 3579545)   /* 3.579545 MHz */
641   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
642   MDRV_SOUND_ADD("tms5220", TMS5220, 680000L)
643   MDRV_SOUND_CONFIG(ti99_8_tms5220interface)
644   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
645595   MDRV_SOUND_WAVE_ADD("wave", "cassette")
646596   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
597   MDRV_SOUND_ADD("soundgen", SN76496, 3579545)   /* 3.579545 MHz */
598   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
647599
648   /* devices */
649   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
650   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
651   // MDRV_IDE_HARDDISK_ADD( "ide_harddisk" )
652   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback)
600   MDRV_TISPEECH_ADD("speech")
601   
602   MDRV_MAPPER8_ADD( "mapper", mapper_devices )
653603
654   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
604   /* tms9901 */
605   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_8)
655606
656   /* rtc */
657   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
607   MDRV_CRUBUS_ADD( "crubus", cru_devices)
658608
659   /* tms9901 */
660   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_8)
609   MDRV_GROM_ADD( "grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
610   MDRV_GROM_ADD( "grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
611   MDRV_GROM_ADD( "grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
661612
662   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
663   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
664   MDRV_FLOPPY_4_DRIVES_ADD(ti99_8_floppy_config)
665   MDRV_MFMHD_3_DRIVES_ADD()
613   MDRV_PBOX8_ADD( "peribox", console_extint, console_notconnected, console_ready )
614   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
666615
667   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
668   MDRV_SMARTMEDIA_ADD("smartmedia")
669   MDRV_TI99_4_RS232_CARD_ADD("rs232")
616   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
617   MDRV_MECMOUSE_ADD( "mecmouse" )
670618MACHINE_CONFIG_END
671619
672620/*
r9485r9486
674622*/
675623ROM_START(ti99_8)
676624   /*CPU memory space*/
677   ROM_REGION(region_cpu1_len_8,"maincpu",0)
625   ROM_REGION(0x8000,"maincpu",0)
678626   ROM_LOAD("998rom.bin", 0x0000, 0x8000, CRC(b7a06ffd) SHA1(17dc8529fa808172fc47089982efb0bf0548c80c))      /* system ROMs */
679627
680628   /*GROM memory space*/
681629   ROM_REGION(0x10000, region_grom, 0)
682630   ROM_LOAD("998grom.bin", 0x0000, 0x6000, CRC(c63806bc) SHA1(cbfa8b04b4aefbbd9a713c54267ad4dd179c13a3))   /* system GROMs */
683631
684   /*DSR ROM space*/
685   ROM_REGION(region_dsr_len, region_dsr, 0)
686   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
687#if HAS_99CCFDC
688   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
689#endif
690   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
691   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
692   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
693
694   /* HSGPL memory space */
695   ROM_REGION(region_hsgpl_len, region_hsgpl, ROMREGION_ERASEFF)
696
697   /*TMS5220 ROM space*/
698   ROM_REGION(0x8000, region_speech_rom, 0)
699   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, BAD_DUMP CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
700
701632ROM_END
702633
703634#define rom_ti99_8e rom_ti99_8
704635
705636/*      YEAR    NAME        PARENT  COMPAT  MACHINE     INPUT   INIT      COMPANY                 FULLNAME */
706COMP(   1983,   ti99_8,      0,      0,   ti99_8_60hz,ti99_8,   ti99_8,      "Texas Instruments",   "TI-99/8 Computer (US)" , 0)
707COMP(   1983,   ti99_8e,   ti99_8,   0,   ti99_8_50hz,ti99_8,   ti99_8,      "Texas Instruments",   "TI-99/8 Computer (Europe)" , 0 )
637COMP(   1983,   ti99_8,      0,      0,   ti99_8_60hz,ti99_8,   0,      "Texas Instruments",   "TI-99/8 Computer (US)" , 0)
638COMP(   1983,   ti99_8e,   ti99_8,   0,   ti99_8_50hz,ti99_8,   0,      "Texas Instruments",   "TI-99/8 Computer (Europe)" , 0 )
src/mess/drivers/geneve.c
r9485r9486
199199
200200#include "emu.h"
201201#include "cpu/tms9900/tms9900.h"
202#include "sound/sn76496.h"
203#include "sound/tms5220.h"
204202#include "deprecat.h"
205#include "video/v9938.h"
206203#include "includes/geneve.h"
207#include "machine/ti99_4x.h"
204#include "machine/ti99/genboard.h"
208205#include "machine/tms9901.h"
209#include "machine/tms9902.h"
210#include "audio/spchroms.h"
211#include "devices/ti99_peb.h"
212#include "machine/994x_ser.h"
213#include "machine/99_dsk.h"
214#include "machine/99_ide.h"
215#include "devices/flopdrv.h"
216#include "machine/smartmed.h"
217#include "devices/harddriv.h"
218#include "machine/idectrl.h"
219#include "machine/smc92x4.h"
220#include "machine/mm58274c.h"
221#include "machine/rtc65271.h"
222#include "formats/ti99_dsk.h"
223#include "devices/ti99_hd.h"
206#include "machine/ti99/videowrp.h"
207#include "sound/sn76496.h"
208#include "machine/ti99/peribox.h"
224209
225210/*
226211    memory map
227212*/
228213
229214static ADDRESS_MAP_START(memmap, ADDRESS_SPACE_PROGRAM, 8)
230   AM_RANGE(0x0000, 0xffff) AM_READWRITE(geneve_r, geneve_w)
215   AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("geneve_board", geneve_r, geneve_w)
231216ADDRESS_MAP_END
232217
233
234218/*
235219    CRU map
236220*/
237
238221static ADDRESS_MAP_START(cru_map, ADDRESS_SPACE_IO, 8)
239222   AM_RANGE(0x0000, 0x00ff) AM_DEVREAD("tms9901", tms9901_cru_r)
240   AM_RANGE(0x0100, 0x01ff) AM_DEVREAD("per_exp_box", geneve_peb_cru_r)
223   AM_RANGE(0x0100, 0x01ff) AM_DEVREAD("geneve_board", geneve_cru_r)
241224
242225   AM_RANGE(0x0000, 0x07ff) AM_DEVWRITE("tms9901", tms9901_cru_w)
243   AM_RANGE(0x0800, 0x0fff) AM_WRITE(geneve_peb_mode_cru_w)
226   AM_RANGE(0x0800, 0x0fff) AM_DEVWRITE("geneve_board", geneve_cru_w)
244227ADDRESS_MAP_END
245228
246
247229/*
248230    Input ports, used by machine code for keyboard and joystick emulation.
249231*/
r9485r9486
453435
454436INPUT_PORTS_END
455437
456
457
458
459static const tms5220_interface geneve_tms5220interface =
438DRIVER_INIT( genmod )
460439{
461   DEVCB_NULL,               /* no IRQ callback */
462   DEVCB_NULL,               /* no Ready callback */
463#if 1
464   spchroms_read,            /* speech ROM read handler */
465   spchroms_load_address,      /* speech ROM load address handler */
466   spchroms_read_and_branch   /* speech ROM read and branch handler */
467#endif
468};
440   /*has_genmod = TRUE;*/
441}
469442
470static const mm58274c_interface geneve_mm58274c_interface =
443DRIVER_INIT( geneve )
471444{
472   1,   /*  mode 24*/
473   0   /*  first day of week */
474};
445   /*has_genmod = FALSE;*/
446}
475447
476
477static const mm58274c_interface floppy_mm58274c_interface =
448MACHINE_START( geneve )
478449{
479   1,   /*  mode 24*/
480   0   /*  first day of week */
481};
450}
482451
483static const floppy_config geneve_floppy_config =
452/*
453    Reset the machine.
454*/
455MACHINE_RESET( geneve )
484456{
485   DEVCB_NULL,
486   DEVCB_NULL,
487   DEVCB_NULL,
488   DEVCB_NULL,
489   DEVCB_NULL,
490   FLOPPY_STANDARD_5_25_DSHD,
491   FLOPPY_OPTIONS_NAME(ti99),
492   NULL
493};
457}
494458
495459static MACHINE_CONFIG_START( geneve_60hz, driver_device )
496460   /* basic machine hardware */
r9485r9486
504468   MDRV_MACHINE_RESET( geneve )
505469
506470   /* video hardware */
507   MDRV_SCREEN_ADD("screen", RASTER)
508   MDRV_SCREEN_REFRESH_RATE(60)   /* or 50Hz */
509   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
510   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
511   MDRV_SCREEN_SIZE(512 + 32, (212 + 28) * 2)
512   MDRV_SCREEN_VISIBLE_AREA(0, 512 + 32 - 1, 0, (212 + 28) * 2 - 1)
471   MDRV_TI_V9938_ADD("video", 60, "screen", 2500, 512+32, (212+28)*2, tms9901_gen_set_int2)   
513472
514   MDRV_PALETTE_LENGTH(512)
515
516   MDRV_PALETTE_INIT(v9938)
517   MDRV_VIDEO_START(geneve)
518   MDRV_VIDEO_UPDATE(generic_bitmapped)
519
520473   /* sound hardware */
521474   MDRV_SPEAKER_STANDARD_MONO("mono")
522   MDRV_SOUND_ADD("sn76496", SN76496, 3579545)   /* 3.579545 MHz */
475   MDRV_SOUND_ADD("soundgen", SN76496, 3579545)   /* 3.579545 MHz */
523476   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
524   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
525   MDRV_SOUND_CONFIG(geneve_tms5220interface)
526   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
527477
528   /* devices */
529   MDRV_PBOX_ADD( "per_exp_box", FALSE, inta_callback, intb_callback )
478   /* Peripheral Box. Take the same as the TI-99/4A. */
479   MDRV_PBOXGEN_ADD( "peribox", board_inta, board_intb, board_ready )
530480
531/*  MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
481   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_geneve)
532482
533    MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) */
534
535   /* rtc */
536   MDRV_MM58274C_ADD("mm58274c", geneve_mm58274c_interface)
537   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
538
539483   /* tms9901 */
540   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99)
541
542   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
543   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
544
545   MDRV_FLOPPY_4_DRIVES_ADD(geneve_floppy_config)
546   MDRV_MFMHD_3_DRIVES_ADD()
547
548   MDRV_SMARTMEDIA_ADD("smartmedia")
549
550   MDRV_TI99_4_RS232_CARD_ADD("rs232")
484   MDRV_GENEVE_BOARD_ADD("geneve_board")
551485MACHINE_CONFIG_END
552486
553
554487/*
555488    ROM loading
556489
r9485r9486
562495   ROM_REGION(region_cpu1_len_geneve, "maincpu", 0)
563496   ROM_LOAD("genbt100.bin", offset_rom_geneve, 0x4000, CRC(8001e386) SHA1(b44618b54dabac3882543e18555d482b299e0109)) /* CPU ROMs */
564497   ROM_LOAD_OPTIONAL("genbt090.bin", offset_altrom_geneve, 0x4000, CRC(b2e20df9) SHA1(2d5d09177afe97d63ceb3ad59b498b1c9e2153f7)) /* CPU ROMs */
565
566   /*DSR ROM space*/
567   ROM_REGION(region_dsr_len, region_dsr, 0)
568   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
569#if HAS_99CCFDC
570   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
571#endif
572   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
573   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
574   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
575
576   /*TMC0285 ROM space*/
577   ROM_REGION(0x8000, region_speech_rom, 0)
578   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
579498ROM_END
580499
581500ROM_START(genmod)
582501   /*CPU memory space*/
583502   ROM_REGION(region_cpu1_len_geneve, "maincpu", 0)
584503   ROM_LOAD("gnmbt100.bin", offset_rom_geneve, 0x4000, CRC(19b89479) SHA1(6ef297eda78dc705946f6494e9d7e95e5216ec47)) /* CPU ROMs */
585
586   /*DSR ROM space*/
587   ROM_REGION(region_dsr_len, region_dsr, 0)
588   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
589#if HAS_99CCFDC
590   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
591#endif
592   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
593   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
594   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
595
596   /*TMC0285 ROM space*/
597   ROM_REGION(0x8000, region_speech_rom, 0)
598   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
599504ROM_END
600505
601506/*    YEAR  NAME      PARENT    COMPAT  MACHINE      INPUT    INIT       COMPANY     FULLNAME */
src/mess/drivers/ti99_4p.c
r9485r9486
5353#include "sound/tms5220.h"
5454#include "video/v9938.h"
5555
56#include "machine/ti99_4x.h"
5756#include "machine/tms9901.h"
5857#include "machine/tms9902.h"
5958#include "audio/spchroms.h"
60#include "devices/ti99_peb.h"
61#include "machine/994x_ser.h"
62#include "machine/99_dsk.h"
63#include "machine/99_ide.h"
64#include "devices/flopdrv.h"
59#include "machine/ti99/peribox.h"
60
6561#include "devices/cassette.h"
66#include "machine/smartmed.h"
67#include "devices/harddriv.h"
68#include "devices/ti99_hd.h"
69#include "machine/idectrl.h"
70#include "machine/smc92x4.h"
71#include "machine/mm58274c.h"
72#include "machine/rtc65271.h"
73#include "formats/ti99_dsk.h"
62#include "machine/ti99/videowrp.h"
63#include "machine/ti99/sgcpu.h"
64#include "machine/ti99/peribox.h"
7465
75
7666static ADDRESS_MAP_START(memmap, ADDRESS_SPACE_PROGRAM, 16)
77   AM_RANGE(0x0000, 0x1fff) AM_ROMBANK("bank1")                         // system ROM
78   AM_RANGE(0x2000, 0x2fff) AM_RAMBANK("bank3")                         // lower 8kb of RAM extension: AMS bank 2
79   AM_RANGE(0x3000, 0x3fff) AM_RAMBANK("bank4")                         // lower 8kb of RAM extension: AMS bank 3
80   AM_RANGE(0x4000, 0x5fff) AM_DEVREADWRITE("per_exp_box", ti99_4p_peb_r, ti99_4p_peb_w)    // DSR ROM space
81   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(ti99_4p_cart_r,ti99_4p_cart_w) // cartridge space (internal or hsgpl)
82   AM_RANGE(0x8000, 0x83ff) AM_RAMBANK("bank2")                         // RAM PAD
83   AM_RANGE(0x8400, 0x87ff) AM_READWRITE(ti99_nop_8_r, ti99_wsnd_w)     // soundchip write
84   AM_RANGE(0x8800, 0x8bff) AM_READWRITE(ti99_rv38_r, ti99_nop_8_w)     // vdp read
85   AM_RANGE(0x8C00, 0x8fff) AM_READWRITE(ti99_nop_8_r, ti99_wv38_w)     // vdp write
86   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)    // speech read - installed dynamically
87   AM_RANGE(0x9400, 0x97ff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)    // speech write - installed dynamically*/
88   AM_RANGE(0x9800, 0x98ff) AM_READWRITE(ti99_4p_grom_r, ti99_nop_8_w)  // GPL read
89   AM_RANGE(0x9900, 0x9bff) AM_RAMBANK("bank11")                        // extra RAM for debugger
90   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(ti99_nop_8_r, ti99_4p_grom_w)  // GPL write
91   AM_RANGE(0xa000, 0xafff) AM_RAMBANK("bank5")                         // upper 24kb of RAM extension: AMS bank 10
92   AM_RANGE(0xb000, 0xbfff) AM_RAMBANK("bank6")                         // upper 24kb of RAM extension: AMS bank 11
93   AM_RANGE(0xc000, 0xcfff) AM_RAMBANK("bank7")                         // upper 24kb of RAM extension: AMS bank 12
94   AM_RANGE(0xd000, 0xdfff) AM_RAMBANK("bank8")                         // upper 24kb of RAM extension: AMS bank 13
95   AM_RANGE(0xe000, 0xefff) AM_RAMBANK("bank9")                         // upper 24kb of RAM extension: AMS bank 14
96   AM_RANGE(0xf000, 0xffff) AM_RAMBANK("bank10")                        // upper 24kb of RAM extension: AMS bank 15
67   AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("sgcpu_board", sgcpu_r, sgcpu_w )
9768ADDRESS_MAP_END
9869
9970static ADDRESS_MAP_START(cru_map, ADDRESS_SPACE_IO, 8)
100   AM_RANGE(0x0000, 0x003f) AM_DEVREAD("tms9901", tms9901_cru_r)
101   AM_RANGE(0x0040, 0x01ff) AM_DEVREAD("per_exp_box", ti99_4p_peb_cru_r)
71   AM_RANGE(0x0000, 0x007f) AM_DEVREAD("tms9901", tms9901_cru_r)
72   AM_RANGE(0x0080, 0x01ff) AM_DEVREAD("sgcpu_board", sgcpu_cru_r )
10273
103   AM_RANGE(0x0000, 0x01ff) AM_DEVWRITE("tms9901", tms9901_cru_w)
104   AM_RANGE(0x0200, 0x0fff) AM_DEVWRITE("per_exp_box", ti99_4p_peb_cru_w)
74   AM_RANGE(0x0000, 0x03ff) AM_DEVWRITE("tms9901", tms9901_cru_w)
75   AM_RANGE(0x0400, 0x0fff) AM_DEVWRITE("sgcpu_board", sgcpu_cru_w )
10576ADDRESS_MAP_END
10677
107
10878/*
10979    Input ports, used by machine code for TI keyboard and joystick emulation.
11080
r9485r9486
142112      PORT_CONFSETTING(    0x01, "TI RS-232 card" )
143113
144114   PORT_START( "EXTCARD" )
145   PORT_CONFNAME( 0x04, 0x00, "P-Code card" )
146      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
147      PORT_CONFSETTING(    0x04, DEF_STR( On ) )
115   PORT_CONFNAME( 0x03, 0x02, "HSGPL extension" )
116      PORT_CONFSETTING(    0x01, "Flash" )
117      PORT_CONFSETTING(    0x02, DEF_STR( On ) )
148118
149119   PORT_START( "HFDCDIP" )
150120   PORT_DIPNAME( 0xff, 0x55, "HFDC drive config" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
r9485r9486
159129      PORT_CONFSETTING( 0x01, "Realistic")
160130
161131   PORT_START( "EVPC-SW1" )
162   PORT_DIPNAME( 0x01, 0x00, "EVPC video mode" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 ) PORT_CHANGED( evpc_changed, (void *)0)
132   PORT_DIPNAME( 0x01, 0x00, "EVPC video mode" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
163133      PORT_DIPSETTING(    0x00, "PAL" )
164134      PORT_DIPSETTING(    0x01, "NTSC" )
165135
166136   PORT_START( "EVPC-SW3" )
167   PORT_DIPNAME( 0x01, 0x00, "EVPC charset" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 ) PORT_CHANGED( evpc_changed, (void *)1)
137   PORT_DIPNAME( 0x01, 0x00, "EVPC charset" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
168138      PORT_DIPSETTING(    0x00, DEF_STR( International ))
169139      PORT_DIPSETTING(    0x01, DEF_STR( German ))
170140
171141   PORT_START( "EVPC-SW4" )
172   PORT_DIPNAME( 0x01, 0x00, "EVPC VDP RAM" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 ) PORT_CHANGED( evpc_changed, (void *)2)
142   PORT_DIPNAME( 0x01, 0x00, "EVPC VDP RAM" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
173143      PORT_DIPSETTING(    0x00, "shifted" )
174144      PORT_DIPSETTING(    0x01, "not shifted" )
175145
176146   PORT_START( "EVPC-SW8" )
177   PORT_DIPNAME( 0x01, 0x00, "EVPC Configuration" ) PORT_CHANGED( evpc_changed, (void *)3)
147   PORT_DIPNAME( 0x01, 0x00, "EVPC Configuration" )
178148      PORT_DIPSETTING(    0x00, "DIP" )
179149      PORT_DIPSETTING(    0x01, "NOVRAM" )
180150
r9485r9486
189159      PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1)
190160      PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1)
191161
192
193162   /* 4 ports for keyboard and joystick */
194163   PORT_START("KEY0")   /* col 0 */
195164      PORT_BIT(0x0088, IP_ACTIVE_LOW, IPT_UNUSED)
r9485r9486
270239
271240INPUT_PORTS_END
272241
273
274static GFXDECODE_START( ti99_4p )
275GFXDECODE_END
276
277static const tms5220_interface ti99_4p_tms5220interface =
242DRIVER_INIT( ti99_4p )
278243{
279   DEVCB_NULL,               /* no IRQ callback */
280   DEVCB_NULL,               /* no Ready callback */
281#if 1
282   spchroms_read,            /* speech ROM read handler */
283   spchroms_load_address,      /* speech ROM load address handler */
284   spchroms_read_and_branch   /* speech ROM read and branch handler */
285#endif
286};
244}
287245
288/* F4 Character Displayer */
289static const gfx_layout ti99_6_charlayout =
246MACHINE_START( ti99_4p )
290247{
291   8, 6,               /* 8 x 6 characters */
292   64,               /* 64 characters */
293   1,               /* 1 bits per pixel */
294   { 0 },               /* no bitplanes */
295   /* x offsets */
296   { 0, 1, 2, 3, 4, 5, 6, 7 },
297   /* y offsets */
298   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8 },
299   8*6               /* every char takes 6 bytes */
300};
248}
301249
302static const gfx_layout ti99_7_charlayout =
303{
304   8, 7,               /* 8 x 7 characters */
305   95,               /* 95 characters */
306   1,               /* 1 bits per pixel */
307   { 0 },               /* no bitplanes */
308   /* x offsets */
309   { 0, 1, 2, 3, 4, 5, 6, 7 },
310   /* y offsets */
311   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8 },
312   8*7               /* every char takes 7 bytes */
313};
314
315static const gfx_layout ti99_8_charlayout =
316{
317   8, 8,               /* 8 x 8 characters */
318   64,               /* 64 characters */
319   1,               /* 1 bits per pixel */
320   { 0 },               /* no bitplanes */
321   /* x offsets */
322   { 0, 1, 2, 3, 4, 5, 6, 7 },
323   /* y offsets */
324   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
325   8*8               /* every char takes 8 bytes */
326};
327
328static const gfx_layout ti99_c_charlayout =
329{
330   8, 8,               /* 8 x 8 characters */
331   1,               /* 1 characters */
332   1,               /* 1 bits per pixel */
333   { 0 },               /* no bitplanes */
334   /* x offsets */
335   { 0, 1, 2, 3, 4, 5, 6, 7 },
336   /* y offsets */
337   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
338   8*8               /* every char takes 8 bytes */
339};
340
341static const gfx_layout ti99_24_charlayout =
342{
343   24, 24,               /* 24 x 24 characters */
344   1,               /* 1 characters */
345   1,               /* 1 bits per pixel */
346   { 0 },               /* no bitplanes */
347   /* x offsets */
348   { 0, 1, 2, 3, 4, 5, 6, 7, 64, 65, 66, 67, 68, 69, 70, 71, 128, 129, 130, 131, 132, 133, 134, 135 },
349   /* y offsets */
350   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8, 48*8, 49*8, 50*8, 51*8, 52*8, 53*8, 54*8, 55*8 },
351   24*24               /* every char takes 72 bytes */
352};
353
354static GFXDECODE_START( ti99b )
355   GFXDECODE_ENTRY( region_grom, 0x04b4, ti99_8_charlayout, 2, 2 )
356   GFXDECODE_ENTRY( region_grom, 0x06b4, ti99_7_charlayout, 2, 2 )
357   GFXDECODE_ENTRY( region_grom, 0x0950, ti99_24_charlayout, 2, 2 )
358   GFXDECODE_ENTRY( region_grom, 0x0998, ti99_c_charlayout, 2, 2 )
359GFXDECODE_END
360
361250/*
362    We use a DAC to emulate "audio gate", even though
363    a) there was no DAC in an actual TI99
364    b) this is a 2-level output (whereas a DAC provides a 256-level output...)
251    Reset the machine.
365252*/
366
367static const floppy_config ti99_4p_floppy_config =
253MACHINE_RESET( ti99_4p )
368254{
369   DEVCB_NULL,
370   DEVCB_NULL,
371   DEVCB_NULL,
372   DEVCB_NULL,
373   DEVCB_NULL,
374   FLOPPY_STANDARD_5_25_DSHD,
375   FLOPPY_OPTIONS_NAME(ti99),
376   NULL
377};
255   tms9901_set_single_int(machine->device("tms9901"), 12, 0);
256}
378257
379static const mm58274c_interface floppy_mm58274c_interface =
258INTERRUPT_GEN( ti99_4p_hblank_interrupt )
380259{
381   1,   /*  mode 24*/
382   0   /*  first day of week */
383};
260   v9938_interrupt(device->machine, 0);
261}
384262
385263/*
386264    Machine description.
r9485r9486
391269   MDRV_CPU_ADD("maincpu", TMS9900, 3000000)
392270   MDRV_CPU_PROGRAM_MAP(memmap)
393271   MDRV_CPU_IO_MAP(cru_map)
272   MDRV_CPU_VBLANK_INT_HACK(ti99_4p_hblank_interrupt, 262)   /* 262.5 in 60Hz, 312.5 in 50Hz */
394273
395   // MZ: Changed 263 to 262 to avoid blank image on startup
396   // The issue is somehow related to changing VReg 9 to 0 in an unconvenient situation
397   // but I could not identify it more closely. Seems to happen in v9938_interrupt.
398   MDRV_CPU_VBLANK_INT_HACK(ti99_4ev_hblank_interrupt, 262)   /* 262.5 in 60Hz, 312.5 in 50Hz */
274   /* video hardware */
275   MDRV_TI_V9938_ADD("video", 60, "screen", 2500, 512+32, (212+28)*2, tms9901_sg_set_int2)   
399276
400277   MDRV_MACHINE_START( ti99_4p )
401278   MDRV_MACHINE_RESET( ti99_4p )
402279
403   /* For HSGPL */
404   MDRV_NVRAM_HANDLER( ti99 )
405
406   /* video hardware */
407   MDRV_SCREEN_ADD("screen", RASTER)
408   MDRV_SCREEN_REFRESH_RATE(60)   /* or 50Hz */
409   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
410   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
411   MDRV_SCREEN_SIZE(512+32, (212+28)*2)
412   MDRV_SCREEN_VISIBLE_AREA(0, 512+32 - 1, 0, (212+28)*2 - 1)
413
414280// Didn't work, probably just done wrong by me:
415281//  MDRV_TIMER_ADD_SCANLINE("v9938_scanline", ti99_4ev_scanline_interrupt , "screen", 0, 1)
416282
417   MDRV_PALETTE_LENGTH(512)
418
419   MDRV_PALETTE_INIT(v9938)
420   MDRV_VIDEO_START(ti99_4ev)
421   MDRV_VIDEO_UPDATE(generic_bitmapped)
422   MDRV_GFXDECODE(ti99b)
423
424283   /* sound hardware */
425284   MDRV_SPEAKER_STANDARD_MONO("mono")
426285   MDRV_SOUND_ADD("dac", DAC, 0)
427286   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
428287   MDRV_SOUND_WAVE_ADD("wave", "cassette")
429288   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
430   MDRV_SOUND_ADD("sn76496", SN76496, 3579545)   /* 3.579545 MHz */
289   MDRV_SOUND_ADD("soundgen", SN76496, 3579545)   /* 3.579545 MHz */
431290   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
432   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
433   MDRV_SOUND_CONFIG(ti99_4p_tms5220interface)
434   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
435291
436   /* devices */
437   MDRV_PBOX_ADD( "per_exp_box", TRUE, tms9901_set_int1, NULL )
438
439/*  MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
440    MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) */
441
442   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
443
444292   /* tms9901 */
445   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
293   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4p)
446294
447   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
448
449   /* rtc */
450   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
451
452   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
453
454   MDRV_FLOPPY_4_DRIVES_ADD(ti99_4p_floppy_config)
455   MDRV_MFMHD_3_DRIVES_ADD()
456
457   MDRV_SMARTMEDIA_ADD("smartmedia")
458
459   MDRV_TI99_4_RS232_CARD_ADD("rs232")
295   /* devices */
296   MDRV_PBOXSG_ADD( "peribox", card_extint, card_notconnected, card_ready )
297   MDRV_SGCPUB_ADD( "sgcpu_board" )
298   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
460299MACHINE_CONFIG_END
461300
462301
463302ROM_START(ti99_4p)
464303   /*CPU memory space*/
465   ROM_REGION16_BE(region_cpu1_len_4p, "maincpu", 0)
304   ROM_REGION16_BE(0x10000, "maincpu", 0)
466305   ROM_LOAD16_BYTE("sgcpu_hb.bin", 0x0000, 0x8000, CRC(aa100730) SHA1(35e585b2dcd3f2a0005bebb15ede6c5b8c787366) ) /* system ROMs */
467306   ROM_LOAD16_BYTE("sgcpu_lb.bin", 0x0001, 0x8000, CRC(2a5dc818) SHA1(dec141fe2eea0b930859cbe1ebd715ac29fa8ecb) ) /* system ROMs */
468
469   /*GROM memory space*/
470   ROM_REGION(0x10000, region_grom, 0)
471   ROM_LOAD("994agr38.bin", 0x0000, 0x6000, CRC(bdd9f09b) SHA1(9b058a55d2528d2a6a69d7081aa296911ed7c0de)) /* system GROMs */
472
473   /*DSR ROM space*/
474   ROM_REGION(region_dsr_len, region_dsr, 0)
475   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5) ) /* TI disk DSR ROM */
476#if HAS_99CCFDC
477   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
478#endif
479   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
480   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
481   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
482   ROM_LOAD("evpcdsr.bin", offset_evpc_dsr, 0x10000, CRC(a062b75d) SHA1(6e8060f86e3bb9c36f244d88825e3fe237bfe9a9)) /* evpc DSR ROM */
483
484   /* HSGPL memory space */
485   ROM_REGION(region_hsgpl_len, region_hsgpl, ROMREGION_ERASEFF)
486
487   /*TMC0285 ROM space*/
488   ROM_REGION(0x8000, region_speech_rom, 0)
489   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
490307ROM_END
491308
492309/*    YEAR  NAME      PARENT   COMPAT   MACHINE      INPUT    INIT      COMPANY     FULLNAME */
src/mess/drivers/ti99_4x.c
r9485r9486
2222#include "deprecat.h"
2323#include "cpu/tms9900/tms9900.h"
2424#include "sound/sn76496.h"
25#include "sound/tms5220.h"
25
2626#include "sound/wave.h"
2727#include "video/v9938.h"
28#include "machine/ti99_4x.h"
2928#include "machine/tms9901.h"
30#include "machine/tms9902.h"
31#include "audio/spchroms.h"
32#include "devices/ti99_peb.h"
33#include "machine/994x_ser.h"
34#include "machine/99_dsk.h"
35#include "machine/99_ide.h"
36#include "machine/99_hsgpl.h"
37#include "devices/flopdrv.h"
38#include "devices/harddriv.h"
3929#include "devices/cassette.h"
40#include "machine/smartmed.h"
41#include "machine/idectrl.h"
42#include "machine/smc92x4.h"
43#include "machine/mm58274c.h"
44#include "machine/rtc65271.h"
45#include "devices/ti99cart.h"
46#include "formats/ti99_dsk.h"
47#include "devices/ti99_hd.h"
4830
31#include "machine/ti99/tiboard.h"
32
33#include "machine/ti99/videowrp.h"
34
35#include "machine/ti99/peribox.h"
36#include "machine/ti99/crubus.h"
37#include "machine/ti99/datamux.h"
38#include "machine/ti99/grom.h"
39#include "machine/ti99/gromport.h"
40#include "machine/ti99/mecmouse.h"
41#include "machine/ti99/handset.h"
42
4943/*
5044    Memory map
5145*/
52
5346static ADDRESS_MAP_START(memmap, ADDRESS_SPACE_PROGRAM, 16)
5447   ADDRESS_MAP_GLOBAL_MASK(0xffff)
5548   AM_RANGE(0x0000, 0x1fff) AM_ROM                              /*system ROM*/
56   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*lower 8kb of RAM extension - installed dynamically*/
57   AM_RANGE(0x4000, 0x5fff) AM_DEVREADWRITE("per_exp_box", ti99_4x_peb_r, ti99_4x_peb_w)   /*DSR ROM space*/
58   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(ti99_cart_r, ti99_cart_w)     /*cartridge memory*/
59//  AM_RANGE(0x6000, 0x7fff) AM_DEVREADWRITE("ti99_multicart", ti99_multicart_r, ti99_multicart_w)
60   AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAMBANK("bank1")         /*RAM PAD, mirrored 4 times*/
61   AM_RANGE(0x8400, 0x87ff) AM_READWRITE(ti99_nop_8_r, ti99_wsnd_w)   /*soundchip write*/
62   AM_RANGE(0x8800, 0x8bff) AM_READWRITE(ti99_rvdp_r, ti99_nop_8_w)   /*vdp read*/
63   AM_RANGE(0x8C00, 0x8fff) AM_READWRITE(ti99_nop_8_r, ti99_wvdp_w)   /*vdp write*/
64   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*speech read - installed dynamically*/
65   AM_RANGE(0x9400, 0x97ff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*speech write - installed dynamically*/
66   AM_RANGE(0x9800, 0x9bff) AM_READWRITE(ti99_grom_r, ti99_nop_8_w)   /*GPL read*/
67   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(ti99_nop_8_r, ti99_grom_w)   /*GPL write*/
68   AM_RANGE(0xa000, 0xffff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*upper 24kb of RAM extension - installed dynamically*/
49   AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAM         /*RAM PAD, mirrored 4 times*/
50   AM_RANGE(0x8800, 0x8bff) AM_DEVREADWRITE("video", ti_tms991x_r16, ti_video_wnop)   /*vdp read*/
51   AM_RANGE(0x8C00, 0x8fff) AM_DEVREADWRITE("video", ti_video_rnop, ti_tms991x_w16)   /*vdp write*/
52   AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("datamux_16_8", ti99_dmux_r, ti99_dmux_w)
6953ADDRESS_MAP_END
7054
7155static ADDRESS_MAP_START(memmap_4ev, ADDRESS_SPACE_PROGRAM, 16)
7256   ADDRESS_MAP_GLOBAL_MASK(0xffff)
73   AM_RANGE(0x0000, 0x1fff) AM_ROM                  /*system ROM*/
74   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*lower 8kb of RAM extension - installed dynamically*/
75   AM_RANGE(0x4000, 0x5fff) AM_DEVREADWRITE("per_exp_box", ti99_4x_peb_r, ti99_4x_peb_w)   /*DSR ROM space*/
76   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(ti99_cart_r, ti99_cart_w)     /*cartridge memory*/
77//  AM_RANGE(0x6000, 0x7fff) AM_DEVREADWRITE("ti99_multicart", ti99_multicart_r, ti99_multicart_w)
78   AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAMBANK("bank1")         /*RAM PAD, mirrored 4 times*/
79   AM_RANGE(0x8400, 0x87ff) AM_READWRITE(ti99_nop_8_r, ti99_wsnd_w)   /*soundchip write*/
80   AM_RANGE(0x8800, 0x8bff) AM_READWRITE(ti99_rv38_r, ti99_nop_8_w)   /*vdp read*/
81   AM_RANGE(0x8C00, 0x8fff) AM_READWRITE(ti99_nop_8_r, ti99_wv38_w)   /*vdp write*/
82   AM_RANGE(0x9000, 0x93ff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*speech read - installed dynamically*/
83   AM_RANGE(0x9400, 0x97ff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*speech write - installed dynamically*/
84   AM_RANGE(0x9800, 0x9bff) AM_READWRITE(ti99_grom_r, ti99_nop_8_w)   /*GPL read*/
85   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(ti99_nop_8_r, ti99_grom_w)   /*GPL write*/
86   AM_RANGE(0xa000, 0xffff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w)   /*upper 24kb of RAM extension - installed dynamically*/
57   AM_RANGE(0x0000, 0x1fff) AM_ROM                              /*system ROM*/
58   AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAM         /*RAM PAD, mirrored 4 times*/
59   AM_RANGE(0x8800, 0x8bff) AM_DEVREADWRITE("video", ti_v9938_r16, ti_video_wnop)   /*vdp read*/
60   AM_RANGE(0x8C00, 0x8fff) AM_DEVREADWRITE("video", ti_video_rnop, ti_v9938_w16)   /*vdp write*/
61   AM_RANGE(0x0000, 0xffff) AM_DEVREADWRITE("datamux_16_8", ti99_dmux_r, ti99_dmux_w)
8762ADDRESS_MAP_END
8863
8964/*
9065    CRU map
9166*/
92
9367static ADDRESS_MAP_START(cru_map, ADDRESS_SPACE_IO, 8)
9468   AM_RANGE(0x0000, 0x007f) AM_DEVREAD("tms9901", tms9901_cru_r)
95   AM_RANGE(0x0080, 0x00ff) AM_DEVREAD("ti99_multicart", ti99_multicart_cru_r)   /* SuperSpace */
96   AM_RANGE(0x0100, 0x01ff) AM_DEVREAD("per_exp_box", ti99_4x_peb_cru_r)
69   AM_RANGE(0x0000, 0x01ff) AM_DEVREAD("crubus", ti99_crubus_r )
9770
9871   AM_RANGE(0x0000, 0x03ff) AM_DEVWRITE("tms9901", tms9901_cru_w)
99   AM_RANGE(0x0400, 0x07ff) AM_DEVWRITE("ti99_multicart", ti99_multicart_cru_w)   /* SuperSpace */
100   AM_RANGE(0x0800, 0x0fff) AM_DEVWRITE("per_exp_box", ti99_4x_peb_cru_w)
72   AM_RANGE(0x0000, 0x0fff) AM_DEVWRITE("crubus", ti99_crubus_w )
10173ADDRESS_MAP_END
10274
10375/*
10476    Input ports, used by machine code for TI keyboard and joystick emulation.
10577*/
10678
79INPUT_CHANGED( gk_changed )
80{
81   running_device *cartsys = field->port->machine->device("gromport");
82   set_gk_switches(cartsys, (UINT8)((UINT64)param&0x07), newval); 
83}
84
10785/* TI99/4a: 48-key keyboard, plus two optional joysticks (2 shift keys) */
10886static INPUT_PORTS_START(ti99_4a)
10987
11088   PORT_START( "RAM" )   /* config */
11189   PORT_CONFNAME( 0x07, 0x01, "RAM extension" )
11290      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
113      PORT_CONFSETTING(    0x01, "Texas Instruments 32 KiB" )
114      PORT_CONFSETTING(    0x02, "Super AMS 1MiB" )
115      PORT_CONFSETTING(    0x03, "Foundation 128 KiB" )
116      PORT_CONFSETTING(    0x04, "Foundation 512 KiB" )
117      PORT_CONFSETTING(    0x05, "Myarc 128 KiB" )
118      PORT_CONFSETTING(    0x06, "Myarc 512 KiB" )
91      PORT_CONFSETTING(    0x01, "Console 32 KiB (16 bit)" )
92      PORT_CONFSETTING(    0x02, "TI Memexp card 32 KiB" )
93      PORT_CONFSETTING(    0x03, "Super AMS 1MiB" )
94      PORT_CONFSETTING(    0x07, "Myarc 512 KiB" )
11995
12096   PORT_START( "SPEECH" )
12197   PORT_CONFNAME( 0x01, 0x01, "Speech synthesizer" )
r9485r9486
128104      PORT_CONFSETTING(    0x01, "TI SD Floppy Controller" )
129105      PORT_CONFSETTING(    0x02, "SNUG BwG Controller" )
130106      PORT_CONFSETTING(    0x03, "Myarc HFDC" )
131//      PORT_CONFSETTING(    0x04, "Corcomp" )
132107
133108   PORT_START( "HDCTRL" )
134109   PORT_CONFNAME( 0x03, 0x00, "HD controller" )
135110      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
136//      PORT_CONFSETTING(    0x01, "Nouspikel IDE Controller" )
111      PORT_CONFSETTING(    0x01, "Nouspikel IDE Controller" )
137112//      PORT_CONFSETTING(    0x02, "WHTech SCSI Controller" )
138113   PORT_CONFNAME( 0x04, 0x00, "USB-SM card" )
139114      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
r9485r9486
146121
147122   /* Flash setting is used to flash an empty HSGPL DSR ROM */
148123   PORT_START( "EXTCARD" )
149   PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" ) PORT_CHANGED( hsgpl_changed, NULL)
124   PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" )
150125      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
151126      PORT_CONFSETTING(    0x01, "Flash" )
152127      PORT_CONFSETTING(    0x02, DEF_STR( On ) )
r9485r9486
160135      PORT_CONFSETTING(    0x01, "Mechatronics Mouse" )
161136
162137   PORT_START( "CARTSLOT" )
163   PORT_DIPNAME( 0x0f, 0x00, "Cartridge slot" )
164      PORT_DIPSETTING(    0x00, "Auto" )
165      PORT_DIPSETTING(    0x01, "Slot 1" )
166      PORT_DIPSETTING(    0x02, "Slot 2" )
167      PORT_DIPSETTING(    0x03, "Slot 3" )
168      PORT_DIPSETTING(    0x04, "Slot 4" )
169      PORT_DIPSETTING(    0x0f, "GRAM Kracker" )
138   PORT_DIPNAME( 0x0f, CART_AUTO, "Cartridge slot" )
139      PORT_DIPSETTING(    CART_AUTO, "Auto" )
140      PORT_DIPSETTING(    CART_1, "Slot 1" )
141      PORT_DIPSETTING(    CART_2, "Slot 2" )
142      PORT_DIPSETTING(    CART_3, "Slot 3" )
143      PORT_DIPSETTING(    CART_4, "Slot 4" )
144      PORT_DIPSETTING(    CART_GK, "GRAM Kracker" )
170145
171146   /* GRAM Kracker Support */
172147   PORT_START( "GKSWITCH1" )
173   PORT_DIPNAME( 0x01, 0x01, "GK switch 1" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)1)
174      PORT_DIPSETTING(    0x00, "GK Off" )
175      PORT_DIPSETTING(    0x01, DEF_STR( Normal ) )
148   PORT_DIPNAME( 0x01, GK_NORMAL, "GK switch 1" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)1)
149      PORT_DIPSETTING(    GK_OFF, "GK Off" )
150      PORT_DIPSETTING(    GK_NORMAL, DEF_STR( Normal ) )
176151
177152   PORT_START( "GKSWITCH2" )
178   PORT_DIPNAME( 0x01, 0x01, "GK switch 2" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)2)
179      PORT_DIPSETTING(    0x00, "GRAM 0" )
180      PORT_DIPSETTING(    0x01, "Op Sys" )
153   PORT_DIPNAME( 0x01, GK_OPSYS, "GK switch 2" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)2)
154      PORT_DIPSETTING(    GK_GRAM0, "GRAM 0" )
155      PORT_DIPSETTING(    GK_OPSYS, "Op Sys" )
181156
182157   PORT_START( "GKSWITCH3" )
183   PORT_DIPNAME( 0x01, 0x01, "GK switch 3" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)3)
184      PORT_DIPSETTING(    0x00, "GRAM 1-2" )
185      PORT_DIPSETTING(    0x01, "TI BASIC" )
158   PORT_DIPNAME( 0x01, GK_TIBASIC, "GK switch 3" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)3)
159      PORT_DIPSETTING(    GK_GRAM12, "GRAM 1-2" )
160      PORT_DIPSETTING(    GK_TIBASIC, "TI BASIC" )
186161
187162   PORT_START( "GKSWITCH4" )
188   PORT_DIPNAME( 0x03, 0x01, "GK switch 4" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)4)
189      PORT_DIPSETTING(    0x00, "Bank 1" )
190      PORT_DIPSETTING(    0x01, "W/P" )
191      PORT_DIPSETTING(    0x02, "Bank 2" )
163   PORT_DIPNAME( 0x03, GK_WP, "GK switch 4" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)4)
164      PORT_DIPSETTING(    GK_BANK1, "Bank 1" )
165      PORT_DIPSETTING(    GK_WP, "W/P" )
166      PORT_DIPSETTING(    GK_BANK2, "Bank 2" )
192167
193168   PORT_START( "GKSWITCH5" )
194   PORT_DIPNAME( 0x01, 0x00, "GK switch 5" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)5)
195      PORT_DIPSETTING(    0x00, "Loader On" )
196      PORT_DIPSETTING(    0x01, "Loader Off" )
169   PORT_DIPNAME( 0x01, GK_LDON, "GK switch 5" ) PORT_CONDITION( "CARTSLOT", 0x0f, PORTCOND_EQUALS, 0x0f )  PORT_CHANGED( gk_changed, (void *)5)
170      PORT_DIPSETTING(    GK_LDON, "Loader On" )
171      PORT_DIPSETTING(    GK_LDOFF, "Loader Off" )
197172
173   PORT_START( "BWGDIP1" )
174   PORT_DIPNAME( 0x01, 0x00, "BwG step rate" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 )
175      PORT_DIPSETTING( 0x00, "6 ms")
176      PORT_DIPSETTING( 0x01, "20 ms")
177
178   PORT_START( "BWGDIP2" )
179   PORT_DIPNAME( 0x01, 0x00, "BwG date/time display" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 )
180      PORT_DIPSETTING( 0x00, "Hide")
181      PORT_DIPSETTING( 0x01, "Show")
182     
183   PORT_START( "BWGDIP34" )
184   PORT_DIPNAME( 0x03, 0x00, "BwG drives" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x02 )
185      PORT_DIPSETTING( 0x00, "DSK1 only")
186      PORT_DIPSETTING( 0x01, "DSK1-DSK2")
187      PORT_DIPSETTING( 0x02, "DSK1-DSK3")
188      PORT_DIPSETTING( 0x03, "DSK1-DSK4")
189
198190   PORT_START( "HFDCDIP" )
199191   PORT_DIPNAME( 0xff, 0x55, "HFDC drive config" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
200192      PORT_DIPSETTING( 0x00, "40 track, 16 ms")
r9485r9486
307299static INPUT_PORTS_START(ti99_4ev)
308300   PORT_INCLUDE(ti99_4a)
309301   PORT_START( "EVPC-SW1" )
310   PORT_DIPNAME( 0x01, 0x00, "EVPC video mode" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 ) PORT_CHANGED( evpc_changed, (void *)0)
302   PORT_DIPNAME( 0x01, 0x00, "EVPC video mode" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
311303      PORT_DIPSETTING(    0x00, "PAL" )
312304      PORT_DIPSETTING(    0x01, "NTSC" )
313305
314306   PORT_START( "EVPC-SW3" )
315   PORT_DIPNAME( 0x01, 0x00, "EVPC charset" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 ) PORT_CHANGED( evpc_changed, (void *)1)
307   PORT_DIPNAME( 0x01, 0x00, "EVPC charset" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
316308      PORT_DIPSETTING(    0x00, DEF_STR( International ))
317309      PORT_DIPSETTING(    0x01, DEF_STR( German ))
318310
319311   PORT_START( "EVPC-SW4" )
320   PORT_DIPNAME( 0x01, 0x00, "EVPC VDP RAM" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 ) PORT_CHANGED( evpc_changed, (void *)2)
312   PORT_DIPNAME( 0x01, 0x00, "EVPC VDP RAM" ) PORT_CONDITION( "EVPC-SW8", 0x01, PORTCOND_EQUALS, 0x00 )
321313      PORT_DIPSETTING(    0x00, "shifted" )
322314      PORT_DIPSETTING(    0x01, "not shifted" )
323315
324316   PORT_START( "EVPC-SW8" )
325   PORT_DIPNAME( 0x01, 0x00, "EVPC Configuration" ) PORT_CHANGED( evpc_changed, (void *)3)
317   PORT_DIPNAME( 0x01, 0x00, "EVPC Configuration" )
326318      PORT_DIPSETTING(    0x00, "DIP" )
327319      PORT_DIPSETTING(    0x01, "NOVRAM" )
328320
r9485r9486
336328
337329   PORT_START( "RAM" )   /* config */
338330   PORT_CONFNAME( 0x07, 0x01, "RAM extension" )
339      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
340      PORT_CONFSETTING(    0x01, "Texas Instruments 32 KiB" )
341      PORT_CONFSETTING(    0x02, "Super AMS 1MiB" )
342      PORT_CONFSETTING(    0x03, "Foundation 128 KiB" )
343      PORT_CONFSETTING(    0x04, "Foundation 512 KiB" )
344      PORT_CONFSETTING(    0x05, "Myarc 128 KiB" )
345      PORT_CONFSETTING(    0x06, "Myarc 512 KiB" )
331      PORT_CONFSETTING(    0x01, "Console 32 KiB (16 bit)" )
332      PORT_CONFSETTING(    0x02, "Texas Instruments 32 KiB" )
333      PORT_CONFSETTING(    0x03, "Super AMS 1MiB" )
334      PORT_CONFSETTING(    0x04, "Foundation 128 KiB" )
335      PORT_CONFSETTING(    0x05, "Foundation 512 KiB" )
336      PORT_CONFSETTING(    0x06, "Myarc 128 KiB" )
337      PORT_CONFSETTING(    0x07, "Myarc 512 KiB" )
346338
347339   PORT_START( "SPEECH" )
348340   PORT_CONFNAME( 0x01, 0x01, "Speech synthesizer" )
r9485r9486
360352   PORT_START( "HDCTRL" )
361353   PORT_CONFNAME( 0x03, 0x00, "HD controller" )
362354      PORT_CONFSETTING(    0x00, DEF_STR( None ) )
363//      PORT_CONFSETTING(    0x01, "Nouspikel IDE Controller" )
355      PORT_CONFSETTING(    0x01, "Nouspikel IDE Controller" )
364356//      PORT_CONFSETTING(    0x02, "WHTech SCSI Controller" )
365357   PORT_CONFNAME( 0x08, 0x00, "USB-SM card" )
366358      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
r9485r9486
372364      PORT_CONFSETTING(    0x01, "TI RS-232 card" )
373365
374366   PORT_START( "EXTCARD" )
375   PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" ) PORT_CHANGED( hsgpl_changed, NULL)
367   PORT_CONFNAME( 0x03, 0x00, "HSGPL extension" )
376368      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
377369      PORT_CONFSETTING(    0x01, "Flash" )
378370      PORT_CONFSETTING(    0x02, DEF_STR( On ) )
379   PORT_CONFNAME( 0x04, 0x00, "P-Code card" )
380      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
381      PORT_CONFSETTING(    0x04, DEF_STR( On ) )
382371
383372   PORT_START( "HCI" )
384373   PORT_CONFNAME( 0x01, 0x00, "Mouse support" )
r9485r9486
723712   GFXDECODE_ENTRY( region_grom, 0x0998, ti99_c_charlayout, 2, 2 )
724713GFXDECODE_END
725714
715static const TMS9928a_interface tms9918_interface =
716{
717   TMS99x8,
718   0x4000,
719   15, 15,
720   tms9901_set_int2
721};
726722
723static const TMS9928a_interface tms9929_interface =
724{
725   TMS9929,
726   0x4000,
727   13, 13,
728   tms9901_set_int2
729};
730
731static const TMS9928a_interface tms9918a_interface =
732{
733   TMS99x8A,
734   0x4000,
735   15, 15,
736   tms9901_set_int2
737};
738
739
740static const TMS9928a_interface tms9929a_interface =
741{
742   TMS9929A,
743   0x4000,
744   13, 13,
745   tms9901_set_int2
746};
747
727748/*
728    TMS5220 speech synthesizer
729    Note that in the real hardware, the predecessor TMC0285 was used.
749   Format:
750   Name, address bus mask, select pattern, write select bit(s), read8z function, write8 function, Condition name, bits which must be set, bits which must not be set
751   
752   Multiple devices may have the same select pattern; as in the real hardware,
753   care must be taken that only one device actually responds. In the case of
754   GROMs, each chip has an internal address counter and an ID, and the chip
755   only responds when the ID and the most significant 3 bits match.
756   If the HSGPL extension is active, the console GROMs should be removed. In
757   reality, the chips should be pulled out of their sockets. Here we simulate
758   this by a condition.
730759*/
731static const tms5220_interface ti99_4x_tms5220interface =
760static const bus_device dmux_devices[] =
732761{
733   DEVCB_NULL,               /* no IRQ callback */
734   DEVCB_NULL,               /* no Ready callback */
735   spchroms_read,            /* speech ROM read handler */
736   spchroms_load_address,      /* speech ROM load address handler */
737   spchroms_read_and_branch   /* speech ROM read and branch handler */
762   { "console_grom_0",     0xfc01, 0x9800, 0x0400, ti99grom_rz,  ti99grom_w, "EXTCARD", 0x00, 0x02 },
763   { "console_grom_1",     0xfc01, 0x9800, 0x0400, ti99grom_rz,  ti99grom_w, "EXTCARD", 0x00, 0x02 },
764   { "console_grom_2",     0xfc01, 0x9800, 0x0400, ti99grom_rz,  ti99grom_w, "EXTCARD", 0x00, 0x02 },
765   { "soundgen",         0xfc01, 0x8400, 0x0000, NULL,         sn76496_w, NULL, 0, 0 },
766   { "gromport",         0xfc01, 0x9800, 0x0400, gromportg_rz, gromportg_w,  NULL, 0, 0 },
767   { "gromport",         0xe000, 0x6000, 0x0000, gromportr_rz, gromportr_w,  NULL, 0, 0 },
768   { "peribox",          0x0000, 0x0000, 0x0000, ti99_peb_data_rz, ti99_peb_data_w, 0, 0 },  // Peribox needs all addresses
769   { NULL, 0, 0, 0, NULL, NULL, 0, 0  }
738770};
739771
740static const mm58274c_interface floppy_mm58274c_interface =
772static const cruconf_device cru_devices[] =
741773{
742   1,   /*  mode 24*/
743   0   /*  first day of week */
774   { "gromport", 0xf800, 0x0800, gromportc_rz, gromportc_w },            // Check: Is this really limited?
775   { "peribox",  0x0000, 0x0000, ti99_peb_cru_rz, ti99_peb_cru_w },    // Peribox needs all addresses
776   { NULL, 0, 0, NULL, NULL }
744777};
745778
779MACHINE_RESET( ti99_4 )
780{
781}
746782
747static const floppy_config ti99_4_floppy_config =
783MACHINE_RESET( ti99_4a )
748784{
749   DEVCB_NULL,
750   DEVCB_NULL,
751   DEVCB_NULL,
752   DEVCB_NULL,
753   DEVCB_NULL,
754   FLOPPY_STANDARD_5_25_DSHD,
755   FLOPPY_OPTIONS_NAME(ti99),
756   NULL
757};
785}
758786
759787static MACHINE_CONFIG_START( ti99_4_60hz, driver_device )
760788   /* basic machine hardware */
r9485r9486
764792   MDRV_CPU_IO_MAP(cru_map)
765793   MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt)
766794
767   MDRV_MACHINE_START( ti99_4_60hz )
768   MDRV_MACHINE_RESET( ti99 )
795   MDRV_MACHINE_RESET( ti99_4 )
769796
770   /* For HSGPL */
771   MDRV_NVRAM_HANDLER( ti99 )
772
773797   /* video hardware */
774   MDRV_FRAGMENT_ADD(tms9928a)
775   MDRV_SCREEN_MODIFY("screen")
776   MDRV_SCREEN_REFRESH_RATE(60)
777   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
798   // MDRV_FRAGMENT_ADD(tms9928a)
799   // MDRV_SCREEN_MODIFY("screen")
800   // MDRV_SCREEN_REFRESH_RATE(60)
801   // MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
802
803   MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9918_interface)   
778804   MDRV_GFXDECODE(ti99)
779805
780806   /* sound hardware */
781807   MDRV_SPEAKER_STANDARD_MONO("mono")
808   MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8)   /* 3.579545 MHz */
809   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
810
782811   MDRV_SOUND_WAVE_ADD("wave.1", "cassette1")
783812   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
784   MDRV_SOUND_WAVE_ADD("wave.2", "cassette2")
785   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
786   MDRV_SOUND_ADD("sn76496", SN94624, 3579545/8)   /* 3.579545 MHz */
787   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
788   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
789   MDRV_SOUND_CONFIG(ti99_4x_tms5220interface)
790   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
791813
792   /* devices */
793   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
794
795   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
796   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback)
797
798   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
799   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
800
801   /* rtc */
802   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
814   MDRV_TI994_BOARD_ADD( "ti_board" )
815   
803816   /* tms9901 */
804   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
817   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4)
805818
806   /* to be moved to controller */
807   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
808   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
819   MDRV_CRUBUS_ADD( "crubus", cru_devices )
820   MDRV_DMUX_ADD( "datamux_16_8", dmux_devices )
821   
822   MDRV_GROM_ADD( "console_grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
823   MDRV_GROM_ADD( "console_grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
824   MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
809825
810   MDRV_FLOPPY_4_DRIVES_ADD(ti99_4_floppy_config)
811   MDRV_MFMHD_3_DRIVES_ADD()
826   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
827   
828   MDRV_PBOX4_ADD( "peribox", console_extint, console_notconnected, console_ready )
812829
813   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
830   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
831   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )   
814832
815   MDRV_SMARTMEDIA_ADD("smartmedia")
816
817   MDRV_TI99_4_RS232_CARD_ADD("rs232")
833   MDRV_MECMOUSE_ADD( "mecmouse" )
834   MDRV_HANDSET_ADD( "handset", "tms9901" )
818835MACHINE_CONFIG_END
819836
820837static MACHINE_CONFIG_START( ti99_4_50hz, driver_device )
r9485r9486
825842   MDRV_CPU_IO_MAP(cru_map)
826843   MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt)
827844
828   MDRV_MACHINE_START( ti99_4_50hz )
829   MDRV_MACHINE_RESET( ti99 )
845   MDRV_MACHINE_RESET( ti99_4 )
830846
831   /* For HSGPL */
832   MDRV_NVRAM_HANDLER( ti99 )
833
834847   /* video hardware */
835   MDRV_FRAGMENT_ADD(tms9928a)
836   MDRV_SCREEN_MODIFY("screen")
837   MDRV_SCREEN_REFRESH_RATE(50)
838   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
839   MDRV_GFXDECODE(ti99)
848   MDRV_TI_TMS991x_ADD("video", tms9928a, 50, "screen", 2500, &tms9929_interface)   
840849
850   MDRV_GFXDECODE(ti99)
851   
841852   /* sound hardware */
842853   MDRV_SPEAKER_STANDARD_MONO("mono")
843   MDRV_SOUND_ADD("sn76496", SN94624, 3579545/8)   /* 3.579545 MHz */
854   MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8)   /* 3.579545 MHz */
844855   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
845   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
846   MDRV_SOUND_CONFIG(ti99_4x_tms5220interface)
847   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
856
848857   MDRV_SOUND_WAVE_ADD("wave.1", "cassette1")
849858   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
850859
851   /* devices */
852   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
860   MDRV_TI994_BOARD_ADD( "ti_board" )
853861
854   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt
855   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback)
856
857   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
858   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
859
860   /* rtc */
861   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
862862   /* tms9901 */
863   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
863   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4)
864864
865   /* to be moved to controller */
866   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
867   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
865   MDRV_CRUBUS_ADD( "crubus", cru_devices )
866   MDRV_DMUX_ADD( "datamux_16_8", dmux_devices )
868867
869   MDRV_FLOPPY_4_DRIVES_ADD(ti99_4_floppy_config)
870   MDRV_MFMHD_3_DRIVES_ADD()
868   MDRV_GROM_ADD( "console_grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
869   MDRV_GROM_ADD( "console_grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
870   MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
871871
872   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
872   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
873   
874   MDRV_PBOX4_ADD( "peribox", console_extint, console_notconnected, console_ready )
873875
874   MDRV_SMARTMEDIA_ADD("smartmedia")
875
876   MDRV_TI99_4_RS232_CARD_ADD("rs232")
876   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
877   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
878   
879   MDRV_MECMOUSE_ADD( "mecmouse" )
880   MDRV_HANDSET_ADD( "handset", "tms9901" )
877881MACHINE_CONFIG_END
878882
879883static MACHINE_CONFIG_START( ti99_4a_60hz, driver_device )
r9485r9486
884888   MDRV_CPU_IO_MAP(cru_map)
885889   MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt)
886890
887   MDRV_MACHINE_START( ti99_4a_60hz )
888   MDRV_MACHINE_RESET( ti99 )
891   MDRV_MACHINE_RESET( ti99_4a )
889892
890   /* For HSGPL and EVPC */
891   MDRV_NVRAM_HANDLER( ti99 )
892
893893   /* video hardware */
894   MDRV_FRAGMENT_ADD(tms9928a)
895   MDRV_SCREEN_MODIFY("screen")
896   MDRV_SCREEN_REFRESH_RATE(60)
897   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
894   MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9918a_interface)   
898895   MDRV_GFXDECODE(ti99a)
899
896   
900897   /* sound hardware */
901898   MDRV_SPEAKER_STANDARD_MONO("mono")
902   MDRV_SOUND_ADD("sn76496", SN94624, 3579545/8)   /* 3.579545 MHz SN94624N */
899   MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8)   /* 3.579545 MHz */
903900   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
904   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
905   MDRV_SOUND_CONFIG(ti99_4x_tms5220interface)
906   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
901
907902   MDRV_SOUND_WAVE_ADD("wave.1", "cassette1")
908903   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
909904
910   /* devices */
911   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
905   MDRV_TI994A_BOARD_ADD( "ti_board" )
912906
913   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
914   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback)
915
916   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
917   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
918
919   /* rtc */
920   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
921
922907   /* tms9901 */
923   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
908   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4a)
924909
925   /* to be moved to controller */
926   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
927   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
910   MDRV_CRUBUS_ADD( "crubus", cru_devices )
911   MDRV_DMUX_ADD( "datamux_16_8", dmux_devices )
928912
929   MDRV_FLOPPY_4_DRIVES_ADD(ti99_4_floppy_config)
930   MDRV_MFMHD_3_DRIVES_ADD()
913   MDRV_GROM_ADD( "console_grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
914   MDRV_GROM_ADD( "console_grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
915   MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
931916
932   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
917   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
918   
919   MDRV_PBOX4A_ADD( "peribox", console_extint, console_notconnected, console_ready )
933920
934   MDRV_SMARTMEDIA_ADD("smartmedia")
921   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
922   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
935923
936   MDRV_TI99_4_RS232_CARD_ADD("rs232")
924   MDRV_MECMOUSE_ADD( "mecmouse" )
937925MACHINE_CONFIG_END
938926
939
940927static MACHINE_CONFIG_START( ti99_4a_50hz, driver_device )
941928   /* basic machine hardware */
942929   /* TMS9900 CPU @ 3.0 MHz */
r9485r9486
944931   MDRV_CPU_PROGRAM_MAP(memmap)
945932   MDRV_CPU_IO_MAP(cru_map)
946933   MDRV_CPU_VBLANK_INT("screen", ti99_vblank_interrupt)
934   
935   MDRV_MACHINE_RESET( ti99_4a )
947936
948   MDRV_MACHINE_START( ti99_4a_50hz )
949   MDRV_MACHINE_RESET( ti99 )
950
951   /* For HSGPL */
952   MDRV_NVRAM_HANDLER( ti99 )
953
954937   /* video hardware */
955   MDRV_FRAGMENT_ADD(tms9928a)
956   MDRV_SCREEN_MODIFY("screen")
957   MDRV_SCREEN_REFRESH_RATE(50)
958   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
938   MDRV_TI_TMS991x_ADD("video", tms9928a, 60, "screen", 2500, &tms9929a_interface)   
959939   MDRV_GFXDECODE(ti99a)
960
940   
961941   /* sound hardware */
962942   MDRV_SPEAKER_STANDARD_MONO("mono")
963   MDRV_SOUND_ADD("sn76496", SN94624, 3579545/8)   /* 3.579545 MHz */
943   MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8)   /* 3.579545 MHz */
964944   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
965   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
966   MDRV_SOUND_CONFIG(ti99_4x_tms5220interface)
967   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
945
968946   MDRV_SOUND_WAVE_ADD("wave.1", "cassette1")
969947   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
970948
971   /* devices */
972   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
949   MDRV_TI994A_BOARD_ADD( "ti_board" )
950   
951   /* tms9901 */
952   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4a)
953   
954   MDRV_CRUBUS_ADD( "crubus", cru_devices )
955   MDRV_DMUX_ADD( "datamux_16_8", dmux_devices )
973956
974   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
975   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) */
957   MDRV_GROM_ADD( "console_grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
958   MDRV_GROM_ADD( "console_grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
959   MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
976960
961   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
962   
963   MDRV_PBOX4A_ADD( "peribox", console_extint, console_notconnected, console_ready )
964
977965   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
978966   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
979967
980   /* rtc */
981   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
982   /* tms9901 */
983   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
984
985   /* to be moved to controller */
986   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
987   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
988
989   MDRV_FLOPPY_4_DRIVES_ADD(ti99_4_floppy_config)
990   MDRV_MFMHD_3_DRIVES_ADD()
991
992   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
993
994   MDRV_SMARTMEDIA_ADD("smartmedia")
995
996   MDRV_TI99_4_RS232_CARD_ADD("rs232")
968   MDRV_MECMOUSE_ADD( "mecmouse" )
997969MACHINE_CONFIG_END
998970
971INTERRUPT_GEN( ti99_4ev_hblank_interrupt )
972{
973   v9938_interrupt(device->machine, 0);
974}
999975
976// Unused
977TIMER_DEVICE_CALLBACK( ti99_4ev_scanline_interrupt )
978{
979   v9938_interrupt(timer.machine, 0);
980}
981
1000982static MACHINE_CONFIG_START( ti99_4ev_60hz, driver_device )
1001983   /* basic machine hardware */
1002984   /* TMS9900 CPU @ 3.0 MHz */
r9485r9486
1005987   MDRV_CPU_IO_MAP(cru_map)
1006988   MDRV_CPU_VBLANK_INT_HACK(ti99_4ev_hblank_interrupt, 262)   /* 262.5 in 60Hz, 312.5 in 50Hz */
1007989
1008   MDRV_MACHINE_START( ti99_4ev_60hz )
1009   MDRV_MACHINE_RESET( ti99 )
990   MDRV_MACHINE_RESET( ti99_4a )
1010991
1011   /* For HSGPL */
1012   MDRV_NVRAM_HANDLER( ti99 )
1013
1014992   /* video hardware */
1015   MDRV_SCREEN_ADD("screen", RASTER)
1016   MDRV_SCREEN_REFRESH_RATE(60)   /* or 50Hz */
1017   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
1018   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1019   MDRV_SCREEN_SIZE(512+32, (212+28)*2)
1020   MDRV_SCREEN_VISIBLE_AREA(0, 512+32 - 1, 0, (212+28)*2 - 1)
993   MDRV_TI_V9938_ADD("video", 60, "screen", 2500, 512+32, (212+28)*2, tms9901_set_int2)   
1021994
1022//  MDRV_TIMER_ADD_SCANLINE("v9938_scanline", ti99_4ev_scanline_interrupt , "screen", 1, 1)
1023
1024   MDRV_PALETTE_LENGTH(512)
1025
1026   MDRV_PALETTE_INIT(v9938)
1027   MDRV_VIDEO_START(ti99_4ev)
1028   MDRV_VIDEO_UPDATE(generic_bitmapped)
1029995   MDRV_GFXDECODE(ti99b)
1030996
1031997   /* sound hardware */
1032998   MDRV_SPEAKER_STANDARD_MONO("mono")
1033   MDRV_SOUND_ADD("sn76496", SN94624, 3579545/8)   /* 3.579545 MHz */
999   MDRV_SOUND_ADD("soundgen", SN94624, 3579545/8)   /* 3.579545 MHz */
10341000   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
1035   MDRV_SOUND_ADD("tmc0285", TMC0285, 680000L)
1036   MDRV_SOUND_CONFIG(ti99_4x_tms5220interface)
1037   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1001
10381002   MDRV_SOUND_WAVE_ADD("wave.1", "cassette1")
10391003   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
10401004
1041   /* devices */
1042   MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL )
1005   MDRV_TI994A_BOARD_ADD( "ti_board" )
1006   
1007   MDRV_TMS9901_ADD("tms9901", tms9901_wiring_ti99_4a)
10431008
1044   // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt )
1045   // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback)  */
1009   MDRV_CRUBUS_ADD( "crubus", cru_devices )
1010   MDRV_DMUX_ADD( "datamux_16_8", dmux_devices )
10461011
1047   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
1048   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
1012   MDRV_GROM_ADD( "console_grom_0", 0, region_grom, 0x0000, 0x1800, console_ready )
1013   MDRV_GROM_ADD( "console_grom_1", 1, region_grom, 0x2000, 0x1800, console_ready )
1014   MDRV_GROM_ADD( "console_grom_2", 2, region_grom, 0x4000, 0x1800, console_ready )
10491015
1050   /* rtc */
1051   MDRV_MM58274C_ADD("mm58274c_floppy", floppy_mm58274c_interface)
1052   /* tms9901 */
1053   MDRV_TMS9901_ADD("tms9901", tms9901reset_param_ti99_4x)
1016   MDRV_TI99_GROMPORT_ADD( "gromport", console_ready )
10541017
1055   /* to be moved to controller */
1056   MDRV_WD179X_ADD("wd179x", ti99_wd17xx_interface )
1057   MDRV_SMC92X4_ADD("smc92x4", ti99_smc92x4_interface )
1018   MDRV_PBOXEV_ADD( "peribox", console_extint, console_notconnected, console_ready )
10581019
1059   MDRV_FLOPPY_4_DRIVES_ADD(ti99_4_floppy_config)
1060   MDRV_MFMHD_3_DRIVES_ADD()
1061
1062   MDRV_TI99_CARTRIDGE_ADD("ti99_multicart")
1063   MDRV_SMARTMEDIA_ADD("smartmedia")
1064
1065   MDRV_TI99_4_RS232_CARD_ADD("rs232")
1020   MDRV_CASSETTE_ADD( "cassette1", default_cassette_config )
1021   MDRV_CASSETTE_ADD( "cassette2", default_cassette_config )
10661022MACHINE_CONFIG_END
10671023
1068
10691024/*
10701025    ROM loading
10711026    Note that we use the same ROMset for 50Hz and 60Hz versions.
1027    ROMs for peripheral equipment have been moved to the respective files.
10721028*/
10731029
10741030ROM_START(ti99_4)
10751031   /*CPU memory space*/
1076   ROM_REGION16_BE(region_cpu1_len, "maincpu", 0)
1032   ROM_REGION16_BE(0x2000, "maincpu", 0)
10771033   ROM_LOAD16_BYTE("u610.bin", 0x0000, 0x1000, CRC(6fcf4b15) SHA1(d085213c64701d429ae535f9a4ac8a50427a8343)) /* CPU ROMs high */
10781034   ROM_LOAD16_BYTE("u611.bin", 0x0001, 0x1000, CRC(491c21d1) SHA1(7741ae9294c51a44a78033d1b77c01568a6bbfb9)) /* CPU ROMs low */
10791035
r9485r9486
10821038   ROM_LOAD("u500.bin", 0x0000, 0x1800, CRC(aa757e13) SHA1(4658d3d01c0131c283a30cebd12e76754d41a84a)) /* system GROM 0 */
10831039   ROM_LOAD("u501.bin", 0x2000, 0x1800, CRC(c863e460) SHA1(6d849a76011273a069a98ed0c3feaf13831c942f)) /* system GROM 1 */
10841040   ROM_LOAD("u502.bin", 0x4000, 0x1800, CRC(b0eda548) SHA1(725e3f26f8c819f356e4bb405b4102b5ae1e0e70)) /* system GROM 1 */
1085
1086   /*DSR ROM space*/
1087   ROM_REGION(region_dsr_len, region_dsr, 0)
1088   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
1089#if HAS_99CCFDC
1090   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
1091#endif
1092   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
1093   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
1094   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
1095
1096   /* HSGPL memory space */
1097   ROM_REGION(region_hsgpl_len, region_hsgpl, ROMREGION_ERASEFF)
1098
1099   /*TMS5220 ROM space*/
1100   ROM_REGION(0x8000, region_speech_rom, 0)
1101   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
11021041ROM_END
11031042
11041043ROM_START(ti99_4a)
11051044   /*CPU memory space*/
1106   ROM_REGION16_BE(region_cpu1_len, "maincpu", 0)
1045   ROM_REGION16_BE(0x2000, "maincpu", 0)
11071046   ROM_LOAD16_WORD("994arom.bin", 0x0000, 0x2000, CRC(db8f33e5) SHA1(6541705116598ab462ea9403c00656d6353ceb85)) /* system ROMs */
11081047
11091048   /*GROM memory space*/
11101049   ROM_REGION(0x10000, region_grom, 0)
11111050   ROM_LOAD("994agrom.bin", 0x0000, 0x6000, CRC(af5c2449) SHA1(0c5eaad0093ed89e9562a2c0ee6a370bdc9df439)) /* system GROMs */
1112
1113   /*DSR ROM space*/
1114   ROM_REGION(region_dsr_len, region_dsr, 0)
1115   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
1116#if HAS_99CCFDC
1117   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
1118#endif
1119   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
1120   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
1121   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
1122   ROM_LOAD_OPTIONAL("pcode_r0.bin", offset_pcode_rom, 0x1000, CRC(3881d5b0) SHA1(a60e0468bb15ff72f97cf6e80979ca8c11ed0426)) /* TI P-Code card rom4732 */
1123   ROM_LOAD_OPTIONAL("pcode_r1.bin", offset_pcode_rom + 0x1000, 0x2000, CRC(46a06b8b) SHA1(24e2608179921aef312cdee6f455e3f46deb30d0)) /* TI P-Code card rom4764 */
1124   ROM_LOAD_OPTIONAL("pcode_g0.bin", offset_pcode_grom, 0x10000, CRC(541b3860) SHA1(7be77c216737334ae997753a6a85136f117affb7)) /* TI P-Code card groms */
1125
1126   /* HSGPL memory space */
1127   ROM_REGION(region_hsgpl_len, region_hsgpl, ROMREGION_ERASEFF)
1128
1129   /*TMS5220 ROM space*/
1130   ROM_REGION(0x8000, region_speech_rom, 0)
1131   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
1132
11331051ROM_END
11341052
11351053ROM_START(ti99_4ev)
11361054   /*CPU memory space*/
1137   ROM_REGION16_BE(region_cpu1_len, "maincpu", 0)
1055   ROM_REGION16_BE(0x2000, "maincpu", 0)
11381056   ROM_LOAD16_WORD("994arom.bin", 0x0000, 0x2000, CRC(db8f33e5) SHA1(6541705116598ab462ea9403c00656d6353ceb85)) /* system ROMs */
11391057
11401058   /*GROM memory space*/
11411059   ROM_REGION(0x10000, region_grom, 0)
11421060   ROM_LOAD("994agr38.bin", 0x0000, 0x6000, CRC(bdd9f09b) SHA1(9b058a55d2528d2a6a69d7081aa296911ed7c0de)) /* system GROMs */
1143
1144   /*DSR ROM space*/
1145   ROM_REGION(region_dsr_len, region_dsr, 0)
1146   ROM_LOAD_OPTIONAL("disk.bin", offset_fdc_dsr, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
1147#if HAS_99CCFDC
1148   ROM_LOAD_OPTIONAL("ccfdc.bin", offset_ccfdc_dsr, 0x4000, BAD_DUMP CRC(f69cc69d)) /* CorComp disk DSR ROM */
1149#endif
1150   ROM_LOAD_OPTIONAL("bwg.bin", offset_bwg_dsr, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
1151   ROM_LOAD_OPTIONAL("hfdc.bin", offset_hfdc_dsr, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
1152   ROM_LOAD_OPTIONAL("rs232.bin", offset_rs232_dsr, 0x1000, CRC(eab382fb) SHA1(ee609a18a21f1a3ddab334e8798d5f2a0fcefa91)) /* TI rs232 DSR ROM */
1153   ROM_LOAD("evpcdsr.bin", offset_evpc_dsr, 0x10000, CRC(a062b75d) SHA1(6e8060f86e3bb9c36f244d88825e3fe237bfe9a9)) /* evpc DSR ROM */
1154
1155   /* HSGPL memory space */
1156   ROM_REGION(region_hsgpl_len, region_hsgpl, ROMREGION_ERASEFF)
1157
1158   /*TMS5220 ROM space*/
1159   ROM_REGION(0x8000, region_speech_rom, 0)
1160   ROM_LOAD_OPTIONAL("spchrom.bin", 0x0000, 0x8000, CRC(58b155f7) SHA1(382292295c00dff348d7e17c5ce4da12a1d87763)) /* system speech ROM */
11611061ROM_END
11621062
11631063#define rom_ti99_4e rom_ti99_4
11641064#define rom_ti99_4ae rom_ti99_4a
11651065
1166
11671066/*    YEAR  NAME      PARENT   COMPAT   MACHINE      INPUT    INIT      COMPANY             FULLNAME */
1168COMP( 1979, ti99_4,   0,      0,      ti99_4_60hz,  ti99_4,  ti99_4,   "Texas Instruments", "TI99/4 Home Computer (US)" , 0)
1169COMP( 1980, ti99_4e,  ti99_4,  0,      ti99_4_50hz,  ti99_4,  ti99_4,   "Texas Instruments", "TI99/4 Home Computer (Europe)" , 0)
1170COMP( 1981, ti99_4a,  0,      0,      ti99_4a_60hz, ti99_4a, ti99_4a,   "Texas Instruments", "TI99/4A Home Computer (US)" , 0)
1171COMP( 1981, ti99_4ae, ti99_4a, 0,      ti99_4a_50hz, ti99_4a, ti99_4a,   "Texas Instruments", "TI99/4A Home Computer (Europe)" , 0)
1172COMP( 1994, ti99_4ev, ti99_4a, 0,      ti99_4ev_60hz,ti99_4ev, ti99_4ev,"Texas Instruments", "TI99/4A Home Computer with EVPC" , 0)
1067COMP( 1979, ti99_4,   0,      0,      ti99_4_60hz,  ti99_4,   0,   "Texas Instruments", "TI99/4 Home Computer (US)" , 0)
1068COMP( 1980, ti99_4e,  ti99_4,  0,      ti99_4_50hz,  ti99_4,  0,   "Texas Instruments", "TI99/4 Home Computer (Europe)" , 0)
1069COMP( 1981, ti99_4a,  0,      0,      ti99_4a_60hz, ti99_4a, 0,   "Texas Instruments", "TI99/4A Home Computer (US)" , 0)
1070COMP( 1981, ti99_4ae, ti99_4a, 0,      ti99_4a_50hz, ti99_4a, 0,   "Texas Instruments", "TI99/4A Home Computer (Europe)" , 0)
1071COMP( 1994, ti99_4ev, ti99_4a, 0,      ti99_4ev_60hz,ti99_4ev, 0, "Texas Instruments", "TI99/4A Home Computer with EVPC" , 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team