disable keyboard to gain speed ?

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
goyo
Officer Cadet
Posts: 52
Joined: Sat Jan 12, 2019 10:16 am

disable keyboard to gain speed ?

Post by goyo »

Is it possible in the c language to disable the Oric keyboard management and read directly the codes of the keyboard?
would anyone have the code in c?
I've heard that it takes 20% of the oric processor... :!: :?:
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: disable keyboard to gain speed ?

Post by Dbug »

20% is not the keyboard reading, it's the total cost of the default ROM IRQ, and there are multiple reasons for that:
- it runs at 100hz, which for all intent and purpose is completely stupid, they should have used a 50hz interrupt
- it is doubly vectorized, so the ROM vector in FFFE-FFFF jumps to whatever is in page 2, so it can be redefined by the user (It's nice but costly)
- it updates internal timers, things like WAIT, blinking cursor, some sounds, ...
- it scans the entire keyboard

the main problem in fixing all that is that you can't really make changes compatible with the system, so when you start replacing the irq handler by your own, any keyboard or timer based code that calls the ROM will fail.

If you are willing to do that, the best approach is to make a disk based game, because then you can use the overlay ram and have FFFE point directly to your irq handler.

You can see an example in my CEO competition entry: http://miniserve.defence-force.org/svn/ ... Road/vbl.s

The code only handles arrow keys and space.
User avatar
goyo
Officer Cadet
Posts: 52
Joined: Sat Jan 12, 2019 10:16 am

Re: disable keyboard to gain speed ?

Post by goyo »

Dbug wrote: Wed Jul 17, 2019 5:47 pm 20% is not the keyboard reading, it's the total cost of the default ROM IRQ, and there are multiple reasons for that:
- it runs at 100hz, which for all intent and purpose is completely stupid, they should have used a 50hz interrupt
- it is doubly vectorized, so the ROM vector in FFFE-FFFF jumps to whatever is in page 2, so it can be redefined by the user (It's nice but costly)
- it updates internal timers, things like WAIT, blinking cursor, some sounds, ...
- it scans the entire keyboard

the main problem in fixing all that is that you can't really make changes compatible with the system, so when you start replacing the irq handler by your own, any keyboard or timer based code that calls the ROM will fail.

If you are willing to do that, the best approach is to make a disk based game, because then you can use the overlay ram and have FFFE point directly to your irq handler.

You can see an example in my CEO competition entry: http://miniserve.defence-force.org/svn/ ... Road/vbl.s

The code only handles arrow keys and space.
Ok it more clear for me , thanks for all these informations Dbug :)
Post Reply