robus Posted December 17, 2023 Share Posted December 17, 2023 The docs say that 0x8 is written to this prior to it being read. Is the 0x8 a signal to set the bits for the pressed console buttons? Quote Link to comment Share on other sites More sharing options...
ClausB Posted December 17, 2023 Share Posted December 17, 2023 (edited) Not exactly. 8 sets the speaker line to output mode and the console switch lines to input mode. So 8 doesn't have to be written before each read. Edited December 17, 2023 by ClausB 1 Quote Link to comment Share on other sites More sharing options...
Pab Posted December 17, 2023 Share Posted December 17, 2023 The VBLANK routine stores 8 in this register to clear (actually set) the status of all console keys and set the console speaker line to output. When you read the register the it clears bit 1 for START, bit 2 for SELECT, and bit 3 for OPTION. 1 Quote Link to comment Share on other sites More sharing options...
phaeron Posted December 17, 2023 Share Posted December 17, 2023 To elaborate, CONSOL controls a 4-bit bidirectional port which is similar to PIA port A in output mode with output bits inverted. Output bits set 0 pull up the signal line, while bits set to 1 ground it. Thus, it's necessary to clear output bits 0-2 to read the console buttons, or else GTIA itself will pull down the lines and they'll read 0 regardless of the button state. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.