GithubHelp home page GithubHelp logo

oric-software-development-kit / keyboard-singlerow Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 7 KB

A simple test program showing how to access the keyboard without relying on the system ROM

Home Page: https://osdk.org/index.php?page=articles&ref=ART16

C 37.19% Assembly 44.89% Batchfile 17.93%
keyboard oric

keyboard-singlerow's Introduction

Keyboard-SingleRow

Sample code demonstrating how to read a single row of the keyboard without using the code from the Oric system ROM.

How to build

This code sample requires the Oric SDK to build.

Just run "osdk_build.bat" to compile it, and then "osdk_execute.bat" to launch it.

How to use

After building and running the project, you should see the following UI:

Screenshot of the Keyboard Matrix sample code

You can press any of the keys on the bottom row, and each of the pressed key will highlight on the list (limited by the keyboard ability to support multiple key presses at the same time)

The gKey value shows the total value of all the pressed keys (each is represented by a single bit)

Reasons

If you are wondering why anyone would want to reinvent the wheel, you need to know a few things about the Oric:

  • The system IRQ runs at 100hz by default, which on the poor 1mhz 6502 is quite costly (simply disabling the IRQ can provide up to a 20% performance boost)
  • Trying to reduce the system IRQ from 100hz to 50hz tends to cause problems, so you need to run your own handler anyway.
  • If you are trying to free as much memory as possible for you own usage, you can exploit the fact that the disk drive system gives your access to the top 16KB of RAM which are normally hidden by the system ROM, which also mean you can use the entire zero page and page 2 whatever way you want.

So obviously if you disable the ROM you have to do everything yourself, including driving the keyboard.

Limitations

This code is not trying to be a complete recreation of the system ROM; which means...

  • It only manages a single row of the keyboard

Authors

This code is the result of a cooperation between multiple people.

  • Jonathan Bristow (Twilighte) made the first version which properly set up the VIA and keyboard hardware
  • Mickaël Pointier (Dbug) for this small demo and the article on OSDK.ORG

Additional information

You can find more information on the topic in various places:

keyboard-singlerow's People

Contributors

dhebug avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.