1 /*
2  *  KCemu -- The emulator for the KC85 homecomputer series and much more.
3  *  Copyright (C) 1997-2010 Torsten Paul
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License along
16  *  with this program; if not, write to the Free Software Foundation, Inc.,
17  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __kc_vcs80_keyboard_h
21 #define __kc_vcs80_keyboard_h
22 
23 #include "kc/kc.h"
24 #include "kc/cb.h"
25 #include "kc/pio.h"
26 #include "kc/keyboard.h"
27 
28 class KeyboardVCS80 : public Keyboard, public PIOCallbackInterface
29 {
30  private:
31   int _key;
32 
33  protected:
34   void init(void);
35   int  decode_key(int keysym, bool press);
36 
37  public:
38   KeyboardVCS80(void);
39   virtual ~KeyboardVCS80(void);
40   virtual void keyPressed(int keysym, int keycode);
41   virtual void keyReleased(int keysym, int keycode);
42   virtual void replayString(const char *text);
43 
44   virtual void callback(void *data);
45 
46   /*
47    *  InterfaceCircuit
48    */
49   virtual void reti(void);
irqreq(void)50   virtual void irqreq(void) {}
irqack()51   virtual word_t irqack() { return IRQ_NOT_ACK; }
52   virtual void reset(bool power_on = false);
53 
54   /*
55    *  PIOCallbackInterface
56    */
57   virtual int callback_A_in(void);
58   virtual int callback_B_in(void);
callback_A_out(byte_t val)59   virtual void callback_A_out(byte_t val) {}
callback_B_out(byte_t val)60   virtual void callback_B_out(byte_t val) {}
61 };
62 
63 #endif /* __kc_vcs80_keyboard_h */
64