.ConfigureBuffer STA screenBufferType \ Set screenBufferType to the new buffer type TAY \ Copy the buffer type into Y so we can use it as an \ index into the various buffer configuration tables LDA buffersMinYaw,Y \ Set the high byte of bufferMinYaw(Hi Lo) to the value STA bufferMinYawHi \ from the buffersMinYaw table for this screen buffer LSR A \ Set bufferMaxYawHi = bufferMinYawHi / 2 EOR #%10000000 \ STA bufferMaxYawHi \ and with bit 7 flipped LDA buffersOrigin,Y \ Set the high byte of bufferOrigin(Hi Lo) to the value STA bufferOriginHi \ from the buffersOrigin table for this screen buffer LDA xBuffersWidth,Y \ Set xBufferWidth to the value from the xBuffersWidth STA xBufferWidth \ table for this screen buffer LDA xBuffersLeft,Y \ Set xBufferLeft to the value from the xBuffersLeft STA xBufferLeft \ table for this screen buffer CLC \ Set xBufferRight = xBufferLeft + xBufferWidth ADC xBufferWidth \ STA xBufferRight \ So this sets the right edge of the screen buffer LDA #0 \ Zero the low byte of bufferMinYaw(Hi Lo) STA bufferMinYawLo STA bufferOriginLo \ Zero the low byte of bufferOrigin(Hi Lo) RTS \ Return from the subroutineName: ConfigureBuffer [Show more] Type: Subroutine Category: Screen buffer Summary: Set up the variables required to configure the screen buffer to a specific buffer typeContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ClearScreen calls ConfigureBuffer * MainGameLoop calls ConfigureBuffer * UseColumnBuffer calls ConfigureBuffer * UseRowBuffer calls ConfigureBuffer
Arguments: A The type of buffer to configure: * 0 = left row buffer (for up/down pan) for the first 256 bytes of the 320-byte row * 1 = right row buffer (for up/down pan) for the last 64 bytes of the 320-byte row * 2 = column buffer (for left/right pan)
[X]
Variable bufferMaxYawHi in workspace Zero page
The maximum allowed yaw angle for points in the current screen buffer (high byte)
[X]
Variable bufferMinYawHi in workspace Zero page
The minimum allowed yaw angle for points in the current screen buffer (high byte)
[X]
Variable bufferMinYawLo in workspace Zero page
The minimum allowed yaw angle for points in the current screen buffer (low byte)
[X]
Variable bufferOriginHi in workspace Zero page
The offset to add to yaw angles for the current screen buffer to convert them from having the origin in the buffer centre to having the origin on the left edge of the buffer (high byte)
[X]
Variable bufferOriginLo in workspace Zero page
The offset to add to yaw angles for the current screen buffer to convert them from having the origin in the buffer centre to having the origin on the left edge of the buffer (low byte)
[X]
Variable buffersMinYaw (category: Screen buffer)
Minimum allowed yaw angles for points in the screen buffer
[X]
Variable buffersOrigin (category: Screen buffer)
The offset to add to yaw angles for each screen buffer to convert from the origin in the buffer centre to the origin on the left
[X]
Variable screenBufferType in workspace Zero page
The type of screen buffer that is currently being used
[X]
Variable xBufferLeft in workspace Zero page
The left edge of the screen buffer in pixels
[X]
Variable xBufferRight in workspace Zero page
The right edge of the screen buffer in pixels
[X]
Variable xBufferWidth in workspace Zero page
The width in pixels of the screen buffer
[X]
Variable xBuffersLeft (category: Screen buffer)
The left edge of each screen buffer in pixels
[X]
Variable xBuffersWidth (category: Screen buffer)
The width of each screen buffer in pixels