-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kbrepeatdelay and kbrepeatrate for cbm targets #452
Conversation
asminc/plus4.inc
Outdated
@@ -33,6 +33,11 @@ FKEY_COUNT := $55D ; Characters for function key | |||
FKEY_SPACE := $55F ; Function key definitions | |||
FKEY_ORIG := $F3D2 ; Original definitions | |||
|
|||
;FIXME: he?! these ok? :o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they are $540, $541 and $542.
asminc/pet.inc
Outdated
@@ -31,6 +31,11 @@ BASIC_BUF_LEN = 81 ; Maximum length of command-line | |||
|
|||
KEY_BUF := $26F ; Keyboard buffer | |||
|
|||
;FIXME: these are wrong? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.
40 columns: $3ee, $3ea, $3e9
80 columns: $e4, $e5, $e6
more? how should we handle the difference between 40- and 80- column models? they are different targets anyway, right? so the different constants could be achived using some ifdef magic? or another .inc? or what? |
i was thinking of the PET targets :) |
Oh I see. Check in target pet for SCR_LINELEN. |
Just for Uz... |
(cc65 has a single So, you will need to define constants like I think that it makes sense to put kbdrepeat()'s prototype in |
mmmh - but that would indicate they are CBM specific (which they hopefully wont be on the long run) |
Well, the functions are something like get_tv(), for example the NES will never get a kbdrepeat(). |
by that logic, also kbhit and cgetc (and probably more) shouldnt be in conio either :) |
I see, there's something inconsistent. Because many targets have an implementation, get_tv() should move to conio? |
Hi, Maybe I don't have a (good enough) overview but... I think this isn't a precise science. It's rather about a sense of what is appropriate. I'd say something that is available on (almost) all targets (think keyboard) and/or can be emulated on (almost) all targets (think F-keys) belongs into a shared header structured by topics (conio, tgi, mouse, ...). Something that is available on one (or few) targets belongs into the target header(s). Let's not discuss things here which have already found their places - even if those places might not always be optimal and/or follow the guide I laid out above. Those keyboard repeat setting functions seem pretty target specific to me. I'd guess no non-CBM target supplies something similar. So I personally clearly see them in cbm.h. Given that they are not considered part of conio I personally think that names starting with 'kb' are fine. I would however rather use the prefix 'kbd' instead of just 'kb'. Or are there things in the CBM world (i.e. BASIC commands or alike) that make the names suggested a premier choice? Regards, |
Ooops, didn't want to close! |
Also, ... portable programs that use stdio might want to use We should have also some defined constants for #define KBDREPEAT_CURSOR 0x00
#define KBDREPEAT_NONE 0x40
#define KBDREPEAT_ALL 0x80 |
I think I understand that this statement refers to your proposal to "set" "something" on the keyboard by default on conio initialization. There were however strong oppsite opinions. Is it possible to elaborate on the topic in a way a non-CBM insider understand the issue? I.e. I presume that a "normal" computer in a "normal" scenario (like i.e. working in the BASIC screen editor) behaves like this: I press a key and the key is accepted once - but if I continue to hold down the key then after some delay (!) the key starts to auto repeat until I release the key. |
on CBM targets the regular alphanumeric keys do not have any repeat at all - only the "editor" keys (cursor, space, insert/delete). why space belongs to them, i have no idea :) |
Thanks - and do I understand it correctly that it is possible to have repeat for the "regular" keys as well? Does the repeat have the "usual" delay before starting? If both question are answered with 'yes' then why isn't it desirable to activate repeat for all keys by default (just like we i.e. switch to lower case output by default) ? |
yes its possible. and yes they will have the initial delay. however i dont think it should be default, since its not what a typical c64 users expects - most programs do not work this way. |
Thanks for the explanation. So it's about soft facts and meeting expectations... |
I'm not aware of any programs that demand that the alpha-numerics never repeat. I find it difficult to imagine that a program would fail if a key was to repeat -- after we held it down for awhile. If a program like that does exist, then it's very unusual; so, it should tell people, "don't hold down any keys". And, it should disable repeating on keyboards that support that switch. I still think that -- portable -- programs should be able to have some consistent expectations about the environments on which they run. So, ... programs should expect to be able to print lower-case text, with capital letters where they're needed. And maybe, they should expect that everybody's keyboards repeat every key. By the way, Commodore wasn't consistent with their models! The C128 and the Plus4, for example, do repeat every key, by default. |
I personally think that Greg's argument is valid. However to be honest it's just not important enough to me to enter a dispute about that topic. Maybe a reasonable compromise would be to have a cc65 constructor that activates the repeat feature and that is as easily as possible to be activated by the user who wants it. Ideally from the build command line... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Beside the "FIXME" question I'd really like to see some - at least rudimentary - documentation.
-
The question about enabling the keyboard repeat by default seems to have lost momentum so I don't see it blocking this pull request (anymore).
@@ -31,6 +31,18 @@ BASIC_BUF_LEN = 81 ; Maximum length of command-line | |||
|
|||
KEY_BUF := $26F ; Keyboard buffer | |||
|
|||
;FIXME: we must somehow handle the difference between the two - how? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this pull request supposed to be merged with this FIXME still in place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know.... would that be acceptable? i don't like the idea a lot myself.... but i don't know to fix this either. are there preprocessor symbols for 40cols vs 80cols PETs? or even different libraries? can it be checked at runtime, and how? i have no idea about either :)
added some docs. i cant test if its ok because linuxdocs fail to build the docs here, for whatever reason |
:-)
At least there are no errors/warnings according to Travis CI... |
no, but here there are - and when i fix them it will fail on CI :) different linuxdoc versions, i guess |
Those functions are fastcall. Their prototypes must be marked with The repeat-delay and the repeat-rate variables aren't "settings". Instead, they are active counters. When a key is pressed, the Kernal changes them 60 times every second. Therefore, there is no "original value" that should be restored by a program. So, their functions should return |
ewww. i could have sworn those are persistant settings. like this the two functions are actually not quite useful at all (you'd have to call them after each keyboard scanning) - i'd rather just remove them. no idea why i have even added them back then :=) |
mmmh shrug |
Sorry - what is wrong? Should I not have this merged? |
as gregg pointed out, the functions that are supposed to set the repeat delay and repeat rate do not work as advertised (and i see no simple way to fix that unfortunately) - so they should probably get removed before someone uses them and wonders that they dont do what they are supposed to do :=) |
Ah, now I see. Your last two commits are listed below your comment starting with 'ewww' so I presumed your commits were meant to "adjust" what was "wrong". I admit that I was too busy trying to make everybody happy regarding the joystick interface to really try to understand what Greg and you were up to. So do I get it right this time that this pull request should just have been closed instead of being merged? So a full revert is the right thing to do now? |
closed? no.... "someone" should delete the two useless functions, then it can be merged :) |
Maybe they aren't totally useless. I haven't tested it; but, maybe they can be used to zero those counters immediately after calling |
that doesnt really work as intended... and resetting the live counters the hard way like that inside your keyboard polling loop.... urks. that sounds like ugly hackery to me that i dont want to encourage :) |
As discussed in #452 after my premature merge the two functions in question don't work as expected. Additionally I adjusted several style deviations in the pull request in question.
Done, see 4aa1949 |
Am Mittwoch, 30. August 2017, 16:41:04 CEST schrieb Oliver Schmidt:
> "someone" should delete the two useless functions
Done, see
4aa1949
e
great :)
so ... what happened to greggs cpeekxy()? :=)
…--
http://www.hitmen-console.org http://magicdisk.untergrund.net
http://www.pokefinder.org http://ar.pokefinder.org
In C++, friends can access each others' private members.
|
quick PR to get things going... (not really ready yet)
since it came up on the list recently - do we want these functions? :) are the names OK or not? should prototypes go into conio.h ?