Previous 199869 Revisions Next

r19819 Tuesday 25th December, 2012 at 21:09:15 UTC by Angelo Salese
Added placeholders for a keyboard device
[src/mess]mess.mak
[src/mess/drivers]pc9801.c
[src/mess/machine]pc9801_kbd.c* pc9801_kbd.h*

trunk/src/mess/machine/pc9801_kbd.c
r0r19819
1/***************************************************************************
2
3   PC-9801 Keyboard simulation
4
5***************************************************************************/
6
7#include "emu.h"
8#include "machine/pc9801_kbd.h"
9
10
11
12//**************************************************************************
13//  GLOBAL VARIABLES
14//**************************************************************************
15
16// device type definition
17const device_type PC9801_KBD = &device_creator<pc9801_kbd_device>;
18
19
20//**************************************************************************
21//  LIVE DEVICE
22//**************************************************************************
23
24//-------------------------------------------------
25//  pc9801_kbd_device - constructor
26//-------------------------------------------------
27
28pc9801_kbd_device::pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
29   : device_t(mconfig, PC9801_KBD, "pc9801_kbd", tag, owner, clock)
30{
31
32}
33
34//-------------------------------------------------
35//  input_ports - device-specific input ports
36//-------------------------------------------------
37
38static INPUT_PORTS_START( pc9801_kbd )
39
40INPUT_PORTS_END
41
42ioport_constructor pc9801_kbd_device::device_input_ports() const
43{
44   return INPUT_PORTS_NAME( pc9801_kbd );
45}
46
47//-------------------------------------------------
48//  device_validity_check - perform validity checks
49//  on this device
50//-------------------------------------------------
51
52void pc9801_kbd_device::device_validity_check(validity_checker &valid) const
53{
54}
55
56
57//-------------------------------------------------
58//  device_start - device-specific startup
59//-------------------------------------------------
60
61void pc9801_kbd_device::device_start()
62{
63    m_irq_func.resolve(m_irq_cb, *this);
64      m_rxtimer = timer_alloc(RX_TIMER);
65      m_rxtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
66}
67
68
69//-------------------------------------------------
70//  device_reset - device-specific reset
71//-------------------------------------------------
72
73void pc9801_kbd_device::device_reset()
74{
75}
76
77//-------------------------------------------------
78//  device_config_complete - perform any
79//  operations now that the configuration is
80//  complete
81//-------------------------------------------------
82
83void pc9801_kbd_device::device_config_complete()
84{
85   // inherit a copy of the static data
86   const pc9801_kbd_interface *intf = reinterpret_cast<const pc9801_kbd_interface *>(static_config());
87   if (intf != NULL)
88      *static_cast<pc9801_kbd_interface *>(this) = *intf;
89
90   // or initialize to defaults if none provided
91   else
92   {
93      memset(&m_irq_cb, 0, sizeof(m_irq_cb));
94   }
95}
96
97//-------------------------------------------------
98//  device_timer - handler timer events
99//-------------------------------------------------
100
101void pc9801_kbd_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
102{
103   // ...
104}
105
106//**************************************************************************
107//  READ/WRITE HANDLERS
108//**************************************************************************
109
110READ8_MEMBER( pc9801_kbd_device::rx_r )
111{
112   m_irq_func(CLEAR_LINE);
113   return 0;
114}
115
116WRITE8_MEMBER( pc9801_kbd_device::tx_w )
117{
118   // ...
119}
trunk/src/mess/machine/pc9801_kbd.h
r0r19819
1/***************************************************************************
2
3   PC-9801 Keyboard simulation
4
5***************************************************************************/
6
7#pragma once
8
9#ifndef __PC9801_KBDDEV_H__
10#define __PC9801_KBDDEV_H__
11
12
13//**************************************************************************
14//  INTERFACE CONFIGURATION MACROS
15//**************************************************************************
16
17#define MCFG_PC9801_KBD_ADD(_tag,_freq,_config) \
18   MCFG_DEVICE_ADD(_tag, PC9801_KBD, _freq) \
19   MCFG_DEVICE_CONFIG(_config)
20
21#define PC9801_KBD_INTERFACE(name) \
22   const pc9801_kbd_interface (name) =
23
24
25//**************************************************************************
26//  TYPE DEFINITIONS
27//**************************************************************************
28
29// ======================> pc9801_kbd_interface
30
31struct pc9801_kbd_interface
32{
33   devcb_write_line      m_irq_cb;
34};
35
36// ======================> pc9801_kbd_device
37
38class pc9801_kbd_device : public device_t,
39                          public pc9801_kbd_interface
40{
41public:
42   // construction/destruction
43   pc9801_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44   virtual ioport_constructor device_input_ports() const;
45
46   // I/O operations
47   DECLARE_WRITE8_MEMBER( tx_w );
48   DECLARE_READ8_MEMBER( rx_r );
49
50protected:
51   // device-level overrides
52   virtual void device_validity_check(validity_checker &valid) const;
53   virtual void device_start();
54   virtual void device_reset();
55   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
56   virtual void device_config_complete();
57
58   devcb_resolved_write_line   m_irq_func;
59
60   static const device_timer_id RX_TIMER = 1;
61   emu_timer *         m_rxtimer;
62};
63
64
65// device type definition
66extern const device_type PC9801_KBD;
67
68
69
70//**************************************************************************
71//  GLOBAL VARIABLES
72//**************************************************************************
73
74
75
76#endif
trunk/src/mess/drivers/pc9801.c
r19818r19819
7878    - Arquephos: needs extra sound board(s)?
7979    - Asoko no Koufuku: black screen with BGM, waits at 0x225f6;
8080    - Aura Battler Dumbine: upd7220: unimplemented FIGD, has layer clearance bugs on gameplay;
81    - Bakasuka Wars: drawing seems busted (either mouse or upd7220)
8281    - Band-Kun: (how to run this without installing?)
8382    - Battle Chess: wants some dip-switches to be on in DSW4, too slow during IA thinking?
8483   - Bishoujo Audition: Moans with a "(program) ended. remove the floppy disk and turn off the power."
r19818r19819
8685   - Bishoujo Shanshinkan: has white rectangles all over the place;
8786   - Bishoujo Tsuushin: hangs with a beep while writing some intro text;
8887
89    - Dragon Buster: slight issue with window masking;
88    - Dragon Buster: slight issue with window masking, that translates to abuse of the uPD7220 (sets resolution differently for each GDC);
9089    - Far Side Moon: doesn't detect sound board (tied to 0x00ec ports)
9190    - Jan Borg Suzume: gets stuck at a pic8259 read;
92    - Jump Hero: right status display isn't shown during gameplay (changes the mode dynamically?)
9391    - Lovely Horror: Doesn't show kanji, tries to read it thru the 0xa9 port;
9492    - Quarth: should do a split screen effect, it doesn't hence there are broken gfxs
95    - Quarth: uploads a PCG charset
93    - Quarth: PCG charset is wrong with normal display
9694    - Runner's High: wrong double height on the title screen;
9795   - Sorcerian, Twilight Zone 3: Fails initial booting, issue with 2dd irq?
9896    - Uchiyama Aki no Chou Bangai: keyboard irq is fussy (sometimes it doesn't register a key press);
r19818r19819
343341#include "machine/pc9801_86.h"
344342#include "machine/pc9801_118.h"
345343#include "machine/pc9801_cbus.h"
344#include "machine/pc9801_kbd.h"
346345
347346
348347#define UPD1990A_TAG "upd1990a"
r19818r19819
481480   inline UINT8 m_pc9801rs_grcg_r(UINT32 offset,int vbank);
482481   inline void m_pc9801rs_grcg_w(UINT32 offset,int vbank,UINT8 data);
483482   DECLARE_CUSTOM_INPUT_MEMBER(system_type_r);
483   DECLARE_WRITE_LINE_MEMBER( keyb_irq_w );
484484
485485   DECLARE_WRITE8_MEMBER(sasi_data_w);
486486   DECLARE_WRITE_LINE_MEMBER(sasi_io_w);
r19818r19819
37473747   MCFG_SCSICB_IO_HANDLER(DEVWRITELINE(DEVICE_SELF_OWNER, pc9801_state, sasi_io_w))
37483748MACHINE_CONFIG_END
37493749
3750WRITE_LINE_MEMBER( pc9801_state::keyb_irq_w )
3751{
3752   // TODO
3753}
3754
3755static PC9801_KBD_INTERFACE( pc9801_kbd_intf )
3756{
3757   DEVCB_DRIVER_LINE_MEMBER( pc9801_state, keyb_irq_w )
3758};
3759
3760static MACHINE_CONFIG_FRAGMENT( pc9801_keyboard )
3761   MCFG_PC9801_KBD_ADD("kbd", 120, pc9801_kbd_intf )
3762MACHINE_CONFIG_END
3763
37503764static MACHINE_CONFIG_START( pc9801, pc9801_state )
37513765   MCFG_CPU_ADD("maincpu", I8086, 5000000) //unknown clock
37523766   MCFG_CPU_PROGRAM_MAP(pc9801_map)
r19818r19819
37633777   MCFG_I8255_ADD( "ppi8255_sys", ppi_system_intf )
37643778   MCFG_I8255_ADD( "ppi8255_prn", ppi_printer_intf )
37653779   MCFG_I8255_ADD( "ppi8255_fdd", ppi_fdd_intf )
3780   MCFG_FRAGMENT_ADD(pc9801_keyboard)
37663781   MCFG_FRAGMENT_ADD(pc9801_mouse)
37673782   MCFG_FRAGMENT_ADD(pc9801_cbus)
37683783   MCFG_FRAGMENT_ADD(pc9801_sasi)
r19818r19819
38313846   MCFG_I8255_ADD( "ppi8255_sys", ppi_system_intf )
38323847   MCFG_I8255_ADD( "ppi8255_prn", ppi_printer_intf )
38333848   MCFG_I8255_ADD( "ppi8255_fdd", ppi_fdd_intf )
3849   MCFG_FRAGMENT_ADD(pc9801_keyboard)
38343850   MCFG_FRAGMENT_ADD(pc9801_mouse)
38353851   MCFG_UPD1990A_ADD("upd1990a", XTAL_32_768kHz, pc9801_upd1990a_intf)
38363852   MCFG_I8251_ADD(UPD8251_TAG, pc9801_uart_interface)
r19818r19819
38963912   MCFG_I8255_ADD( "ppi8255_sys", ppi_system_intf )
38973913   MCFG_I8255_ADD( "ppi8255_prn", ppi_printer_intf )
38983914   MCFG_I8255_ADD( "ppi8255_fdd", ppi_fdd_intf )
3915   MCFG_FRAGMENT_ADD(pc9801_keyboard)
38993916   MCFG_FRAGMENT_ADD(pc9801_mouse)
39003917   MCFG_UPD1990A_ADD("upd1990a", XTAL_32_768kHz, pc9801_upd1990a_intf)
39013918   MCFG_I8251_ADD(UPD8251_TAG, pc9801_uart_interface)
trunk/src/mess/mess.mak
r19818r19819
14761476   $(MESS_MACHINE)/pc9801_86.o   \
14771477   $(MESS_MACHINE)/pc9801_118.o   \
14781478   $(MESS_MACHINE)/pc9801_cbus.o   \
1479   $(MESS_MACHINE)/pc9801_kbd.o   \
14791480
14801481$(MESSOBJ)/pcshare.a:         \
14811482   $(MESS_MACHINE)/pc_turbo.o   \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team