Previous 15994 Revisions Next

r5312 Tuesday 28th July, 2009 at 18:59:43 UTC by Wilbert Pol
[T1000RL] Added support for BIOS banking.
[src/mess/drivers]pc.c
[src/mess/includes]tandy1t.h
[src/mess/machine]tandy1t.c

src/mess/includes/tandy1t.h
r5311r5312
1818
1919extern NVRAM_HANDLER( tandy1000 );
2020
21MACHINE_RESET( tandy1000rl );
22READ8_HANDLER( tandy1000_bank_r );
23WRITE8_HANDLER( tandy1000_bank_w );
24
2125INPUT_PORTS_EXTERN( t1000_keyboard );
2226
2327
src/mess/machine/tandy1t.c
r5311r5312
1616  8x read 16 bit word at x
1717  30 cx 30 4x 16bit 00 write 16bit at x
1818*/
19static struct {
19static struct
20{
2021   int state;
2122   int clock;
2223   UINT8 oper;
2324   UINT16 data;
24   struct {
25   struct
26   {
2527      UINT8 low, high;
2628   } ee[0x40]; /* only 0 to 4 used in hx, addressing seems to allow this */
2729} eeprom={0};
2830
2931NVRAM_HANDLER( tandy1000 )
3032{
31   if (file==NULL) {
33   if (file==NULL)
34   {
3235      // init only
33   } else if (read_or_write) {
36   }
37   else if (read_or_write)
38   {
3439      mame_fwrite(file, eeprom.ee, sizeof(eeprom.ee));
35   } else {
40   }
41   else
42   {
3643      mame_fread(file, eeprom.ee, sizeof(eeprom.ee));
3744   }
3845}
r5311r5312
4653
4754static void tandy1000_write_eeprom(UINT8 data)
4855{
49   if (!eeprom.clock && (data&4) ) {
56   if (!eeprom.clock && (data&4) )
57   {
5058//            logerror("!!!tandy1000 eeprom %.2x %.2x\n",eeprom.state, data);
51      switch (eeprom.state) {
59      switch (eeprom.state)
60      {
5261      case 0:
5362         if ((data&3)==0) eeprom.state++;
5463         break;
r5311r5312
7483      case 10:
7584         eeprom.oper=(eeprom.oper<<1)|(data&1);
7685         logerror("!!!tandy1000 eeprom %.2x\n",eeprom.oper);
77         if ((eeprom.oper&0xc0)==0x80) {
86         if ((eeprom.oper&0xc0)==0x80)
87         {
7888            eeprom.state=100;
7989            eeprom.data=eeprom.ee[eeprom.oper&0x3f].low
8090               |(eeprom.ee[eeprom.oper&0x3f].high<<8);
8191            logerror("!!!tandy1000 eeprom read %.2x,%.4x\n",eeprom.oper,eeprom.data);
82         } else if ((eeprom.oper&0xc0)==0x40) {
92         }
93         else if ((eeprom.oper&0xc0)==0x40)
94         {
8395            eeprom.state=200;
84         } else eeprom.state=0;
96         }
97         else
98            eeprom.state=0;
8599         break;
86100
87101         /* read 16 bit */
r5311r5312
142156   eeprom.clock=data&4;
143157}
144158
145static struct {
159static struct
160{
146161   UINT8 data[8];
162
163   UINT8 bios_bank;   /* I/O port FFEAh */
147164} tandy={ {0}};
148165
149166WRITE8_HANDLER ( pc_t1t_p37x_w )
r5311r5312
175192   bit 4 input eeprom data in
176193   bit 3 output turbo mode
177194*/
178static struct {
195static struct
196{
179197   UINT8 portb, portc;
180198} tandy_ppi= { 0 };
181199
182200WRITE8_HANDLER ( tandy1000_pio_w )
183201{
184   switch (offset) {
202   switch (offset)
203   {
185204   case 1:
186205      tandy_ppi.portb = data;
187206      pit8253_gate_w( devtag_get_device(space->machine, "pit8253"), 2, data & 1);
188207      pc_speaker_set_spkrdata( space->machine, data & 0x02 );
189208      pc_keyb_set_clock(data&0x40);
190      if ( data & 0x80 ) {
209      if ( data & 0x80 )
210      {
191211         pc_keyb_clear();
192212      }
193213      break;
r5311r5312
204224 READ8_HANDLER(tandy1000_pio_r)
205225{
206226   int data=0xff;
207   switch (offset) {
227   switch (offset)
228   {
208229   case 0:
209230      data = pc_keyb_read();
210231      break;
r5311r5312
222243}
223244
224245
246static void tandy1000_set_bios_bank( running_machine *machine )
247{
248   memory_set_bankptr( machine, 11, memory_region(machine, "maincpu") + ( tandy.bios_bank & 0x07 ) * 0x10000 );
249}
225250
251
252MACHINE_RESET( tandy1000rl )
253{
254   MACHINE_RESET_CALL( pc );
255   tandy.bios_bank = 6;
256   tandy1000_set_bios_bank( machine );
257}
258
259
260READ8_HANDLER( tandy1000_bank_r )
261{
262   UINT8 data = 0xFF;
263
264   logerror( "%s: tandy1000_bank_r: offset = %x\n", cpuexec_describe_context(space->machine), offset );
265
266   switch( offset )
267   {
268   case 0x00:   /* FFEA */
269      data = tandy.bios_bank;
270      break;
271   }
272
273   return data;
274}
275
276
277WRITE8_HANDLER( tandy1000_bank_w )
278{
279   logerror( "%s: tandy1000_bank_w: offset = %x, data = %02x\n", cpuexec_describe_context(space->machine), offset, data );
280
281   switch( offset )
282   {
283   case 0x00:   /* FFEA */
284      tandy.bios_bank = data;
285      tandy1000_set_bios_bank( space->machine );
286      break;
287   }
288}
289
290
291
226292INPUT_PORTS_START( t1000_keyboard )
227293   PORT_START("pc_keyboard_0")
228294   PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED )    /* unused scancode 0 */
src/mess/drivers/pc.c
r5311r5312
380380   AM_RANGE(0xc8000, 0xc9fff) AM_ROM
381381   AM_RANGE(0xca000, 0xcffff) AM_NOP
382382   AM_RANGE(0xd0000, 0xeffff) AM_ROM AM_REGION("maincpu", 0x60000)   /* This should become AM_ROMBANK(x) */
383   AM_RANGE(0xd0000, 0xeffff) AM_ROMBANK(11)                  /* Banked part of the BIOS */
383384   AM_RANGE(0xf0000, 0xfffff) AM_ROM AM_REGION("maincpu", 0x70000)
384385ADDRESS_MAP_END
385386
r5311r5312
401402   AM_RANGE(0x03d0, 0x03df) AM_READWRITE8(pc_T1T_r,               pc_T1T_w, 0xffff)
402403   AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8(pc_fdc_r,               pc_fdc_w, 0xffff)
403404   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_r, ins8250_w, 0xffff)
405   AM_RANGE(0xffea, 0xffeb) AM_READWRITE8(tandy1000_bank_r, tandy1000_bank_w, 0xffff)
404406ADDRESS_MAP_END
405407
406408
r5311r5312
19451947   MDRV_CPU_PC(tandy1000_16, tandy1000_16, I8086, XTAL_28_63636MHz / 3, pc_frame_interrupt)
19461948
19471949   MDRV_MACHINE_START(pc)
1948   MDRV_MACHINE_RESET(pc)
1950   MDRV_MACHINE_RESET(tandy1000rl)
19491951
19501952   MDRV_PIT8253_ADD( "pit8253", ibm5150_pit8253_config )
19511953
r5311r5312
26512653
26522654// pcjr (better graphics, better sound)
26532655COMP(  1983,   ibmpcjr,   ibm5150,   0,   ibmpcjr,    tandy1t,   pcjr,       pcjr,    "International Business Machines",  "IBM PC Jr", GAME_NOT_WORKING|GAME_IMPERFECT_COLORS )
2656
2657// tandy 1000
26542658COMP(  1987,   t1000hx,   ibm5150,   0,   t1000hx,    tandy1t,   t1000hx,   ibm5160, "Tandy Radio Shack",  "Tandy 1000HX", 0)
26552659COMP(  1987,   t1000sx,   ibm5150,   0,   t1000hx,    tandy1t,   t1000hx,   ibm5160, "Tandy Radio Shack",  "Tandy 1000SX", GAME_NOT_WORKING)
26562660COMP(  1989,    t1000rl,    ibm5150,    0,  t1000_16,   tandy1t,    t1000hx,    ibm5160, "Tandy Radio Shack",  "Tandy 1000RL", GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team