Prev: 43858 Up: Map Next: 44019
43921: Check Display Mode
Used by the routine at StartPictureModeScreenIdle.
Jumps to MatchCharacterPair when the command mode at 40996 is 2. Otherwise walks the clause in E and stores the words it accepts.
CheckDisplayMode 43921 LD A,(40996) Jump to MatchCharacterPair if the command mode at 40996 is 2.
43924 CP 2
43926 JR Z,MatchCharacterPair
43928 LD A,E Read the low byte of the source.
43929 OR 7 Mark bits 0-2 on the result.
43931 LD E,A Store the result in the low byte of the source.
CheckDisplayMode_Loop 43932 CALL SaveTextPointer Go to CheckDisplayMode_Loop if it is 224.
43935 CP 224
43937 JR Z,CheckDisplayMode_Loop
43939 CP 48 Go to CheckDisplayMode_Next if it is not 48.
43941 JR NZ,CheckDisplayMode_Next
CheckDisplayMode_TestBitClear 43943 BIT 1,E Jump ahead to CheckDisplayMode_ConditionHoldsCaller if bit 1 is clear.
43945 JR Z,CheckDisplayMode_ConditionHoldsCaller
CheckDisplayMode_CharacterLowByte 43947 RES 1,E Clear bit 1 of E and store BC at IY+0-1.
43949 LD (IY+0),C
43952 LD (IY+1),B
43955 JR CheckDisplayMode_Loop Go back and test the next display marker.
The condition holds, so the caller continues.
CheckDisplayMode_ConditionHoldsCaller 43957 SCF Mark the condition as met.
43958 RET Return.
A zero code clears the third flag bit when that bit is set.
CheckDisplayMode_Next 43959 CP 0 Go to CheckDisplayMode_TestCodeClearsFirst if it is not 0.
43961 JR NZ,CheckDisplayMode_TestCodeClearsFirst
CheckDisplayMode_TestBitClearAgain 43963 BIT 2,E Jump back to CheckDisplayMode_ConditionHoldsCaller if bit 2 is clear.
43965 JR Z,CheckDisplayMode_ConditionHoldsCaller
43967 RES 2,E Clear bit 2 of E and store BC at IY+2-3.
43969 LD (IY+2),C
43972 LD (IY+3),B
43975 JR CheckDisplayMode_Loop Go back and test the next display marker.
A code of 64 clears the first flag bit.
CheckDisplayMode_TestCodeClearsFirst 43977 CP 64 Go to CheckDisplayMode_TestBlankKeepsSecond unless the code is 64.
43979 JR NZ,CheckDisplayMode_TestBlankKeepsSecond
43981 RES 0,E Clear the mark on this character.
43983 JR CheckDisplayMode_TestBitClear
A blank keeps the second flag bit, or the first when the second is clear.
CheckDisplayMode_TestBlankKeepsSecond 43985 CP 32 Go to CheckDisplayMode_TestDisplayModeZero if it is not 32.
43987 JR NZ,CheckDisplayMode_TestDisplayModeZero
43989 BIT 1,E Jump back to CheckDisplayMode_TestBitClear while bit 1 is present.
43991 JR NZ,CheckDisplayMode_TestBitClear
43993 BIT 0,E Jump back to CheckDisplayMode_TestBitClearAgain while bit 0 is present.
43995 JR NZ,CheckDisplayMode_TestBitClearAgain
43997 RES 2,E Clear the mark on this character, then set the mark on this character.
43999 SET 0,E
44001 LD A,(IY+0)
44004 LD (IY+2),A Store A at IY+2.
44007 LD A,(IY+1) Copy the high byte beside the low byte and repeat the store from CheckDisplayMode_CharacterLowByte.
44010 LD (IY+3),A
44013 JR CheckDisplayMode_CharacterLowByte
See whether the display mode is zero, then see whether bit 1 of the low byte of the source is set.
CheckDisplayMode_TestDisplayModeZero 44015 OR A See whether the display mode is zero.
44016 BIT 1,E See whether bit 1 of the low byte of the source is set.
44018 RET Return.
Prev: 43858 Up: Map Next: 44019