AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Tkeyboard mistaking simbols1/30/2024 ![]() This can be done even in basic, by using the equivalent Characters or Ke圜odes of these or by poking directly into them. In this case it would be dumb to pollute the already very limited amount of RAM for the program with a stack of extra-routines solely for that specific case Instead the computer-players simulated interaction is using the real registers of Port 1. Maybe the software has AI built-in or simplified NPCs (Non-Playable-Characters) to provide a single-player-mode for a game that actually requires two players to be playing like TicTacToe, Chess, etc. This can affect the handling of the registers, too mostly due to timing- and memory-swapping-constraints. Maybe the game syncs graphical representations in general and RasterBars | Z-Scrolling | interlaced colors | etc. So input can not be processed simultaneosly. It is kind of hardwired to the registers for x- and y-axis in the #DC00|#DC01 and making use of it switches these to read-only mode. Or the game makes intense use of (especially ring-)modulation for its sound-processing, which in return contaminates the registers for the Joystick-ports, because the processing of analogue JoyStick|Mouse|etc. ), which leads to an overlap with the registers for the Joystick. The CIA has at an offset +2 to the direct digital signal cache registers - so for #DC00 at #DC02 and for #DC01 at #DC03 respectively - registers that state if a signal is read-only or if it is allowed to write to it.įurthermore, the C=64 is designed to allow for a charmap-flip from alphanumeric with UPPER- and lower-case to UPPERCASE plus GRAPHIC-SYMBOLS.Īnother factor can be that a game makes use of memory-intensive bitmap-graphics and therefore has to swap-out some memory from kernel-space (Yes: KERNAL, it's okay, calm down. on Atari ST or Amiga, the analogue ones are not.īut regarding your question, another detail has to be mentioned: While the pins used for digital signal input are generic as in cross-platform on (purposely) identical ports like e.g. Signals are cached in CIA +DC00.Īlso, the yet not mentioned pins 5 and 9 cache the position (y- and x-axis) for analogue joystick | mouse | paddle operation-mode. Signals are cached in CIA #DC01.īut for the second Port the keys representing its signals are always a key-combination starting with the C= | Cequal (as in equal and as in "Key is followed by another, so it becomes a sequel") | Commodore-Key | The Key with the Commodore-Logo. The signals a (digital) JoyStick delivers, come in via Pins 1 to 4 (Up, Down, Left, Right) and additionally Pins 6 and 9 for the buttons (Left, Right) - the equivalent values are represented on the charmap by e.g.: SPACE for Pin 6 aka Fire|Click and other keys, like Numbers and Arrows (can't recall which exactly, i think LEFT-ARROW was one of them). how the CIA (Complex Interface Adapter) maps JoyStick - or in general, any - input: In addition to what already was stated, namely: Routine thinks that it is the CTRL key)." To the left in order to slow down a program listing (the keyscan ![]() ![]() So, if you can't beat them, sit back and press your joystick ![]() ManyĬommercially available games just use Controller Port 2 to avoid theĬonflict. The problem of mistaking the joystick for a keypress is much moreĭifficult - there is no real way to turn off the joystick. Sometimes you can use the simpler solution ofĬlearing the keyboard buffer after reading the joystick, with a POKE 56333,127:POKE 56320,255, and restoring it after the read with a The problem of mistaking the keyboard for the joystick can be solvedīy turning off the keyscan momentarily when reading the stick with a It will register as being pushed to the right if the 2 key is being The routine will interpret this as the 2 key being pressed, becauseīoth set the same bit to 0. The joystick into Controller Port 1 and push the stick to the right, Keyboard has no way of telling whether a particular bit was set to byĪ keypress or one of the joystick switches. "Since CIA #1 Data Port B is used for reading the keyboard as well as Specifically, look at pages 172 to 176 for full details - but here is a brief excerpt with the relevant info: As Wilson points out in his answer, it has to do with how the CIA chips interact with the keyboard and the joystick ports, and the confusion that can arise trying to determine where input is being received from.Ĭompute!'s Mapping the Commodore 64 has an excellent write-up here explaining how the "Complex Interface Adapter" (CIA#1) deals with scanning the keyboard matrix and how the joystick ports are caught up in the drama.
0 Comments
Read More
Leave a Reply. |