This is an old revision of the document!
When selecting a texture it is similar to C but is far more simplified. Normally, in C you would do the following:
#define Texture 0
In asm this translates to the following:
mov R7, 0 out GPU_SelectedTexture, R7
What is happening in the above snip of code is that we are putting in our number ID for our texture into register 7 and then feeding R7 into the GPU_SelectedTexture.
After you have successfully selected your texture you need to select a region inside your texture file. To accomplish this in asm you are repeating similar steps as to selecting a texture. Here is a sample of what that would look like:
mov R7, 1 out GPU_SelectedRegion, R7
Similarly to above, we are putting the id for a region into R7 and then feeding R7 into GPU_SelectedRegion.
To display your regions you need 2 things. Firstly, you need to say where you want to display the region. That is done by putting in values for X and Y into 2 different registers. Here is what that looks like:
mov R2, 20 ; X coordinate mov R3, 40 ; Y coordinate
Implemented from scratch, in assembly: