Previous 199869 Revisions Next

r35156 Saturday 21st February, 2015 at 03:36:16 UTC by Robbbert
(MESS) zorba : system can boot from floppy, is now usable. [Robbbert]
[src/mess/drivers]pc9801.c zorba.c

trunk/src/mess/drivers/pc9801.c
r243667r243668
14101410   {
14111411      if(BIT(m_egc.regs[2], 10))
14121412      {
1413         m_egc.leftover[0] = 0;
1413         m_egc.leftover[0] = m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = 0;
14141414         egc_shift(0, data);
14151415         // leftover[0] is inited above, set others to same
14161416         m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = m_egc.leftover[0];
r243667r243668
14221422   // mask off the bits before the start
14231423   if(m_egc.first)
14241424   {
1425      mask &= dir ? ~((1 << dst_off) - 1) : ((1 << (16 - dst_off)) - 1);
1426      if(BIT(m_egc.regs[2], 10) && !m_egc.init)
1425      mask &= dir ? ~((1 << dst_off) - 1) : ((1 << (dst_off + 1)) - 1);
1426      if(!m_egc.init)
14271427         m_egc.leftover[0] = m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = 0;
14281428   }
14291429
r243667r243668
15131513      m_egc.pat[2] = m_video_ram_2[plane_off + (0x4000 * 3)];
15141514      m_egc.pat[3] = m_video_ram_2[plane_off];
15151515   }
1516   if(m_egc.first && !m_egc.init)
1517   {
1518      m_egc.leftover[0] = m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = 0;
1519      m_egc.init = true;
1520   }
15211516   for(int i = 0; i < 4; i++)
15221517      m_egc.src[i] = egc_shift(i, m_video_ram_2[plane_off + (((i + 1) & 3) * 0x4000)]);
15231518
r243667r243668
15731568         {
15741569            if((m_grcg.mode & (1 << i)) == 0)
15751570            {
1571
15761572               if(mem_mask & 0xff)
15771573               {
15781574                  vram[offset | (((i + 1) & 3) * 0x8000)] &= ~(data >> 0);
r243667r243668
19001896   else if(offset == 7)
19011897   {
19021898//      logerror("%02x GRCG TILE %02x\n",data,m_grcg.tile_index);
1903      m_grcg.tile[m_grcg.tile_index] = BITSWAP8(data,0,1,2,3,4,5,6,7);
1899      m_grcg.tile[m_grcg.tile_index] = BITSWAP16((UINT16) data,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7);
19041900      m_grcg.tile_index ++;
19051901      m_grcg.tile_index &= 3;
19061902      return;
r243667r243668
19141910   if(!m_ex_video_ff[2])
19151911      return;
19161912
1917   if(!(m_egc.regs[1] & 0x6000) || (offset != 4)) // why?
1918      COMBINE_DATA(&m_egc.regs[offset]);
1913   COMBINE_DATA(&m_egc.regs[offset]);
19191914   switch(offset)
19201915   {
19211916      case 1:
trunk/src/mess/drivers/zorba.c
r243667r243668
1313The keyboard is an intelligent serial device like the Kaypro's keyboard. They even have the same plug,
1414and might be swappable. Need a schematic.
1515
16Instead of using a daisy chain, the IM2 vectors are calculated by a prom (u77). Unfortunately, the prom
17contents make no sense at all (mostly FF), so the vectors for IRQ0 and IRQ2 are hard-coded. Other IRQ
18vectors are not used as yet.
19
20Status:
21- Boots up, and the keyboard works
22
1623ToDo:
17- Add interrupt vector hardware and masking feature
24- Need software that does more than plain text (such as games)
25- Add masking feature (only used for the UARTs)
1826- Connect devices to the above hardware
1927- Fix the display
20- Fix floppy-disk
21- Connect up the PIT
28- Connect the PIT to the UARTs
2229- Replace the ascii keyboard with the real one, if possible
2330- Probably lots of other things
2431
r243667r243668
3845#include "machine/keyboard.h"
3946#include "machine/wd_fdc.h"
4047
41#define KEYBOARD_TAG "keyboard"
4248
4349class zorba_state : public driver_device
4450{
r243667r243668
7783   DECLARE_WRITE8_MEMBER(pia0_porta_w);
7884   DECLARE_WRITE8_MEMBER(kbd_put);
7985   DECLARE_READ8_MEMBER(keyboard_r);
80   I8275_DRAW_CHARACTER_MEMBER( zorba_update_chr );
86   DECLARE_WRITE_LINE_MEMBER(irq0_w);
87   DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
88   DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
89   I8275_DRAW_CHARACTER_MEMBER(zorba_update_chr);
8190   required_device<palette_device> m_palette;
8291
8392private:
8493   UINT8 m_term_data;
94   UINT8 m_fdc_rq;
8595   required_device<cpu_device> m_maincpu;
8696   required_device<beep_device> m_beep;
8797   required_device<z80dma_device> m_dma;
r243667r243668
149159   membank("bankr0")->set_entry(1);
150160}
151161
162WRITE_LINE_MEMBER( zorba_state::irq0_w )
163{
164   if (state)
165   {
166      m_maincpu->set_input_line_vector(0, 0x88);
167      m_maincpu->set_input_line(0, ASSERT_LINE);
168   }
169   else
170      m_maincpu->set_input_line(0, CLEAR_LINE);
171}
172
173WRITE_LINE_MEMBER( zorba_state::fdc_intrq_w )
174{
175   m_fdc_rq = (m_fdc_rq & 2) | state;
176   if (m_fdc_rq == 1)
177   {
178      m_maincpu->set_input_line_vector(0, 0x80);
179      m_maincpu->set_input_line(0, ASSERT_LINE);
180   }
181   else
182   if (m_fdc_rq == 0)
183      m_maincpu->set_input_line(0, CLEAR_LINE);
184}
185
186WRITE_LINE_MEMBER( zorba_state::fdc_drq_w )
187{
188   m_fdc_rq = (m_fdc_rq & 1) | (state << 1);
189   if (m_fdc_rq == 2)
190   {
191      m_maincpu->set_input_line_vector(0, 0x80);
192      m_maincpu->set_input_line(0, ASSERT_LINE);
193   }
194   else
195   if (m_fdc_rq == 0)
196      m_maincpu->set_input_line(0, CLEAR_LINE);
197}
198
152199WRITE8_MEMBER( zorba_state::intmask_w )
153200{
154201}
r243667r243668
173220{
174221// since our Z80 has no support for BUSACK, we assume it is granted immediately
175222   m_maincpu->set_input_line(Z80_INPUT_LINE_BUSRQ, state);
176   m_maincpu->set_input_line(INPUT_LINE_HALT, state); // do we need this?
177223   m_dma->bai_w(state); // tell dma that bus has been granted
178224}
179225
r243667r243668
226272   m_fdc->set_floppy(floppy);
227273
228274   if (floppy)
229   {
230      floppy->ss_w(!BIT(data, 5)); // might need inverting
231   }
275      floppy->ss_w(!BIT(data, 5));
232276
233277   m_floppy0->get_device()->mon_w(BIT(data, 4));
234278   m_floppy1->get_device()->mon_w(BIT(data, 4));
r243667r243668
275319
276320MACHINE_RESET_MEMBER( zorba_state, zorba )
277321{
322   m_fdc_rq = 0;
278323   m_beep->set_frequency(800);
279324   m_p_chargen = memregion("chargen")->base();
280325   membank("bankr0")->set_entry(1); // point at rom
281326   membank("bankw0")->set_entry(0); // always write to ram
327   m_maincpu->reset();
282328}
283329
284330READ8_MEMBER( zorba_state::keyboard_r )
r243667r243668
323369   MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_24MHz/6)
324370   // busack on cpu connects to bai pin
325371   MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(zorba_state, busreq_w))  //connects to busreq on cpu
326   MCFG_Z80DMA_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))   // connects to IRQ0 on cpu
372   MCFG_Z80DMA_OUT_INT_CB(WRITELINE(zorba_state, irq0_w))   // connects to IRQ0 on IM2 controller
327373   //ba0 - not connected
328374   MCFG_Z80DMA_IN_MREQ_CB(READ8(zorba_state, memory_read_byte))
329375   MCFG_Z80DMA_OUT_MREQ_CB(WRITE8(zorba_state, memory_write_byte))
330376   MCFG_Z80DMA_IN_IORQ_CB(READ8(zorba_state, io_read_byte))
331377   MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(zorba_state, io_write_byte))
332378
333   MCFG_DEVICE_ADD("uart0", I8251, 0)
334   // COM port
379   MCFG_DEVICE_ADD("uart0", I8251, 0) // U32 COM port J2
335380
336   MCFG_DEVICE_ADD("uart1", I8251, 0)
337   // printer port
381   MCFG_DEVICE_ADD("uart1", I8251, 0) // U31 printer port J3
338382
339   MCFG_DEVICE_ADD("uart2", I8251, 0)
340   // keyboard
383   MCFG_DEVICE_ADD("uart2", I8251, 0) // U30 serial keyboard J6
341384
342// port A - disk select etc, beeper
343// port B - parallel interface
385   // port A - disk select etc, beeper
386   // port B - parallel interface
344387   MCFG_DEVICE_ADD("pia0", PIA6821, 0)
345388   MCFG_PIA_WRITEPA_HANDLER(WRITE8(zorba_state, pia0_porta_w))
346389
347// IEEE488 interface
390   // IEEE488 interface
348391   MCFG_DEVICE_ADD("pia1", PIA6821, 0)
349392
350393   MCFG_DEVICE_ADD("pit", PIT8254, 0)
351   MCFG_PIT8253_CLK0(XTAL_24MHz / 3) /* Timer 0: ? */
352   MCFG_PIT8253_CLK1(XTAL_24MHz / 3) /* Timer 1: ? */
353   MCFG_PIT8253_CLK2(XTAL_24MHz / 3) /* Timer 2: ? */
394   MCFG_PIT8253_CLK0(XTAL_24MHz / 3) /* Timer 0: clock to J2 comm port */
395   MCFG_PIT8253_CLK1(XTAL_24MHz / 3) /* Timer 1: clock to U31 */
396   MCFG_PIT8253_CLK2(XTAL_24MHz / 3) /* Timer 2: clock to U30 */
354397
355398   MCFG_DEVICE_ADD("crtc", I8275, XTAL_14_31818MHz/7)
356399   MCFG_I8275_CHARACTER_WIDTH(8)
357400   MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(zorba_state, zorba_update_chr)
358401   MCFG_I8275_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
359   MCFG_I8275_IRQ_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
402   MCFG_I8275_IRQ_CALLBACK(WRITELINE(zorba_state, irq0_w))
360403   MCFG_FD1793x_ADD("fdc", XTAL_24MHz / 24)
404   MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(zorba_state, fdc_intrq_w))
405   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(zorba_state, fdc_drq_w))
406   //MCFG_WD_FDC_FORCE_READY
361407   MCFG_FLOPPY_DRIVE_ADD("fdc:0", zorba_floppies, "525dd", floppy_image_device::default_floppy_formats)
362408   MCFG_FLOPPY_DRIVE_ADD("fdc:1", zorba_floppies, "525dd", floppy_image_device::default_floppy_formats)
363409
364410   /* Keyboard */
365   MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
411   MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
366412   MCFG_GENERIC_KEYBOARD_CB(WRITE8(zorba_state, kbd_put))
367413MACHINE_CONFIG_END
368414
r243667r243668
379425   ROM_REGION( 0x60, "proms", 0 )
380426   ROM_LOAD( "74ls288.u37", 0x0000, 0x0020, CRC(0a67edd6) SHA1(c1ece8978a3a061e0130d43907fa63a71e75e75d) )
381427   ROM_LOAD( "74ls288.u38", 0x0020, 0x0020, CRC(5ec93ea7) SHA1(3a84c098474b05d5cbe1939a3e15f66d06470581) )
382   ROM_LOAD( "74ls288.u77", 0x0040, 0x0020, CRC(946e03b0) SHA1(24240bdd7bdf507a5b51628fb36ad1266fc53a28) )
428   ROM_LOAD( "74ls288.u77", 0x0040, 0x0020, CRC(946e03b0) SHA1(24240bdd7bdf507a5b51628fb36ad1266fc53a28) ) // suspected bad dump
383429ROM_END
384430
385431COMP( 1982, zorba, 0, 0, zorba, zorba, zorba_state, zorba, "Telcon Industries", "Zorba", GAME_NOT_WORKING )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team