I'm trying to put together some assembler code that read the keyboard status and display something, using the full TEXT screen and without the cursor flashing. I mostly got it, I just want to get rid of the keypress sounds. I'm a bit puzzled over that later issue.
In Basic, I can stop the cursor flashing and the keyboard sounds with this command
Code: Select all
POKE #026A, (PEEK(#026A) AND 254) OR 8
Code: Select all
#define ORIC1_STATUS_ADDR $026A
#define ORIC1_STATUS_CURSOR_BLINK %10000000 ; 1 to enable
#define ORIC1_STATUS_KEYBOARD_SOUND 8 ; 0 to enable
; --- disable cursor blinking and keyboard sound
lda ORIC1_STATUS_ADDR
ora #ORIC1_STATUS_KEYBOARD_SOUND
sta ORIC1_STATUS_ADDR
lda ORIC1_STATUS_ADDR
and #!ORIC1_STATUS_CURSOR_BLINK
sta ORIC1_STATUS_ADDR
Even more puzzling : if only disable the keyboard sound, and keep the cursor flashing on, the sound is disabled properly !
Code: Select all
#define ORIC1_STATUS_ADDR $026A
#define ORIC1_STATUS_CURSOR_BLINK %10000000 ; 1 to enable
#define ORIC1_STATUS_KEYBOARD_SOUND 8 ; 0 to enable
; --- disable keyboard sound
lda ORIC1_STATUS_ADDR
ora #ORIC1_STATUS_KEYBOARD_SOUND
sta ORIC1_STATUS_ADDR
Here's the routine I use to read they keyboard status, copied verbatim from the (excellent) "Oric Atmos and Oric 1 Graphics and Machine Code Techniques" book by Geoff Phililps.
Code: Select all
; -----------------------------------------------------------------------------
; Read keyboard keys state
; - key's row on keyboard A
; - key's column on keyboard in X
; - Result is given by zero status flag
; -----------------------------------------------------------------------------
#define ORIC1_ROM_WRITE_TO_8192_CHIP $F535
_is_key_pressed
.(
php
sei
pha
lda #$0E
jsr ORIC1_ROM_WRITE_TO_8192_CHIP
pla
ora #$B8
sta $0300
ldx #$04
_loop
dex
bne _loop
lda $0300
and #$08
tax
plp
txa
rts
.)
Code: Select all
; --- check for key D status
lda #ORIC_ROW_KEY_D
ldx #ORIC_COL_KEY_D
jsr _is_key_pressed
; --- if D is pressed, update cursor column
beq _d_key_not_pressed
.(
; do stuffs
.)
_d_key_not_pressed