From 61d9555dc02104047eb904ac5efade090b2f0e55 Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Sun, 8 Dec 2024 15:26:10 +0800 Subject: [PATCH 1/5] Document updates --- Source/Doc/SystemGuide.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Doc/SystemGuide.md b/Source/Doc/SystemGuide.md index 5911bb32..56e994ba 100644 --- a/Source/Doc/SystemGuide.md +++ b/Source/Doc/SystemGuide.md @@ -2383,6 +2383,11 @@ Cold Start (0x02): : Perform a system cold start (like a power on). All devices are reinitialized. +User Restart (0x03): + + : Perform a video terminal reset. Terminal emulation and visual display + systems are reset. + The Status (A) is a standard HBIOS result code. ### Function 0xF1 -- System Version (SYSVER) From 778231dc80d52d60b83bb89cc542854bf4183d92 Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Sun, 8 Dec 2024 16:18:45 +0800 Subject: [PATCH 2/5] Doc updates for front panel diagnostics --- Source/Doc/SystemGuide.md | 66 +++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/Source/Doc/SystemGuide.md b/Source/Doc/SystemGuide.md index 56e994ba..aa0a9578 100644 --- a/Source/Doc/SystemGuide.md +++ b/Source/Doc/SystemGuide.md @@ -3340,28 +3340,62 @@ placeholder ### Diagnostic LEDs -Progress through the boot and initialization process can be difficult to monitor -due to the lack of console or video output. Access to these output devices does -not become available until late the in the boot process. If these output devices -are also involved with the issue trying to be resolved then trouble shooting is -even more difficult. +Progress through the boot and initialization process can be difficult to +monitor due to the lack of console or video output. Access to these output +devices does not become available until late the in the boot process. If +these output devices are also involved with the issue trying to be resolved +then trouble shooting is even more difficult. -ROMWBW can be configured to display boot progress with the assistance of additional -hardware. This take the form of an LED breakout debugging board connected to an -8-bit output port. As the boot code executes, the LED output display is updated. +ROMWBW can be configured to display boot progress with the assistance of +additional hardware. This can take the form of a front panel LED display or +LED breakout debugging board connected to an 8-bit output port. Or it can +utilize existing platform status LEDS. -To use a LED breakout board, it must be connected the computers data, reset and port -select lines. +As the boot code executes, the LED output display is updated to indicate the execution progress. -To enable the DIAG option the following settings must be made in the systems .ini -configuration file, where 0xnn is the port address. +Platforms that have these capabilities built in have them enabled by default. -DIAGENABLE .SET TRUE -DIAGPORT .SET 0xnn +#### Front Panel display -The following table shows the ROMWBW process steps in relation to the LED display. +A LED front panel or breakout board needs to be connected the computers data, +reset and port select lines. -| **LED** | **RomWBW Processes** | +To enable this option the following settings can be made in the platforms custom +configuration file. + +``` +FPLED_ENABLE .SET TRUE ; ENABLE FRONT PANEL +``` + +Custom hardware can be configured with : + +``` +FPLED_IO .SET $nn ; USE PORT ADDRESS nn +FPLED_INV .SET FALSE ; INVERTED LED BITS +``` + +#### Platform Status LEDS + +These status LEDs use preexisting status LEDs on each platform. + +Enable using: + +``` +LEDENABLE .SET TRUE ; ENABLES STATUS LED +``` + +Customize using: + +``` +LEDMODE .SET LEDMODE_STD ; LEDMODE_[STD|SC|RTC|NABU] +LEDPORT .SET $nn ; STATUS LED PORT ADDRESS +``` + +The following table shows the ROMWBW process steps in relation to the panel +display. + + +| **PANEL** | **RomWBW Processes** | |------------|------------------------------------------------| | `........` | Initial boot | | | Jump to start address | From 55336ac01071707ff30d164f63b935cb1b0865ea Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Sun, 8 Dec 2024 17:30:01 +0800 Subject: [PATCH 3/5] Typo --- Source/HBIOS/sio.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/HBIOS/sio.asm b/Source/HBIOS/sio.asm index c7e23e01..73f5d189 100644 --- a/Source/HBIOS/sio.asm +++ b/Source/HBIOS/sio.asm @@ -921,7 +921,7 @@ SIO_INITPRT: XOR A ; SIGNAL SUCCESS RET ; RETURN ; -; THE SIO IS A LITTLE PRICKLY ABOUT THE ORDER IN WHICH REGSITERS ARE +; THE SIO IS A LITTLE PRICKLY ABOUT THE ORDER IN WHICH REGISTERS ARE ; WRITTEN DURING CONFIGURATION. THE TABLE BELOW IS USED TO SETUP ; THE REGISTER VALUES AND THEN THE ENTIRE TABLE CAN BE SPIT OUT. ; From c106b752614c77591fdfc84f8c8aec2117f43ec3 Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Sun, 8 Dec 2024 21:12:47 +0800 Subject: [PATCH 4/5] Refactor ps2iface --- Source/HBIOS/ps2iface.inc | 91 ++++++++++++++++----------------------- Source/HBIOS/tms.asm | 2 +- 2 files changed, 39 insertions(+), 54 deletions(-) diff --git a/Source/HBIOS/ps2iface.inc b/Source/HBIOS/ps2iface.inc index 8ca320c4..5e4e992f 100644 --- a/Source/HBIOS/ps2iface.inc +++ b/Source/HBIOS/ps2iface.inc @@ -1,8 +1,8 @@ ;__________________________________________________________________________________________________ ; HARDWARE INTERFACE FOR POLLED AND INTERRUPT DRIVEN PS2 KEYBOARD. ; -; IN POLLED MODE THE KEYBOARD DEVICE IS IDENTIFIED BY THE TABLE POINTED TO BY IY -; IN INTERRUPT MODE THE KEYBOARD DEVICE IS UNKNOWN SO PREDEFINED PORT VALUES ARE USED. +; IN POLLED MODE THE CONTROLLER PORT VALUES ARE KNOWN BY THE CALLING DRIVER. +; IN INTERRUPT MODE THE DEVICES PORTS ARE UNKNOWN SO PREDEFINED PORT VALUES ARE USED. ; ; REQUIRES AN APPROPRIATE INTERRUPT JUMPER TO BE SET. ; CURRENTLY CONFIGURED FOR INT #2 ON DUODYNE WITH I/O MULTI BOARD. @@ -15,12 +15,12 @@ ;__________________________________________________________________________________________________ ; ; -KBDQSIZ .EQU 16 ; MUST BE POWER OF TWO, <=128 +KBDQSIZ .EQU 32 ; MUST BE POWER OF TWO, <=128. KBDQGETX .DB 0 ; QUEUE INDEX KBDQPUTX .DB 0 ; QUEUE INDEX - .DB $55 ; GUARD BYTE FOR DEBUGGING -KBDQ .FILL KBDQSIZ,0 ; CIRCULAR KEYBOARD BUFFER - .DB $AA ; GUARD BYTE FOR DEBUGGING +; .DB $55 ; GUARD BYTE FOR DEBUGGING ; NOTE THAT SCAN CODES ARE BEING +KBDQ .FILL KBDQSIZ,0 ; CIRCULAR KEYBOARD BUFFER ; BUFFERED. ONE KEY PRESS CAN +; .DB $AA ; GUARD BYTE FOR DEBUGGING ; GENERATE SEVERAL SCAN CODES ;__________________________________________________________________________________________________ ; RESET THE QUEUE TO EMPTY @@ -38,49 +38,32 @@ KBDQ .FILL KBDQSIZ,0 ; CIRCULAR KEYBOARD BUFFER ; KBD_INT: ; CALL KBDQDBG - LD IY,KBDIDAT - LD C,(IY+KBD_ST) ; READ CONTROLLER STATUS - EZ80_IO - IN A,(C) - AND 1 - RET Z - LD C,(IY+KBD_DAT) ; GET THE RESPONSE - EZ80_IO - IN A,(C) -; CALL KBDQPUSH ; SAVE KEYBOARD SCAN CODE -; RET + LD IY,KBDIDAT ; POINT TO PORT TABLE ; -;__________________________________________________________________________________________________ -; ADD A BYTE TO THE KEYBOARD QUEUE -;__________________________________________________________________________________________________ +; LD C,(IY+KBD_ST) +; EZ80_IO +; IN A,(C) ; READ CONTROLLER STATUS +; AND 1 ; EXIT IF NOTHING + + CALL KBD_IST_P + RET Z ; TO READ + LD C,(IY+KBD_DAT) + EZ80_IO ; IF SOMETHING PENDING + IN A,(C) ; READ THE BYTE IN + LD B,A ; AND SAVE IT ; -KBDQPUSH: ; ADD A SCAN CODE TO THE QUEUE - PUSH AF - CALL KBDQFULL - JR Z,KBDQISF ; EXIT IF THE QUEUE IS FULL + CALL KBDQLEN ; CHECK IF + SUB KBDQSIZ ; QUEUE IS FULL + RET Z ; EXIT IF THE QUEUE IS FULL ; - LD HL,KBDQPUTX - LD A,(HL) ; CREATE QUEUE INDEX - AND KBDQSIZ-1 - INC (HL) ; UPDATE INDEX + LD HL,KBDQPUTX ; CREATE QUEUE INDEX + CALL KBD_Q_IDX ; POINTER IN HL ; - LD HL,KBDQ ; INDEX INTO THE QUEUE - LD B,0 - LD C,A - ADD HL,BC - POP AF LD (HL),A ; SAVE THE CHARACTER IN THE QUEUE ; CALL KBDQDBG ; RET ; -KBDQISF:POP AF - RET - -KBDQFULL: ; RETURN Z IF QUEUE IS FULL - CALL KBDQLEN ; RETURN NZ IF STILL SPACE IN QUEUE - SUB KBDQSIZ - RET #ENDIF ; ;__________________________________________________________________________________________________ @@ -104,25 +87,27 @@ KBDQPOP: CALL KBDQLEN RET Z ; EXIT IF THE QUEUE IS EMPTY ; - LD HL,KBDQGETX + LD HL,KBDQGETX ; CREATE QUEUE INDEX + CALL KBD_Q_IDX ; POINTER IN HL +; + LD A,(HL) ; GET THE CHARACTER FROM THE QUEUE +; LD (HL),B ; DEBUG - CLEAN QUEUE +; + RET + +KBD_Q_IDX: LD A,(HL) ; CREATE QUEUE INDEX AND KBDQSIZ-1 INC (HL) ; UPDATE INDEX -; LD HL,KBDQ ; INDEX INTO THE QUEUE - LD B,0 LD C,A - ADD HL,BC - LD A,(HL) ; GET THE CHARACTER FROM THE QUEUE -; LD (HL),B ; DEBUG - CLEAN QUEUE -; + LD A,B ; NOTE THE QUEUE GET + LD B,0 ; AND PUT INDEXES + ADD HL,BC ; NEVER DECREASE RET ; #ENDIF ; -; RETURN A BYTE TO FROM KEYBOARD QUEUE -; NOTE THE QUEUE INDEX'S NEVER DECREASE IN SIZE. -; #IF ((INTMODE == 2) & KBDINTS)) KBD_IN .EQU KBD_IN_Q #ELSE @@ -204,9 +189,9 @@ KBDQDBG: PUSH BC PUSH AF - CALL NEWLINE ; PRINT QUEUE CONTENTS WITH PRE AND POST GUARD BYTES - LD B,KBDQSIZ+2 - LD HL,KBDQ-1 + CALL NEWLINE ; PRINT QUEUE CONTENTS + LD B,KBDQSIZ ; +2 PRE AND POST GUARD BYTES + LD HL,KBDQ ; -1 PRE AND POST GUARD BYTES KBDQPRT: LD A,(HL) CALL PRTHEXBYTE diff --git a/Source/HBIOS/tms.asm b/Source/HBIOS/tms.asm index 07e08ad9..577ad721 100644 --- a/Source/HBIOS/tms.asm +++ b/Source/HBIOS/tms.asm @@ -917,7 +917,7 @@ TMS_XY2IDX: RET ; RETURN ; ;---------------------------------------------------------------------- -; WRITE VALUE IN A TO CURRENT VDU BUFFER POSTION, ADVANCE CURSOR +; WRITE VALUE IN A TO CURRENT VDU BUFFER POSITION, ADVANCE CURSOR ;---------------------------------------------------------------------- ; TMS_PUTCHAR: From 043600595fb3aee9f6c98acd60942ab3b5e29d08 Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Sun, 8 Dec 2024 21:19:18 +0800 Subject: [PATCH 5/5] Update ps2iface.inc --- Source/HBIOS/ps2iface.inc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Source/HBIOS/ps2iface.inc b/Source/HBIOS/ps2iface.inc index 5e4e992f..6dff5ee3 100644 --- a/Source/HBIOS/ps2iface.inc +++ b/Source/HBIOS/ps2iface.inc @@ -15,7 +15,7 @@ ;__________________________________________________________________________________________________ ; ; -KBDQSIZ .EQU 32 ; MUST BE POWER OF TWO, <=128. +KBDQSIZ .EQU 32 ; MUST BE POWER OF TWO, <=128 KBDQGETX .DB 0 ; QUEUE INDEX KBDQPUTX .DB 0 ; QUEUE INDEX ; .DB $55 ; GUARD BYTE FOR DEBUGGING ; NOTE THAT SCAN CODES ARE BEING @@ -40,13 +40,8 @@ KBD_INT: ; CALL KBDQDBG LD IY,KBDIDAT ; POINT TO PORT TABLE ; -; LD C,(IY+KBD_ST) -; EZ80_IO -; IN A,(C) ; READ CONTROLLER STATUS -; AND 1 ; EXIT IF NOTHING - - CALL KBD_IST_P - RET Z ; TO READ + CALL KBD_IST_P ; READ CONTROLLER STATUS + RET Z ; EXIT IF NOTHINGTO READ LD C,(IY+KBD_DAT) EZ80_IO ; IF SOMETHING PENDING IN A,(C) ; READ THE BYTE IN