Previous 15994 Revisions Next

r4925 Wednesday 3rd June, 2009 at 11:05:33 UTC by Curt Coder
[XEROX820] Fixed memory banking and scroll register, added 5.25" floppy formats, implemented COM8116.
[src/mess/drivers]xerox820.c
[src/mess/machine]com8116.c com8116.h

src/mess/machine/com8116.c
r4924r4925
77
88*********************************************************************/
99
10/*
11
12   TODO:
13
14   - everything
15
16*/
17
1810#include "driver.h"
1911#include "com8116.h"
2012
r4924r4925
3527   devcb_resolved_write_line   out_fr_func;
3628   devcb_resolved_write_line   out_ft_func;
3729
30   UINT32 fr_divisors[16];      /* receiver divisor ROM */
31   UINT32 ft_divisors[16];      /* transmitter divisor ROM */
32
33   int fr;                  /* receiver frequency */
34   int ft;                  /* transmitter frequency */
35
3836   /* timers */
3937   emu_timer *fx4_timer;
4038   emu_timer *fr_timer;
r4924r4925
7068
7169WRITE8_DEVICE_HANDLER( com8116_str_w )
7270{
73//   com8116_t *com8116 = get_safe_token(device);
71   com8116_t *com8116 = get_safe_token(device);
7472
7573   if (LOG) logerror("COM8116 '%s' Receiver Divider %01x\n", device->tag, data & 0x0f);
7674
77//   timer_adjust_periodic(com8116->fr_timer, attotime_zero, 0, ATTOTIME_IN_HZ(1));
75   com8116->fr = data & 0x0f;
76
77   timer_adjust_periodic(com8116->fr_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / com8116->fr_divisors[com8116->fr] / 2));
7878}
7979
8080/*-------------------------------------------------
r4924r4925
8383
8484WRITE8_DEVICE_HANDLER( com8116_stt_w )
8585{
86//   com8116_t *com8116 = get_safe_token(device);
86   com8116_t *com8116 = get_safe_token(device);
8787
8888   if (LOG) logerror("COM8116 '%s' Transmitter Divider %01x\n", device->tag, data & 0x0f);
8989
90//   timer_adjust_periodic(com8116->ft_timer, attotime_zero, 0, ATTOTIME_IN_HZ(1));
90   com8116->ft = data & 0x0f;
91
92   timer_adjust_periodic(com8116->ft_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / com8116->ft_divisors[com8116->fr] / 2));
9193}
9294
9395/*-------------------------------------------------
r4924r4925
134136{
135137   com8116_t *com8116 = get_safe_token(device);
136138   const com8116_interface *intf = get_interface(device);
139   int i;
137140
138141   /* resolve callbacks */
139142   devcb_resolve_write_line(&com8116->out_fx4_func, &intf->out_fx4_func, device);
140143   devcb_resolve_write_line(&com8116->out_fr_func, &intf->out_fr_func, device);
141144   devcb_resolve_write_line(&com8116->out_ft_func, &intf->out_ft_func, device);
142145
146   for (i = 0; i < 16; i++)
147   {
148      assert(intf->fr_divisors[i] != 0);
149      assert(intf->ft_divisors[i] != 0);
150
151      com8116->fr_divisors[i] = intf->fr_divisors[i];
152      com8116->ft_divisors[i] = intf->ft_divisors[i];
153   }
154
143155   /* create the timers */
144156   if (com8116->out_fx4_func.target)
145157   {
r4924r4925
151163   com8116->ft_timer = timer_alloc(device->machine, ft_tick, (void *)device);
152164
153165   /* register for state saving */
154//    state_save_register_global(device->machine, com8116->);
166    state_save_register_global(device->machine, com8116->fr);
167    state_save_register_global(device->machine, com8116->ft);
155168}
156169
157170/*-------------------------------------------------
src/mess/machine/com8116.h
r4924r4925
5656   /* this gets called for every change of the fT pin (pin 17) */
5757   devcb_write_line      out_ft_func;
5858
59   /* receiver divisor ROM */
60   UINT32 fr_dividers[16];
59   /* receiver divisor ROM (19-bit) */
60   UINT32 fr_divisors[16];
6161
62   /* transmitter divisor ROM */
63   UINT32 ft_dividers[16];
62   /* transmitter divisor ROM (19-bit) */
63   UINT32 ft_divisors[16];
6464};
6565
6666/***************************************************************************
src/mess/drivers/xerox820.c
r4924r4925
1111
1212   TODO:
1313
14   - COM8116
14   - Big Board
15   - Big Board II
16   - Xerox 820-II
17   - Xerox 16/8
1518   - type in Monitor v1.0 from manual
1619   - proper keyboard emulation (MCU?)
1720
r4924r4925
142145   {
143146      /* ROM */
144147      memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_UNMAP);
148      memory_install_readwrite8_handler(program, 0x1000, 0x2fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
145149   }
146150   else
147151   {
148152      /* RAM */
149153      memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_BANK(1));
154      memory_install_readwrite8_handler(program, 0x1000, 0x2fff, 0, 0, SMH_BANK(2), SMH_BANK(2));
150155   }
151156
152   memory_install_readwrite8_handler(program, 0x3000, 0x3fff, 0, 0, SMH_BANK(2), SMH_BANK(2));
157   memory_install_readwrite8_handler(program, 0x3000, 0x3fff, 0, 0, SMH_BANK(3), SMH_BANK(3));
153158
154159   memory_set_bank(machine, 1, bank);
155   memory_set_bank(machine, 2, bank);
160   memory_set_bank(machine, 3, bank);
156161}
157162
158163static WRITE8_HANDLER( scroll_w )
159164{
160165   xerox820_state *state = space->machine->driver_data;
161166
162   state->scroll = data;
167   state->scroll = (offset >> 8) & 0x1f;
163168}
164169
165170/* Memory Maps */
r4924r4925
167172static ADDRESS_MAP_START( xerox820_mem, ADDRESS_SPACE_PROGRAM, 8 )
168173   ADDRESS_MAP_UNMAP_HIGH
169174   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
170   AM_RANGE(0x1000, 0x2fff) AM_RAM
171   AM_RANGE(0x3000, 0x3fff) AM_RAMBANK(2)
175   AM_RANGE(0x1000, 0x2fff) AM_RAMBANK(2)
176   AM_RANGE(0x3000, 0x3fff) AM_RAMBANK(3)
172177   AM_RANGE(0x4000, 0xffff) AM_RAM
173178ADDRESS_MAP_END
174179
175180static ADDRESS_MAP_START( xerox820_io, ADDRESS_SPACE_IO, 8 )
176   ADDRESS_MAP_GLOBAL_MASK(0xff)
177   AM_RANGE(0x00, 0x00) AM_MIRROR(0x03) AM_DEVWRITE(COM8116_TAG, com8116_str_w)
178   AM_RANGE(0x04, 0x04) AM_MIRROR(0x02) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
179   AM_RANGE(0x05, 0x05) AM_MIRROR(0x02) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
180   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE(Z80GPPIO_TAG, z80pio_alt_r, z80pio_alt_w)
181   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x03) AM_DEVWRITE(COM8116_TAG, com8116_stt_w)
182   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(WD1771_TAG, wd17xx_r, wd17xx_w)
183   AM_RANGE(0x14, 0x14) AM_MIRROR(0x03) AM_WRITE(scroll_w)
184   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_r, z80ctc_w)
185   AM_RANGE(0x1c, 0x1f) AM_DEVREADWRITE(Z80KBPIO_TAG, z80pio_alt_r, z80pio_alt_w)
181   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff03) AM_DEVWRITE(COM8116_TAG, com8116_str_w)
182   AM_RANGE(0x04, 0x04) AM_MIRROR(0xff02) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_d_r, z80sio_d_w)
183   AM_RANGE(0x05, 0x05) AM_MIRROR(0xff02) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_c_r, z80sio_c_w)
184   AM_RANGE(0x08, 0x0b) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80GPPIO_TAG, z80pio_alt_r, z80pio_alt_w)
185   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff03) AM_DEVWRITE(COM8116_TAG, com8116_stt_w)
186   AM_RANGE(0x10, 0x13) AM_MIRROR(0xff00) AM_DEVREADWRITE(WD1771_TAG, wd17xx_r, wd17xx_w)
187   AM_RANGE(0x14, 0x14) AM_MIRROR(0xff03) AM_MASK(0xff00) AM_WRITE(scroll_w)
188   AM_RANGE(0x18, 0x1b) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_r, z80ctc_w)
189   AM_RANGE(0x1c, 0x1f) AM_MIRROR(0xff00) AM_DEVREADWRITE(Z80KBPIO_TAG, z80pio_alt_r, z80pio_alt_w)
186190ADDRESS_MAP_END
187191
188192/* Input Ports */
r4924r4925
503507   DEVCB_NULL,      /* fX/4 output */
504508   DEVCB_NULL,      /* fR output */
505509   DEVCB_NULL,      /* fT output */
506   {0},         /* receiver ROM */
507   {0}            /* transmitter ROM */
510   { 101376, 67584, 46080, 37686, 33792, 16896, 8448, 4224, 2816, 2534, 2112, 1408, 1056, 704, 528, 264 },         /* receiver divisor ROM */
511   { 101376, 67584, 46080, 37686, 33792, 16896, 8448, 4224, 2816, 2534, 2112, 1408, 1056, 704, 528, 264 },         /* transmitter divisor ROM */
508512};
509513
510514/* Video */
r4924r4925
576580   state->kbpio = devtag_get_device(machine, Z80KBPIO_TAG);
577581   state->z80ctc = devtag_get_device(machine, Z80CTC_TAG);
578582   state->wd1771 = devtag_get_device(machine, WD1771_TAG);
579//   state->com8116 = devtag_get_device(machine, COM8116_TAG);
580583
581584   /* allocate video memory */
582585   state->video_ram = auto_alloc_array(machine, UINT8, XEROX820_LCD_VIDEORAM_SIZE);
r4924r4925
585588   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, Z80_TAG), 0);
586589   memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "monitor"), 0);
587590
588   memory_configure_bank(machine, 2, 0, 1, memory_region(machine, Z80_TAG) + 0x3000, 0);
589   memory_configure_bank(machine, 2, 1, 1, state->video_ram, 0);
591   memory_configure_bank(machine, 2, 0, 1, memory_region(machine, Z80_TAG) + 0x1000, 0);
592   memory_set_bank(machine, 2, 0);
590593
594   memory_configure_bank(machine, 3, 0, 1, memory_region(machine, Z80_TAG) + 0x3000, 0);
595   memory_configure_bank(machine, 3, 1, 1, state->video_ram, 0);
596
591597   /* bank switch */
592598   xerox820_bankswitch(machine, 1);
593599
r4924r4925
707713         state->_8n5 = 1;
708714         state->dsdd = 0;
709715         return INIT_PASS;
716
717      case 40*1*18*128: // 90K 5.25" SSSD
718         basicdsk_set_geometry(image, 40, 1, 18, 128, 1, 0, FALSE);
719         state->_8n5 = 0;
720         state->dsdd = 0;
721         return INIT_PASS;
722
723      case 40*2*18*128: // 180K 5.25" DSSD
724         basicdsk_set_geometry(image, 40, 2, 18, 128, 1, 0, FALSE);
725         state->_8n5 = 0;
726         state->dsdd = 1;
727         return INIT_PASS;
710728      }
711729   }
712730
r4924r4925
738756/*
739757static SYSTEM_CONFIG_START( xerox820ii )
740758   CONFIG_RAM_DEFAULT   (64 * 1024)
741   CONFIG_DEVICE(xerox820_floppy_getinfo)
759   CONFIG_DEVICE(xerox820ii_floppy_getinfo)
742760//   CONFIG_DEVICE(xerox820_harddisk_getinfo) 10MB
743761SYSTEM_CONFIG_END
744762*/
745763/* System Drivers */
746764
747/*    YEAR  NAME        PARENT      COMPAT  MACHINE     INPUT      INIT   CONFIG      COMPANY      FULLNAME      FLAGS */
748COMP( 1981, xerox820,   0,         0,      xerox820,   xerox820,   0,      xerox820,   "Xerox",   "Xerox 820",   GAME_NOT_WORKING)
765/*    YEAR  NAME        PARENT      COMPAT  MACHINE     INPUT      INIT   CONFIG      COMPANY                     FULLNAME      FLAGS */
766COMP( 1981, xerox820,   0,         0,      xerox820,   xerox820,   0,      xerox820,   "Xerox",                  "Xerox 820",   0)
749767/*
750COMP( 1983, xerox820ii,   xerox820,   0,      xerox820ii,   xerox820,   0,      xerox820ii,   "Xerox",   "Xerox 820-II",   GAME_NOT_WORKING)
768COMP( 1980, bigboard,   0,         0,      bigboard,   bigboard,   0,      bigboard,   "Digital Research Computers",   "Big Board",   GAME_NOT_WORKING)
769COMP( 1983, bigbord2,   0,         0,      bigbord2,   bigboard,   0,      bigbord2,   "Digital Research Computers",   "Big Board II",   GAME_NOT_WORKING)
770COMP( 1983, xerox820ii,   0,         0,      xerox820ii,   xerox820,   0,      xerox820ii,   "Xerox",                  "Xerox 820-II",   GAME_NOT_WORKING)
771COMP( 1983, xerox168,   0,         0,      xerox168,   xerox168,   0,      xerox816,   "Xerox",                  "Xerox 16/8",   GAME_NOT_WORKING)
751772*/

Previous 15994 Revisions Next


© 1998-2018 The MESS Team