Skip to navigation


Maths (Geometry): SCALEX

[Apple II version]

Name: SCALEX [Show more] Type: Subroutine Category: Maths (Geometry) Summary: Scale the x-coordinate in A to 32 + 0.75 * A
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT103 calls SCALEX * TT14 calls SCALEX * TT22 calls SCALEX

This routine (and the related SCALEY and SCALEY2 routines) are called from various places in the code to scale the value in A. This code is different in the Apple II and BBC Master versions, and allows coordinates to be scaled correctly on different platforms. In the Apple version, the scaling routines scale screen coordinates in the system charts by 3/4 in each direction. This enables the charts to fit into the smaller screen size when compared to the BBC Micro versions, while still leaving the dashboard on-screen (the Commodore 64 version also has a smaller screen, but it removes the dashboard from the screen to make more room). The scaling routines do the following: * SCALEX scales an x-coordinate to 32 + 0.75 * x * SCALEY scales a y-coordinate to 0.375 * y * SCALEY2 scales a y-coordinate to 0.75 * y
.SCALEX JSR SCALEY2 ; Set A = 0.75 * A ADC #32 ; Set A = A + 32 ; = 32 + 0.75 * A ; ; The addition works because SCALEY2 clears the C flag RTS ; Return from the subroutine