Convert figure images to markdown
This commit is contained in:
parent
307b59584f
commit
77a95ec319
115 changed files with 218 additions and 403 deletions
18
58-03.md
18
58-03.md
|
|
@ -20,8 +20,7 @@ the least.
|
|||
 *That's what Zen programming is all about, though; tying together two pieces of seemingly unrelated information to good effect—and that's what I had failed to do. Like Robert Heinlein—like all of us—I had viewed the world through a filter composed of my ingrained assumptions, and one of those assumptions, based on all my past experience, was that pixel processing proceeds left to right. Eventually, I might have come up with Chris's approach; but I would only have come up with it when and if I relaxed and stepped back a little, and allowed myself—almost dared myself—to think of it. When you're optimizing, be sure to leave quiet, nondirected time in which to conjure up those less obvious solutions, and periodically try to figure out what assumptions you're making—and then question them!*
|
||||
------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
\
|
||||
**Figure 58.3** *Texture mapping a single vertical column.*
|
||||

|
||||
|
||||
There are a few complications with Chris's approach, not least that
|
||||
X-Sharp's polygon-filling convention (top and left edges included,
|
||||
|
|
@ -91,9 +90,8 @@ current coordinates with four separate 16-bit operations, and carries
|
|||
from fractional to integer parts are detected via conditional jumps, as
|
||||
shown in Figure 58.4. There's quite a lot we can do to improve this.
|
||||
|
||||
\
|
||||
**Figure 58.4** *Original method for advancing the source texture
|
||||
pointer.*
|
||||

|
||||
|
||||
First, we can sum the X and Y integer advance amounts outside the loop,
|
||||
then add them both to the source pointer with a single instruction.
|
||||
|
|
@ -123,13 +121,11 @@ X and Y, and the following instruction **ADC SI,BP** finishes advancing
|
|||
the source pointer in X. That's a mere 3 cycles, and all that remains is
|
||||
to finish advancing the source pointer in Y.
|
||||
|
||||
\
|
||||
**Figure 58.5** *Efficient method for advancing source texture
|
||||
pointer.*
|
||||

|
||||
|
||||
\
|
||||
**Figure 58.6** *Storing both X and Y fractional coordinates in one
|
||||
register.*
|
||||

|
||||
|
||||
Actually, we also advanced the source pointer by the Y integer amount
|
||||
back when we added BP to SI; all that's left is to detect whether our
|
||||
|
|
|
|||
Loading…
Reference in a new issue