Previous 15994 Revisions Next

r10779 Sunday 13th March, 2011 at 00:56:45 UTC by Michael Zapf
Added Genmod switch box
[src/mess/drivers]geneve.c
[src/mess/machine/ti99]genboard.c genboard.h ti99defs.h

src/mess/machine/ti99/genboard.c
r10778r10779
4040    1 0111 00.. .... .... .... p-box address block 0xxx, 2xxx
4141    1 0111 010. .... .... .... p-box address block 4xxx (DSR)
4242    1 0111 011. .... .... .... p-box address block 6xxx
43    1 0111 100. .... .... .... p-box address block 8xxx
43    1 0111 100. .... .... .... p-box address block 8xxx (Speech at 0x9000)
4444    1 0111 101. .... .... .... p-box address block axxx
4545    1 0111 11.. .... .... .... p-box address block cxxx, exxx
4646
r10778r10779
5555
5656    The TI console (or more precise, the Flex Cable Interface) sets the AMA/B/C
5757    lines to 1. Most cards actually check for AMA/B/C=1. However, this decoding
58    was forgotten in some designs which cause the card memory to be mirrored. The
59    usual DSR space at 0x4000-0x5fff which would be reachable via page 0xba is then
60    mirrored on a number of other pages:
58    was forgotten in third party cards which cause the card address space
59    to be mirrored. The usual DSR space at 4000-5fff which would be reachable
60    via page 0xba is then mirrored on a number of other pages:
6161
6262    10 xxx 010x = 82, 8a, 92, 9a, a2, aa, b2, ba
6363
r10778r10779
7070    to detect AMD=0, AME=1. Otherwise these cards, although completely decoding the
7171    19-bit address, would reappear at 512 KiB distances.
7272
73    For the page numbers we get
74
73    For the page numbers we get:
7574    Standard:
7675    00-3f are internal (DRAM)
7776    40-7f are internal expansion, never used
r10778r10779
8584    c0-ef are the P-Box address space (expect Memex at that location)
8685    f0-ff are internal (EPROM)
8786
87    Genmod's double switch box is also emulated. There are two switches:
88    - Turbo mode: Activates or deactivates the wait state logic on the Geneve
89      board. This switch may be changed at any time.
90    - TI mode: Selects between the on-board memory, which is obviously required
91      for the GPL interpreter, and the external Memex memory. This switch
92      triggers a reset when changed.
93
8894    Michael Zapf, February 2011
8995***************************************************************************/
9096
r10778r10779
137143   int      zero_wait;
138144
139145   int      genmod;
146   int    turbo;
147   int      timode;
140148
141149   /* GROM simulation */
142150   int      grom_address;
r10778r10779
230238   }
231239}
232240
241void set_gm_switches(device_t *board, int number, int value)
242{
243   if (number==1)
244   {
245      // Turbo switch. May be changed at any time.
246      logerror("Genmod: Setting turbo flag to %d\n", value);
247      ((genboard_state*)board)->turbo = value;
248   }
249   else
250   {
251      // TIMode switch. Causes reset when changed.
252      logerror("Genmod: Setting timode flag to %d\n", value);
253      ((genboard_state*)board)->timode = value;
254      board->machine->schedule_hard_reset();
255   }
256}
233257/****************************************************************************
234258    GROM simulation. The Geneve board simulated GROM circuits within its gate
235259    array.
r10778r10779
424448      physaddr = 0x1e0000; // points to boot eprom
425449   }
426450   else
427   { // mf_mapmode=0 (bit 11)
451   {
428452      if (!board->geneve_mode && page==3)
429453      {
430454         // Cartridge paging in TI mode
r10778r10779
482506      // Route everything else to the P-Box
483507      //   0x000000-0x07ffff for the stock Geneve (AMC,AMB,AMA,A0 ...,A15)
484508      //   0x000000-0x1fffff for the GenMod.(AME,AMD,AMC,AMB,AMA,A0 ...,A15)
485      // Add a wait state (if not GenMod)
509      // Add a wait state
486510      cpu_adjust_icount(board->cpu, -4);
487511      physaddr = (physaddr & 0x0007ffff);  // 19 bit address (with AMA..AMC)
488512      ti99_peb_data_rz(board->peribox, physaddr, &value);
r10778r10779
490514   }
491515   else
492516   {
517      // GenMod mode
518      if (!board->turbo)
519      {
520         cpu_adjust_icount(board->cpu, -4);
521      }
522      if ((board->timode) && ((physaddr & 0x180000)==0x000000))
523      {
524         // DRAM. One wait state.
525         value = board->dram[physaddr & 0x07ffff];
526         return value;
527      }
528
493529      if ((physaddr & 0x1e0000)==0x1e0000)
494530      {
495531         // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
r10778r10779
676712   }
677713   else
678714   {
715      // GenMod mode
716      if (!board->turbo)
717      {
718         cpu_adjust_icount(board->cpu, -4);
719      }
720      if ((board->timode) && ((physaddr & 0x180000)==0x000000))
721      {
722         // DRAM. One wait state.
723         board->dram[physaddr & 0x07ffff] = data;
724         return;
725      }
726
679727      if ((physaddr & 0x1e0000)==0x1e0000)
680728      {
681729         // 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
r10778r10779
13881436         fatalerror("GenMod boot rom missing.\n");
13891437      }
13901438      board->genmod = TRUE;
1439      board->turbo = input_port_read(device->machine, "GENMODDIPS") & GM_TURBO;
1440      board->timode = input_port_read(device->machine, "GENMODDIPS") & GM_TIM;
13911441   }
13921442
13931443   switch (input_port_read(device->machine, "SRAM"))
src/mess/machine/ti99/genboard.h
r10778r10779
2424
2525extern const tms9901_interface tms9901_wiring_geneve;
2626void tms9901_gen_set_int2(running_machine *machine, int state);
27void set_gm_switches(device_t *board, int number, int value);
28
2729INTERRUPT_GEN( geneve_hblank_interrupt );
2830
2931/* device interface */
src/mess/machine/ti99/ti99defs.h
r10778r10779
99#define READ8Z_DEVICE_HANDLER(name)      void name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, UINT8 *value)
1010#define READ16Z_DEVICE_HANDLER(name)      void name(ATTR_UNUSED device_t *device, ATTR_UNUSED offs_t offset, UINT16 *value)
1111
12#define GM_NEVER 42
1312#define GENMOD 0x01
1413
1514enum
1615{
16   GM_TURBO = 1,
17   GM_TIM = 2,
18   GM_NEVER = 42
19};
20
21enum
22{
1723   RAM_NONE = 0,
1824   RAM_TI32_INT,
1925   RAM_TI32_EXT,
src/mess/drivers/geneve.c
r10778r10779
235235   AM_RANGE(0x0800, 0x0fff) AM_DEVWRITE("geneve_board", geneve_cru_w)
236236ADDRESS_MAP_END
237237
238static INPUT_CHANGED( gm_changed )
239{
240   device_t *board = field->port->machine->device("geneve_board");
241   set_gm_switches(board, (UINT8)((UINT64)param&0x03), newval);
242}
243
238244/*
239245    Input ports, used by machine code for keyboard and joystick emulation.
240246*/
r10778r10779
328334      PORT_CONFSETTING(   0x00, "128 KiB" )
329335      PORT_CONFSETTING(   0x01, "192 KiB" )
330336
337   PORT_START( "GENMODDIPS" )
338   PORT_DIPNAME( GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, GENMOD ) PORT_CHANGED( gm_changed, (void *)1)
339      PORT_CONFSETTING( 0x00, DEF_STR( Off ))
340      PORT_CONFSETTING( GM_TURBO, DEF_STR( On ))
341   PORT_DIPNAME( GM_TIM, GM_TIM, "Genmod TI mode") PORT_CONDITION( "MODE", 0x01, PORTCOND_EQUALS, GENMOD ) PORT_CHANGED( gm_changed, (void *)2)
342      PORT_CONFSETTING( 0x00, DEF_STR( Off ))
343      PORT_CONFSETTING( GM_TIM, DEF_STR( On ))
344
331345   PORT_START( "DRVSPD" )
332346   PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" ) PORT_CONDITION( "DISKCTRL", 0x07, PORTCOND_EQUALS, 0x03 )
333347      PORT_CONFSETTING( 0x00, "No delay")
r10778r10779
546560   /*CPU memory space*/
547561   ROM_REGION(0xc000, "maincpu", 0)
548562   ROM_LOAD("genbt100.bin", 0x0000, 0x4000, CRC(8001e386) SHA1(b44618b54dabac3882543e18555d482b299e0109)) /* CPU ROMs */
549   ROM_LOAD_OPTIONAL("genbt090.bin", 0x4000, 0x4000, CRC(b2e20df9) SHA1(2d5d09177afe97d63ceb3ad59b498b1c9e2153f7)) /* CPU ROMs */
563   ROM_LOAD_OPTIONAL("genbt098.bin", 0x4000, 0x4000, CRC(b2e20df9) SHA1(2d5d09177afe97d63ceb3ad59b498b1c9e2153f7)) /* CPU ROMs */
550564   ROM_LOAD_OPTIONAL("gnmbt100.bin", 0x8000, 0x4000, CRC(19b89479) SHA1(6ef297eda78dc705946f6494e9d7e95e5216ec47)) /* CPU ROMs */
551565ROM_END
552566

Previous 15994 Revisions Next


© 1998-2018 The MESS Team