diff --git a/Source/Apps/Test/kbdinfo/mseinfo.asm b/Source/Apps/Test/kbdinfo/mseinfo.asm new file mode 100644 index 00000000..506aeacf --- /dev/null +++ b/Source/Apps/Test/kbdinfo/mseinfo.asm @@ -0,0 +1,896 @@ +; +;======================================================================= +; Mouse Information Utility (MSEINFO) +;======================================================================= +; +; Simple utility that attempts to determine the status of the mouse you +; have attached to an 8242 keyboard controller. +; +; Based on Wayne Warthen's KBDINFO program, Thanks to his great work +; on RomWBW and support to the Retrobrewcomputers community at large +; +; Additional help from these websites +; https://isdaman.com/alsos/hardware/mouse/ps2interface.htm +; +; Second PS/2 write data port info from +; https://wiki.osdev.org/%228042%22_PS/2_Controller#Second_PS.2F2_Port +; +; PS/2 Mouse initialization code in C +; http://bos.asmhackers.net/docs/mouse/snippet_2/mouse.inc +; +;======================================================================= +; +; Mouse controller port addresses (adjust as needed) +; +iocmd .equ $E3 ; keyboard controller command port address +iodat .equ $E2 ; keyboard controller data port address +; +; General operational equates (should not requre adjustment) +; +stksiz .equ $40 ; Working stack size +; +timeout .equ $00 ; Controller timeout constant +; +restart .equ $0000 ; CP/M restart vector +bdos .equ $0005 ; BDOS invocation vector +; +;======================================================================= +; + .org $100 ; standard CP/M executable +; +; + ; setup stack (save old value) + ld (stksav),sp ; save stack + ld sp,stack ; set new stack +; + call crlf + ld de,str_banner ; banner + call prtstr +; + call main ; do the real work +; +exit: + call crlf2 + ld de,str_exit + call prtstr + ;call crlf + + ; clean up and return to command processor + call crlf ; formatting + ld sp,(stksav) ; restore stack + jp restart ; return to CP/M via restart +; +; +;======================================================================= +; Main Program +;======================================================================= +; +main: +; +; Display active mouse controller port addresses +; + call crlf2 + ld de,str_cmdport + call prtstr + ld a,iocmd + call prthex + call crlf + ld de,str_dataport + call prtstr + ld a,iodat + call prthex +; +; Attempt self-test command on mouse controller +; +; Mouse controller should respond with an 0x55 on data port +; after being sent a 0xAA on the command port. +; + call crlf2 + ld de,str_ctrl_test + call prtstr + ld a,$aa ; self-test command + call put_cmd_dbg + jp c,err_ctlr_io ; handle controller error + call get_data_dbg + jp c,err_ctlr_io ; handle controller error + cp $55 ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr +; +; Send 0xA8 Mouse Enable command to 8242 controller +; + call crlf2 + ld de,str_enable_mouse + call prtstr + + ld a,$a8 ; Send Mouse Enable command to 8242 + call put_cmd_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for self-test status + jp c,err_ctlr_io ; handle controller error + cp $AA ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $00 ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + + + +; +; Disable translation on keyboard controller to get raw scan codes! Enable Mouse +; +; call crlf2 +; ld de,str_trans_off +; call prtstr +; ld a,$60 ; write to command register 0 +; call put_cmd_dbg +; jp c,err_ctlr_io ; handle controller error +; ld a,$00 ; xlat disabled, mouse enabled, no ints +; call put_cmd_dbg +; jp c,err_ctlr_io ; handle controller error + +; Attempt four reset commands on mouse controller +; + call crlf2 + ld de,str_mse_init + call prtstr + +; Reset Pass #1 + ld a,$ff ; Send Mouse Reset command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + call get_data_dbg ; Read Mouse for self-test status + jp c,err_ctlr_io ; handle controller error + cp $AA ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $00 ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + +; Reset Pass #2 + ld a,$ff ; Send Mouse Reset command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + call get_data_dbg ; Read Mouse for self-test status + jp c,err_ctlr_io ; handle controller error + cp $AA ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $00 ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + +; Reset Pass #3 + ld a,$ff ; Send Mouse Reset command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + call get_data_dbg ; Read Mouse for self-test status + jp c,err_ctlr_io ; handle controller error + cp $AA ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $00 ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + +; Reset Pass #4 + ld a,$ff ; Send Mouse Reset command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + call get_data_dbg ; Read Mouse for self-test status + jp c,err_ctlr_io ; handle controller error + cp $AA ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $00 ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + +; Begin setting mouse parameters, Request Microsoft Scrolling Mouse Mode + + ld a,$f3 ; Send Set Sample Rate command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$c8 ; Send Decimal 200 command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$f3 ; Send Set Sample Rate command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$64 ; Send Decimal 100 command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$f3 ; Send Set Sample Rate command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$50 ; Send Decimal 80 command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$f2 ; Send Read Device Type command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $03 ; detect MS Intellimouse/Microsoft Scrolling Mouse + jp z,Intellimouse + cp $00 ; expected value? ($00 if Regular PS/2 Mouse) + jp z,ReadMouseID +Intellimouse: + call crlf + ld de,str_intellimouse_ok + call prtstr +ReadMouseID: + jp nz,err_ctlr_test ; handle self-test error + call crlf + + ld a,$f3 ; Send Set Sample Rate command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$0a ; Send Decimal 10 command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$f2 ; Send Read Device Type command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + cp $03 ; detect MS Intellimouse/Microsoft Scrolling Mouse + jp z,Intellimouse2 + cp $00 ; expected value? ($00 if Regular PS/2 Mouse) + jp z,ReadMouseID2 +Intellimouse2: + call crlf + ld de,str_intellimouse_ok + call prtstr +ReadMouseID2: + jp nz,err_ctlr_test ; handle self-test error + call crlf + + ld a,$e8 ; Send Set Resolution command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$03 ; Send 8 Counts/mm command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$e6 ; Send Set Scaling 1:1 command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$f3 ; Send Set Sample Rate command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$28 ; Send Decimal 40 command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + + ld a,$f4 ; Send Enable command + call put_data_dbg + jp c,err_ctlr_io ; handle controller error + + call get_data_dbg ; Read Mouse for Acknowledge + jp c,err_ctlr_io ; handle controller error + cp $fa ; expected value? + jp nz,err_ctlr_test ; handle self-test error + call crlf + ld de,str_ctrl_test_ok + call prtstr + +; Initialization Complete + +ReadMousePackets: + +; call check_read +; jp nz, ReadMousePackets + + call get_data_dbg ; Read Mouse for self-test status + jp c,err_ctlr_io ; handle controller error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + call crlf + + call get_data_dbg ; Read Mouse for Mouse ID + jp c,err_ctlr_io ; handle controller error + call crlf + + call crlf + + jp ReadMousePackets + +; +done: + ret + +; +;======================================================================= +; Mouse Controller I/O Routines +;======================================================================= +; +wait_write: +; +; Wait for mouse controller to be ready for a write +; A=0 indicates success (ZF set) +; + ld b,timeout ; setup timeout constant +wait_write1: + in a,(iocmd) ; get status + ld c,a ; save status + and $02 ; isolate input buf status bit + ret z ; 0 means ready, all done + call delay ; wait a bit + djnz wait_write1 ; loop until counter exhausted + ld de,str_timeout_write ; write timeout message + call crlf + call prtstr + ld a,c ; recover last status value + call prthex + or $ff ; signal error + ret +; +wait_read: +; +; Wait for mouse controller to be ready to read a byte +; A=0 indicates success (ZF set) +; + ld b,timeout ; setup timeout constant +wait_read1: + in a,(iocmd) ; get status + ld c,a ; save status + and $01 ; isolate input buf status bit + xor $01 ; invert so 0 means ready + ret z ; if 0, all done + call delay ; wait a bit + djnz wait_read1 ; loop until counter exhausted + ld de,str_timeout_read ; write timeout message + call crlf + call prtstr + ld a,c ; recover last status value + call prthex + or $ff ; signal error + ret +; +check_read: +; +; Check for data ready to read +; A=0 indicates data available (ZF set) +; + in a,(iocmd) ; get status + and $01 ; isolate input buf status bit + xor $01 ; invert so 0 means ready + ret +; +put_cmd: +; +; Put a cmd byte from A to the mouse interface with timeout +; CF set indicates timeout error +; + ld e,a ; save incoming value + call wait_write ; wait for controller ready + jr z,put_cmd1 ; if ready, move on + scf ; else, signal timeout error + ret ; and bail out +put_cmd1: + ld a,e ; recover value to write + out (iocmd),a ; write it + or a ; clear CF for success + ret +; +put_cmd_dbg: + call put_cmd + ret c + push af + call crlf + ld de,str_put_cmd + call prtstr + call prthex + pop af + ret +; +put_data: +; +; Put a data byte from A to the mouse interface with timeout +; CF set indicates timeout error +; +; note: direct data to second PS/2 port, send $d4 to 8242 command register +; different than keyboard which uses first PS/2 port + + push af ; save contents of a + ld e,a ; save incoming value + call wait_write ; wait for controller ready + jr z,put_data0 ; if ready, move on + scf ; else, signal timeout error + ret ; and bail out +put_data0: + ld a,$d4 ; direct to second PS/2 port for mouse + out (iocmd),a ; send second port command to 8242 + pop af + +; rest of put_data is the same as for PS/2 keyboard + + ld e,a ; save incoming value + call wait_write ; wait for controller ready + jr z,put_data1 ; if ready, move on + scf ; else, signal timeout error + ret ; and bail out +put_data1: + ld a,e ; recover value to write + out (iodat),a ; write it + or a ; clear CF for success + ret +; +put_data_dbg: + call put_data + ret c + push af + call crlf + ld de,str_put_data + call prtstr + call prthex + pop af + ret + +; +; Get a data byte from the mouse interface to A with timeout +; CF set indicates timeout error +; +get_data: +; + call wait_read ; wait for byte to be ready + jr z,get_data1 ; if ready, move on + scf ; else signal timeout error + ret ; and bail out +get_data1: + in a,(iodat) ; get data byte + or a ; clear CF for success + ret +; +get_data_dbg: + call get_data + ret c + push af + call crlf + ld de,str_get_data + call prtstr + call prthex + pop af + ret +; +; Error Handlers +; +err_ctlr_io: + ld de,str_err_ctrl_io + jr err_ret +; +err_ctlr_test: + ld de,str_err_ctrl_test + jr err_ret +; +err_mse_reset: + ld de,str_err_mse_reset + jr err_ret +; +err_ret: + call crlf2 + call prtstr + or $ff ; signal error + ret +; +;======================================================================= +; Utility Routines +;======================================================================= +; +; +; Print character in A without destroying any registers +; +prtchr: + push bc ; save registers + push de + push hl + ld e,a ; character to print in E + ld c,$02 ; BDOS function to output a character + call bdos ; do it + pop hl ; restore registers + pop de + pop bc + ret +; +prtdot: +; + ; shortcut to print a dot preserving all regs + push af ; save af + ld a,'.' ; load dot char + call prtchr ; print it + pop af ; restore af + ret ; done +; +; Print a zero terminated string at (de) without destroying any registers +; +prtstr: + push af + push de +; +prtstr1: + ld a,(de) ; get next char + or a + jr z,prtstr2 + call prtchr + inc de + jr prtstr1 +; +prtstr2: + pop de ; restore registers + pop af + ret +; +; Print the value in A in hex without destroying any registers +; +prthex: + push af ; save AF + push de ; save DE + call hexascii ; convert value in A to hex chars in DE + ld a,d ; get the high order hex char + call prtchr ; print it + ld a,e ; get the low order hex char + call prtchr ; print it + pop de ; restore DE + pop af ; restore AF + ret ; done +; +; print the hex word value in hl +; +prthexword: + push af + ld a,h + call prthex + ld a,l + call prthex + pop af + ret +; +; print the hex dword value in de:hl +; +prthex32: + push bc + push de + pop bc + call prthexword + push hl + pop bc + call prthexword + pop bc + ret +; +; Convert binary value in A to ascii hex characters in DE +; +hexascii: + ld d,a ; save A in D + call hexconv ; convert low nibble of A to hex + ld e,a ; save it in E + ld a,d ; get original value back + rlca ; rotate high order nibble to low bits + rlca + rlca + rlca + call hexconv ; convert nibble + ld d,a ; save it in D + ret ; done +; +; Convert low nibble of A to ascii hex +; +hexconv: + and $0F ; low nibble only + add a,$90 + daa + adc a,$40 + daa + ret +; +; Print value of A or HL in decimal with leading zero suppression +; Use prtdecb for A or prtdecw for HL +; +prtdecb: + push hl + ld h,0 + ld l,a + call prtdecw ; print it + pop hl + ret +; +prtdecw: + push af + push bc + push de + push hl + call prtdec0 + pop hl + pop de + pop bc + pop af + ret +; +prtdec0: + ld e,'0' + ld bc,-10000 + call prtdec1 + ld bc,-1000 + call prtdec1 + ld bc,-100 + call prtdec1 + ld c,-10 + call prtdec1 + ld e,0 + ld c,-1 +prtdec1: + ld a,'0' - 1 +prtdec2: + inc a + add hl,bc + jr c,prtdec2 + sbc hl,bc + cp e + ret z + ld e,0 + call prtchr + ret +; +; Start a new line +; +crlf2: + call crlf ; two of them +crlf: + push af ; preserve AF + ld a,13 ; + call prtchr ; print it + ld a,10 ; + call prtchr ; print it + pop af ; restore AF + ret +; +; Brief delay +; +delay: + push bc + ld b,0 +delay1: + ex (sp),hl + ex (sp),hl + ex (sp),hl + ex (sp),hl + ex (sp),hl + ex (sp),hl + ex (sp),hl + ex (sp),hl + djnz delay1 + pop bc + ret +; +;======================================================================= +; Constants +;======================================================================= +; +str_banner .db "Mouse Information, v0.1",0 +str_exit .db "Done, Thank you for using MSEINFO!",0 +str_cmdport .db "Mouse Controller Command Port: 0x",0 +str_dataport .db "Mouse Controller Data Port: 0x",0 +str_timeout_write .db "Mouse Controller Write Timeout, Status: 0x",0 +str_timeout_read .db "Mouse Controller Read Timeout, Status: 0x",0 +str_err_ctrl_io .db "Mouse Controller I/O Failure",0 +str_err_ctrl_test .db "Mouse Controller Self-Test Failed",0 +str_put_cmd .db "Sent Command 0x",0 +str_put_data .db "Sent Data 0x",0 +str_get_data .db "Got Data 0x",0 +str_ctrl_test .db "Attempting Controller Self-Test",0 +str_mse_init .db "Attempting Mouse Initialization",0 +str_enable_mouse .db "Enabling Mouse in 8242 Controller",0 +str_ctrl_test_ok .db "Controller Self-Test OK",0 +str_intellimouse_ok .db "MS Intellimouse OK",0 +str_trans_off .db "Disabling Controller Translation",0 +str_mse_reset .db "Attempting Mouse Reset",0 +str_mse_reset_ok .db "Mouse Reset OK",0 +str_err_mse_reset .db "Mouse Reset Failed",0 +; +;======================================================================= +; Working data +;======================================================================= +; +stksav .dw 0 ; stack pointer saved at start + .fill stksiz,0 ; stack +stack .equ $ ; stack top +; +workbuf .fill 8 +workbuf_len .db 0 +; +;======================================================================= +; + .end + diff --git a/Source/Apps/Test/kbdtest/kbdtest.asm b/Source/Apps/Test/kbdtest/kbdtest.asm index 84f43664..e32aec3b 100644 --- a/Source/Apps/Test/kbdtest/kbdtest.asm +++ b/Source/Apps/Test/kbdtest/kbdtest.asm @@ -253,22 +253,31 @@ print2: ret ;--------------------------------------------------------------------------------------------------- +; Black: ESC,[30m +; Red: ESC,[31m +; Green: ESC,[32m +; Yellow: ESC,[33m +; Blue: ESC,[34m +; Magenta: ESC,[35m +; Cyan: ESC,[36m +; White: ESC,[37m +; Reset: ESC,[0m SIGNON: .DB CR,LF,LF - .DB "Test VT82C42 PC Keyboard & Mouse controller chip on Z80 KBDMSE Board." + .DB ESC,"[33m","Test VT82C42 PC Keyboard & Mouse controller chip on Z80 KBDMSE Board." ; Yellow .DB CR,LF,"$" INIT_ERR_STR: .DB CR,LF,BELL - .DB "Error: The 0xAA Test of Controller did nor return 0x55. Program Halted." + .DB ESC,"[31m","Error: The 0xAA Test of Controller did nor return 0x55. Program Halted." ; Red .DB CR,LF,"$" INIT_OK: .DB CR,LF - .DB "The 0xAA Test of Controller returned 0x55. Now enter keyboard keys." + .DB ESC,"[32m","The 0xAA Test of Controller returned 0x55. Now enter keyboard keys." ; Green .DB CR,LF,LF,"$" SCAN_MSG: - .DB "Scancode = $" + .DB ESC,"[34m","Scancode = $" ; Blue UPKEY_MSG: .DB "(Up Keystroke)$" CAPS_MSG: @@ -280,9 +289,9 @@ CTRL_MSG: NUM_MSG: .DB "(NUM Key)$" IBM1_MSG: - .DB "Table 1 lookup -> $" + .DB ESC,"[36m","Table 1 lookup -> $" ; Cyan IBM2_MSG: - .DB " Table 2 lookup -> $" + .DB ESC,"[37m"," Table 2 lookup -> $" ; White IBM1TBL: ;The "Normal" table diff --git a/Source/Apps/VGM/Build.cmd b/Source/Apps/VGM/Build.cmd index dff972dd..07e354b1 100644 --- a/Source/Apps/VGM/Build.cmd +++ b/Source/Apps/VGM/Build.cmd @@ -7,5 +7,5 @@ set TASMTABS=%TOOLS%\tasm32 tasm -t180 -g3 -fFF -dWBW vgmplay.asm vgmplay.com vgmplay.lst || exit /b -copy /Y VGMPLAY.COM ..\..\..\Binary\Apps\ || exit /b +copy /Y vgmplay.com ..\..\..\Binary\Apps\ || exit /b copy /Y Tunes\*.* ..\..\..\Binary\Apps\Tunes\ || exit /b \ No newline at end of file diff --git a/Source/Apps/VGM/Makefile b/Source/Apps/VGM/Makefile index 18c105cc..c410aec2 100644 --- a/Source/Apps/VGM/Makefile +++ b/Source/Apps/VGM/Makefile @@ -1,14 +1,14 @@ -OBJECTS = VGMPLAY.COM +OBJECTS = vgmplay.com DEST = ../../../Binary/Apps TOOLS = ../../../Tools OTHERS = *.LST include $(TOOLS)/Makefile.inc -DEPS := VGMPLAY.ASM $(shell find . -name '*.inc') +DEPS := vgmplay.asm $(shell find . -name '*.inc') -VGMPLAY.COM: $(DEPS) - $(TASM) -dWBW VGMPLAY.ASM VGMPLAY.COM VGMPLAY.LST +vgmplay.com: $(DEPS) + $(TASM) -dWBW vgmplay.asm vgmplay.com vgmplay.lst all:: mkdir -p $(DEST)/Tunes diff --git a/Source/Apps/VGM/Tunes/ITSGAMOV.VGM b/Source/Apps/VGM/Tunes/itsgamov.vgm similarity index 100% rename from Source/Apps/VGM/Tunes/ITSGAMOV.VGM rename to Source/Apps/VGM/Tunes/itsgamov.vgm diff --git a/Source/Apps/VGM/Tunes/LEMMIN01.VGM b/Source/Apps/VGM/Tunes/lemmin01.vgm similarity index 100% rename from Source/Apps/VGM/Tunes/LEMMIN01.VGM rename to Source/Apps/VGM/Tunes/lemmin01.vgm diff --git a/Source/Apps/VGM/Tunes/PENGUI03.VGM b/Source/Apps/VGM/Tunes/pengui03.vgm similarity index 100% rename from Source/Apps/VGM/Tunes/PENGUI03.VGM rename to Source/Apps/VGM/Tunes/pengui03.vgm diff --git a/Source/Apps/VGM/Tunes/PITFAL02.VGM b/Source/Apps/VGM/Tunes/pitfal02.vgm similarity index 100% rename from Source/Apps/VGM/Tunes/PITFAL02.VGM rename to Source/Apps/VGM/Tunes/pitfal02.vgm diff --git a/Source/Apps/VGM/Tunes/TIGER02.VGM b/Source/Apps/VGM/Tunes/tiger02.vgm similarity index 100% rename from Source/Apps/VGM/Tunes/TIGER02.VGM rename to Source/Apps/VGM/Tunes/tiger02.vgm diff --git a/Source/Apps/VGM/Tunes/WONDER01.VGM b/Source/Apps/VGM/Tunes/wonder01.vgm similarity index 100% rename from Source/Apps/VGM/Tunes/WONDER01.VGM rename to Source/Apps/VGM/Tunes/wonder01.vgm diff --git a/Source/Apps/VGM/VGMPLAY.ASM b/Source/Apps/VGM/vgmplay.asm similarity index 100% rename from Source/Apps/VGM/VGMPLAY.ASM rename to Source/Apps/VGM/vgmplay.asm diff --git a/Source/Apps/VGM/VGMPLAY.TXT b/Source/Apps/VGM/vgmplay.txt similarity index 100% rename from Source/Apps/VGM/VGMPLAY.TXT rename to Source/Apps/VGM/vgmplay.txt diff --git a/Source/HBIOS/game.asm b/Source/HBIOS/game.asm index 66a618a7..1ea2303c 100644 --- a/Source/HBIOS/game.asm +++ b/Source/HBIOS/game.asm @@ -1184,7 +1184,7 @@ COUT: PUSH AF PUSH DE PUSH HL LD B,01H - LD C,0 + LD C,80H LD E,A RST 08 POP HL @@ -1207,7 +1207,7 @@ CIN: PUSH BC PUSH DE PUSH HL LD B,00H - LD C,00H + LD C,80H RST 08 LD A,E POP HL diff --git a/Source/Images/fd_bp.txt b/Source/Images/fd_bp.txt index 88605d3f..fa97b717 100644 --- a/Source/Images/fd_bp.txt +++ b/Source/Images/fd_bp.txt @@ -33,11 +33,13 @@ ../../Binary/Apps/zminit.ovr 15: ../../Binary/Apps/zmconfig.ovr 15: ../../Binary/Apps/zmd.com 15: -# +../../Binary/Apps/vgmplay.com 15: + # Add Tune sample files # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add Common Applications # diff --git a/Source/Images/fd_cpm22.txt b/Source/Images/fd_cpm22.txt index 44a39734..525717c8 100644 --- a/Source/Images/fd_cpm22.txt +++ b/Source/Images/fd_cpm22.txt @@ -29,11 +29,13 @@ d_cpm22/ReadMe.txt 0: ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # # Add Tune sample files # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add OS image # diff --git a/Source/Images/fd_cpm3.txt b/Source/Images/fd_cpm3.txt index f324e5a9..92eb3860 100644 --- a/Source/Images/fd_cpm3.txt +++ b/Source/Images/fd_cpm3.txt @@ -45,6 +45,7 @@ ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # # Add Common Applications # diff --git a/Source/Images/fd_zsdos.txt b/Source/Images/fd_zsdos.txt index 09af8c9f..0d7c71ae 100644 --- a/Source/Images/fd_zsdos.txt +++ b/Source/Images/fd_zsdos.txt @@ -42,11 +42,13 @@ d_cpm22/u0/XSUB.COM 0: ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # # Add Tune sample files # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add OS image # diff --git a/Source/Images/hd_bp.txt b/Source/Images/hd_bp.txt index ea4ba8ef..7449e46d 100644 --- a/Source/Images/hd_bp.txt +++ b/Source/Images/hd_bp.txt @@ -33,6 +33,7 @@ ../../Binary/Apps/zminit.ovr 15: ../../Binary/Apps/zmconfig.ovr 15: ../../Binary/Apps/zmd.com 15: +../../Binary/Apps/vgmplay.com 15: # ../../Binary/Apps/Test/*.com 2: Test/*.* 2: @@ -41,6 +42,7 @@ Test/*.* 2: # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add CPNET client files # diff --git a/Source/Images/hd_cpm22.txt b/Source/Images/hd_cpm22.txt index 11372530..e98400cc 100644 --- a/Source/Images/hd_cpm22.txt +++ b/Source/Images/hd_cpm22.txt @@ -29,6 +29,7 @@ d_cpm22/ReadMe.txt 0: ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # ../../Binary/Apps/Test/*.com 2: Test/*.* 2: @@ -37,6 +38,7 @@ Test/*.* 2: # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add CPNET client files # diff --git a/Source/Images/hd_cpm3.txt b/Source/Images/hd_cpm3.txt index 3c8c78c0..40feb417 100644 --- a/Source/Images/hd_cpm3.txt +++ b/Source/Images/hd_cpm3.txt @@ -45,6 +45,7 @@ ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # ../../Binary/Apps/Test/*.com 2: Test/*.* 2: @@ -53,6 +54,7 @@ Test/*.* 2: # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add CPNET client files # diff --git a/Source/Images/hd_nzcom.txt b/Source/Images/hd_nzcom.txt index 0c904109..2f561e07 100644 --- a/Source/Images/hd_nzcom.txt +++ b/Source/Images/hd_nzcom.txt @@ -46,6 +46,7 @@ d_zsdos/u0/*.* 0: ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # ../../Binary/Apps/Test/*.com 2: Test/*.* 2: @@ -54,6 +55,7 @@ Test/*.* 2: # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add CPNET client files # diff --git a/Source/Images/hd_zpm3.txt b/Source/Images/hd_zpm3.txt index 61bcd4de..3d52e4b7 100644 --- a/Source/Images/hd_zpm3.txt +++ b/Source/Images/hd_zpm3.txt @@ -44,6 +44,7 @@ ../../Binary/Apps/zminit.ovr 15: ../../Binary/Apps/zmconfig.ovr 15: ../../Binary/Apps/zmd.com 15: +../../Binary/Apps/vgmplay.com 15: # ../../Binary/Apps/Test/*.com 2: Test/*.* 2: @@ -52,6 +53,7 @@ Test/*.* 2: # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add CPNET client files # diff --git a/Source/Images/hd_zsdos.txt b/Source/Images/hd_zsdos.txt index 806d879a..4d8c8e06 100644 --- a/Source/Images/hd_zsdos.txt +++ b/Source/Images/hd_zsdos.txt @@ -42,6 +42,7 @@ d_cpm22/u0/XSUB.COM 0: ../../Binary/Apps/zminit.ovr 0: ../../Binary/Apps/zmconfig.ovr 0: ../../Binary/Apps/zmd.com 0: +../../Binary/Apps/vgmplay.com 0: # ../../Binary/Apps/Test/*.com 2: Test/*.* 2: @@ -50,6 +51,7 @@ Test/*.* 2: # ../../Binary/Apps/Tunes/*.pt? 3: ../../Binary/Apps/Tunes/*.mym 3: +../../Binary/Apps/Tunes/*.vgm 3: # # Add CPNET client files #