Previous 15994 Revisions Next

r10869 Sunday 20th March, 2011 at 05:41:53 UTC by Jonathan Gevaryahu
Prose 2000/2020: attached 8259 PIC, but int sources are not hooked up yet, also not sure if callback is done properly. Startup test 3 still does not pass properly, keeps resetting (waiting for 8251 interrupt?).
[src/mess/drivers]tsispch.c
[src/mess/includes]tsispch.h

src/mess/includes/tsispch.h
r10868r10869
1919        m_maincpu(*this, "maincpu"),
2020        m_dsp(*this, "dsp"),
2121        m_terminal(*this, TERMINAL_TAG),
22        m_uart(*this, "i8251a_u15")
22        m_uart(*this, "i8251a_u15"),
23        m_pic(*this, "pic8259")
2324      { }
2425     
2526   required_device<cpu_device> m_maincpu;
2627   required_device<cpu_device> m_dsp;
2728   required_device<device_t> m_terminal;
2829   required_device<device_t> m_uart;
30   required_device<device_t> m_pic;
2931
3032   UINT8 infifo[32];         // input fifo
3133   UINT8 infifo_tail_ptr;      // " tail
src/mess/drivers/tsispch.c
r10868r10869
1717*  Correctly load UPD7720 roms as UPD7725 data - done, this is utterly disgusting code.
1818*  Attached i8251a uart at u15
1919*  Added dipswitch array S4
20*  Attached 8259 PIC - done, but int sources are not hooked up yet, also not sure if callback is done properly
2021*
2122*  TODO:
2223*  Hook the terminal to the i8251a uart at u15
r10868r10869
2425*  Attach the other i8251a uart (assuming it is hooked to the hardware at all!)
2526*  Correctly implement UPD7720 cpu core to avoid needing revolting conversion code
2627*  Correct memory maps and io maps - partly done
27*  Attach 8259 PIC and figure out where all the ints come from
28*  8259 PIC: figure out where all the ints come from
2829*  Add other dipswitches and jumpers (these may actually just control clock dividers for the two 8251s)
2930*  Everything else
3031*
r10868r10869
4142#include "cpu/upd7725/upd7725.h"
4243#include "cpu/i86/i86.h"
4344#include "machine/msm8251.h"
45#include "machine/pic8259.h"
4446#include "machine/terminal.h"
4547
4648/*
r10868r10869
5860   return 0x00ea; // does exactly what it says on the tin
5961}*/
6062
61/* led/dipswitch stuff */
63/*****************************************************************************
64 PIC 8259 stuff
65*****************************************************************************/
66static WRITE_LINE_DEVICE_HANDLER( pic8259_set_int_line )
67{
68   cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
69}
70
71static const struct pic8259_interface pic8259_config =
72{
73   DEVCB_LINE(pic8259_set_int_line)
74};
75
76static IRQ_CALLBACK(irq_callback)
77{
78   int r = 0;
79   r = pic8259_acknowledge(device->machine->device("pic8259"));
80   return r;
81}
82
83/*****************************************************************************
84 LED/dipswitch stuff
85*****************************************************************************/
6286READ8_MEMBER( tsispch_state::dsw_r )
6387{
6488   UINT8 data;
r10868r10869
94118   popmessage("LED status: (%x) %x %x %x %x (%x %x %x)\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0));
95119}
96120
97
98/* upd7720 stuff */
99
121/*****************************************************************************
122 UPD77P20 stuff
123*****************************************************************************/
100124READ16_MEMBER( tsispch_state::dsp_data_r )
101125{
102126   upd7725_device *upd7725 = machine->device<upd7725_device>("dsp");
r10868r10869
136160   upd7725->snesdsp_write(false, data);
137161}
138162
139/* Reset */
163/*****************************************************************************
164 Reset and Driver Init
165*****************************************************************************/
140166void tsispch_state::machine_reset()
141167{
142168   // clear fifos (TODO: memset would work better here...)
143169   int i;
144170   for (i=0; i<32; i++) infifo[i] = 0;
145171   infifo_tail_ptr = infifo_head_ptr = 0;
172   cpu_set_irq_callback(machine->device("maincpu"), irq_callback);
146173   // below seem to be unnecessary?
147174   //cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
148175   //cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, CLEAR_LINE);
r10868r10869
219246   AM_RANGE(0x00000, 0x02FFF) AM_MIRROR(0x34000) AM_RAM // verified; 6264*2 sram, only first 3/4 used
220247   AM_RANGE(0x03000, 0x03001) AM_MIRROR(0x341FC) AM_DEVREADWRITE8_LEGACY("i8251a_u15", msm8251_data_r, msm8251_data_w, 0x00FF)
221248   AM_RANGE(0x03002, 0x03003) AM_MIRROR(0x341FC) AM_DEVREADWRITE8_LEGACY("i8251a_u15", msm8251_status_r, msm8251_control_w, 0x00FF)
222   //AM_RANGE(0x03200, 0x03203) AM_MIRROR(0x341FC) // AMD P8259 PIC @ U5 (reads as 04 and 7c, upper byte is open bus)
249   AM_RANGE(0x03200, 0x03203) AM_MIRROR(0x341FC) AM_DEVREADWRITE8_LEGACY("pic8259", pic8259_r, pic8259_w, 0x00FF) // AMD P8259 PIC @ U5 (reads as 04 and 7c, upper byte is open bus)
223250   AM_RANGE(0x03400, 0x03401) AM_MIRROR(0x341FE) AM_READ8(dsw_r, 0x00FF) // verified, read from dipswitch s4
224251   AM_RANGE(0x03400, 0x03401) AM_MIRROR(0x341FE) AM_WRITE8(led_w, 0xFF00) // verified, write to the 4 leds, plus 4 other mystery bits
225252   AM_RANGE(0x03600, 0x03601) AM_MIRROR(0x341FC) AM_READWRITE(dsp_data_r, dsp_data_w) // verified; UPD77P20 data reg r/w
r10868r10869
287314    MCFG_CPU_PROGRAM_MAP(dsp_prg_map)
288315    MCFG_CPU_DATA_MAP(dsp_data_map)
289316
317    /* PIC 8259 */
318    MCFG_PIC8259_ADD("pic8259", pic8259_config)
319
290320    /* uarts */
291321    MCFG_MSM8251_ADD("i8251a_u15", default_msm8251_interface)
292322

Previous 15994 Revisions Next


© 1998-2018 The MESS Team