Skip to navigation

Screen buffer: screenBufferHi

Name: screenBufferHi [Show more] Type: Variable Category: Screen buffer Summary: The value to add to scrollScreenHi for each direction to get the high byte of the screen buffer address of the content to scroll in
Context: See this variable in context in the source code References: This variable is used as follows: * SetBufferAddress uses screenBufferHi

This table contains the address within the screen buffer from which the interrupt handler should start pulling screen content to scroll onto the screen, depending on the direction of the scroll. The content that should be pulled onto the screen at the start of the scrolling process is as follows: * When panning right: The left column of the column-shaped screen buffer appears first as the new content scrolls in from the right * When panning left: The right column of the column-shaped screen buffer appears first as the new content scrolls in from the right * When panning up: The bottom row of the row-shaped screen buffer appears first as the new content scrolls in from above * When panning down: The top row of the row-shaped screen buffer appears first as the new content scrolls in from below This table contains the address of the new content for each panning direction, but with a slight complication. The first step in scrolling content onto the screen is to add the scrolling direction in scrollScreen(Hi Lo), so to make sure the first scroll moves the correct content onto the screen, the values in this table already have the corresponding value of scrollScreen(Hi Lo) subtracted from them, so when this is added at the start of the scroll, the address correctly points to the address of the new content in the screen buffer. The screen buffer starts at address screenBufferRow0, each character column takes up eight bytes of buffer space, and each character row takes up 320 bytes of buffer space.
.screenBufferHi EQUB HI(screenBufferRow0 + 0 * 8 - 8) \ Direction 0 \ \ Pan right, scroll left \ \ screenBufferRow0 = base address of \ screen buffer \ \ 0 * 8 = the left column (column 0) \ of the 16-column screen \ buffer \ \ -8 = - scrollScreen(Hi Lo) \ = - +8 EQUB HI(screenBufferRow0 + 15 * 8 + 8) \ Direction 1 \ \ Pan left, scroll right \ \ screenBufferRow0 = base address of \ screen buffer \ \ 15 * 8 = the right column (column \ 15) of the 16-column \ screen buffer \ \ 8 = - scrollScreen(Hi Lo) \ = - -8 EQUB HI(screenBufferRow0 + 7 * 320 + 320) \ Direction 2 \ \ Pan up, scroll down \ \ screenBufferRow0 = base address of \ screen buffer \ \ 8 * 320 = the bottom row (row 7) \ of the 8-row screen \ buffer \ \ 320 = - scrollScreen(Hi Lo) \ = - -320 EQUB HI(screenBufferRow0 + 0 * 320 - 320) \ Direction 3 \ \ Pan down, scroll up \ \ screenBufferRow0 = base address of \ screen buffer \ \ 8 * 320 = the top row (row 0) of \ the 8-row screen buffer \ \ -320 = - scrollScreen(Hi Lo) \ = - +320