Previous 15994 Revisions Next

r15656 Tuesday 24th July, 2012 at 02:42:50 UTC by R. Belmont
Resubmit of last patch with proper contents (doh) (nw)
[src/emu/machine]am9517a.c
[src/mess/drivers]at.c
[src/mess/includes]at.h genpc.h
[src/mess/machine]at.c genpc.c southbridge.c southbridge.h

src/emu/machine/am9517a.c
r15655r15656
118118   {
119119      m_status &= ~(1 << (channel + 4));
120120   }
121   trigger(1);
121122}
122123
123124
r15655r15656
142143
143144
144145//-------------------------------------------------
145//  set_hreq -
146//  set_hreq
146147//-------------------------------------------------
147148
148149inline void am9517a_device::set_hreq(int state)
r15655r15656
498499               }
499500            }
500501         }
502         if(m_state == STATE_SI)
503         {
504            suspend_until_trigger(1, true);
505            m_icount = 0;
506         }
501507         break;
502508
503509      case STATE_S0:
r15655r15656
507513         {
508514            m_state = (MODE_MASK == MODE_CASCADE) ? STATE_SC : get_state1(true);
509515         }
516         else
517         {
518            suspend_until_trigger(1, true);
519            m_icount = 0;
520         }
510521         break;
511522
512523      case STATE_SC:
513524         if (!is_request_active(m_current_channel))
514525         {
526            set_hreq(0);
515527            m_current_channel = -1;
516528            m_state = STATE_SI;
517529         }
530         else
531         {
532            suspend_until_trigger(1, true);
533            m_icount = 0;
534         }
518535
519536         set_dack();
520537         break;
r15655r15656
649666         data = m_status;
650667
651668         // clear TC bits
652         m_status &= 0x0f;
669         m_status &= 0xf0;
653670         break;
654671
655672      case REGISTER_TEMPORARY:
r15655r15656
793810         break;
794811      }
795812   }
813   trigger(1);
796814}
797815
798816
r15655r15656
805823   if (LOG) logerror("AM9517A '%s' Hold Acknowledge: %u\n", tag(), state);
806824
807825   m_hack = state;
826   trigger(1);
808827}
809828
810829
src/mess/machine/at.c
r15655r15656
158158   device_set_input_line(m_maincpu, INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
159159
160160   /* Assert HLDA */
161   i8237_hlda_w( m_dma8237_2, state );
161   m_dma8237_2->hack_w(state);
162162}
163163
164164READ8_MEMBER(at_state::pc_dma_read_byte)
r15655r15656
229229WRITE_LINE_MEMBER( at_state::pc_dack1_w ) { set_dma_channel(m_dma8237_1, 1, state); }
230230WRITE_LINE_MEMBER( at_state::pc_dack2_w ) { set_dma_channel(m_dma8237_1, 2, state); }
231231WRITE_LINE_MEMBER( at_state::pc_dack3_w ) { set_dma_channel(m_dma8237_1, 3, state); }
232WRITE_LINE_MEMBER( at_state::pc_dack4_w ) { i8237_hlda_w( m_dma8237_1, state ? 0 : 1); } // it's inverted
232WRITE_LINE_MEMBER( at_state::pc_dack4_w ) { m_dma8237_1->hack_w(state ? 0 : 1); } // it's inverted
233233WRITE_LINE_MEMBER( at_state::pc_dack5_w ) { set_dma_channel(m_dma8237_2, 5, state); }
234234WRITE_LINE_MEMBER( at_state::pc_dack6_w ) { set_dma_channel(m_dma8237_2, 6, state); }
235235WRITE_LINE_MEMBER( at_state::pc_dack7_w ) { set_dma_channel(m_dma8237_2, 7, state); }
236236
237237I8237_INTERFACE( at_dma8237_1_config )
238238{
239   DEVCB_DEVICE_LINE("dma8237_2",i8237_dreq0_w),
239   DEVCB_DEVICE_LINE_MEMBER("dma8237_2", am9517a_device, dreq0_w),
240240   DEVCB_DRIVER_LINE_MEMBER(at_state, at_dma8237_out_eop),
241241   DEVCB_DRIVER_MEMBER(at_state, pc_dma_read_byte),
242242   DEVCB_DRIVER_MEMBER(at_state, pc_dma_write_byte),
src/mess/machine/genpc.c
r15655r15656
1111#include "machine/i8255.h"
1212#include "machine/pic8259.h"
1313#include "machine/pit8253.h"
14#include "machine/8237dma.h"
1514#include "sound/speaker.h"
1615#include "machine/ram.h"
1716#include "imagedev/cassette.h"
r15655r15656
6463   device_set_input_line(m_maincpu, INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
6564
6665   /* Assert HLDA */
67   i8237_hlda_w( m_dma8237, state );
66   m_dma8237->hack_w(state);
6867}
6968
7069
r15655r15656
122121WRITE8_MEMBER( ibm5160_mb_device::pc_dma8237_0_dack_w )
123122{
124123   m_u73_q2 = 0;
125   i8237_dreq0_w( m_dma8237, m_u73_q2 );
124   m_dma8237->dreq0_w( m_u73_q2 );
126125}
127126
128127
r15655r15656
199198   if ( m_out1 == 0 && state == 1 && m_u73_q2 == 0 )
200199   {
201200      m_u73_q2 = 1;
202      i8237_dreq0_w( m_dma8237, m_u73_q2 );
201      m_dma8237->dreq0_w( m_u73_q2 );
203202   }
204203   m_out1 = state;
205204}
r15655r15656
422421   DEVCB_DEVICE_LINE("pic8259", pic8259_ir7_w),
423422
424423   // dma request
425   DEVCB_DEVICE_LINE("dma8237", i8237_dreq1_w),
426   DEVCB_DEVICE_LINE("dma8237", i8237_dreq2_w),
427   DEVCB_DEVICE_LINE("dma8237", i8237_dreq3_w)
424   DEVCB_DEVICE_LINE_MEMBER("dma8237", am9517a_device, dreq1_w),
425   DEVCB_DEVICE_LINE_MEMBER("dma8237", am9517a_device, dreq2_w),
426   DEVCB_DEVICE_LINE_MEMBER("dma8237", am9517a_device, dreq3_w)
428427};
429428
430429static const pc_kbdc_interface pc_kbdc_intf =
r15655r15656
583582   }
584583}
585584
585void ibm5160_mb_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler)
586{
587   int buswidth = m_maincpu->memory().space_config(AS_IO)->m_databus_width;
588   switch(buswidth)
589   {
590      case 8:
591         m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0);
592         break;
593      case 16:
594         m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff);
595         break;
596      default:
597         fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported", buswidth);
598         break;
599   }
600}
586601
602
587603//-------------------------------------------------
588604//  device_start - device-specific startup
589605//-------------------------------------------------
590606
591607void ibm5160_mb_device::device_start()
592608{
593   install_device(m_dma8237, 0x0000, 0x000f, 0, 0, FUNC(i8237_r), FUNC(i8237_w) );
609   install_device(0x0000, 0x000f, 0, 0, read8_delegate(FUNC(am9517a_device::read), (am9517a_device*)m_dma8237), write8_delegate(FUNC(am9517a_device::write), (am9517a_device*)m_dma8237) );
594610   install_device(m_pic8259, 0x0020, 0x0021, 0, 0, FUNC(pic8259_r), FUNC(pic8259_w) );
595611   install_device(m_pit8253, 0x0040, 0x0043, 0, 0, FUNC(pit8253_r), FUNC(pit8253_w) );
596612
r15655r15656
632648   device_set_irq_callback(m_maincpu, pc_irq_callback);
633649
634650   m_u73_q2 = 0;
635   m_out1 = 0;
651   m_out1 = 2; // initial state of pit output is undefined
636652   m_pc_spkrdata = 0;
637653   m_pc_input = 0;
638654   m_dma_channel = 0;
src/mess/machine/southbridge.c
r15655r15656
88#include "cpu/i386/i386.h"
99#include "machine/southbridge.h"
1010#include "machine/pc_keyboards.h"
11#include "machine/8237dma.h"
1112
1213const struct pic8259_interface at_pic8259_master_config =
1314{
src/mess/machine/southbridge.h
r15655r15656
2121#include "includes/ps2.h"
2222
2323#include "imagedev/harddriv.h"
24#include "machine/8237dma.h"
2524#include "machine/pci.h"
2625#include "machine/kb_keytro.h"
2726
src/mess/includes/genpc.h
r15655r15656
99
1010#include "machine/ins8250.h"
1111#include "machine/i8255.h"
12#include "machine/8237dma.h"
12#include "machine/am9517a.h"
1313#include "machine/isa.h"
1414#include "machine/pc_kbdc.h"
1515#include "imagedev/cassette.h"
r15655r15656
3737
3838   void install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name);
3939   void install_device_write(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_device_func whandler, const char *whandler_name);
40   void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler);
4041public:
4142   required_device<cpu_device>  m_maincpu;
4243   required_device<device_t>  m_pic8259;
43   required_device<device_t>  m_dma8237;
44   required_device<am9517a_device>  m_dma8237;
4445   required_device<device_t>  m_pit8253;
4546   required_device<i8255_device>  m_ppi8255;
4647   required_device<device_t>  m_speaker;
src/mess/includes/at.h
r15655r15656
3636#include "includes/ps2.h"
3737
3838#include "imagedev/harddriv.h"
39#include "machine/8237dma.h"
39#include "machine/am9517a.h"
4040#include "machine/pci.h"
4141#include "machine/kb_keytro.h"
4242
r15655r15656
9999   required_device<cpu_device> m_maincpu;
100100   optional_device<device_t> m_pic8259_master;
101101   optional_device<device_t> m_pic8259_slave;
102   optional_device<device_t> m_dma8237_1;
103   optional_device<device_t> m_dma8237_2;
102   optional_device<am9517a_device> m_dma8237_1;
103   optional_device<am9517a_device> m_dma8237_2;
104104   optional_device<device_t> m_pit8254;
105105   optional_device<cs8221_device> m_cs8221;
106106   optional_device<cs4031_device> m_cs4031;
r15655r15656
180180extern const struct pic8259_interface at_pic8259_master_config;
181181extern const struct pic8259_interface at_pic8259_slave_config;
182182extern const struct pit8253_config at_pit8254_config;
183extern const i8237_interface at_dma8237_1_config;
184extern const i8237_interface at_dma8237_2_config;
183extern const am9517a_interface at_dma8237_1_config;
184extern const am9517a_interface at_dma8237_2_config;
185185
186186
187187DRIVER_INIT( atcga );
src/mess/drivers/at.c
r15655r15656
6262
6363READ8_MEMBER( at_state::at_dma8237_2_r )
6464{
65   return i8237_r( m_dma8237_2, offset / 2);
65   return m_dma8237_2->read(space, offset / 2);
6666}
6767
6868WRITE8_MEMBER( at_state::at_dma8237_2_w )
6969{
70   i8237_w( m_dma8237_2, offset / 2, data);
70   m_dma8237_2->write(space, offset / 2, data);
7171}
7272
7373READ8_MEMBER( at_state::at_keybc_r )
r15655r15656
105105
106106static ADDRESS_MAP_START( at16_io, AS_IO, 16, at_state )
107107   ADDRESS_MAP_UNMAP_HIGH
108   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8_LEGACY("dma8237_1", i8237_r, i8237_w, 0xffff)
108   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffff)
109109   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0xffff)
110110   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffff)
111111   AM_RANGE(0x0060, 0x0063) AM_READWRITE8(at_keybc_r, at_keybc_w, 0xffff)
r15655r15656
136136
137137static ADDRESS_MAP_START( neat_io, AS_IO, 16, at_state )
138138   ADDRESS_MAP_UNMAP_HIGH
139   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8_LEGACY("dma8237_1", i8237_r, i8237_w, 0xffff)
139   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffff)
140140   AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0xffff)
141141   AM_RANGE(0x0022, 0x0023) AM_READWRITE(neat_chipset_r, neat_chipset_w)
142142   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffff)
r15655r15656
150150
151151static ADDRESS_MAP_START( at386_io, AS_IO, 32, at_state )
152152   ADDRESS_MAP_UNMAP_HIGH
153   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8_LEGACY("dma8237_1", i8237_r, i8237_w, 0xffffffff)
153   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffffffff)
154154   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0xffffffff)
155155   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff)
156156   AM_RANGE(0x0060, 0x0063) AM_READWRITE8(at_keybc_r, at_keybc_w, 0xffff)
r15655r15656
193193
194194static ADDRESS_MAP_START( ct486_io, AS_IO, 32, at_state )
195195   ADDRESS_MAP_UNMAP_HIGH
196   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8_LEGACY("dma8237_1", i8237_r, i8237_w, 0xffffffff)
196   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffffffff)
197197   AM_RANGE(0x0020, 0x0023) AM_READWRITE(ct486_chipset_r, ct486_chipset_w)
198198   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff)
199199   AM_RANGE(0x0060, 0x0063) AM_READWRITE8(at_keybc_r, at_keybc_w, 0xffff)
r15655r15656
212212
213213static ADDRESS_MAP_START( megapc_io, AS_IO, 32, at_state )
214214   ADDRESS_MAP_UNMAP_HIGH
215   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8_LEGACY("dma8237_1", i8237_r, i8237_w, 0xffffffff)
215   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffffffff)
216216   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8_LEGACY("pic8259_master", pic8259_r, pic8259_w, 0xffffffff)
217217   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8_LEGACY("pit8254", pit8253_r, pit8253_w, 0xffffffff)
218218   AM_RANGE(0x0060, 0x0063) AM_READWRITE8(at_keybc_r, at_keybc_w, 0xffff) // TODO: is this the correct type?
r15655r15656
335335   DEVCB_DEVICE_LINE("pic8259_slave", pic8259_ir7_w),
336336
337337   // dma request
338   DEVCB_DEVICE_LINE("dma8237_1", i8237_dreq0_w),
339   DEVCB_DEVICE_LINE("dma8237_1", i8237_dreq1_w),
340   DEVCB_DEVICE_LINE("dma8237_1", i8237_dreq2_w),
341   DEVCB_DEVICE_LINE("dma8237_1", i8237_dreq3_w),
338   DEVCB_DEVICE_LINE_MEMBER("dma8237_1", am9517a_device, dreq0_w),
339   DEVCB_DEVICE_LINE_MEMBER("dma8237_1", am9517a_device, dreq1_w),
340   DEVCB_DEVICE_LINE_MEMBER("dma8237_1", am9517a_device, dreq2_w),
341   DEVCB_DEVICE_LINE_MEMBER("dma8237_1", am9517a_device, dreq3_w),
342342
343   DEVCB_DEVICE_LINE("dma8237_2", i8237_dreq1_w),
344   DEVCB_DEVICE_LINE("dma8237_2", i8237_dreq2_w),
345   DEVCB_DEVICE_LINE("dma8237_2", i8237_dreq3_w),
343   DEVCB_DEVICE_LINE_MEMBER("dma8237_2", am9517a_device, dreq1_w),
344   DEVCB_DEVICE_LINE_MEMBER("dma8237_2", am9517a_device, dreq2_w),
345   DEVCB_DEVICE_LINE_MEMBER("dma8237_2", am9517a_device, dreq3_w),
346346};
347347
348348static SLOT_INTERFACE_START(pc_isa16_cards)
r15655r15656
425425   /* internal ram */
426426   MCFG_RAM_ADD(RAM_TAG)
427427   MCFG_RAM_DEFAULT_SIZE("1664K")
428   MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,16M")
428429MACHINE_CONFIG_END
429430
430431
r15655r15656
459460   /* internal ram */
460461   MCFG_RAM_ADD(RAM_TAG)
461462   MCFG_RAM_DEFAULT_SIZE("1664K")
463   MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,16M")
462464MACHINE_CONFIG_END
463465
464466
r15655r15656
480482   /* internal ram */
481483   MCFG_RAM_ADD(RAM_TAG)
482484   MCFG_RAM_DEFAULT_SIZE("1664K")
485   MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,16M")
483486MACHINE_CONFIG_END
484487
485488
r15655r15656
504507   /* internal ram */
505508   MCFG_RAM_ADD(RAM_TAG)
506509   MCFG_RAM_DEFAULT_SIZE("1664K")
510   MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,16M")
507511MACHINE_CONFIG_END
508512
509513static MACHINE_CONFIG_START( atvga, at_state )
r15655r15656
525529   /* internal ram */
526530   MCFG_RAM_ADD(RAM_TAG)
527531   MCFG_RAM_DEFAULT_SIZE("1664K")
532   MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,16M")
528533MACHINE_CONFIG_END
529534
530535static MACHINE_CONFIG_START( xb42639, at_state )
r15655r15656
545550   /* internal ram */
546551   MCFG_RAM_ADD(RAM_TAG)
547552   MCFG_RAM_DEFAULT_SIZE("1664K")
553   MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,16M")
548554MACHINE_CONFIG_END
549555
550556//-------------------------------------------------

Previous 15994 Revisions Next


© 1998-2018 The MESS Team