0 Members and 1 Guest are viewing this topic.
did that basic to assembly source conversion thing work at all?
BTW: this routine draws the triangle from top to bottom, which means that the points needs to be in the right order, so does anybody knows a routine to sort the points based on their Y coordinate?
Start: di call ClearGbuf call fastCopy ld a, 64*3 ld (direction), a in a,($02) rla sbc a, a out ($20), a ld hl, 0 ld (x), hl ld hl, $0200 ld (y), hlSpelLus: call ClearGBuf ld a, $FF ld (plotsscreen), a ld hl, plotsscreen ld de, plotsscreen+1 ld bc, 767 ldir ld hl, (x) ld (xfrom), hl ld hl, (y) ld (yfrom), hl ld hl, 0 ld (zfrom), hl ld (zto), hl ld a, 64 ld b, a ld a, (direction) add a, b call SinA ld de, (x) add hl, de ld (xto), hl ld a, (direction) call SinA ld de, (y) add hl, de ld (yto), hl ld hl, $0100 ld (zup), hl ld hl, 0 ld (xup), hl ld (yup), hl call InitView ld hl, -256 ld (xpoint), hl ld hl, 0 ld (ypoint), hl ld hl, -$0100 ld (zpoint), hl call C3DTo2D ld hl, (screenx) ld (screenx2), hl ld hl, (screeny) ld (screeny2), hl ld hl, 256 ld (xpoint), hl ld hl, 0 ld (ypoint), hl ld hl, -$0100 ld (zpoint), hl call C3DTo2D ld hl, (screenx) ld (screenx3), hl ld hl, (screeny) ld (screeny3), hl ld hl, -256 ld (xpoint), hl ld hl, 0 ld (ypoint), hl ld hl, $0100 ld (zpoint), hl call C3DTo2D ld a, (screenx) ld (x1), a ld a, (screeny) ld (y1), a ld a, 0 ld (u1), a ld (v1), a ld a, (screenx2) ld (x2), a ld a, (screeny2) ld (y2), a ld a, 0 ld (u2), a ld a, 8 ld (v2), a ld a, (screenx3) ld (x3), a ld a, (screeny3) ld (y3), a ld a, 8 ld (u1), a ld (v1), a call DrawTriangle call FastCopy ;knoppen ld a, $FE out (1), a in a, (1) bit 0, a call z, MoveBack bit 3, a call z, MoveForward bit 1, a call z, TurnLeft bit 2, a call z, TurnRight ld a, %11111101 out ($01), a in a, ($01) bit 6, a jp z, Einde jp spelLus MoveBack: push af ld a, (direction) ld b, 64 add a, b call SinA call NegHL ld de, $0A00 call DivFP ld de, (X) add hl, de ld (X), hl ld a, (direction) call SinA call NegHL ld de, $0A00 call DivFP ld de, (Y) add hl, de ld (Y), hl pop af retMoveForward: push af ld a, (direction) ld b, 64 add a, b call SinA ld de, $0A00 call DivFP ld de, (X) add hl, de ld (X), hl ld a, (direction) call SinA ld de, $0A00 call DivFP ld de, (Y) add hl, de ld (Y), hl pop af retTurnLeft: push af ld a, (direction) inc a ld (direction), a pop af retTurnRight: ld a, (direction) dec a ld (direction), a ret Einde: ;Key port resetten ld a, $FF out ($01), a call ClearGbuf call fastCopy ld hl, 0 ld (CurRow), hl EI bjump(_JForceCmdNoChar)