Last active
December 19, 2015 19:21
-
-
Save plainspooky/caf056f9b39f36ba363c to your computer and use it in GitHub Desktop.
Ferramenta que destrava o CAPS-LOCK em computadores MSX (feito especialmente para os HOT-BIT da Sharp que travam o CAPS na hora do boot).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
; "caps off" | |
; - Destrava o CAPS-LOCK do teclado do MSX | |
; | |
; (C)2015 Giovanni dos Reis Nunes <giovanni@athena> | |
; | |
; This program is free software; you can redistribute it and/or modify | |
; it under the terms of the GNU General Public License as published by | |
; the Free Software Foundation; either version 2 of the License, or | |
; (at your option) any later version. | |
; | |
; This program is distributed in the hope that it will be useful, | |
; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
; GNU General Public License for more details. | |
; | |
; You should have received a copy of the GNU General Public License | |
; along with this program; if not, write to the Free Software | |
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | |
; MA 02110-1301, USA. | |
; | |
BOOT: equ 0x00 | |
CALSLT: equ 0x001C | |
CAPST: equ 0xFCAB | |
CHGCAP: equ 0x0132 | |
MSXDOS: equ 0x0005 | |
PUTSTR: equ 0x09 | |
SLTROM: equ 0xFCC1 | |
; | |
; Macro para chamar as rotinas da BIOS a partir da BDOS | |
; | |
MACRO __bios,BIOS | |
ld iy,(SLTROM-1) | |
ld ix,BIOS | |
call CALSLT | |
ENDM | |
; | |
; Início do programa | |
; | |
org 0x100 ; endereço inicial dos executáveis | |
; | |
; Altera o estado do CAPS-LOCK no teclado e também do seu led. | |
; | |
xor a ; A=0 | |
ld (CAPST),a ; altero o status do CAPS-LOCK | |
inc a ; A=A+1 | |
__bios CHGCAP ; chamo a rotina que altera o estado | |
; do led de CAPS-LOCK, isto é se o seu | |
; MSX tiver um led. Né Expert? ^_^ | |
; | |
; Notifica a liberação do CAPS-LOCK na tela | |
; | |
ld c,PUTSTR ; seleciono a rotina para escrever | |
ld de,MESG0 ; strings na tela e aponto o endereço | |
; da mesma. | |
call MSXDOS ; chamo a rotina da BDOS | |
ld c,BOOT ; retorno de forma educada para o | |
call MSXDOS ; MSX-DOS, i.e., uma "graceful dead") | |
MESG0: | |
db "CAPS-LOCK released!" ; mensagem de liberação do CAPS-LOCK | |
db 13,10,"$" ; com sua quebra de linha, o $ indica o | |
; fim da string. | |
; | |
; Fim do programa (MSX Rulez) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment