
|
 |
|
Michael Abrash's Graphics Programming Black Book, Special Edition
by Michael Abrash
The Coriolis Group
ISBN: 1576101746 Pub Date: 07/01/97
|
Index
- Numbers
- 1/z sorting
- abutting span sorting, 1229-1230
- AddPolygonEdges function, 1232-1233, 1238
- vs. BSP-order sorting, 1226-1227
- calculating 1/z value, 1220-1222
- ClearEdgeLists function, 1236-1237
- DrawSpans function, 1236
- independent span sorting, 1230, 1231-1238, 1239-1241
- intersecting span sorting, 1228-1229
- PolyFacesViewer function, 1232
- reliability, 1227
- ScanEdges function, 1234-1236, 1238-1239
- UpdateWorld function, 1237-1238
- 3-D animation
- See also Hidden surface removal; 3-D drawing; 3-D polygon rotation demo program; X-Sharp 3-D animation package.
- demo programs
- solid cube rotation program, 957-961, 962-963, 964-966, 967
- 3-D polygon rotation program, 939, 940-945, 948-949
- 12-cube rotation program, 972, 973-984, 985-987
- depth sorting, 1000, 1001-1002
- rotation
- ConcatXforms function, 944
- matrix representation, 938-939
- multiple axes of rotation, 948
- XformVec function, 943
- rounding vs. truncation, 1002-1003
- translation of objects, 937-938
- 3-D clipping
- arithmetic imprecision, handling, 1240
- line segments, clipping to planes, 1195-1197
- overview, 1195
- polygon clipping
- BackRotateVector function, 1203
- clipping to frustum, 1200, 1201-1206, 1206-1207
- ClipToFrustum function, 1204
- ClipToPlane function, 1199
- optimization, 1207
- overview, 1197-1200
- PolyFacesViewer function, 1203
- ProjectPolygon function, 1201
- SetUpFrustum function, 1204
- SetWorldspace function, 1204
- TransformPoint function, 1203
- TransformPolygon function, 1203
- UpdateWorld function, 1205
- viewspace clipping, 1207
- ZSortObjects function, 1201
- 3-D drawing
- See also BSP (Binary Space Partitioning) trees; Hidden surface removal; Polygons, filling; Shading; 3-D animation.
- backface removal
- BSP tree rendering, 1160-1161
- calculations, 955-957
- motivation for, 954-955
- and sign of dot product, 1140
- solid cube rotation demo program, 957-961, 962-963, 964-966, 967
- background surfaces, 1240
- draw-buffers, and beam trees, 1187
- and dynamic objects, 1100-1101
- Gouraud shading, 1246-1250
- lighting
- Gouraud shading, 1246-1250
- overlapping lights, 1247
- perspective correctness, 1248-1250
- rotational variance, 1249
- surface-based lighting, 1250-1256, 1260-1262
- viewing variance, 1249
- moving models in 3-D drawings, 1212-1222
- painters algorithm, 1099, 1104-1105
- perspective correctness problem, 1248-1250
- portals, and beam trees, 1188
- projection
- dot products, 1141-1142
- overview, 937, 948
- raycast, subdividing, and beam trees, 1187
- reference materials, 934-935
- rendering BSP trees
- clipping, 1158-1159
- ClipWalls function, 1152-1155, 1158-1159
- DrawWallsBackToFront function, 1155-1156, 1160-1161
- overview, 1149
- reference materials, 1157
- TransformVertices function, 1151-1152, 1158
- UpdateViewPos function, 1151, 1157
- UpdateWorld function, 1156-1157, 1157
- viewspace, transformation of objects to, 1158
- wall orientation testing, 1160-1161
- WallFacingViewer function, 1150-1151, 1161
- span-based drawing, and beam trees, 1187
- transformation of objects, 935-936
- triangle model drawing
- fast triangle drawing, 1263-1265
- overview, 1262-1263
- precision, 1265
- subdivision rasterization, 1266-1267, 1267-1270
- vertex-free surfaces, and beam trees, 1187
- visibility determination, 1099-1106
- visible surface determination (VSD)
- beam trees, 1185-1189
- culling to frustum, 1181-1184
- overdraw problem, 1184-1185
- potentially visible set (PVS), precalculating, 1188-1189
- 3-D engine, Quake
- BSP trees, 1276-1277
- lighting, 1282-1283
- model overview, 1276-1277
- portals, 1279-1280
- potentially visible set (PVS), 1278-1279
- rasterization, 1282
- world, drawing, 1280-1281
- 3-D math
- cross products, 1139-1140
- dot products
- calculating, 1135-1137
- calculating light intensity, 1137
- projection, 1141-1142
- rotation, 1143-1144
- sign of, 1140-1141
- of unit vectors, 1136
- of vectors, 1135-1136
- matrix math
- assembly routines, 992, 996-999
- C-language implementations, 974-976
- normal vectors, calculating, 955-956
- rotation of 3-D objects, 938-939, 943-944, 948
- transformation, optimized, 1172-1173, 1173-1174
- vector length, 1135
- 3-D polygon rotation demo program
- matrix multiplication functions, 943-944, 948
- overview, 939
- performance, 949
- polygon filling with clipping support, 940-943
- transformation and projection, 944-945, 948
- 3-D solid cube rotation demo program
- basic implementation, 957-961, 962-963
- incremental transformations, 964-966
- object representation, 967
- 8-bit bus cycle-eater
- 286 and 386 processors, 210
- 8088 processor
- effects on performance, 82
- optimizing for, 83-85
- overview, 79-82
- and registers, 85
- 12-cube rotation demo program
- limitations of, 986
- optimizations in, 985-986
- performance, 986
- X-Sharp animation package, 972, 973-984, 984-985
- 16-bit checksum program
- See also TCP/IP checksum program.
- assembly implementation, 10-12, 17-18
- C language implementation, 8-9, 15-16
- overview, 8
- redesigning, 9
- 16-color VGA modes
- color paging, 628-629
- DAC (Digital/Analog Converter), 626-628
- palette RAM, 626
- 24-byte hi/lo function, 292-293
- 32-bit addressing modes, 256-258
- 32-bit division, 181-184, 1008
- 32-bit fixed-point arithmetic, optimizing, 1086-1089, 1090-1091, 1092-1093
- 32-bit instructions, optimizing, 1091
- 32-bit registers
- See also Registers; VGA registers.
- adding with LEA, 131
- BSWAP instruction, 252
- multiplying with LEA, 132-133
- 386 processor, 222
- time vs. space tradeoff, 187
- using as two 16-bit registers, 253-254
- 256-color modes
- See also 320×400 256-color mode.
- DAC settings, 629
- mapping RGB model to, 1036, 1037-1038, 1039
- resolution, 360×480 256-color mode, 619-620
- 286 processor
- CMP instruction, 161, 306
- code alignment, 215-218
- cycle-eaters, 209-210
- data alignment, 213-215
- data transfer rates, 212
- display adapter cycle-eater, 219-221
- display memory wait states, 220
- DRAM refresh cycle-eater, 219
- effective address calculations, 129, 223-225
- instruction fetching, 215-218
- LEA vs. ADD instructions, 130
- lookup tables, vs. rotating or shifting, 145-146
- LOOP instruction vs. DEC/JNZ sequence, 139
- memory access, performance, 223-225
- new features, 221
- POPF instruction, and interrupts, 226
- protected mode, 208-209
- stack pointer alignment, 218-219
- system wait states, 210-212
- 320×240 256-color mode. See Mode X.
- 320×400 256-color mode
- advantages of, 590-591
- display memory organization, 591-593
- line drawing, 600
- page flipping demo program, 600-605
- performance, 599-600
- pixel drawing demo program, 593-598, 599-600
- 360×480 256-color mode
- display memory, accessing, 621-622
- Draw360×480Dot subroutine, 613-614
- drawing speed, 618
- horizontal resolution, 620
- line drawing demo program, 615-618, 618-619
- mode set routine (John Bridges), 609, 612, 620-621
- on VGA clones, 610-611
- Read360×480Dot subroutine, 614-615
- 256-color resolution, 619-620
- vertical resolution, 619
- 386 native mode, 32-bit displacements, 187
- 386 processor
- alignment, stack pointer, 218-219
- CMP instruction, 161, 306
- cycle-eaters, 209-210
- data alignment, 213, 218
- and display adapter cycle-eater, 107
- display adapter cycle-eater, 219-221
- doubleword alignment, 218
- DRAM refresh cycle-eater, 219
- effective address calculations, 129, 223-225
- LEA instruction, 130-133, 172
- LODSD vs. MOV/LEA sequence, 171
- lookup tables, vs. rotating or shifting, 145-146
- LOOP instruction vs. DEC/JNZ sequence, 139
- memory access, performance, 223-225
- MUL and IMUL instructions, 173-174
- multiplication operations, increasing speed of, 173-174
- new instructions and features, 222
- Pentium code, running on, 411
- protected mode, 208-209
- rotation instructions, clock cycles, 185-186
- system wait states, 210-212
- 32-bit addressing modes, 256-258
- 32-bit multiply and divide operations, 985
- using 32-bit register as two 16-bit registers, 253-254
- XCHG vs. MOV instructions, 377, 832
- 386SX processor, 16-bit bus cycle-eater, 81
- 486 processor
- AX register, setting to absolute value, 172
- byte registers and lost cycles, 242-245
- CMP instruction
- operands, order of, 306
- vs. SCASW, 161
- copying bytes between registers, 172
- and display adapter cycle-eater, 107
- indexed addressing, 237-238
- internal cache
- effect on code timing, 246
- optimization, 236
- LAHF and SAHF instructions, 148
- LEA instruction, vs. ADD, 131
- LODSB instruction, 304
- LODSD instruction, vs. MOV/LEA sequence, 171
- lookup tables, vs. rotating or shifting, 145-146
- LOOP instruction, vs. DEC/JNZ sequence, 139
- MOV instruction, vs. XCHG, 377
- n-bit vs. 1-bit shift and rotate instructions, 255-256
- Pentium code, running on, 411
- pipelining
- address calculation, 238-240, 250
- stack addressing, 241-242
- rotation instructions, clock cycles, 185-186
- stack-based variables, 184-184
- 32-bit addressing modes, 256-258
- timing code, 245-246
- using 32-bit register as two 16-bit registers, 253-254
- XCHG instruction, vs. MOV, 377, 832
- 640×400 mode, mode set routine, 852-853
- 640×480 mode, page flipping, 836-837
- 8086 processor vs. 8088 processor, 79-81
- 8088 processor
- CMP instruction, 161, 306
- cycle-eaters
- 8-bit bus cycle-eater, 79-85
- display adapter cycle-eater, 101-108
- DRAM refresh cycle-eater, 95-99
- overview, 78-79, 80
- prefetch queue cycle-eater, 86-94
- wait states, 99-101
- display memory access, 220
- effective address calculation options, 129
- vs. 8086 processor, 79-81
- LAHF and SAHF instructions, 148
- LEA vs. ADD, 130
- LODSB instruction, 304
- lookup tables, vs. rotating or shifting, 145-146
- LOOP instruction vs. DEC/JNZ sequence, 139
- memory variables, size of, 83-85
- stack-based variables, placement of, 184-184
- 8253 timer chip
- and DRAM refresh, 95
- reference material, 72
- resetting, 43
- system clock inaccuracies
- long-period Zen timer, 53, 54
- Zen timer, 43, 45-46, 48
- timer 0
- operation, 44
- stopping, 54, 65
- timer modes, 44, 45
- timer operation, 43-45
- undocumented features, 54, 65
- A
- Absolute value, setting AX register, 171
- Abstraction, and optimization, 330-332, 345-346
- Abutting span sorting, 1229-1230
- AC (Attribute Controller), VGA
- addressing, 427-428
- Color Select register, 628-629
- Index register, 443, 555
- Mode Control register, 575
- Mode register
- color paging, 628-629
- 256-color modes, 629
- palette RAM registers, setting, 631-632
- Pel Panning register, 574
- registers, setting and reading, 583
- screen blanking demo program, 556-557
- Active edge table (AET), 744
- Adapters, display. See Display adapter cycle-eater.
- ADD instruction
- and Carry flag, 147-148
- vs. INC, 147-148, 219
- vs. LEA, 130, 170-171
- AddDirtyRect function, 867-869
- Addition, using LEA, 130, 131
- AddObject function, 1001-1002
- AddPolygonEdges function, 1232-1233, 1238
- Addressable memory, protected mode, 221
- Addressing modes
- 486 processor
- indexed addressing, 237-238
- 32-bit addressing modes, 256-258
- 386 processor, 130-133, 222
- VGA, internal indexing, 427-428
- Addressing pipeline penalty
- See also Pipeline stalls.
- 486 processor, 238-240, 250
- Pentium processor, 400-403
- AdvanceAET function
- complex polygons, 748-749
- monotone-vertical polygons, 769
- AET (active edge table), 744
- AGIs (Address Generation Interlocks), 400-403
- See also Addressing pipeline penalty; Pipeline stalls.
- Algorithms In C (book), 192, 196
- Alignment
- Pentium processor
- non-alignment penalties, 376
- TCP/IP checksum program, 409
- REP STOS instruction, 735
- 386 processor, 218
- 286 processor
- code alignment, 215-218
- data alignment, 213-215
- stack pointer alignment, 218-219
- ALU and latch demo program, 453-457, 458-460
- ALUs (Arithmetic Logic Units), VGA
- ALU and latch demo program, 453-457, 458-460
- logical functions, 458
- operational modes, 458
- overview, 451-452
- Ambient shading, 1023, 1025-1027
- AND instruction, Pentium processor
- AGIs (Address Generation Interlocks), 401-402
- vs. TEST, 377
- Animation
- See also Animation demo programs; Mode X; 3-D animation.
- apparent motion, 1064
- ball animation demo program, 431-441
- challenges in, 819-820
- on PCs, 795-796
- page flipping, flicker-free animation, 444-446
- speed, importance of, 1064
- Animation demo programs
- Mode X animation, 924-925, 925-930
- page flipping animation
- assembly code, 825-830
- C code, 820-825
- split screen and page flipping, 830-837
- 3-D polygon rotation
- matrix multiplication functions, 943-944, 948
- overview, 939
- performance, 949
- polygon filling with clipping support, 940-943
- transformation and projection, 944-945, 948
- 3-D solid cube rotation demo program
- basic implementation, 957-961, 962-963
- incremental transformations, 964-966
- object representation, 967
- Animation techniques
- bit-plane animation
- assembly implementation, 801-809, 810
- limitations, 811-813
- page flipping, 814
- palette registers, 799-801
- principles, 796-798
- shearing, 813
- dirty-rectangle animation
- C implementation, 847-851, 863-869
- description, 844-845
- ordering rectangles, 873
- overlapping rectangles, 872-873
- vs. page flipping, 846, 862
- performance, 873
- system memory buffer size, 851
- writing to display memory, 856-857
- internal animation, 872
- masked images, 871-872
- Antialiasing, Wus algorithm, 776-779, 780-791, 791-792
- Apparent motion, in animation, 1064
- AppendRotationX function, 964, 975
- AppendRotationY function, 964-965, 975
- AppendRotationZ function, 965, 976
- Appropriate technology, 775-776
- Arithmetic flags. See Flags.
- Arrays, sorting, 180-181
- Aspect ratio, Mode X, 878
- Assemblers
- MASM (Microsoft Assembler), 187
- optimizing assemblers, 71-72
- TASM (Turbo Assembler), 71-72
- Assembly language optimization
- See also Clock cycles; Local optimization; Optimization.
- data, placing limitations on, 274
- instruction size vs. execution time, 90-92, 93
- multi-bit rotations, 23-24
- objectives, 28
- optimizing instructions, 23-24
- programmers responsibilities, 27-29
- rearranging instructions, 418-419
- reducing size of code, 416-418
- stack addressing, 420
- understanding data, importance of, 122
- Assembly language programmers, vs. compilers, 154-155
- Assembly language, transformation issues, 25-26
- AT computer
- display adapter cycle-eater, 107
- 286 processor, data transfer rates, 212
- Attribute Controller, VGA. See AC (Attribute Controller), VGA.
- Automatic variables, 184-185
- AX register, setting to absolute value, 171
- B
- Backface culling. See Backface removal.
- Backface removal
- See also Hidden surface removal; Visible surface determination.
- BSP tree rendering, 1160-1161
- calculations, 955-957
- motivation for, 954-955
- and sign of dot product, 1140
- solid cube rotation demo program, 957-961, 962-963, 964-966, 967
- Background surfaces, 1240
- BackRotateVector function, 1203
- Ball animation demo program, 431-441
- Barrel shifter, VGA, 463-464
- Beam trees
- improvement, attempts at, 1187-1188
- overview, 1185
- performance, 1186
- potentially visible set (PVS), precalculating, 1188-1189
- Benchmarks, reliability of, 729
- Biased perceptions, and optimization, 1080, 1085
- Big endian format, 252
- BIOS. See EGA BIOS; VGA BIOS.
- Bit mask
- bitmapped text demo program, 466-469, 470-471
- and latches, 470
- overview, 464-466
- Bit Mask register
- bit mask, controlling, 465
- drawing solid text, 1040
- setting inside a loop, 429
- vs. write mode 3, 832, 844
- BitMan, 1039-1041, 1042-1044
- Bitmap organization, Mode X, 882-883
- Bitmapped text
- demo program using bit mask, 466-469, 470-471
- reference material, 471
- Bitmapped text demo program, 466-469, 470-471
- Bitmaps
- chunky, converting to planar, 504-505, 505-508
- relocating, 516-517
- transient color effects, 509
- Bit-plane animation
- assembly implementation, 801-809, 810
- limitations, 811-813
- overview, 796
- page flipping, 814
- palette registers, 799-801
- principles, 796-798
- shearing, 813
- Black box approach, and future of programming, 725-726
- Blocks. See Restartable blocks.
- Borders (overscan), 555-556
- BOUND instruction, 221
- Boundary pixels, polygons
- rules for selecting, 712
- texture mapping, 1049-1052, 1065-1066, 1067
- Bounding volumes, 1184
- Boyer-Moore algorithm
- assembly implementations, 271-274, 274-277
- C language implementation, 269
- overview, 263-265
- performance, 266-268
- test-bed program, 270
- Branch prediction, Pentium processor, 377-378
- Branching instructions
- See also Branch prediction.
- 286 and 386 processors
- non-word-alignment penalty, 216
- and prefetch queue cycle-eater, 210
- eliminating, 312-313
- Pentium processor
- branches within loops, 378
- pairing in U-pipe, 405
- x86 family CPUs, performance, 140
- Bresenhams line-drawing algorithm
- basic algorithm
- assembly implementation, 655-656, 671-677
- C language implementation, 661-665, 665-671
- description, 657-660
- strengths and weaknesses, 660-661
- run-length slice algorithm
- assembly implementation, 698-704
- C-language implementations, 688-692, 692-693
- description, 683-684
- implementation details, 685-687
- integer-based implementation, 685-687
- potential optimizations, 705
- Bresenhams run-length slice algorithm. See Run-length slice algorithm.
- Bridges, John
- mode set routine, 360x480 256-color mode, 609, 612, 620-621
- 256-color modes, undocumented, 879
- Brute-force solutions, 193
- BSP (Binary Space Partitioning) trees
- 2-D line representation, 1120
- 3-D rendering, 1162
- beam trees
- improvement, attempts at, 1187-1188
- overview, 1185
- performance, 1186
- potentially visible set (PVS), precalculating, 1188-1189
- BSP compiler
- BuildBSPTree function, 1125-1127
- SelectBSPTree function, 1124-1125
- BuildBSPTree function, 1125-1127
- building, 1101-1104
- BuildTree function, 1112
- data recursion vs. code recursion, 1108-1113
- description, 1098-1099, 1119
- and dynamic objects, 1100-1101
- edge sorting for hidden surface removal, 1220, 1226
- inorder traversal, 1107-1113
- leaves, storing polygons in, 1181
- multiple BSP trees, sorting, 1227
- optimizations, 1128-1129
- performance, 1100, 1111-1113
- potentially visible set (PVS)
- precalculating, 1188-1189
- world, drawing, 1280-1281
- reference materials, 1114
- rendering recursively
- backface removal, 1160-1161
- clipping, 1158-1159
- ClipWalls function, 1152-1155, 1158-1159
- DrawWallsBackToFront function, 1155-1156, 1160-1161
- overview, 1149
- reference materials, 1157
- TransformVertices function, 1151-1152, 1158
- UpdateViewPos function, 1151, 1157
- UpdateWorld function, 1156-1157, 1157
- viewspace, transformation of objects to, 1158
- wall orientation testing, 1160-1161
- WallFacingViewer function, 1150-1151, 1161
- SelectBSPTree function, 1124-1125
- splitting heuristic, 1128-1129
- 3-D engine, Quake
- overview, 1276-1277
- potentially visible set (PVS) management, 1278-1279
- visible surface determination (VSD)
- beam trees, 1185-1189
- culling to frustum, 1181-1184
- overdraw problem, 1184-1185
- painters algorithm, 1099-1106
- polygon culling, 1181-1184
- PVS, precalculating, 1188-1189
- WalkBSPTree function, 1106
- WalkTree function, 1109-1110
- BSP compiler
- BuildBSPTree function, 1125-1127
- overview, 1123
- SelectBSPTree function, 1124-1125
- BSP models, Quake 3-D engine, 1284
- BSWAP instruction, 486 processor
- 32-bit registers, using as two 16-bit registers, 253-254
- rotating pixel bits, 252
- Bubble sort, 755
- Buffer-filling routine, optimizations
- rearranging instructions, 418-419
- reducing size of code, 416-418
- stack addressing, 420
- Buffers, internal
- in 16-bit checksum program, 15-16
- in search engine, 114-115
- BuildBSPTree function, 1125-1127
- BuildGET function, 768-769
- BuildGETStructure function, 747-748
- BuildMaps function, 353-355
- BuildTree function, 1112
- Bus access
- 8088 processor, 81, 99-101
- Pentium processor, 377
- Byte registers, 486 processor, 242-245
- Byte-OUT instruction, 429
- Byte-per-pixel mode. See Mode X.
- C
- C library functions
- getc() function, 12, 14
- memchr() function, 116
- memcmp() function, 116
- memcpy() function, 1147-1148
- memset() function, 727
- optimization, 15
- read() function, 12, 121
- strstr() function, 115
- Cache, internal. See Internal cache.
- Cache lines, Pentium processor, 374
- Calculations, redundant, and optimization, 682-683
- Calculus and Analytic Geometry (book), 1135
- CALL instruction
- 486 processor, 241-242
- Pentium processor, 404
- Carmack, John
- and id Software, 1118
- overdraw, 1184-1186
- subdivision rasterization, 1266-1267, 1267-1270
- Carry flag
- DEC instruction, 148
- INC vs. ADD instructions, 147-148
- LOOP instruction, 148
- rotating bits through, 185
- in word count program (David Stafford), 317-319
- Cats, shipping via air freight, 697-698
- Cellmap class, 325-329, 333-335, 341-345
- Cellmap wrapping, Game of Life, 331-332, 333-335, 336, 337-338
- Cell_state method, 327, 334, 344
- CGA (Color/Graphics Adapter)
- display adapter cycle-eater, 104
- VGA compatibility with, 430
- Challenges
- Game of Life
- rules, 346, 350
- 3-cell-per-word implementation (David Stafford), 351-352, 353-363, 363-365
- ScanBuffer routine, 305, 307-319
- Change list, in Game of Life, 363-366
- Chaplin, Michael, 776
- Character/attribute map, VGA mode 3, 517
- Chartreuse moose story, 399
- Checksum programs. See 16-bit checksum program; TCP/IP checksum program.
- Chunky bitmap conversion demo program, 505-508
- Chunky bitmaps, converting to planar, 504-505, 505-508
- Circular linked lists, 288-292
- Clear_cell method, 327, 334, 343
- ClearEdgeLists function, 1236-1237
- Clements, Willem, 313-315
- Client-server architecture, and QuakeWorld, 1291
- Clipping
- See also Hidden surface removal (HSR); Visible surface determination (VSD).
- arithmetic imprecision, handling, 1240
- in BSP tree rendering, 1158-1159
- line segments, clipping to planes, 1195-1197
- masked copying, Mode X, 923
- overview, 1195
- polygon clipping
- BackRotateVector function, 1203
- clipping to frustum, 1200, 1201-1206, 1206-1207
- ClipToFrustum function, 1204
- ClipToPlane function, 1199
- optimization, 1207
- overview, 1197-1200
- PolyFacesViewer function, 1203
- ProjectPolygon function, 1201
- SetUpFrustum function, 1204
- SetWorldspace function, 1204
- TransformPoint function, 1203
- TransformPolygon function, 1203
- UpdateViewPos function, 1202
- UpdateWorld function, 1205
- viewspace clipping, 1207
- ZSortObjects function, 1201
- ClipToFrustum function, 1204
- ClipToPlane function, 1199
- Clock cycles
- See also Cycle-eaters.
- address calculation pipeline, 238-240
- branch prediction, 377-378
- byte registers and lost cycles, 242-245
- cross product floating point optimization, 1171, 1172
- and data alignment, 213-215
- data transfer rates, 81, 82
- dot product floating point optimization, 1170
- dual-pipe execution, 405
- effective address calculations
- 286 and 386 processors, 223-225
- Pentium processor, 375-376
- 8088 processor
- data transfer rates, 81, 82
- memory access, 82, 83-85
- floating point instructions, 1167-1170
- 486 processor
- address calculation pipeline, 238-240, 250
- byte registers and lost cycles, 242-245
- indexed addressing, 237-238
- stack addressing, 241-242
- 32-bit addressing modes, 256-258
- FXCH instruction, 1170
- indexed addressing, 237-238
- instruction execution times, 86-93
- lockstep execution, 390-394, 400-403
- matrix transformation optimization, 1173
- memory access, 82, 83-85
- non-alignment penalties, 376
- non-word-alignment penalty, 217
- 1/z value of planes, calculating, 1221
- OUT instructions, 843, 1082-1083
- Pentium processor
- branch prediction, 377-378
- cross product floating point optimization, 1171, 1172
- dot product floating point optimization, 1170
- effective address calculations, 375-376
- floating point instructions, 1167-1168
- FXCH instruction, 1170
- initial pipe, effect of, 405
- lockstep execution, 390-394, 400-403
- matrix transformation optimization, 1173
- non-alignment penalties, 376
- pipelining, 1168-1170
- prefix bytes, 376, 395, 407
- prefix bytes, 376, 395, 407
- vs. program size, 28
- projection, floating point optimization, 1174
- stack addressing, 241-242
- string instructions, 82
- system wait states, 211
- 32-bit addressing modes, 256-258
- 386 processor, effective address calculation, 223-225
- 286 processor
- effective address calculation, 223-225
- system wait states, 211
- CMP instruction
- operands, order of, 306
- vs. SCASW, 161
- CMPXCHG8B instruction, Pentium processor, 378
- Code alignment
- 386 processor, 218
- 286 processor, 215-218
- Code generator, for Game of Life (David Stafford), 351-352, 353-363, 363-365
- Code recursion
- vs. data recursion, 1108-1110
- Euclids algorithm, 198-199
- Collision detection demo program, 531-534
- Color
- adapter-dependent mapping, 1036
- color perception research, 1035
- reflective vs. emissive, 1035
- Color Compare register, 531
- Color cycling
- bit-by-bit loading of DAC, 650-651
- demo program, 643, 644-648, 648-649
- interleaved loading of DAC, 649-650
- loading DAC, 640-643
- overview, 639-640
- using page flipping, 650
- using subset of DAC, 649
- Color cycling demo program, 643, 644-648, 648-649
- Color Dont Care register, 534
- Color Dont Care register demo program, 535-537, 535
- Color mapping demo program, EGA, 551-555
- Color models. See RGB (red, green, blue) color model.
- Color paging, 628-629
- Color path, VGA
- color paging, 628-629
- DAC (Digital/Analog Converter), 626-628
- palette RAM, 626
- Color planes. See Planes, VGA.
- Color Select register, 628-629
- Color selection
- EGA
- overscan, 555-556
- palette registers, 548-551, 551-555
- screen blanking, 556-557
- VGA, 557
- ColorBarsUp subroutine, 604
- Color-forcing demo program, 474-476
- Color-patterned lines demo program, 509-515
- Compiled DLLs, Quake 2, 1293
- Compiler-based optimization
- cautions for use of, 9
- data recursion vs. code recursion, 1112-1113
- in FindIDAverage function, 159
- Compilers
- vs. assembly language programmers, 154-155
- avoiding thinking like, 152, 154-155
- bitblt compiler for Game of Life (David Stafford), 351-352, 353-363, 363-365
- handling of segments, 154
- Complex polygons
- defined, 710, 742
- edges, keeping track of, 742-744, 753, 755, 756
- polygon-filling programs, 745-752, 754
- Computational Geometry, An Introduction (book), 759-760
- Computer Graphics: Principles and Practice (book), 660, 934, 1121
- Computer Graphics (book), 1135, 1157
- ConcatXforms function
- assembly implementation, 997-999, 1019-1022
- C-language implementation, 944, 976
- CONSTANT_TO_INDEXED_REGISTER macro, 594
- Coordinate systems
- left-handed, 1140
- right-handed, 935-937
- Copy_cells method, 327, 333
- CopyDirtyRectangles function, 850
- CopyDirtyRectangleToScreen function, 866-867
- Copying
- bytes between registers, 172
- pixels, using latches (Mode X), 905-907, 908,
-
871
- CopyScreenToScreenMaskedX subroutine, 918, 919-921
- CopyScreenToScreenX subroutine, 905-907, 908
- CopySystemToScreenMaskedX subroutine, 916-918
- CopySystemToScreenX subroutine, 908, 909-911
- CosSin subroutine, 994-996, 999, 1013-1015
- Count_neighbors method, 334-335
- CPU reads from VGA memory, 526
- CPUID instruction, Pentium processor, 378
- CreateAlignedMaskedImage function, 922-923
- Cross products
- calculating, 955-956, 1139-1140
- floating point optimization, 1171, 1172
- CRT Controller, VGA. See CRTC (CRT Controller), VGA.
- CRTC (CRT Controller), VGA
- addressing, 427-428
- Line Compare register, 565
- Overflow register, 565
- shearing, 813-814
- start address registers, setting, 583
- Cycle-eaters
- 286 and 386 processors
- data alignment cycle-eater,
- display adapter cycle-eater, 219-221
- DRAM refresh cycle-eater, 219
- overview, 209-210
- prefetch queue cycle-eater, 211-212
- system wait states, 210-212
- data alignment cycle-eater
- 386 processor, 218
- 286 processor, 213-215
- display adapter cycle-eater
- 286 and 386 processors, 219-221
- 8088 processor, 101-108
- DRAM refresh cycle-eater
- 286 and 386 processors, 219
- 8088 processor, 95-99, 108
- 8-bit bus cycle-eater, 79-85, 108
- 8088 processor
- display adapter cycle-eater, 101-108
- DRAM refresh cycle-eater, 95-99, 108
- 8-bit bus cycle-eater, 79-85, 108
- prefetch queue cycle-eater, 86-94, 108
- wait states, 99-101
- overview
- 286 and 386 processors, 209-210
- 8088 processor, 78-79, 80
- prefetch queue cycle-eater
- 286 and 386 processors, 211-212
- 8088 processor, 86-94, 108
- system wait states, 210-212
- wait states, 99-101
- Cycles. See Clock cycles; Cycle-eaters.
- D
- DAC (Digital/Analog Converter)
- color cycling
- bit-by-bit loading, 650-651
- color cycling demo program, 643, 644-648, 648-649
- interleaved loading, 649-650
- problems, 640-643
- using subset of, 649
- Data register, 642-643
- index wrapping, 651
- loading
- bit-by-bit loading, 650-651
- directly, 642-643
- interleaved loading, 649-650
- via VGA BIOS, 641-642, 648
- and Write Index register, 642-643, 651
- Mask register, blanking screen, 651
- Read Index register, 651-652
- reading, 651-652
- setting registers, 630, 631-632
- in VGA color path, 626-628
- Write Index register
- DAC index wrapping, 651
- loading DAC, 642-643
- DAC registers demo program, 632-635
- Data alignment cycle-eater
- 386 processor, 218
- 286 processor, 213-215
- Data bus, 8-bit
- See also 8-bit bus cycle-eater.
- Data manipulation instructions, and flags, 147
- Data recursion
- vs. code recursion, 1108
- Euclids algorithm, 200
- inorder tree traversal, 1108, 1109-1110, 1110
- Data register, loading DAC, 642-643
- Data Rotate register
- barrel shifter, controlling, 463
- vs. CPU-based rotations, 489
- effect on ALUs, 452
- Data rotation, VGA
- barrel shifter, 463-464
- bit mask, 464-471
- CPU vs. Data Rotate register, 489
- Data transfer rates
- display adapters, 220
- 8088 processor vs. 8086 processor, 81, 82
- 286 processor, 212
- DDA (digital differential analyzer) texture mapping
- assembly implementation, 1069-1073, 1074
- C implementation, 1053-1058
- disadvantages, 1052-1053, 1059
- DrawTexturedPolygon, 1055-1056
- hardware dependence, 1053
- multiple adjacent polygons, 1068
- optimized implementation, 1069-1073, 1074
- orientation independence, 1065-1067, 1067
- performance, 1074
- ScanOutLine function, 1058-1059, 1067, 1069-1073, 1074
- SetUpEdge function, 1057-1058
- StepEdge function, 1056-1057
- techniques, 1048-1051
- DDJ Essential Books on Graphics Programming (CD), 1157
- DEC instruction
- and Carry flag, 148
- memory accesses, 83
- vs. SUB, 219
- DEC/JNZ sequence, 139
- Delay sequences
- loading palette RAM or DAC registers, 632
- VGA programming, 558
- DeleteNodeAfter function, 284
- Depth sorting of nonconvex objects, 1000, 1001-1002
- Diffuse shading, 1023-1025, 1025-1027
- Digital differential analyzer. See DDA (digital differential analyzer).
- Direct far jumps, 186
- Direct memory access. See DMA.
- Directed lighting, and shading, 1023, 1028
- Directives
- EVEN, 214
- NOSMART, 72
- Dirty-rectangle animation
- demo program, C implementation, 847-851, 863-869
- description, 844-845
- ordering rectangles, 873
- overlapping rectangles, 872-873
- vs. page flipping, 846, 862
- performance, 873
- system memory buffer size, 851
- writing to display memory, 856-857
- Disk caches, 19
- Display adapter cycle-eater
- 286 and 386 processors, 219-221
- data transfer rates, 220
- 8088 processor
- graphics routines, impact on, 106
- optimizing for, 107
- overview, 101-104
- performance, impact on, 104
- read/write/modify operations, 107
- wait states, 99-101
- Display memory
- See also Bit mask; Displaymemory access.
- Mode X
- copying between memory locations, 905-907, 908
- copying from system memory, 908, 909-911
- masked copy from system memory, 916-918, 916
- masked copying between locations, 918-919, 919-921
- memory allocation, 903-904
- running code from, 104
- start address, changing, 857
- VGA
- access times, 842-844
- 360x480 256-color mode, 621-622
- 320 x 400 256-color mode, 591-593, 605
- Display memory access
- See also Display memory; Memory access.
- display adapter cycle-eater, 101-103, 105, 107
- and string instructions, 107
- VGA access times, 842-844
- wait states, 101-103, 220, 733
- Display memory planes. See Planes, VGA.
- DIV instruction, 32-bit division, 181-184, 1008
- Divide By Zero interrupt, 181
- Divide-by-N timer mode, 45
- Division, 32-bit, 181-184, 1008
- DMA (direct memory access), and DRAM refresh, 95
- Dont care planes, 535
- DOS function calls
- overhead, 9
- and restartable blocks, 123
- Dot products
- calculating, 1135-1137
- calculating light intensity, 1137
- floating point optimization, 1170, 1171
- line segments, clipping to planes, 1196-1197
- projection, 1141-1142
|