OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [emuThor/] [source/] [clsKeyboard.h] - Diff between revs 32 and 35

Show entire file | Details | Blame | View Log

Rev 32 Rev 35
Line 1... Line 1...
#pragma once
#pragma once
#include "clsDevice.h"
#include "clsDevice.h"
 
// Keyboard Device Emulation
 
//
 
// The keyboard controller code loops around until there are no more scan
 
// codes available from the keyboard. In real life an interrupt signal is
 
// generated by each scan code sent by the keyboard. There is no hardware
 
// buffering of scan-codes. In the emulation only a single emulation 
 
// interrupt is generated for a keypress(button) event and multiple scan
 
// codes are buffered. Rather than emulate the keyboard interface more
 
// closely the emulation is simplified and the driver software recognizes
 
// the way the emulation works. Otherwise it might be necessary to
 
// implement the keyboard interface in it's own thread with calls to
 
// Sleep() between each scan-code transmission.
 
// It should work because the interrupt routine checks for additional
 
// scan codes during it's processing. This is a case where the software
 
// for the system is designed around supporting the emulator.
 
// In real life there should never be two scan-codes sent by the keyboard
 
// close enough together for the loop in the keyboard code to be 
 
// effective. The loop is harmless enough as the scan-code status
 
// needs to be tested anyway. Whether its a while() or an if() is
 
// irrelevant.
 
 
class clsKeyboard : public clsDevice
class clsKeyboard : public clsDevice
{
{
        unsigned __int8 buffer[32];
        unsigned __int8 buffer[32];
        int head;
        int head;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.