diff options
author | biouman <> | 2001-05-14 11:16:59 +0000 |
---|---|---|
committer | biouman <> | 2001-05-14 11:16:59 +0000 |
commit | 2d3e05c791bf5ee7443d64c5550915ce554e36cf (patch) | |
tree | fa71cd6a437063a21273d5fe4bb9a28773cc2718 /samples | |
parent | ff1f5fcda29d65c4149f09ffb3359d9373dfa948 (diff) |
*** empty log message ***
Diffstat (limited to 'samples')
-rw-r--r-- | samples/cube.s | 109 | ||||
-rw-r--r-- | samples/drawline.s | 33 |
2 files changed, 126 insertions, 16 deletions
diff --git a/samples/cube.s b/samples/cube.s index 593bf79..29f36cc 100644 --- a/samples/cube.s +++ b/samples/cube.s @@ -19,6 +19,7 @@ NL DB, ( (-8) * 65536); oppose de L V DB 8 * 2; distance pt de vue - plan de l ecran X0 DB 40; centre de l ecran Y0 DB 12; centre de l ecran +sauge DS "\n"; .text ; @@ -28,8 +29,8 @@ Y0 DB 12; centre de l ecran ; Mult: MUL R5, R6; - SHR Rd, 16; - SHL Rg, 16; + SHR Rd, R30; + SHL Rg, R30; ADD R5, Rg, Rd; RET; @@ -73,6 +74,7 @@ InitCube: MOV, Points3D[0], L; MOV, Points3D[22], NL; MOV, Points3D[23], NL; ; + MOV R30, 16 RET; @@ -300,7 +302,7 @@ BouclProj: MOV R5, Points3D[R3+0]; ADD R6, R6, R7; DIV R5, R6; MOV R5, Rg; - SHR R5, 16; + SHR R5, R30; MOV R6, [X0]; ADD R5, R5, R6; MOV Points2D[R2], R5; @@ -314,7 +316,7 @@ BouclProj: MOV R5, Points3D[R3+0]; ADD R6, R6, R7; DIV R5, R6; MOV R5, Rg; - SHR R5, 16; + SHR R5, R30; MOV R6, [Y0]; ADD R5, R5, R6; MOV Points2D[R2+1], R5; @@ -339,61 +341,157 @@ Draw: MOV R7, Points2D[0]; MOV R6, Points2D[1]; MOV R9, Points2D[2]; MOV R8, Points2D[3]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[2]; MOV R6, Points2D[3]; MOV R9, Points2D[4]; MOV R8, Points2D[5]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[4]; MOV R6, Points2D[5]; MOV R9, Points2D[6]; MOV R8, Points2D[7]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[6]; MOV R6, Points2D[7]; MOV R9, Points2D[0]; MOV R8, Points2D[1]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[8]; MOV R6, Points2D[9]; MOV R9, Points2D[10]; MOV R8, Points2D[11]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[10]; MOV R6, Points2D[11]; MOV R9, Points2D[12]; MOV R8, Points2D[13]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[12]; MOV R6, Points2D[13]; MOV R9, Points2D[14]; MOV R8, Points2D[15]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[14]; MOV R6, Points2D[15]; MOV R9, Points2D[8]; MOV R8, Points2D[9]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[0]; MOV R6, Points2D[1]; MOV R9, Points2D[8]; MOV R8, Points2D[9]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[2]; MOV R6, Points2D[3]; MOV R9, Points2D[10]; MOV R8, Points2D[11]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[4]; MOV R6, Points2D[5]; MOV R9, Points2D[12]; MOV R8, Points2D[13]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; MOV R7, Points2D[6]; MOV R6, Points2D[7]; MOV R9, Points2D[14]; MOV R8, Points2D[15]; + MOV, [0xffffff06], R7; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R6; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R9; + MOV, [0xffffff04], sauge; + MOV, [0xffffff06], R8; + MOV, [0xffffff04], sauge; CALL DrawLine; RET; @@ -433,10 +531,11 @@ IncrAngl: MOV R5, [T1]; ; .start CALL InitCube; + CALL ClrScr; Main: CALL IncrAngl; CALL MajMatr; CALL RotCube; CALL Proj; - CALL ClrScr; + ;CALL ClrScr; CALL Draw; JMP Main; diff --git a/samples/drawline.s b/samples/drawline.s index aebb3bf..18ee1a9 100644 --- a/samples/drawline.s +++ b/samples/drawline.s @@ -36,11 +36,13 @@ DrawLinePrim1: PUSH R10 PUSH R12 PUSH R13 PUSH R14 + PUSH R30 + MOV R30, 1 SUB R13, R9, R7 - SHL R13, R13, 1 + SHL R13, R30 SUB R12, R8, R6 SUB R14, R12, R13 - SHL R12, R12, 1 + SHL R12, R30 MOV R10, R6 MOV R11, R7 DrawLinePrim1B: JNLE R10, R8, DrawLinePrim1O @@ -54,7 +56,8 @@ DrawLinePrim1B: JNLE R10, R8, DrawLinePrim1O DrawLinePrim1C: SUB R14, R12 DrawLinePrim1L: ADD R10, 1 JMP DrawLinePrim1B -DrawLinePrim1O: POP R14 +DrawLinePrim1O: POP R30 + POP R14 POP R13 POP R12 POP R11 @@ -90,11 +93,13 @@ DrawLinePrim2: PUSH R10 PUSH R12 PUSH R13 PUSH R14 + PUSH R30 + MOV R30, 1 SUB R12, R8, R6 - SHL R12, R12, 1 + SHL R12, R30 SUB R13, R9, R7 SUB R14, R13, R12 - SHL R13, R13, 1 + SHL R13, R30 MOV R10, R6 MOV R11, R7 DrawLinePrim2B: JNLE R11, R9, DrawLinePrim2O @@ -108,7 +113,8 @@ DrawLinePrim2B: JNLE R11, R9, DrawLinePrim2O DrawLinePrim2C: SUB R14, R13 DrawLinePrim2L: ADD R11, 1 JMP DrawLinePrim2B -DrawLinePrim2O: POP R14 +DrawLinePrim2O: POP R30 + POP R14 POP R13 POP R12 POP R11 @@ -144,11 +150,13 @@ DrawLinePrim3: PUSH R10 PUSH R12 PUSH R13 PUSH R14 + PUSH R30 + MOV R30, 1 SUB R12, R6, R8 - SHL R12, R12, 1 + SHL R12, R30 SUB R13, R9, R7 SUB R14, R13, R12 - SHL R13, R13, 1 + SHL R13, R30 MOV R10, R6 MOV R11, R7 DrawLinePrim3B: JNLE R11, R9, DrawLinePrim3O @@ -162,7 +170,8 @@ DrawLinePrim3B: JNLE R11, R9, DrawLinePrim3O DrawLinePrim3C: SUB R14, R13 DrawLinePrim3L: ADD R11, 1 JMP DrawLinePrim3B -DrawLinePrim3O: POP R14 +DrawLinePrim3O: POP R30 + POP R14 POP R13 POP R12 POP R11 @@ -198,11 +207,13 @@ DrawLinePrim4: PUSH R10 PUSH R12 PUSH R13 PUSH R14 + PUSH R30 + MOV R30, 1 SUB R13, R9, R7 - SHL R13, R13, 1 + SHL R13, R30 SUB R12, R6, R8 SUB R14, R12, R13 - SHL R12, R12, 1 + SHL R12, R30 MOV R10, R6 MOV R11, R7 DrawLinePrim4B: JNGE R10, R8, DrawLinePrim4O |