Previous 199869 Revisions Next

r18769 Monday 29th October, 2012 at 16:05:49 UTC by Curt Coder
(MESS) cbm2: Fixed graphics, and some 8088 WIP. (nw)
[src/mess/drivers]cbm2.c
[src/mess/includes]cbm2.h

trunk/src/mess/drivers/cbm2.c
r18768r18769
22
33    TODO:
44
5   - 8088 board
56    - CIA timers fail in burn-in test
67    - NTSC variants unable to load from disk
78    - shift lock
89    - Hungarian keyboard
910    - cbm620hu charom banking?
11    - DIN roms 324866-03a / 324867-02
1012    - user port
11    - co-processor bus
12    - 8088 co-processor board
1313
1414*/
1515
r18768r18769
4444//  read_pla - low profile PLA read
4545//-------------------------------------------------
4646
47void cbm2_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
47void cbm2_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas,
4848   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4)
4949{
50   UINT32 input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6;
50   UINT32 input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | m_busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6;
5151   UINT32 data = m_pla1->read(input);
5252
5353   *casseg1 = BIT(data, 0);
r18768r18769
6565//  read_pla - high profile PLA read
6666//-------------------------------------------------
6767
68void cbm2hp_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
68void cbm2hp_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas,
6969   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4)
7070{
71   UINT32 input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0;
71   UINT32 input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | m_busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0;
7272   UINT32 data = m_pla1->read(input);
7373
7474   *casseg1 = BIT(data, 0);
r18768r18769
8686//  bankswitch -
8787//-------------------------------------------------
8888
89void cbm2_state::bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
89void cbm2_state::bankswitch(offs_t offset, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
9090   int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
9191   int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
9292   int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs)
9393{
9494   int rasseg1 = 1, rasseg2 = 1, rasseg3 = 1, rasseg4 = 1;
9595
96   this->read_pla(offset, ras, cas, refen, eras, ecas, busy2, casseg1, casseg2, casseg3, casseg4, &rasseg1, &rasseg2, &rasseg3, &rasseg4);
96   this->read_pla(offset, ras, cas, refen, eras, ecas, casseg1, casseg2, casseg3, casseg4, &rasseg1, &rasseg2, &rasseg3, &rasseg4);
9797
98   int busen1 = m_dramon;
9998   int decoden = 0;
100   *sysioen = !(P0 && P1 && P2 && P3) && busen1;
101   *dramen = !((!(P0 && P1 && P2 && P3)) && busen1);
99   *sysioen = !(P0 && P1 && P2 && P3) && m_busen1;
100   *dramen = !((!(P0 && P1 && P2 && P3)) && m_busen1);
102101
103102   if (!decoden && !*sysioen)
104103   {
r18768r18769
151150
152151READ8_MEMBER( cbm2_state::read )
153152{
154   int busy2 = 1, eras = 1, ecas = 1, refen = 0, cas = 0, ras = 1, sysioen = 1, dramen = 1;
153   int eras = 1, ecas = 0, refen = 0, cas = 0, ras = 1, sysioen = 1, dramen = 1;
155154   int casseg1 = 1, casseg2 = 1, casseg3 = 1, casseg4 = 1, buframcs = 1, extbufcs = 1, vidramcs = 1;
156155   int diskromcs = 1, csbank1 = 1, csbank2 = 1, csbank3 = 1, basiccs = 1, knbcs = 1, kernalcs = 1;
157156   int crtccs = 1, cs1 = 1, sidcs = 1, extprtcs = 1, ciacs = 1, aciacs = 1, tript1cs = 1, tript2cs = 1;
158157
159   bankswitch(offset, busy2, eras, ecas, refen, cas, ras, &sysioen, &dramen,
158   bankswitch(offset, eras, ecas, refen, cas, ras, &sysioen, &dramen,
160159      &casseg1, &casseg2, &casseg3, &casseg4, &buframcs, &extbufcs, &vidramcs,
161160      &diskromcs, &csbank1, &csbank2, &csbank3, &basiccs, &knbcs, &kernalcs,
162161      &crtccs, &cs1, &sidcs, &extprtcs, &ciacs, &aciacs, &tript1cs, &tript2cs);
r18768r18769
189188      {
190189         data = m_buffer_ram[offset & 0x7ff];
191190      }
191      if (!extbufcs && m_extbuf_ram)
192      {
193         data = m_extbuf_ram[offset & 0x7ff];
194      }
192195      if (!vidramcs)
193196      {
194197         data = m_video_ram[offset & 0x7ff];
r18768r18769
216219      {
217220         data = m_sid->read(space, offset & 0x1f);
218221      }
222      if (!extprtcs && m_ext_cia)
223      {
224         data = m_ext_cia->read(space, offset & 0x0f);
225      }
219226      if (!ciacs)
220227      {
221228         data = m_cia->read(space, offset & 0x0f);
r18768r18769
246253
247254WRITE8_MEMBER( cbm2_state::write )
248255{
249   int busy2 = 1, eras = 1, ecas = 1, refen = 0, cas = 0, ras = 1, sysioen = 1, dramen = 1;
256   int eras = 1, ecas = 0, refen = 0, cas = 0, ras = 1, sysioen = 1, dramen = 1;
250257   int casseg1 = 1, casseg2 = 1, casseg3 = 1, casseg4 = 1, buframcs = 1, extbufcs = 1, vidramcs = 1;
251258   int diskromcs = 1, csbank1 = 1, csbank2 = 1, csbank3 = 1, basiccs = 1, knbcs = 1, kernalcs = 1;
252259   int crtccs = 1, cs1 = 1, sidcs = 1, extprtcs = 1, ciacs = 1, aciacs = 1, tript1cs = 1, tript2cs = 1;
253260
254   bankswitch(offset, busy2, eras, ecas, refen, cas, ras, &sysioen, &dramen,
261   bankswitch(offset, eras, ecas, refen, cas, ras, &sysioen, &dramen,
255262      &casseg1, &casseg2, &casseg3, &casseg4, &buframcs, &extbufcs, &vidramcs,
256263      &diskromcs, &csbank1, &csbank2, &csbank3, &basiccs, &knbcs, &kernalcs,
257264      &crtccs, &cs1, &sidcs, &extprtcs, &ciacs, &aciacs, &tript1cs, &tript2cs);
r18768r18769
282289      {
283290         m_buffer_ram[offset & 0x7ff] = data;
284291      }
292      if (!extbufcs && m_extbuf_ram)
293      {
294         m_extbuf_ram[offset & 0x7ff] = data;   
295      }
285296      if (!vidramcs)
286297      {
287298         m_video_ram[offset & 0x7ff] = data;
r18768r18769
301312      {
302313         m_sid->write(space, offset & 0x1f, data);
303314      }
315      if (!extprtcs && m_ext_cia)
316      {
317         m_ext_cia->write(space, offset & 0x0f, data);
318      }
304319      if (!ciacs)
305320      {
306321         m_cia->write(space, offset & 0x0f, data);
r18768r18769
319334      }
320335
321336      m_exp->write(space, offset & 0x1fff, data, csbank1, csbank2, csbank3);
337   }   
338}
339
340
341//-------------------------------------------------
342//  ext_read -
343//-------------------------------------------------
344
345READ8_MEMBER( cbm2_state::ext_read )
346{
347   int ras = 1, cas = 1, refen = 1, eras = 1, ecas = 0;
348   int casseg1 = 1, casseg2 = 1, casseg3 = 1, casseg4 = 1, rasseg1 = 1, rasseg2 = 1, rasseg3 = 1, rasseg4 = 1;
349
350   this->read_pla(offset, ras, cas, refen, eras, ecas, &casseg1, &casseg2, &casseg3, &casseg4, &rasseg1, &rasseg2, &rasseg3, &rasseg4);
351
352   UINT8 data = 0xff;
353
354   if (!casseg1)
355   {
356      data = m_ram->pointer()[offset & 0xffff];
322357   }
358   if (!casseg2)
359   {
360      data = m_ram->pointer()[0x10000 | (offset & 0xffff)];
361   }
362   if (!casseg3 && (m_ram->size() > 0x20000))
363   {
364      data = m_ram->pointer()[0x20000 | (offset & 0xffff)];
365   }
366   if (!casseg4 && (m_ram->size() > 0x30000))
367   {
368      data = m_ram->pointer()[0x30000 | (offset & 0xffff)];
369   }
370
371   return data;
323372}
324373
325374
326375//-------------------------------------------------
376//  ext_write -
377//-------------------------------------------------
378
379WRITE8_MEMBER( cbm2_state::ext_write )
380{
381   int ras = 1, cas = 1, refen = 1, eras = 1, ecas = 0;
382   int casseg1 = 1, casseg2 = 1, casseg3 = 1, casseg4 = 1, rasseg1 = 1, rasseg2 = 1, rasseg3 = 1, rasseg4 = 1;
383
384   this->read_pla(offset, ras, cas, refen, eras, ecas, &casseg1, &casseg2, &casseg3, &casseg4, &rasseg1, &rasseg2, &rasseg3, &rasseg4);
385
386   if (!casseg1)
387   {
388      m_ram->pointer()[offset & 0xffff] = data;
389   }
390   if (!casseg2)
391   {
392      m_ram->pointer()[0x10000 | (offset & 0xffff)] = data;
393   }
394   if (!casseg3 && (m_ram->size() > 0x20000))
395   {
396      m_ram->pointer()[0x20000 | (offset & 0xffff)] = data;
397   }
398   if (!casseg4 && (m_ram->size() > 0x30000))
399   {
400      m_ram->pointer()[0x30000 | (offset & 0xffff)] = data;
401   }
402}
403
404
405//-------------------------------------------------
327406//  read_pla1 - P500 PLA #1 read
328407//-------------------------------------------------
329408
r18768r18769
750829
751830
752831//-------------------------------------------------
832//  ADDRESS_MAP( ext_mem )
833//-------------------------------------------------
834
835static ADDRESS_MAP_START( ext_mem, AS_PROGRAM, 8, cbm2_state )
836   AM_RANGE(0x00000, 0xeffff) AM_READWRITE(ext_read, ext_write)
837   AM_RANGE(0xf0000, 0xf0fff) AM_MIRROR(0xf000) AM_ROM AM_REGION(EXT_I8088_TAG, 0)
838ADDRESS_MAP_END
839
840
841//-------------------------------------------------
842//  ADDRESS_MAP( ext_io )
843//-------------------------------------------------
844
845static ADDRESS_MAP_START( ext_io, AS_IO, 8, cbm2_state )
846   ADDRESS_MAP_GLOBAL_MASK(0xff)
847   AM_RANGE(0x0000, 0x0001) AM_MIRROR(0x1e) AM_DEVREADWRITE_LEGACY(EXT_I8259A_TAG, pic8259_r, pic8259_w)
848   AM_RANGE(0x0020, 0x0027) AM_MIRROR(0x18) AM_DEVREADWRITE(EXT_MOS6525_TAG, tpi6525_device, read, write)
849ADDRESS_MAP_END
850
851
852//-------------------------------------------------
753853//  ADDRESS_MAP( p500_mem )
754854//-------------------------------------------------
755855
r18768r18769
9751075//  mc6845_interface crtc_intf
9761076//-------------------------------------------------
9771077
978static MC6845_UPDATE_ROW( lp_crtc_update_row )
1078static MC6845_UPDATE_ROW( crtc_update_row )
9791079{
9801080   cbm2_state *state = device->machine().driver_data<cbm2_state>();
9811081
r18768r18769
9871087      offs_t char_rom_addr = (ma & 0x1000) | (state->m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f);
9881088      UINT8 data = state->m_charom[char_rom_addr & 0xfff];
9891089
990      for (int bit = 0; bit < 8; bit++)
1090      for (int bit = 0; bit < 9; bit++)
9911091      {
9921092         int color = BIT(data, 7) ^ BIT(code, 7) ^ BIT(ma, 13);
9931093         if (cursor_x == column) color ^= 1;
9941094
9951095         bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[color];
9961096
997         data <<= 1;
1097         if (bit < 8 || !state->m_graphics) data <<= 1;
9981098      }
9991099   }
10001100}
10011101
1002static const mc6845_interface lp_crtc_intf =
1102static const mc6845_interface crtc_intf =
10031103{
10041104   SCREEN_TAG,
1005   8,
1105   9,
10061106   NULL,
1007   lp_crtc_update_row,
1107   crtc_update_row,
10081108   NULL,
10091109   DEVCB_NULL,
10101110   DEVCB_NULL,
r18768r18769
10141114};
10151115
10161116
1017static MC6845_UPDATE_ROW( hp_crtc_update_row )
1018{
1019   cbm2_state *state = device->machine().driver_data<cbm2_state>();
1020
1021   int x = 0;
1022
1023   for (int column = 0; column < x_count; column++)
1024   {
1025      UINT8 code = state->m_video_ram[(ma + column) & 0x7ff];
1026      offs_t char_rom_addr = (ma & 0x1000) | (state->m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f);
1027      UINT8 data = state->m_charom[char_rom_addr & 0xfff];
1028
1029      for (int bit = 0; bit < 8; bit++)
1030      {
1031         int color = BIT(data, 7) ^ BIT(code, 7) ^ BIT(ma, 13);
1032         if (cursor_x == column) color ^= 1;
1033
1034         bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[color];
1035
1036         data <<= 1;
1037      }
1038
1039      bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[BIT(code, 7) ^ BIT(ma, 13)];
1040   }
1041}
1042
1043static const mc6845_interface hp_crtc_intf =
1044{
1045   SCREEN_TAG,
1046   9,
1047   NULL,
1048   hp_crtc_update_row,
1049   NULL,
1050   DEVCB_NULL,
1051   DEVCB_NULL,
1052   DEVCB_NULL,
1053   DEVCB_NULL,
1054   NULL
1055};
1056
10571117//-------------------------------------------------
10581118//  vic2_interface vic_intf
10591119//-------------------------------------------------
r18768r18769
12521312
12531313   // memory
12541314   m_dramon = BIT(data, 4);
1315   if (m_busy2) m_busen1 = m_dramon;
12551316
12561317   // cassette
12571318   m_cassette->write(BIT(data, 5));
r18768r18769
16531714};
16541715
16551716
1717//-------------------------------------------------
1718//  pic8259_interface ext_pic_intf
1719//-------------------------------------------------
16561720
1721static IRQ_CALLBACK( pic_irq_callback )
1722{
1723   cbm2_state *state = device->machine().driver_data<cbm2_state>();
1724
1725   return pic8259_acknowledge(state->m_ext_pic);
1726}
1727
1728static pic8259_interface ext_pic_intf =
1729{
1730   DEVCB_CPU_INPUT_LINE(EXT_I8088_TAG, INPUT_LINE_IRQ0),
1731   DEVCB_LINE_VCC,
1732   DEVCB_NULL
1733};
1734
1735
1736//-------------------------------------------------
1737//  tpi6525_interface ext_tpi_intf
1738//-------------------------------------------------
1739
1740READ8_MEMBER( cbm2_state::ext_tpi_pb_r )
1741{
1742   /*
1743   
1744       bit     description
1745   
1746       0       _BUSY1
1747       1       CIA PB1
1748       2       CIA PB2
1749       3       CIA PB3
1750       4       CIA PB4
1751       5       CIA PB5
1752       6       1
1753       7       1
1754   
1755   */
1756
1757   UINT8 data = 0xc0;
1758
1759   // _BUSY1
1760   data |= !m_busen1;
1761
1762   // CIA
1763   data = m_ext_cia->pb_r() & 0x3e;
1764
1765   return data;
1766}
1767
1768WRITE8_MEMBER( cbm2_state::ext_tpi_pb_w )
1769{
1770   /*
1771   
1772       bit     description
1773   
1774       0       U22B CL
1775       1       
1776       2       
1777       3       
1778       4       
1779       5       
1780       6       CIA FLAG
1781       7       
1782   
1783   */
1784
1785   // _BUSY2
1786   if (!BIT(data, 0))
1787   {
1788      m_busy2 = 1;
1789      m_busen1 = m_dramon;
1790   }
1791
1792   m_ext_cia->flag_w(BIT(data, 6));
1793}
1794
1795WRITE8_MEMBER( cbm2_state::ext_tpi_pc_w )
1796{
1797   /*
1798   
1799       bit     description
1800   
1801       0       
1802       1       
1803       2       
1804       3       
1805       4       
1806       5       U22 CLK
1807       6       
1808       7       
1809   
1810   */
1811}
1812
1813static const tpi6525_interface ext_tpi_intf =
1814{
1815   DEVCB_NULL,
1816   DEVCB_DEVICE_MEMBER(EXT_MOS6526_TAG, mos6526_device, pa_r),
1817   DEVCB_NULL,
1818   DEVCB_DRIVER_MEMBER(cbm2_state, ext_tpi_pb_r),
1819   DEVCB_DRIVER_MEMBER(cbm2_state, ext_tpi_pb_w),
1820   DEVCB_NULL,
1821   DEVCB_DRIVER_MEMBER(cbm2_state, ext_tpi_pc_w),
1822   DEVCB_NULL,
1823   DEVCB_NULL
1824};
1825
1826
1827//-------------------------------------------------
1828//  MOS6526_INTERFACE( ext_cia_intf )
1829//-------------------------------------------------
1830
1831READ8_MEMBER( cbm2_state::ext_cia_pb_r )
1832{
1833   /*
1834   
1835       bit     description
1836   
1837       0       _BUSY1
1838       1       TPI PB1
1839       2       TPI PB2
1840       3       TPI PB3
1841       4       TPI PB4
1842       5       TPI PB5
1843       6       1
1844       7       1
1845   
1846   */
1847
1848   UINT8 data = 0xc0;
1849
1850   // _BUSY1
1851   data |= !m_busen1;
1852
1853   // TPI
1854   data |= tpi6525_portb_r(m_ext_tpi, space, 0) & 0x3e;
1855
1856   return data;
1857}
1858
1859WRITE8_MEMBER( cbm2_state::ext_cia_pb_w )
1860{
1861   /*
1862   
1863       bit     description
1864   
1865       0       U22B CL
1866       1       
1867       2       
1868       3       
1869       4       
1870       5       
1871       6       PIC IR0, U29B CL, U22B PR
1872       7       PIC IR7
1873   
1874   */
1875
1876   // _BUSY2
1877   if (!BIT(data, 0))
1878   {
1879      m_busy2 = 1;
1880      m_busen1 = m_dramon;
1881   }
1882   else if (!BIT(data, 6))
1883   {
1884      m_busy2 = 0;
1885      m_busen1 = 0;
1886   }
1887
1888   pic8259_ir0_w(m_ext_pic, !BIT(data, 6));
1889   pic8259_ir7_w(m_ext_pic, BIT(data, 7));
1890}
1891
1892static MOS6526_INTERFACE( ext_cia_intf )
1893{
1894   DEVCB_DEVICE_LINE_MEMBER(MOS6525_1_TAG, tpi6525_device, i3_w),
1895   DEVCB_NULL,
1896   DEVCB_NULL,
1897   DEVCB_NULL,
1898   DEVCB_DEVICE_HANDLER(EXT_MOS6525_TAG, tpi6525_porta_r),
1899   DEVCB_NULL,
1900   DEVCB_DRIVER_MEMBER(cbm2_state, ext_cia_pb_r),
1901   DEVCB_DRIVER_MEMBER(cbm2_state, ext_cia_pb_w)
1902};
1903
1904
1905
16571906//**************************************************************************
16581907//  MACHINE INITIALIZATION
16591908//**************************************************************************
r18768r18769
16661915{
16671916   m_tpi1->i0_w(m_todclk);
16681917
1918   if (m_ext_pic) pic8259_ir2_w(m_ext_pic, m_todclk);
1919
16691920   m_todclk = !m_todclk;
16701921}
16711922
r18768r18769
16931944
16941945   // state saving
16951946   save_item(NAME(m_dramon));
1947   save_item(NAME(m_busen1));
1948   save_item(NAME(m_busy2));
16961949   save_item(NAME(m_graphics));
16971950   save_item(NAME(m_ntsc));
16981951   save_item(NAME(m_todclk));
r18768r18769
17301983
17311984
17321985//-------------------------------------------------
1986//  MACHINE_START( cbm2x_ntsc )
1987//-------------------------------------------------
1988
1989MACHINE_START_MEMBER( cbm2_state, cbm2x_ntsc )
1990{
1991   // register CPU IRQ callback
1992   m_ext_cpu->set_irq_acknowledge_callback(pic_irq_callback);
1993
1994   // allocate memory
1995   m_extbuf_ram.allocate(0x800);
1996
1997   MACHINE_START_CALL_MEMBER(cbm2_ntsc);
1998}
1999
2000
2001//-------------------------------------------------
2002//  MACHINE_START( cbm2x_pal )
2003//-------------------------------------------------
2004
2005MACHINE_START_MEMBER( cbm2_state, cbm2x_pal )
2006{
2007   // register CPU IRQ callback
2008   m_ext_cpu->set_irq_acknowledge_callback(pic_irq_callback);
2009
2010   // allocate memory
2011   m_extbuf_ram.allocate(0x800);
2012
2013   MACHINE_START_CALL_MEMBER(cbm2_pal);
2014}
2015
2016
2017//-------------------------------------------------
17332018//  MACHINE_START( p500 )
17342019//-------------------------------------------------
17352020
r18768r18769
17812066MACHINE_RESET_MEMBER( cbm2_state, cbm2 )
17822067{
17832068   m_dramon = 1;
2069   m_busen1 = 1;
2070   m_busy2 = 1;
17842071   m_graphics = 1;
17852072   m_tpi1_irq = CLEAR_LINE;
17862073   m_cass_rd = 1;
r18768r18769
18772164   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
18782165   MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, VIC6567_CLOCK, cbm2_expansion_cards, NULL, NULL)
18792166   //MCFG_CBM2_USER_PORT_ADD(CBM2_USER_PORT_TAG, user_intf, cbm2_user_port_cards, NULL, NULL)
1880   //MCFG_CBM2_SYSTEM_PORT_ADD(CBM2_SYSTEM_PORT_TAG, system_intf, cbm2_system_port_cards, NULL, NULL)
18812167
18822168   // internal ram
18832169   MCFG_FRAGMENT_ADD(128k)
r18768r18769
19272213   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
19282214   MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, VIC6569_CLOCK, cbm2_expansion_cards, NULL, NULL)
19292215   //MCFG_CBM2_USER_PORT_ADD(CBM2_USER_PORT_TAG, user_intf, cbm2_user_port_cards, NULL, NULL)
1930   //MCFG_CBM2_SYSTEM_PORT_ADD(CBM2_SYSTEM_PORT_TAG, system_intf, cbm2_system_port_cards, NULL, NULL)
19312216
19322217   // internal ram
19332218   MCFG_FRAGMENT_ADD(128k)
r18768r18769
19602245   MCFG_SCREEN_SIZE(768, 312)
19612246   MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1)
19622247
1963   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/9, lp_crtc_intf)
2248   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/9, crtc_intf)
19642249
19652250   // sound hardware
19662251   MCFG_SPEAKER_STANDARD_MONO("mono")
r18768r18769
19842269   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
19852270   MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, XTAL_18MHz/9, cbm2_expansion_cards, NULL, NULL)
19862271   //MCFG_CBM2_USER_PORT_ADD(CBM2_USER_PORT_TAG, user_intf, cbm2_user_port_cards, NULL, NULL)
1987   //MCFG_CBM2_SYSTEM_PORT_ADD(CBM2_SYSTEM_PORT_TAG, system_intf, cbm2_system_port_cards, NULL, NULL)
19882272
19892273   // software list
19902274   MCFG_SOFTWARE_LIST_ADD("flop_list", "cbm2_flop")
r18768r18769
20532337static MACHINE_CONFIG_START( cbm2hp_ntsc, cbm2hp_state )
20542338   MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
20552339
2056   MCFG_DEVICE_REMOVE(MC68B45_TAG)
2057   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/9, hp_crtc_intf)
2058
20592340   // devices
20602341   MCFG_DEVICE_REMOVE(MOS6525_2_TAG)
20612342   MCFG_TPI6525_ADD(MOS6525_2_TAG, hp_tpi2_intf)
r18768r18769
20892370static MACHINE_CONFIG_START( bx256hp, cbm2hp_state )
20902371   MCFG_FRAGMENT_ADD(b256hp)
20912372
2092   //MCFG_DEVICE_REMOVE(CBM2_SYSTEM_PORT_TAG)
2093   //MCFG_CBM2_SYSTEM_PORT_ADD(CBM2_SYSTEM_PORT_TAG, system_intf, cbm2_system_port_cards, "8088", NULL)
2373   MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2x_ntsc)
2374
2375   MCFG_CPU_ADD(EXT_I8088_TAG, I8088, XTAL_12MHz)
2376   MCFG_CPU_PROGRAM_MAP(ext_mem)
2377   MCFG_CPU_IO_MAP(ext_io)
2378
2379   MCFG_PIC8259_ADD(EXT_I8259A_TAG, ext_pic_intf)
2380   MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf)
2381   MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 50, ext_cia_intf)
20942382MACHINE_CONFIG_END
20952383
20962384
r18768r18769
21392427static MACHINE_CONFIG_START( cbm730, cbm2hp_state )
21402428   MCFG_FRAGMENT_ADD(cbm720)
21412429
2142   //MCFG_DEVICE_REMOVE(CBM2_SYSTEM_PORT_TAG)
2143   //MCFG_CBM2_SYSTEM_PORT_ADD(CBM2_SYSTEM_PORT_TAG, system_intf, cbm2_system_port_cards, "8088", NULL)
2430   MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2x_pal)
2431
2432   MCFG_CPU_ADD(EXT_I8088_TAG, I8088, XTAL_12MHz)
2433   MCFG_CPU_PROGRAM_MAP(ext_mem)
2434   MCFG_CPU_IO_MAP(ext_io)
2435
2436   MCFG_PIC8259_ADD(EXT_I8259A_TAG, ext_pic_intf)
2437   MCFG_TPI6525_ADD(EXT_MOS6525_TAG, ext_tpi_intf)
2438   MCFG_MOS6526_ADD(EXT_MOS6526_TAG, XTAL_18MHz/9, 60, ext_cia_intf)
21442439MACHINE_CONFIG_END
21452440
21462441
r18768r18769
23472642   ROM_LOAD( "901241-03.u59", 0x0000, 0x2000, CRC(5c1f3347) SHA1(2d46be2cd89594b718cdd0a86d51b6f628343f42) )
23482643   ROM_LOAD( "901240-03.u60", 0x2000, 0x2000, CRC(72aa44e1) SHA1(0d7f77746290afba8d0abeb87c9caab9a3ad89ce) )
23492644
2350   ROM_REGION( 0x1000, "8088", 0)
2645   ROM_REGION( 0x1000, EXT_I8088_TAG, 0)
23512646   ROM_LOAD( "8088.u14", 0x0000, 0x1000, CRC(195e0281) SHA1(ce8acd2a5fb6cbd70d837811d856d656544a1f97) )
23522647
23532648   ROM_REGION( 0x2000, "kernal", 0 )
trunk/src/mess/includes/cbm2.h
r18768r18769
55
66#include "emu.h"
77#include "cpu/m6502/m6509.h"
8#include "cpu/i86/i86.h"
89#include "formats/cbm_snqk.h"
910#include "includes/cbm.h"
1011#include "machine/6525tpi.h"
r18768r18769
1617#include "machine/ieee488.h"
1718#include "machine/mos6526.h"
1819#include "machine/petcass.h"
20#include "machine/pic8259.h"
1921#include "machine/pla.h"
2022#include "machine/ram.h"
2123#include "machine/vcsctrl.h"
r18768r18769
4143#define CONTROL1_TAG   "joy1"
4244#define CONTROL2_TAG   "joy2"
4345
46#define EXT_I8088_TAG   "ext_u1"
47#define EXT_I8087_TAG   "ext_u4"
48#define EXT_I8259A_TAG   "ext_u3"
49#define EXT_MOS6526_TAG   "ext_u15"
50#define EXT_MOS6525_TAG   "ext_u16"
51
4452class cbm2_state : public driver_device
4553{
4654public:
r18768r18769
6270        m_ram(*this, RAM_TAG),
6371        m_cassette(*this, PET_DATASSETTE_PORT_TAG),
6472        m_ieee(*this, IEEE488_TAG),
73        m_ext_cpu(*this, EXT_I8088_TAG),
74        m_ext_pic(*this, EXT_I8259A_TAG),
75        m_ext_cia(*this, EXT_MOS6526_TAG),
76        m_ext_tpi(*this, EXT_MOS6525_TAG),
6577        m_buffer_ram(*this, "buffer_ram"),
78        m_extbuf_ram(*this, "extbuf_ram"),
6679        m_dramon(1),
6780        m_video_ram(*this, "video_ram"),
6881        m_video_ram_size(0x800),
r18768r18769
93106   required_device<pet_datassette_port_device> m_cassette;
94107   required_device<ieee488_device> m_ieee;
95108
109   optional_device<cpu_device> m_ext_cpu;
110   optional_device<pic8259_device> m_ext_pic;
111   optional_device<mos6526_device> m_ext_cia;
112   optional_device<tpi6525_device> m_ext_tpi;
113
96114   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
97115
98116   DECLARE_MACHINE_START( cbm2 );
99117   DECLARE_MACHINE_START( cbm2_ntsc );
100118   DECLARE_MACHINE_START( cbm2_pal );
119   DECLARE_MACHINE_START( cbm2x_ntsc );
120   DECLARE_MACHINE_START( cbm2x_pal );
101121   DECLARE_MACHINE_RESET( cbm2 );
102122
103   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
123   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas,
104124      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4);
105125
106   void bankswitch(offs_t offset, int busy2, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
126   void bankswitch(offs_t offset, int eras, int ecas, int refen, int cas, int ras, int *sysioen, int *dramen,
107127      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *buframcs, int *extbufcs, int *vidramcs,
108128      int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs,
109129      int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs);
r18768r18769
112132
113133   DECLARE_READ8_MEMBER( read );
114134   DECLARE_WRITE8_MEMBER( write );
135   DECLARE_READ8_MEMBER( ext_read );
136   DECLARE_WRITE8_MEMBER( ext_write );
115137
116138   DECLARE_READ8_MEMBER( sid_potx_r );
117139   DECLARE_READ8_MEMBER( sid_poty_r );
r18768r18769
135157
136158   DECLARE_WRITE_LINE_MEMBER( tape_read_w );
137159
160   DECLARE_READ8_MEMBER( ext_tpi_pb_r );
161   DECLARE_WRITE8_MEMBER( ext_tpi_pb_w );
162   DECLARE_WRITE8_MEMBER( ext_tpi_pc_w );
163
164   DECLARE_READ8_MEMBER( ext_cia_pb_r );
165   DECLARE_WRITE8_MEMBER( ext_cia_pb_w );
166
138167   // memory state
139168   optional_shared_ptr<UINT8> m_buffer_ram;
169   optional_shared_ptr<UINT8> m_extbuf_ram;
140170   UINT8 *m_basic;
141171   UINT8 *m_kernal;
142172   UINT8 *m_charom;
143173   int m_dramon;
174   int m_busen1;
175   int m_busy2;
144176
145177   // video state
146178   optional_shared_ptr<UINT8> m_video_ram;
r18768r18769
172204      : cbm2_state(mconfig, type, tag)
173205   { }
174206
175   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int busy2,
207   virtual void read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas,
176208      int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4);
177209
178210   DECLARE_READ8_MEMBER( tpi2_pc_r );

Previous 199869 Revisions Next


© 1997-2024 The MAME Team