Previous 15994 Revisions Next

r8157 Monday 24th May, 2010 at 19:47:10 UTC by Michael Zapf
Indentation fixes
[src/mess/machine]ti99_4x.c

src/mess/machine/ti99_4x.c
r8156r8157
273273
274274static void create_grom_high2k(int first, int last)
275275{
276        /* Generate missing chunk of each console GROMs. Although a GROM
277           occupies 8 KiB of address space, it only has 6 KiB capacity, and
278           the last 2 KiB mirror previous content as shown above. */
279        int base;
280        for (base=(first&0xe000); base<((last+1)&0xe000); base+=0x2000)
281        {
282                int j;
283                for (j=0; j<0x800; j++)
284                {
285                        console_GROMs.data_ptr[base+0x1800+j] =
286                                  console_GROMs.data_ptr[base+0x0800+j]
287                                | console_GROMs.data_ptr[base+0x1000+j];
288                }
289        }
276   /* Generate missing chunk of each console GROMs. Although a GROM */
277   /* occupies 8 KiB of address space, it only has 6 KiB capacity, and */
278   /* the last 2 KiB mirror previous content as shown above. */
279   int base;
280   for (base=(first&0xe000); base<((last+1)&0xe000); base+=0x2000)
281   {
282      int j;
283      for (j=0; j<0x800; j++)
284      {
285         console_GROMs.data_ptr[base+0x1800+j] =
286              console_GROMs.data_ptr[base+0x0800+j]
287            | console_GROMs.data_ptr[base+0x1000+j];
288      }
289   }
290290}
291291
292292int ti99_is_99_8()
r8156r8157
375375
376376MACHINE_START( ti99_4_60hz )
377377{
378    ti99_common_init(machine, &tms9918_interface);
378   ti99_common_init(machine, &tms9918_interface);
379379}
380380
381381static const TMS9928a_interface tms9929_interface =
r8156r8157
388388
389389MACHINE_START( ti99_4_50hz )
390390{
391    ti99_common_init(machine, &tms9929_interface);
391   ti99_common_init(machine, &tms9929_interface);
392392}
393393
394394static const TMS9928a_interface tms9918a_interface =
r8156r8157
414414
415415MACHINE_START( ti99_4a_50hz )
416416{
417    ti99_common_init(machine, &tms9929a_interface);
417   ti99_common_init(machine, &tms9929a_interface);
418418}
419419
420420MACHINE_START( ti99_4ev_60hz)
r8156r8157
428428   if (gfxparm != 0)
429429      TMS9928A_configure(gfxparm);
430430
431        /* Initialize all. Actually, at this point, we don't know
432        how the switches are set. Later we use the configuration switches to
433        determine which one to use. */
431   /* Initialize all. Actually, at this point, we don't know */
432   /* how the switches are set. Later we use the configuration switches */
433   /* to determine which one to use. */
434434   ti99_peb_init();
435435   ti99_floppy_controllers_init_all(machine);
436436   ti99_ide_init(machine);
437437   ti99_hsgpl_init(machine);
438438   ti99_usbsm_init(machine);
439439
440   /* Find the cartslot device and cache it. This is a string search,
441    and we don't want to repeat it on each memory access. */
440   /* Find the cartslot device and cache it. This is a string search, */
441   /* and we don't want to repeat it on each memory access. */
442442   cartslots = devtag_get_device(machine, "ti99_multicart");
443443   assert(cartslots != NULL);
444444}
r8156r8157
485485#endif
486486
487487   if (!has_evpc) TMS9928A_reset();
488        else v9938_reset(0);
488   else v9938_reset(0);
489489
490490   /* clear keyboard interface state (probably overkill, but can't harm) */
491491   KeyCol = 0;
r8156r8157
536536   if (ti99_model == model_99_4p)
537537      ti99_4p_internal_dsr_reset(machine);
538538
539        if (has_speech)
539   if (has_speech)
540540   {
541541      static const spchroms_interface speech_intf = { region_speech_rom };
542542
r8156r8157
893893{
894894   if (! tms5220_readyq_r())
895895   {
896      /* Weirdly enough, we are always seeing some problems even though
897        everything is working fine. */
896      /* Weirdly enough, we are always seeing some problems even */
897      /* though everything is working fine. */
898898      attotime time_to_ready = double_to_attotime(tms5220_time_to_ready());
899899      logerror("ti99/4a speech says aaargh!\n");
900900      logerror("(time to ready: %f -> %d)\n", time_to_ready, (int) ceil(3000000*time_to_ready));
r8156r8157
911911   cpu_adjust_icount(devtag_get_device(space->machine, "maincpu"),-(54+3));      /* this is just an approx. minimum, it can be much more */
912912
913913   #if 1
914   /* the stupid design of the tms5220 core means that ready is cleared when
915    there are 15 bytes in FIFO.  It should be 16.  Of course, if it were the
916    case, we would need to store the value on the bus, which would be more
917    complex. */
914   /* the stupid design of the tms5220 core means that ready is cleared */
915   /* when there are 15 bytes in FIFO.  It should be 16.  Of course, if */
916   /* it were the case, we would need to store the value on the bus, */
917   /* which would be more complex. */
918918   if (! tms5220_readyq_r(devtag_get_device(space->machine, "tmc0285")))
919919   {
920920      attotime time_to_ready = double_to_attotime(tms5220_time_to_ready(devtag_get_device(space->machine, "tmc0285")));
r8156r8157
937937
938938   if (console_GROMs.addr < 0x6000)
939939   {
940      /* GROMs are buffered. Data is retrieved from a buffer,
941        while the buffer is replaced with the next cell
942        content. */
940      /* GROMs are buffered. Data is retrieved from a buffer, */
941      /* while the buffer is replaced with the next cell content. */
943942      reply = console_GROMs.buf;
944943
945      /* Get next value, put it in buffer. Note that the
946        GROM wraps at 8K boundaries. */
944      /* Get next value, put it in buffer. Note that the GROM */
945      /* wraps at 8K boundaries. */
947946      console_GROMs.buf = console_GROMs.data_ptr[console_GROMs.addr];
948947//      printf("GROM address (cons) = %04x, offset = %04x, reply = %02x\n", console_GROMs.addr, offset, reply);
949948   }
950949
951   /* The address pointer in the cartridge system is updated by this call.
952       We pretend to do a data read, so we mask away the address bit in the
953       offset. */
950   /* The address pointer in the cartridge system is updated by this */
951   /* call. We pretend to do a data read, so we mask away the address */
952   /* bit in the offset. */
954953   replycart = ti99_cartridge_grom_r(cartslots, offset&0xfffc);
955954
956955   if (console_GROMs.addr >= 0x6000 || override_console)
r8156r8157
958957      reply = replycart;
959958   }
960959
961   /* Each GROM chip has its own counter, so we update all of them even
962    when we do not access them. */
963   /* The program counter wraps at each GROM chip size (8K),
964    so 0x5fff + 1 = 0x4000. */
960   /* Each GROM chip has its own counter, so we update all of them even */
961   /* when we do not access them. */
962   /* The program counter wraps at each GROM chip size (8K), */
963   /* so 0x5fff + 1 = 0x4000. */
965964   console_GROMs.addr = ((console_GROMs.addr + 1) & 0x1FFF) | (console_GROMs.addr & 0xE000);
966965
967966   /* Reset the read and write address flipflops. */
r8156r8157
980979   cpu_adjust_icount(devtag_get_device(space->machine, "maincpu"),-4 /*20+3*/);      /* from 4 to 23? */
981980   //  cpu_spinuntil_time(space->machine->firstcpu, ATTOTIME_IN_USEC(6));
982981
983   /* This implementation features a multislot cartridge system which
984    is based on multiple GROM base addresses. The standard base
985    is >9800 (slot 0). When we access the port >9804, we switch to
986    slot 1, >9808 is slot 2, ... >983C is slot 15. Although theoretically
987    we could address up to 256 banks, the TI operating system does not
988    check more than 16 banks.
989    Cartridges may also contain ROMs which need to be banked
990    simultaneously. We use the cartridge slot number to swap the ROM at
991    >6000, or RAM if available. I don't know whether this is the way
992    Texas Instruments envisaged it in the OS, but it is the only
993    plausible way to allow for GROM+ROM cartridges.
994    Note that some cartridges may have programming flaws which only
995    appear when the cartridge is used in a higher-numbered slot.
996    Parsec is one example which only runs in slot 0 as the
997    programmers hard-coded an access to GROM port 0. Note: This *may*
998    be worked around if we make sure that switching only occurs
999    when the address is set, not when data is read or written. But
1000    it's not clear whether this has unwanted side effects.
1001    */
982   /* This implementation features a multislot cartridge system which    */
983   /* is based on multiple GROM base addresses. The standard base        */
984   /* is >9800 (slot 0). When we access the port >9804, we switch to     */
985   /* slot 1, >9808 is slot 2, ... >983C is slot 15. Although            */
986   /* theoretically we could address up to 256 banks, the TI operating   */
987   /* system does not check more than 16 banks.                          */
988   /* Cartridges may also contain ROMs which need to be banked           */
989   /* simultaneously. We use the cartridge slot number to swap the ROM   */
990   /* at >6000, or RAM if available. I don't know whether this is the    */
991   /* way Texas Instruments envisaged it in the OS, but it is the only   */
992   /* plausible way to allow for GROM+ROM cartridges.                    */
993   /* Note that some cartridges may have programming flaws which only    */
994   /* appear when the cartridge is used in a higher-numbered slot.       */
995   /* Parsec is one example which only runs in slot 0 as the             */
996   /* programmers hard-coded an access to GROM port 0. Note: This *may*  */
997   /* be worked around if we make sure that switching only occurs        */
998   /* when the address is set, not when data is read or written. But     */
999   /* it's not clear whether this has unwanted side effects.             */
10021000
10031001   if (offset & 1)
10041002   {   /* Read GROM address

Previous 15994 Revisions Next


© 1998-2018 The MESS Team