; changes to M100 rom for hardware scrolling patch ; blocks: ; 44C7 - 44CC ; 44ED - 44F2 ; 752B - 7532 ; 75B0 - end ; subroutine to scroll line upward 44D2 SCLUP ; A holds the number of repetitions ; L holds the "target" line, "source" line is L+1 sclup .equ 44D2H ; subroutine to scroll line downward 44FA SCLDN ; A holds the number of repetitions ; L holds the "target" line, "source" line is L-1 scldn .equ 44FAH ;-------------------------------------------------------------------------------------- ; PATCH 6 ; replacement to Escape M routine, bytes 44C7 - 44CC ; routine enters with HL holding row/column .org 44C7H p6: CALL p8 ;returns with A holding the lowest line possible JZ TRAP_M ;jump to the subroutine that performs the hardware scrolling ;if it returns, then it is a normal scroll operation ;assuming L and A are still valid ;-------------------------------------------------------------------------------------- ; PATCH 6.1 ; mod to Escape M routine, bytes 44DA-44DC ; routine enters with HL holding row/column .org 44DAH p6_1: call redir ;call the redirect routine for sending character to LCD or ;simply the LCD ram ;-------------------------------------------------------------------------------------- ; PATCH 7 ; replacement to Escape M routine, bytes 44ED - 44F2 ; routine enters with HL holding row/column .org 44EDH p7: CALL p8 ;returns with A holding the lowest line possible JZ TRAP_L ;jump to the subroutine that performs the hardware scrolling ;if it returns, then it is a normal scroll operation ;assuming L and A are still valid ;-------------------------------------------------------------------------------------- ; PATCH 7.1 ; mod to Escape L routine, bytes 4502-4504 ; routine enters with HL holding row/column .org 4502H p7_1: call redir ;call the redirect routine for sending character to LCD or ;simply the LCD ram ;-------------------------------------------------------------------------------------- ;PATCH 10 ; this is the corrected LCD set page routine, 752B to 7532 .org 752BH p10: CALL SETPG1 ;Enable LCD drivers after short delay OUT 0FEH ;Send page 0 command to LCD drivers RET NOP NOP ;-------------------------------------------------------------------------------------- ;PATCH 8 ;SAVE SOME BYTES IN PATCH 6 AND 7 BY CREATING PATCH 8 .org 075B0H p8: CALL 43A2H ;test FAC7H for zero or non zero CALL 43A9H ;get label line protect status, load A "status"+08H MOV H,A ;MOV A TO H MOV A,L ;move l into A SUI 01H ;COMPARE WITH 01H MOV A,H ;PUT A BACK.. RET ;-------------------------------------------------------------------------------------- ; NEW SUBROUTINE TRAP_M ; HARDWARE SCROLL UP, FOR ESCAPE M ; CAPTURE THE SPECIAL CASE WHEN THE SCROLL OCCURS IN LINE 1, AND THEN EXECUTE DIFFERENT COMMANDS ; FOR 6 OR 7 SCROLLS, DEPENDING ON LABLE LINE ON/OFF TRAP_M: PUSH PSW ;PUT PSW ON STACK MVI A,040H ;LOAD A WITH 40H CALL SETPG ;CALL SET PAGE REGISTER CALL RU ;ROLL UPPER LCD MVI L,04H ;LOAD L WITH O4H MVI A,01H ;SET ACCUMULATOR TO 1 CALL SCLUP ;CALL SCROLL UP TO MOVE LINE 5 TO LINE 4, ERASE 5 CALL RL ;ROLL LOWER LCD POP PSW ;RELOAD ACCUMULATOR WITH MAXLINE DATA MVI L,08H ;SET L TO 08H SUB L ;SUBTRACT 08 FROM A RZ ;return if result is 00 MVI A,01H ;LOAD A WITH 01H JMP SCLDN ;SCROLL LINE 7 TO LINE 8 ;-------------------------------------------------------------------------------------- ; NEW SUBROUTINE TRAP_L ; HARDWARE SCROLL DOWN, FOR ESCAPE L ; CAPTURE THE SPECIAL CASE WHEN THE SCROLL OCCURS IN LINE 1, AND THEN EXECUTE DIFFERENT COMMANDS ; FOR 6 OR 7 SCROLLS, DEPENDING ON LABLE LINE ON/OFF TRAP_L: MOV A,H ;RELOAD A WITH LAST LINE DATA SUI 08H ;SUBTRACT 08H JZ CONT ;JUMP AHEAD IF LAST LINE = 8 MVI L,07H ;LOAD L WITH 07H MVI A,01H ;LOAD A WITH 01H CALL SCLUP ;SCROLL LINE 8 TO LINE 7, ERASE 8 CONT: MVI A,0C0H ;ADD C0H, SAME AS SUBTRACTING 040H CALL SETPG ;CALL SET PAGE REGISTER CALL RL ;ROLL LOWER LCD MVI L,04H ;LOAD L WITH O4H MVI A,01H ;SET ACCUMULATOR TO 1 CALL SCLDN ;CALL SCROLL DOWN TO MOVE LINE 4 TO LINE 5, ERASE 4 CALL RU ;ROLL UPPER LCD RET RU: LXI H,RUDAT ;LOAD HL WITH RUDAT FOR UPPER LCD DRIVERS JMP ROLL ;JUMP TO ROLL RL: LXI H,RLDAT ;LOAD HL WITH RDAT FOR LOWER LCD DRIVERS POP PSW ;GET COMMAND WORD ROLL: CALL 753BH ;CALL ROUTINE TO SELECT LCD DRIVERS OUT 0FEH ;WRITE ACCUMULATOR TO UPPER LCD DRIVERS RET SETPG1: CALL 7533H ;Enable LCD drivers after short delay XRA A ;ZERO OUT THE ACCUMULATOR SETPG: LXI H,0F9AAH ;GET CURRENT PAGE REGISTER ADD M ;ADD M TO A MOV M,A ;STORE A IN PAGE REGISTER ORI 3EH ;FORM COMMAND WORD PUSH PSW ;PUSH COMMAND WORD ONTO STACK PUSH PSW ;PUSH COMMAND WORD ONTO STACK RET ;-------------------------------------------------------------------------------------------- ; patch to add some constants at the bottom of the rom in unused space .org 7FFAH ;bottom of ROM...unused 6 bytes RUDAT: DB 0F8H,00H ;SELECT THE UPPER LCD DRIVERS RLDAT: DB 07H,03H ;SELECT THE LOWER LCD DRIVERS