.GetIconRowAddress LDA viewScreenAddr \ Set iconRowAddr(1 0) = viewScreenAddr(1 0) - &0140 SEC \ = viewScreenAddr(1 0) - 320 SBC #&40 \ STA iconRowAddr \ starting with the low bytes LDA viewScreenAddr+1 \ And then the high bytes SBC #&01 CMP #&60 \ If the result of the subtraction is less than &6000, BCS gicn1 \ add &2000 to wrap it around so the result is within ADC #&20 \ screen memory from &6000 and up .gicn1 STA iconRowAddr+1 \ Store the high byte of the result in iconRowAddr(1 0), \ so we have the following: \ \ iconRowAddr(1 0) = viewScreenAddr(1 0) - 320 \ \ Each character row in screen mode 5 takes up 320 bytes \ (40 character blocks of eight bytes each), so this \ sets iconRowAddr(1 0) to the address of the character \ row just above the player's scrolling landscape view, \ which is in screen memory at viewScreenAddr(1 0) RTS \ Return from the subroutineName: GetIconRowAddress [Show more] Type: Subroutine Category: Scanner/energy row Summary: Calculate the address in screen memory of the icon and scanner row at the top of the screenContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ResetScreenAddress calls GetIconRowAddress * ScrollPlayerView calls GetIconRowAddress
Returns: A The high byte of the address in iconRowAddr(1 0)
[X]
Label gicn1 is local to this routine
[X]
Variable iconRowAddr in workspace Main variable workspace
The screen address of the icon and scanner row along the top of the screen
[X]
Variable viewScreenAddr in workspace Main variable workspace
The screen address of the player's scrolling landscape view, which is just below the icon and scanner row at the top of the screen