From: Svjatoslav Agejenko Date: Wed, 22 Oct 2025 00:44:51 +0000 (+0300) Subject: Better site publishing script X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;ds=sidebyside;p=qbasicapps.git Better site publishing script --- diff --git a/.gitignore b/.gitignore index 17a01d0..61b803c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ -/qbasicapps.iml +# IntelliJ files /.idea/ +/qbasicapps.iml + +# Volkov Commander /VC.COM /VC.INI + +# Qbasic installation /QB45 -/index.html -/Graphics/3D/3D Synthezier/doc/index.html -/Math/Truth table calculator/doc/index.html -/Graphics/Spirals/index.html -/Graphics/index.html -/2D GFX/Animations/index.html -/3D GFX/3D Synthezier/index.html \ No newline at end of file + +# Index HTML files are autogenerated anyway +**/index.html \ No newline at end of file diff --git a/2D GFX/Fractals/index.html b/2D GFX/Fractals/index.html deleted file mode 100644 index cd95ce4..0000000 --- a/2D GFX/Fractals/index.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - - - -Fractals - - - - - - -
-

Fractals

- - - - -
-

1. Fractal circles

-
-

-This QBasic program generates a visually captivating spiral fractal -composed of circles. It employs a recursive algorithm to create -intricate patterns that can inspire those interested in fractal -geometry, recursive programming, and graphical design. -

- - -
-

fractal%20circles.png -

-
- -
-
Color and Depth
The color of each circle alternates based on the -recursion depth, adding visual complexity to the fractal.
-
Termination Condition
The recursion terminates when the size of -the circles becomes too small, ensuring the program doesn't run -indefinitely.
-
- -

-Source code -

-
-
- -
-

2. Fractal circles animated

-
-

-This QBasic program creates an animated fractal composed of circles, -demonstrating an engaging visual effect. The program uses a timer -system to control the animation's progression. -

- -
- -
-

-Source code -

-
-
- -
-

3. Fractal of squares

-
-

-This QBasic program generates and displays a fractal pattern composed of squares. -

- - -
-

fractal%20squares,%201.png -

-
- - -
-

fractal%20squares,%202.png -

-
-
-
- -
-

4. Fractal of squares animated

-
-

-This QBasic program generates an animated fractal pattern composed of -size-shifting squares. The animation creates a visually captivating -display by continuously redrawing the fractal with varying parameters, -resulting in a dynamic and ever-changing geometric pattern. -

- -
- -
- -

-Source code -

-
-
- -
-

5. Fractal of trees

-
-

-QBasic program that generates a visually appealing fractal tree -animation. The program creates a dynamic fractal pattern that -resembles a tree, with branches that grow and change over time. -

- -
- -
- - -

-Source code -

-
-
-
-
-

Created: 2025-08-21 to 21:52

-

Validate

-
- - diff --git a/2D GFX/Spirals/index.html b/2D GFX/Spirals/index.html deleted file mode 100644 index f99da9b..0000000 --- a/2D GFX/Spirals/index.html +++ /dev/null @@ -1,944 +0,0 @@ - - - - - - - -Spiral series - - - - - - -
-

Spiral series

- - - -
-

1. Spiral with increasing density

-
- -
-

spiral.png -

-
- -

-From every point in the spiral, subdivided line is traced. Line -segments are connected between the neighbors. Line segment count -progressively increases towards the center. -

- -

-spiral.bas -

- -
-
DECLARE SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER)
-
-' Program to render fancy looking spiral.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-DIM SHARED lineVertexX(1 TO 100) AS DOUBLE
-DIM SHARED lineVertexY(1 TO 100) AS DOUBLE
-DIM SHARED depth AS INTEGER
-DIM SHARED tempDepth AS INTEGER
-SCREEN 12
-
-' Initialize the scale factor for the spiral
-spiralScaleFactor = 200
-depth = 0
-
-' Generate the spiral by iterating through angles and scaling appropriately
-FOR angle = 1 TO 30 STEP .1
-    ' Calculate the current scale based on the remaining distance to the center
-    spiralScaleFactor = (30 - angle) * 7
-    ' Convert polar coordinates to cartesian for the current point
-    xPosition = SIN(angle) * spiralScaleFactor + 200
-    yPosition = COS(angle) * spiralScaleFactor + 200
-    ' Store the current depth (z-axis value)
-    tempDepth = angle
-    ' Draw a line from the previous point to the current point with a color based on depth
-    DrawLine xPosition + (xPosition / 2) + (angle * 3), (yPosition - (xPosition / 3)) + (angle * 3), xPosition + 25, yPosition + 25 - (angle * 3), depth
-    ' Set the color for the next segment
-    depth = 15
-NEXT angle
-
-' Wait for user input to close the program
-userInput$ = INPUT$(1)
-
-SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER)
-    ' Calculate the step increments for x and y based on the depth
-    deltaX = (endX - startX) / tempDepth
-    deltaY = (endY - startY) / tempDepth
-
-    FOR segmentIndex = 1 TO tempDepth
-        ' If there is a previous vertex, draw a line to the new starting point
-        IF lineVertexX(segmentIndex) > 0 THEN LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col
-        ' Store the current starting point as the next vertex
-        lineVertexX(segmentIndex) = startX
-        lineVertexY(segmentIndex) = startY
-        ' Increment the starting point by the calculated deltas
-        startX = startX + deltaX
-        startY = startY + deltaY
-        ' Draw a line from the stored vertex to the new starting point
-        LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col
-    NEXT segmentIndex
-END SUB
-
-
-
-
- -
-

2. Spiral with varying height

-
- -
-

spiral, 2.png -

-
- -

-From every point in the spiral, subdivided line is traced. Line -segments are connected between the neighbors. This creates effect -where lines run from edges towards the center. Center is vertically -displaced by sinus function where input is the distance to the center. -

- -

-spiral, 2.bas -

- -
-
' Program to render fancy looking spiral.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-DIM SHARED spiralX(1 TO 10000) AS SINGLE ' X coordinates of the spiral points
-DIM SHARED spiralY(1 TO 10000) AS SINGLE ' Y coordinates of the spiral points
-DIM SHARED pointCount AS INTEGER ' Total number of points plotted
-SCREEN 12 ' Set screen resolution to 640x480 with 16 colors
-
-' Initialize the scale factor for the spiral
-scaleFactor = 200
-pointCount = 0
-
-' Calculate and plot each point on the spiral
-FOR angle = 1 TO 100 STEP .05
-    pointCount = pointCount + 1
-    scaleFactor = 100 - angle ' Update the scaling factor as the loop progresses
-
-    ' Calculate the X and Y coordinates based on the sine and cosine of the angle
-    spiralX(pointCount) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(pointCount) = COS(angle) * scaleFactor + 300
-
-    ' Apply a vertical displacement to create a more dynamic effect
-    spiralY(pointCount) = spiralY(pointCount) + (SIN((angle + 20) / 10) * angle)
-
-    ' Plot the point on the screen
-    PSET (spiralX(pointCount), spiralY(pointCount)), 15
-NEXT angle
-
-' Draw lines between points to create the spiral effect
-FOR segmentStart = 1 TO pointCount - 125
-    LINE (spiralX(segmentStart), spiralY(segmentStart)) - _
-         (spiralX(segmentStart + 125), spiralY(segmentStart + 125)), 15
-NEXT segmentStart
-
-' Wait for user input before exiting
-a$ = INPUT$(1)
-END ' Exit the program
-
-
-
-
- -
-

3. Shaded spiral

-
- -
-

spiral, 3.png -

-
- -

-Similar to previous spiral, Line segments are connected between the -neighbors and sinus from the center decides vertical -displacement. Attempt of shading is made where brighter areas have -more detail. -

- -

-spiral, 3.bas -

- -
-
' Program to render fancy looking spiral with shaded surface.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-' Declare shared arrays for storing coordinates and sine values
-DIM SHARED spiralX(1 TO 10000)
-DIM SHARED spiralY(1 TO 10000)
-DIM SHARED sineValue1(1 TO 10000)
-DIM SHARED sineValue2(1 TO 10000)
-
-
-' Set the screen mode to 640x480 with 16 colors
-SCREEN 12
-
-' Initialize the spiral rotation parameter
-DIM spiralRotation AS SINGLE
-spiralRotation = 0
-
-' Generate and draw the spiral points
-FOR angle = 0 TO 150 STEP .05
-    spiralRotation = spiralRotation + 1
-    scaleFactor = 150 - angle
-
-    ' Calculate the X and Y coordinates for the current point
-    spiralX(spiralRotation) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(spiralRotation) = COS(angle) * scaleFactor + 300
-
-    ' Apply additional vertical displacement based on a secondary sine function
-    spiralY(spiralRotation) = spiralY(spiralRotation) + (SIN((angle + 20) / 10) * (angle / 5 + 1))
-
-    ' Store the current sine values for later use
-    sineValue1(spiralRotation) = SIN(angle)
-    sineValue2(spiralRotation) = SIN((angle + 20) / 10)
-
-    ' Draw the current point on the screen
-    PSET (spiralX(spiralRotation), spiralY(spiralRotation)), 15
-NEXT angle
-
-' Connect the points to form a continuous line
-FOR index = 1 TO spiralRotation - 127
-    ' Draw a line segment between points 126 steps apart
-    LINE (spiralX(index), spiralY(index))-(spiralX(index + 126), spiralY(index + 126)), 15
-
-    ' Initialize the line drawing flag
-    DIM drawLine AS INTEGER
-    drawLine = 1
-
-    ' Check conditions to determine if a line segment should be drawn
-    IF sineValue1(index) > .8 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 0
-    IF sineValue1(index) < -.2 AND (sineValue2(index) - .4) > sineValue2(index + 125) THEN drawLine = 0
-
-    ' Draw a line segment if the conditions are met
-    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 1), spiralY(index + 1)), 15
-
-    ' Reset the line drawing flag and check for different conditions
-    drawLine = 0
-    IF sineValue1(index) > .8 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1
-    IF sineValue1(index) < -.2 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1
-
-    ' Draw a line segment if the conditions are met
-    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 127), spiralY(index + 127)), 15
-
-    ' Reset the line drawing flag and check for another set of conditions
-    drawLine = 0
-    IF sineValue1(index) > .9 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1
-    IF sineValue1(index) < -.5 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1
-
-    ' Draw a line segment if the conditions are met
-    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 125), spiralY(index + 125)), 15
-NEXT index
-
-' Wait for a key press before exiting
-a$ = INPUT$(1)
-
-
-
-
- -
-

4. Sphere forming spiral

-
-

-Similar to previous spiral, Line segments are connected between the -neighbors. Spiral height and width are calculated such that they form -multiple linked spherical shapes. Initially point cloud in shown: -

- - -
-

spiral, 4, 1.png -

-
- -

-In the next step, points are connected using lines: -

- - -
-

spiral, 4, 2.png -

-
- - -

-spiral, 4.bas -

- -
-
' Program to render fancy looking spiral.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-' Declare shared arrays to hold the x and y coordinates of the spiral
-DIM SHARED spiralX(1 TO 10000)
-DIM SHARED spiralY(1 TO 10000)
-
-' Initialize the screen to a graphics mode with 640x480 resolution and 16 colors
-SCREEN 12
-
-' Constants for the initial size and the starting value of the index
-CONST InitialSize = 100
-CONST StartIndex = 0
-
-' Variable to keep track of the current position in the spiral arrays
-DIM torusIndex AS DOUBLE
-torusIndex = StartIndex
-
-' Loop parameters
-DIM angle AS DOUBLE
-DIM scaleFactor AS DOUBLE
-
-' Generate the first arm of the spiral
-FOR angle = 0 TO 97.35 STEP .15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * InitialSize
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 250
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 200)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Generate the second arm of the spiral
-FOR angle = 97.35 TO 0 STEP -.15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * (InitialSize / 2)
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 350
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 100)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Generate the third arm of the spiral
-FOR angle = 0 TO 97.35 STEP .15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * (InitialSize / 4)
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 300
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 50)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Generate the fourth arm of the spiral
-FOR angle = 97.35 TO 0 STEP -.15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * (InitialSize / 8)
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 325
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 25)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Calculate the number of lines to draw based on the current index
-DIM totalSegments AS DOUBLE
-totalSegments = (torusIndex - 42) / 4
-
-a$ = INPUT$(1)
-' Clear the screen before drawing the lines
-CLS
-
-' Draw the lines between points in the spiral
-FOR angle = 1 TO totalSegments * 4
-    LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 42), spiralY(angle + 42)), 15
-    LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 1), spiralY(angle + 1)), 15
-NEXT angle
-
-' Wait for the user to press a key before exiting
-a$ = INPUT$(1)
-
-' End of program
-SYSTEM
-
-
-
-
- -
-

5. Textured spherical spiral

-
- -
-

spiral, 5.png -

-
- -

-Similar to previous spiral, Line segments are connected between the -neighbors. Spiral height and width are calculated such that sphere is -formed. Sphere is textured. Texture is loaded from file: -texture.dat .Invisible surface detection and removal is -attempted. -

- -

-spiral, 5.bas -

- -
-
' Program to render fancy looking spiral.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-DECLARE SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2)
-DIM SHARED spiralX(1 TO 10000)
-DIM SHARED spiralY(1 TO 10000)
-DIM SHARED angles(1 TO 10000)
-DIM SHARED phaseAngles(1 TO 10000)
-DIM SHARED spiralLength
-SCREEN 12
-stepUnit = 200
-spiralLength = 0
-
-' Generate the spiral points
-FOR angleIndex = 1 TO 97 STEP .15
-    spiralLength = spiralLength + 1
-    stepUnit = SIN(angleIndex / 31) * 100
-    xPos = SIN(angleIndex) * stepUnit * 3 + 320
-    yPos = COS(angleIndex) * stepUnit + 250
-    yPos = yPos - (COS(angleIndex / 31) * 200)
-    angles(spiralLength) = angleIndex
-    phaseAngles(spiralLength) = angleIndex / 31
-    spiralX(spiralLength) = xPos
-    spiralY(spiralLength) = yPos
-    PSET (xPos, yPos), 15
-NEXT angleIndex
-
-' Load texture data from file
-OPEN "texture.dat" FOR INPUT AS #1
-DIM SHARED textureData$(1 TO 1000)
-textureIndex = 0
-1
-    LINE INPUT #1, textureLine$
-    IF LEFT$(textureLine$, 3) = "END" THEN GOTO 2
-    textureIndex = textureIndex + 1
-    textureData$(textureIndex) = textureLine$
-GOTO 1
-2
-CLS
-
-' Apply texture to the spiral
-textureIndex = 1
-FOR charIndex = 1 TO 20
-    FOR textCharIndex = 1 TO LEN(textureData$(charIndex))
-        textureChar$ = RIGHT$(LEFT$(textureData$(charIndex), textCharIndex), 1)
-        textureIndex = textureIndex + 1
-        IF textureIndex > spiralLength - 43 THEN GOTO DONE
-        teeVal = SIN(angles(textureIndex + 32)) - COS(phaseAngles(textureIndex))
-
-        ' Draw lines if the condition is met
-        IF teeVal <= 0 THEN
-            LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 1), spiralY(textureIndex + 1)), 15
-            LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 42), spiralY(textureIndex + 42)), 15
-            ' Fill the segment if the character matches
-            IF textureChar$ = "M" THEN
-                CALL FillSegment(spiralX(textureIndex), spiralY(textureIndex), spiralX(textureIndex + 1), spiralY(textureIndex + 1), spiralX(textureIndex + 42), spiralY(textureIndex + 42), spiralX(textureIndex + 43), spiralY(textureIndex + 43))
-            END IF
-        END IF
-    NEXT textCharIndex
-NEXT charIndex
-DONE:
-a$ = INPUT$(1)
-SYSTEM
-
-' Subroutine to fill a segment with lines
-SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2)
-    ' Assign input parameters to local variables
-    xStart = x1
-    yStart = y1
-    xEnd = x2
-    yEnd = y2
-    xxStart = xx1
-    yyStart = yy1
-    xxEnd = xx2
-    yyEnd = yy2
-
-    ' Calculate step increments
-    j = 10
-    xStep = (xEnd - xStart) / j
-    yStep = (yEnd - yStart) / j
-    xxStep = (xxEnd - xxStart) / j
-    yyStep = (yyEnd - yyStart) / j
-
-    ' Draw lines between the points
-    FOR a = 1 TO j
-        xStart = xStart + xStep
-        yStart = yStart + yStep
-        xxStart = xxStart + xxStep
-        yyStart = yyStart + yyStep
-        LINE (xStart, yStart)-(xxStart, yyStart), 15
-    NEXT a
-END SUB
-
-
-
-
- -
-

6. Textured and shaded spherical spiral

-
- -
-

spiral, 6.png -

-
- -

-Similar to previous spiral, Line segments are connected between the -neighbors. Spiral height and width are calculated such that sphere is -formed. Sphere is textured. Texture is loaded from file: -texture1.dat . Invisible surface detection and removal is -attempted. Sphere is shaded. -

- -

-spiral, 6.bas -

- -
-
' Program to render fancy looking textured and shaded spiral.
-' Texture is loaded from file.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024 - 2025, Improved program readability
-
-DECLARE SUB fill(x1, y1, x2, y2, xx1, yy1, xx2, yy2, hel)
-DIM SHARED torux(1 TO 10000)
-DIM SHARED toruy(1 TO 10000)
-DIM SHARED sin1(1 TO 10000)
-DIM SHARED cos1(1 TO 10000)
-DIM SHARED tor
-
-' Set the screen mode to 12
-SCREEN 12
-su = 200
-tor = 0
-
-' Calculate points for the spiral
-FOR a = 1 TO 97 STEP .15
-    tor = tor + 1
-    su = SIN(a / 31) * 100
-    x = SIN(a) * su * 3 + 320
-    y = COS(a) * su + 250
-    y = y - (COS(a / 31) * 200)
-    sin1(tor) = a
-    cos1(tor) = a / 31
-    torux(tor) = x
-    toruy(tor) = y
-    ' Set the pixel at (x, y) to color 15
-    PSET (x, y), 15
-NEXT a
-
-' Open the text file for input
-OPEN "texture1.dat" FOR INPUT AS #1
-DIM SHARED text$(1 TO 1000)
-
-a = 0
-1
-' Read a line from the file
-LINE INPUT #1, a$
-' Check if the line is the end marker
-IF LEFT$(a$, 3) = "END" THEN GOTO 2
-
-' Increment the counter and store the line in the text array
-a = a + 1
-text$(a) = a$
-GOTO 1
-2
-' Close the file
-CLOSE #1
-
-' Clear the screen
-CLS
-a = 1
-' Loop through each character in the text
-FOR c = 1 TO 20
-    FOR b = 1 TO LEN(text$(c))
-        ' Get the current character
-        a$ = RIGHT$(LEFT$(text$(c), b), 1)
-
-        ' Increment the counter
-        a = a + 1
-        ' Check if we have reached the end of the points array
-        IF a > tor - 43 THEN GOTO 3
-
-        ' Calculate the angle for the current point
-        tee = SIN(sin1(a + 32))
-        tee = tee - COS(cos1(a))
-
-        ' Draw lines based on the calculated angle
-        IF tee <= 0 THEN
-            LINE (torux(a), toruy(a))-(torux(a + 1), toruy(a + 1)), 15
-            LINE (torux(a), toruy(a))-(torux(a + 42), toruy(a + 42)), 15
-            hel = 10
-            hel1 = COS(cos1(a) - 1) + .5
-            hel2 = SIN(sin1(a) + 1) + 1
-            ' Adjust brightness based on the angles
-            IF hel2 > 1 AND hel1 > 1 THEN
-                hel3 = (hel2 - 1) * (hel1 - 1) * 8
-                hel = hel / (hel3 + 1)
-            END IF
-
-            ' Adjust brightness if the character is "M"
-            IF a$ = "M" THEN hel = hel / 3
-
-            ' Fill the shape with the calculated brightness
-            fillQuadrilateralWithShading torux(a), toruy(a), torux(a + 1), toruy(a + 1), torux(a + 42), toruy(a + 42), torux(a + 43), toruy(a + 43), hel
-        END IF
-    NEXT b
-NEXT c
-
-' Wait for user input
-3
-a$ = INPUT$(1)
-SYSTEM
-
-'
-' Fills a quadrilateral area using scanline algorithm with variable density
-' Creates shaded surface effect by interpolating between opposite edges
-'
-SUB fillQuadrilateralWithShading (startEdgePointX1, startEdgePointY1, endEdgePointX1, endEdgePointY1, shiftedStartEdgeX1, shiftedStarEdgeY1, shiftedEndEdgeX1, shiftEndEdgeY1, brightnessFactor)
-
-' This subroutine creates the illusion of a shaded surface by drawing multiple lines
-' between two opposite edges of a quadrilateral. The density of these lines is
-' controlled by the brightnessFactor parameter - higher values produce sparser lines.
-'
-' Parameters:
-' startEdgePointX1/Y1 and endEdgePointX1/Y1 define one pair of points forming an edge
-' shiftedStartEdgeX1/Y1 and shiftedEndEdgeX1/Y1 define the opposite edge
-' brightnessFactor controls how densely packed the lines will be drawn
-
-' Local variables for working with point coordinates
-edgePointX1 = startEdgePointX1
-edgePointY1 = startEdgePointY1
-edgePointX2 = endEdgePointX1
-edgePointY2 = endEdgePointY1
-oppositePointX1 = shiftedStartEdgeX1
-oppositePointY1 = shiftedStarEdgeY1
-oppositePointX2 = shiftedEndEdgeX1
-oppositePointY2 = shiftEndEdgeY1
-
-' Calculate distance differences along first edge
-deltaX1 = edgePointX1 - edgePointX2
-deltaY1 = edgePointY1 - edgePointY2
-length1 = SQR((deltaX1 * deltaX1) + (deltaY1 * deltaY1))
-
-' Calculate distance differences along second edge
-deltaX2 = oppositePointX1 - oppositePointX2
-deltaY2 = oppositePointY1 - oppositePointY2
-length2 = SQR((deltaX2 * deltaX2) + (deltaY2 * deltaY2))
-
-' Average length determines number of steps based on brightness factor
-averageLength = (length1 + length2) / 2
-stepCount = averageLength / brightnessFactor
-
-' Calculate step increments for each axis
-xStep1 = (edgePointX2 - edgePointX1) / stepCount
-yStep1 = (edgePointY2 - edgePointY1) / stepCount
-xStep2 = (oppositePointX2 - oppositePointX1) / stepCount
-yStep2 = (oppositePointY2 - oppositePointY1) / stepCount
-
-' Draw intermediate connecting lines across the shape
-FOR stepIndex = 1 TO stepCount
-    edgePointX1 = edgePointX1 + xStep1
-    edgePointY1 = edgePointY1 + yStep1
-    oppositePointX1 = oppositePointX1 + xStep2
-    oppositePointY1 = oppositePointY1 + yStep2
-
-    ' Draw line between current interpolated points
-    LINE (edgePointX1, edgePointY1)-(oppositePointX1, oppositePointY1), 15
-NEXT stepIndex
-
-END SUB
-
-
-
-
-
-
-

Created: 2025-08-21 to 21:52

-

Validate

-
- - diff --git a/2D GFX/Textures/index.html b/2D GFX/Textures/index.html deleted file mode 100644 index ad92071..0000000 --- a/2D GFX/Textures/index.html +++ /dev/null @@ -1,709 +0,0 @@ - - - - - - - -Algorithmic textures - - - - - - -
-

Algorithmic textures

- - - -
-

1. Circular waves

-
-

-This QBasic program creates visually captivating circular wave -patterns by manipulating pixel colors based on sine function -calculations. It's a simple yet effective demonstration of how -mathematical functions can be used to generate complex visual -patterns. -

- -

-The program uses two nested loops to iterate over each pixel on the -screen. The outer loop handles the vertical axis (y-coordinate), and -the inner loop handles the horizontal axis (x-coordinate). -

- -

-For each pixel, the program calculates a sine value based on the -squared distance from the origin (0,0). This calculation involves the -formula: -

- -
-colorvalue = SIN((x^2 + y^2) / 10) * 10
-
- - -

-This program is a blend of mathematics and art, showcasing how simple -algorithms can produce intricate and visually appealing results. -

- -

-Circular waves.png -Source code -

- -
-
' Program to render circular wave patterns.
-' Algorithm was accidentally discovered while experimenting with sine function.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003, Initial version
-' 2025, Improved program readability
-
-SCREEN 13
-
-' Initialize the screen mode to 320x200 with 16 colors
-
-' Outer loop for the vertical axis (y-coordinate)
-FOR ycoordinate = 1 TO 199
-    ' Inner loop for the horizontal axis (x-coordinate)
-    FOR xcoordinate = 1 TO 319
-        ' Calculate the sine value based on the squared distances from the origin
-        colorvalue = SIN((xcoordinate ^ 2 + ycoordinate ^ 2) / 10) * 10
-
-        ' Clamp the color value to the range [0, 15]
-        IF colorvalue < 0 THEN colorvalue = 0
-        IF colorvalue > 15 THEN colorvalue = 15
-
-        ' Set the pixel color at (xcoordinate, ycoordinate) with an offset to use the full 16-color palette
-        PSET (xcoordinate, ycoordinate), colorvalue + 16
-    NEXT xcoordinate
-NEXT ycoordinate
-
-' Wait for user key press
-WHILE INKEY$ = "": WEND
-CLS
-END
-
-
-
-
- -
-

2. Diamond square clouds

-
-

-This QBasic program demonstrates the Diamond-Square algorithm, a -method used to generate fractal terrain or cloud surfaces. The -algorithm is particularly useful for creating realistic landscapes or -textures in computer graphics. -

- -

-Diamond square clouds.png -Source code -

- -
-
DECLARE SUB DrawPixels (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER)
-' Program to render cloud surface using diamond square algorithm.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-DECLARE SUB DrawBox (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER)
-DECLARE SUB SetPalette ()
-DECLARE SUB InitializeProgram ()
-DEFINT A-Z
-InitializeProgram
-
-DIM SHARED maxLightness AS INTEGER
-maxLightness = 127
-
-DIM scale AS INTEGER
-scale = 2 ^ 8
-
-1 :
-scale = scale \ 2
-x1 = (319 \ scale) - 1
-y1 = (199 \ scale) - 1
-
-FOR y = 0 TO y1
-    FOR x = 0 TO x1
-        DrawPixels x * scale, y * scale, scale
-    NEXT x
-NEXT y
-
-IF scale > 2 THEN GOTO 1
-WAITa$ = INPUT$(1)
-
-SUB DrawPixels (x1 AS INTEGER, y1 AS INTEGER, s AS INTEGER)
-    ' Get the lightness values for the corners of the box
-    c1 = POINT(x1, y1)
-    c2 = POINT(x1 + s, y1)
-    c3 = POINT(x1, y1 + s)
-    c4 = POINT(x1 + s, y1 + s)
-
-    ' Calculate the midpoint lightness values
-    sp = s \ 2
-    k = s * 2
-    kp = k / 2
-
-    cc2 = ((c1 + c2) / 2) + (RND * k) - kp
-    IF cc2 > maxLightness THEN cc2 = maxLightness
-    IF cc2 < 0 THEN cc2 = 0
-
-    cc3 = ((c1 + c3) / 2) + (RND * k) - kp
-    IF cc3 > maxLightness THEN cc3 = maxLightness
-    IF cc3 < 0 THEN cc3 = 0
-
-    cc4 = ((c2 + c4) / 2) + (RND * k) - kp
-    IF cc4 > maxLightness THEN cc4 = maxLightness
-    IF cc4 < 0 THEN cc4 = 0
-
-    cc5 = ((c3 + c4) / 2) + (RND * k) - kp
-    IF cc5 > maxLightness THEN cc5 = maxLightness
-    IF cc5 < 0 THEN cc5 = 0
-
-    ' Calculate the central lightness value
-    cc1 = ((cc2 + cc3 + cc4 + cc5) / 4) + (RND * k) - kp
-    IF cc1 > maxLightness THEN cc1 = maxLightness
-    IF cc1 < 0 THEN cc1 = 0
-
-    ' Set the calculated lightness values for the box
-    PSET (x1 + sp, y1 + sp), cc1
-    PSET (x1 + sp, y1), cc2
-    PSET (x1, y1 + sp), cc3
-    PSET (x1 + s, y1 + sp), cc4
-    PSET (x1 + sp, y1 + s), cc5
-END SUB
-
-SUB InitializeProgram
-    ' Set the screen mode and initialize the color palette
-    SCREEN 13
-    SetPalette
-    RANDOMIZE TIMER
-END SUB
-
-SUB SetPalette
-    ' Set the color palette for lightness levels
-    FOR a = 0 TO 255
-        OUT &H3C8, a
-        OUT &H3C9, a / 4
-        OUT &H3C9, a / 3
-        OUT &H3C9, a / 2.3
-    NEXT a
-END SUB
-
-
-
-
- -
-

3. Old paper

-
-

-This QBasic program generates a procedural texture that simulates the -appearance of old paper. -

- -

-The program initializes the screen to a 320x200 resolution with 256 -colors (SCREEN 13 in QBasic) and sets up a grayscale color -palette. Each color index from 0 to 63 is assigned a shade of gray, -creating a smooth gradient. -

- -

-The program generates the texture by iterating over each pixel on the -screen. For each pixel, it calculates a color value based on the color -of the pixel directly above it, adding a small amount of random -noise. This creates a smooth transition between pixels with controlled -randomness, mimicking the fibrous texture of paper. -

- -

-Old paper.png -Source code -

- -
-
' Program to render surface resembling old paper.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003, Initial version
-' 2025, Improved program readability
-
-DEFINT A-Z
-SCREEN 13
-RANDOMIZE TIMER
-
-' Initialize the color palette to grayscale. Each color index from 0 to 63 has R, G, B values equal to the index,
-' creating a smooth grayscale gradient for the 256-color mode.
-FOR paletteIndex = 0 TO 63
-    OUT &H3C8, paletteIndex
-    OUT &H3C9, paletteIndex  ' Set red component
-    OUT &H3C9, paletteIndex  ' Set green component
-    OUT &H3C9, paletteIndex  ' Set blue component
-NEXT paletteIndex
-
-noiseOffset = 0
-
-' Generate a paper-like surface by averaging the color of the pixel above with some randomness.
-' This creates a procedural texture that mimics the roughness of paper.
-FOR y = 1 TO 190
-    FOR x = 1 TO 310
-        stepCounter = stepCounter + 1
-
-        ' Approximately every 10 steps, introduce a new random noise offset to create variation in the pattern.
-        ' This prevents the surface from becoming too uniform.
-        IF stepCounter > 10 THEN
-            noiseOffset = RND * currentColor / 20
-            stepCounter = stepCounter - (RND * 20 + 10)
-        END IF
-
-        ' Get the color of the pixel directly above the current position.
-        topColor = POINT(x, y - 1)
-
-        ' Calculate the current color as the average of the top color and the previous current color,
-        ' plus a small random noise and minus the noise offset. This creates a smooth transition with
-        ' controlled randomness.
-        currentColor = (topColor + currentColor) \ 2 + ((RND * 2) - noiseOffset)
-
-        ' Clamp the color value to stay within the valid palette range (0 to 63).
-        IF currentColor < 0 THEN currentColor = 0
-        IF currentColor > 63 THEN currentColor = 63
-
-        ' Plot the current pixel at (x-1, y) using the calculated color.
-        PSET (x - 1, y), currentColor
-    NEXT x
-
-    ' Set the starting color for the next row to the last calculated color of the current row.
-    ' This ensures continuity between rows.
-    PSET (0, y + 1), currentColor
-NEXT y
-
-' Wait for a single key press before exiting the program.
-inputKey$ = INPUT$(1)
-
-SYSTEM
-
-
-
-
- -
-

4. Wood

-
-

-This QBasic program creates a visually appealing simulation of a wood -surface. It is designed to generate a realistic wood grain texture -using simple graphical techniques. -

- -

-Wood.png -Source code -

- -
-
' Program to render surface resembling wood.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024 - 2025, Improved program readability
-
-DECLARE SUB DrawWoodSurface (woodX%, woodY%)
-DECLARE SUB DrawPaper (xPos%, y1Pos%)
-DEFINT A-Z
-SCREEN 12
-RANDOMIZE TIMER
-
-' Set palette colors
-FOR colorIndex = 0 TO 15
-    OUT &H3C8, colorIndex
-    OUT &H3C9, colorIndex * 4
-    OUT &H3C9, colorIndex * 3
-    OUT &H3C9, colorIndex * 0
-NEXT colorIndex
-
-' Main loop to draw wood at random positions
-100:
-woodX = RND * 400 + 200
-woodY = RND * 100 + 200
-CALL DrawWoodSurface(woodX, woodY)
-GOTO 100
-
-' Wait for user input to exit
-exitKey$ = INPUT$(1)
-
-SUB DrawWoodSurface (woodX, woodY)
-    DIM lowerY AS INTEGER
-    DIM phaseOffset AS INTEGER
-    DIM xStepCounter AS INTEGER
-    DIM randomOffset AS INTEGER
-    DIM newColor AS INTEGER
-    DIM upperColor AS INTEGER
-    DIM currentColor AS INTEGER
-
-    ' Draw the outline of the wood
-    lowerY = woodY + 1
-    LINE (0, 0)-(woodX, woodY), 0, BF  ' Black background
-    LINE (5, 5)-(woodX - 5, lowerY - 5), 8, BF  ' Gray wood outline
-    LINE (10, 10)-(woodX - 10, lowerY - 10), 15, BF  ' White inner highlight
-
-    ' Initialize random phase offset for color variation
-    phaseOffset = RND * 300
-
-    ' Draw the wood texture
-    FOR y = woodY - 1 TO 0 STEP -1
-        FOR x = woodX - 1 TO 0 STEP -1
-            xStepCounter = xStepCounter + 1
-            IF xStepCounter > woodX THEN
-                randomOffset = RND * 13  ' Small random noise for texture variation
-                xStepCounter = SIN((y + phaseOffset) / 100) * woodX  ' Sine wave to create wavy grain pattern
-            END IF
-            upperColor = POINT(x, y + 1)  ' Get color from upper pixel
-            currentColor = POINT(x, y)    ' Get color from current pixel
-            newColor = (upperColor * 2 + currentColor + newColor * 3 + randomOffset) / 7 + RND * 1
-
-            ' Ensure color value is within the valid range (0-15)
-            IF newColor < 0 THEN newColor = 0
-            IF newColor > 15 THEN newColor = 15
-
-            ' Set the pixel color for the wood texture
-            PSET (x + 1, y), newColor
-        NEXT x
-    NEXT y
-
-END SUB
-
-
-
-
- -
-

5. Yellow flame

-
-

-"Yellow Flame" is a visually captivating program written in QBasic -that generates a dynamic flame-like pattern on the screen. -

- -

-Program initializes the color palette using sine waves to create a -smooth gradient of colors. This gradient is essential for the flame -effect. -

- -

-The core of the program involves generating a surface pattern that -mimics a flame. It does this by iterating over each pixel on the -screen and calculating the average color of the surrounding pixels. A -small amount of randomness is added to this average to create a -natural, flickering effect. -

- -

-Yellow flame.png -Source code -

- -
-
' Yellow flame.
-'
-' This program is free software: released under Creative Commons Zero (CC0) license
-' by Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability
-
-
-DEFINT A-Z ' Define all variables as integers
-SCREEN 13 ' Set graphics mode to 320x200 with 256 colors
-RANDOMIZE TIMER ' Seed the random number generator
-
-' Initialize palette registers with sine wave colors
-FOR paletteIndex = 0 TO 255
-    OUT &H3C8, paletteIndex
-    OUT &H3C9, INT(SIN(paletteIndex / 21) * 30 + 30)
-    OUT &H3C9, INT(SIN(paletteIndex / 34) * 30 + 30)
-    OUT &H3C9, INT(SIN(paletteIndex / 10) * 30 + 30)
-NEXT paletteIndex
-
-' Generate the surface pattern
-FOR y = 1 TO 199
-    FOR x = 1 TO 319
-        prevPixel = POINT(x, y - 1)
-        leftPixel = POINT(x - 1, y)
-        diagPixel = POINT(x - 1, y - 1)
-        left2Pixel = POINT(x - 2, y)
-
-        ' Calculate the average of surrounding pixels and add some randomness
-        newColor = (prevPixel + leftPixel + diagPixel + left2Pixel) \ 4 + (RND * 5 - 2)
-
-        ' Clamp the color value within the valid range
-        IF newColor < 0 THEN newColor = 0
-        IF newColor > 63 THEN newColor = 63
-
-        ' Set the pixel with the calculated color
-        PSET (x, y), newColor
-    NEXT x
-NEXT y
-
-' Wait for user input to exit
-userInput$ = INPUT$(1)
-
-
-
-
-
-
-

Created: 2025-08-21 to 21:52

-

Validate

-
- - diff --git a/3D GFX/3D Synthezier/doc/index.html b/3D GFX/3D Synthezier/doc/index.html deleted file mode 100644 index a3436a1..0000000 --- a/3D GFX/3D Synthezier/doc/index.html +++ /dev/null @@ -1,1573 +0,0 @@ - - - - - - - -3D Synthezier - - - - - - - - - - - - - - - - - - -
-

3D Synthezier

- - - - -
-

1. Operating principle

-
-

-Parses scene definition language and creates 3D world based on -it. Result will be in a wavefront obj file, witch can be then -visualized using external renderer. -

- -

-Basic concept of defining scene is: -

-
    -
  • Simple and primitive objects are created on point and polygon level.
  • -
  • More complex ones can be created my combinig already existing ones, -while applying various transformations on them.
  • -
- -

-Objects with all its subobjects can be rotated, mirrored or resized -omong any axis. Generator has built in cache for data input and output -to minimize file access. -

- -

-Examples: -

- -

-Download Blender files: -

- - - --- -- - - - - - - - - - - - - - - - - - -
filesize
rectangular city.blend3.6 MB
hexagonal city.blend21 MB
- -

-They were produced by importing generated wavefront obj files into -Blender. -

-
- -
-

1.1. Rectangular city

-
- -
-

rectangular city, 1.jpeg -

-
- - -
-

rectangular city, 2.jpeg -

-
- - -
-

rectangular city, 3.jpeg -

-
-
-
-
-

1.2. Hexagonal city

-
- -
-

hexagonal city, 1.jpeg -

-
- - -
-

hexagonal city, 2.jpeg -

-
- - -
-

hexagonal city, 3.jpeg -

-
-
-
-
-
-

2. Scene description language

-
-

-See also examples. -

-
-
-

2.1. here

-
-
-here
-
- -

-defines new segment -

-
-
-
-

2.2. p

-
-
-p  x y z
-
- -

-defines new point -

-
-
-
-

2.3. f

-
-
-f  p1 p2 p3 p4
-
- -

-defines new polygon, p4 may be unused -

-
-
-
-

2.4. warn

-
-
-warn  <message>
-
- -

-displays warning message, and wait for key -

-
-
-
-

2.5. end

-
-
-end
-
- -

-terminates parser -

-
-
-
-

2.6. mtl

-
-
-mtl  material
-
- -

-selects material -

-
-
-
-

2.7. mtlrnd

-
-
-mtlrnd  material ...
-
- -

-selects random material from list -

-
-
-
-

2.8. obj

-
-
-obj  object xz45 xy20 x+3 y*2
-
- -

-includes sub object, can be rotated moved or resized, across X Y Z. If -object name begin vith ~ then it will be loaded from current -directory. if object name ends with ~ then object will be parsed -directly from file, and not chached, to allow loading of greater than -500 lines files. -

- - -
-

rotation.png -

-
-
-
-
-

2.9. rnd

-
-
-rnd  p^1^2^3 p^7^2^1
-
- -

-select random command to execute, ^ will be converted to spaces. -

-
-
-
-

2.10. #

-
-
-# whatever text
-
- -

-comment -

-
-
-
-

2.11. out

-
-
-out  file
-
- -

-specify output file name, must be first command -

-
-
-
-

2.12. set

-
-
-set  variable  contents
-
- -

-set variable contents, variable must be number, contents can be -string. max variables is 100. first is 0. -

-
-
-
-

2.13. variables usage

-
-
-anycommand %1 anything
-
- -

-inserts variable 1 contents info line -

-
-
-
-

2.14. cmp

-
-
-cmp  flag string1 string2
-
- -

-compares strings, and inserts TRUE to flag, if they are equal, else inserts FALSE. max 9 falgs, 0 first. Each subobject has its own flags. -

-
-
-
-

2.15. ?

-
-
-?flag anycommand
-
- -

-executes command if flag is true. -

- -

-exapmle: ?3 obj car z*2 xy45 -

-
-
-
-

2.16. dum

-
-
-dum
-
- -

-dummy function, does notheing -

-
-
-
- -
-

3. Installation

-
-

-Edit bin/3dparse.bas file and update include path in there. -

-
- -
-

3.1. System requirements

-
- - - --- -- - - - - - - - - - - - - - - - - - -
softwaretested version
DOS6.22
QBasic4.5
-
-
- -
-

3.2. Directory layout

-
-
-
bin
-
3dparse.bas
3D generator main executable
-
city1.3d
city with square-like buildings
-
city2.3d
city with hexangular buildings
-
result.mtl
shared material library
-
*.bat
quick launch scripts
-
- -
include
3D objects used to compose the scene
-
-
-
-
- -
-

4. Usage

-
-

-Make sure you have QB binaries in your PATH. Execute -

-
-bin/city1.bat
-
- -

-or -

-
-bin/city2.bat
-
- -

-to generate example cities. After parsing is finished, appropriate -*.obj files will appear in the bin directory holding generated scene. -Visualize scene with your favourite renderer. -

-
-
-
-
-

Created: 2025-08-21 to 21:54

-

Validate

-
- - diff --git a/3D GFX/Miscellaneous/index.html b/3D GFX/Miscellaneous/index.html deleted file mode 100644 index 4038c39..0000000 --- a/3D GFX/Miscellaneous/index.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - -Miscellaneous 3D graphics demos - - - - - - -
-

Miscellaneous 3D graphics demos

- - - -
-

1. Rotating exclamation mark

-
-

-Wireframe 3D model of a rotating exclamation mark. -

- -
- -
- -

-Source code -

-
-
- -
-

2. 3D bouncing ball

-
-

-This QBasic program creates a visually engaging 3D animation of a -point-cloud ball bouncing around the screen. The program is an example -of early computer graphics techniques. -

- -
- -
- -

-Source code -

-
-
- -
-

3. 3D text in a room

-
-

-Wireframe 3D text hanging in a wireframe 3D room. User can look and -fly around in all directions. -

- -
- -
- -

-Source code -

-
-
- -
-

4. 3D bouncing cubes on grid floor

-
-

-3D wireframe cubes bouncing on a grid floor, creating an immersive and -dynamic visual effect. -

- -
- -
- -

-Source code -

-
-
- -
-

5. Matrix math for rotation in 3D space

-
-

-Instead of combining simple 2D rotors, pixels in this 3D space are -rotated by using matrix multiplications. -

- -
- -
- -

-Source code -

-
-
- -
-

6. Maze explorer

-
-

-The Evolving 3D Maze Explorer is a QBasic program that generates and -navigates through a dynamically evolving 3D maze. This program is an -excellent example of early 3D graphics programming and provides an -interactive experience where users can explore a maze that grows and -changes as they navigate through it. -

- - -
-

Maze%20explorer.png -

-
- -

-Source code -

-
-
- -
-

7. Tank animation

-
-

-Animated tank driving through the bridge back and forward. User can -look and fly around in all directions. -

- -
- -
- -

-Source code -

-
-
- -
-

8. Tiled room

-
-

-Room with some tiles on the wall and on the floor. User can freely fly -around. -

- -
- -
- -

-Source code -

-
-
-
-
-

Created: 2025-08-21 to 21:54

-

Validate

-
- - diff --git a/3D GFX/Space/Universe explorer/index.html b/3D GFX/Space/Universe explorer/index.html deleted file mode 100644 index 2daf567..0000000 --- a/3D GFX/Space/Universe explorer/index.html +++ /dev/null @@ -1,45 +0,0 @@ - -Universe Explorer - - - -

Universe Explorer

-
-
-This QBasic program draws 3D universe consisting of stars in realtime. - -Stars form different galaxies, and galaxies in turn form metagalaxies, witch -finally form universe. - -Program allows you to freely fly around using mouse and the keyboard. -In this simulation universe consists from many millions of stars. -Since QBasic cannot handle large arrays it was quite an art to -invent and optimize formula witch syntheszies any part of the -universe on demand. Every galaxy and metagalaxy is unique. -When user flies near to some galaxy, it will be synthezied, -and detail level will increase. -


-
single metagalaxy -
-


-
single galaxy -
-


-
another galaxy -
-
-
-
-Requirements:
-	CPU 500 MHz or better
-	MS QBasic (preferably QB 4.5)
-	QBEXT TSR (included)
-
-Running program:
-	Since QB has no mouse support there is workaround hack: QBEXT.
-	Thats a tiny TSR that must be loaded first to allow
-	mouse usage.
-
-
- - \ No newline at end of file diff --git a/3D GFX/Space/index.html b/3D GFX/Space/index.html deleted file mode 100644 index c31ff99..0000000 --- a/3D GFX/Space/index.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - -Space themed 3D graphics - - - - - - -
-

Space themed 3D graphics

- - - -
-

1. Galaxy explorer

-
-

-This QBasic program renders a navigable 3D point cloud galaxy, -allowing users to explore a virtual galaxy using mouse or keyboard -controls. The program creates a visually engaging simulation of a -galaxy with stars distributed in a spiral pattern. -

- - -
-

Galaxy%20explorer.png -

-
- -

-Source code -

-
-
- -
-

2. Rocket simulator

-
-

-QBasic program that simulates the takeoff and flight of a rocket from -the surface of a planet. This program provides a simple yet engaging -3D visualization of a rocket's journey, allowing users to navigate and -observe the rocket's trajectory from various angles. -

- -
- -
- -

-Source code -

-
-
- -
-

3. Stars

-
-

-The 3D Starfield Simulation is a QBasic program that creates a -visually captivating simulation of a starfield in three -dimensions. This program is designed to render stars moving in space, -giving the illusion of flying through a galaxy. -

- -

-How the Program Works: -

- -
-
Camera Rotation
The camera's rotation is calculated to give a -dynamic view of the starfield.
-
Star Movement
Each star's position is updated to simulate -movement through space. Stars that get too close to the viewer are -repositioned to the far distance to create an infinite starfield -effect.
-
Projection
The 3D coordinates of each star are projected onto a -2D screen using perspective projection, which scales the stars based -on their distance from the viewer.
-
Brightness and Color
The brightness of each star is adjusted -based on its distance, with closer stars appearing brighter.
-
- -
- -
- -

-Source code -

-
-
- -
-

4. Universe explorer

-
-

-This QBasic program that simulates a navigable 3D universe. Users can -freely fly through a dynamically generated universe composed of galaxy -clusters, galaxies, and stars. The program employs a clever algorithm -to manage the level of detail, dynamically increasing or decreasing -the complexity of the universe regions based on the user's -position. This ensures a reasonable quantity of stars is rendered at -any given time, optimizing performance and visual experience. -

- -

-What's in it for the Reader? -

- -
-
Algorithm Insight
The program provides a practical example of -dynamic level-of-detail algorithms, which can be useful for anyone -interested in computer graphics, game development, or simulation -programming.
- -
3D Navigation
It demonstrates how to implement a 3D navigation -system using basic input devices like a mouse and keyboard, offering -insights into handling user inputs for movement and interaction in a -3D space.
- -
Procedural Generation
The universe is procedurally generated, -showcasing how to create complex structures like galaxies and star -systems algorithmically.
- -
Performance Optimization
The program highlights techniques for -optimizing performance in resource-intensive applications, such as -limiting the number of rendered objects based on distance.
-
- - -
-

1.png -

-
- - -
-

2.png -

-
- - -
-

3.png -

-
- -

-Source code -

-
-
-
-
-

Created: 2025-08-21 to 21:54

-

Validate

-
- - diff --git a/Math/Plotting/index.html b/Math/Plotting/index.html deleted file mode 100644 index 0dec982..0000000 --- a/Math/Plotting/index.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - -Plotting - - - - - - -
-

Plotting

- - - -
-

1. 2D graph

-
-

-The 2D Graph Plotter is a simple yet effective program written in -QBasic that allows users to plot mathematical functions on a -two-dimensional grid. This program is particularly useful for -visualizing mathematical functions and understanding their graphical -representations. -

- -

-The main loop of the program calculates the y-value for each x-value -based on a user-defined mathematical function. -

- - -
-

2D%20graph%20plot.png -

-
- -

-Source code -

-
-
- -
-

2. 3D graph

-
-

-The 3D Heightmap Explorer is a QBasic program designed to visualize -mathematical functions in three dimensions. It allows users to explore -various heightmaps by defining custom formulas and observing their -graphical representations. This program is particularly useful for -educational purposes, helping users understand complex mathematical -surfaces. -

- -

-Users can navigate through the 3D space using keyboard controls to -move around and inspect the heightmap from different angles. -

- -

-The core of the program is the formula subroutine, where users can -define their mathematical functions. Multiple example formulas are -provided, which can be enabled or disabled to create different visual -effects. -

- -

-The program includes a grid system that helps users perceive the scale -and orientation of the 3D space. This includes background grids and a -central 3D cross to indicate the zero point. -

- -

-The formula subroutine evaluates the user-defined mathematical -function to determine the height (Z-coordinate) of each point on the -grid. -

- - -
-

3D%20graph.png -

-
- -

-Source code -

-
-
- -
-

3. Deriviative calculator

-
-

-This QBasic program is designed to compute and plot an arbitrary -mathematical function on a 2D graph. Additionally, it calculates and -plots the derivative of the function, providing a visual -representation of both the function and its rate of change. The -program is a great educational tool for those interested in -understanding how mathematical functions and their derivatives can be -visualized. -

- - -
-

Deriviative%20calculator.png -

-
- -

-Source code -

-
-
- -
-

4. Sine and cosine table

-
-

-The SIN & COS Table Generator is a QBasic program designed to visually -plot the sine and cosine functions on a graphical screen. This program -is particularly useful for educational purposes, providing a clear -visual representation of these fundamental trigonometric functions. -

- - -
-

Sine%20and%20cosine%20table.png -

-
- -

-Source code -

-
-
-
-
-

Created: 2025-08-21 to 21:54

-

Validate

-
- - diff --git a/Math/Simulation/index.html b/Math/Simulation/index.html deleted file mode 100644 index 6581e0d..0000000 --- a/Math/Simulation/index.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - - -Simulation - - - - - - -
-

Simulation

- - - -
-

1. Explosion simulator

-
-

-This QBasic program simulates the propagation of shock waves in a gas -within a confined space. It models the behavior of pressure and -velocity in a two-dimensional grid, providing a visual representation -of how shock waves interact with boundaries and each other. -

- -

-The program initializes a 100x100 grid to represent pressure and -velocity values. It sets up initial conditions, including placing -pressure disturbances and defining boundary walls. -

- -

-The core of the program is a loop that continuously updates the -pressure and velocity values. The velocities in the horizontal and -vertical directions are updated based on pressure differences between -adjacent grid points. The program checks for and corrects negative -pressure values to ensure physical realism. The pressure grid is -updated based on the current velocities. The program handles boundary -conditions by setting velocities to zero at wall boundaries. -

- - -
-

Explosion%20simulator.png -

-
- -

-Source code -

-
-
- -
-

2. Gravity in 2D

-
-

-The Gravitation Simulation program is a simple yet insightful QBasic -application that simulates the gravitational interaction between a -central mass and an orbiting object in a two-dimensional space. This -program provides a visual representation of how gravitational forces -influence the motion of celestial bodies, making it an excellent -educational tool for understanding basic orbital mechanics. -

- - -
-

Gravity%20in%202D.png -

-
- -

-Source code -

-
-
- -
-

3. Gravity in 3D

-
-

-This QBasic program simulates the gravitational interactions between -spheres in a three-dimensional space. It provides a visual -representation of how spheres might move under the influence of -gravitational forces, offering an educational insight into basic -physics principles. -

- -

-When spheres are far apart, gravity is dominating force. When Distance -between spheres crosses critical threshold, much stronger repulsive -force emerges and becomes dominant. -

- -

-There is also friction. This ensures that after some bouncing, spheres -will reach stable configuration. -

- -
- -
- -

-Source code -

-
-
- -
-

4. Interference

-
-

-This QBasic program simulates the interference pattern created by two -sine waves with slightly different frequencies. It visually -demonstrates how wave interference works, which is a fundamental -concept in physics and engineering, particularly in the study of -sound, light, and other wave phenomena. -

- -

-Program combines two waves to create an interference pattern, which is -displayed as a third waveform. -

- -
- -
- -

-Source code -

-
-
- -
-

5. Interferogram

-
-

-This QBasic program simulates the interference pattern created by -multiple frequencies interacting with each other. The result is a -visual representation known as an interferogram, which is commonly -used in physics and engineering to analyze wave interactions. -

- - -
-

Interferogram.png -

-
- -

-Source code -

-
-
- -
-

6. Surface tension

-
-

-This QBasic program simulates the behavior of water spills and the -subsequent effects of surface tension using cellular automata -rules. The simulation models how water spreads and how surface tension -affects the shape of the water body, particularly smoothing out sharp -edges over time. -

- -

-The main loop continuously calculates the next state of each cell -based on the surface tension rules. It uses the Moore neighborhood, -which includes all eight surrounding cells, to determine the state of -each cell in the next iteration. -

- -

-The rules dictate that a water cell survives only if surrounded by a -moderate density of other water cells, while an empty space becomes a -water cell if surrounded by a high density of water cells. -

- - -
-

Surface%20tension.png -

-
- -

-Source code -

-
-
- -
-

7. Wave 1

-
-

-This QBasic program simulates the propagation of waves across a -surface. It provides a visual representation of wave dynamics, which -can be both educational and a source of inspiration for those -interested in physics simulations or algorithmic art. -

- -

-The program updates the velocity and height of each point based on the -calculated averages, applying a damping factor to simulate energy -loss. -

- - -
-

Wave%201.png -

-
- -

-Source code -

-
-
- -
-

8. Wave 2

-
-

-This QBasic program simulates and visualizes the behavior of water -waves on a 2D surface. It creates a dynamic animation of water -disturbed by random rain droplets, demonstrating how waves propagate -and interact with each other. The program is an example of a simple -physics simulation and can serve as an educational tool for -understanding wave mechanics. -

- - -
-

Wave%202.png -

-
- -

-Source code -

-
-
-
-
-

Created: 2025-08-21 to 21:55

-

Validate

-
- - diff --git a/Math/Truth table/index.html b/Math/Truth table/index.html deleted file mode 100644 index f0f9a69..0000000 --- a/Math/Truth table/index.html +++ /dev/null @@ -1,1683 +0,0 @@ - - - - - - - -Truth table calculator - - - - - - - - - - - - - - - - - - -
-

Truth table calculator

- - - -

-A truth table is a mathematical table used to determine the output of a logic function -based on all possible combinations of inputs. Each row represents a possible state of -the input variables, with the corresponding output value. Truth tables are crucial in -designing and understanding digital circuits, Boolean algebra, and logical expressions. -

- -
-

1. Implemented logical operations

-
-
-
-

1.1. Equivalent ( ⇔ , 1 )

-
-

-The equivalent operation, also known as logical biconditional, is true if and only if -both inputs are the same. In other words, it asserts that both propositions are -either both true or both false. It is often represented by the symbol ⇔. -

- -

-Truth Table: -

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABA ⇔ B
TTT
TFF
FTF
FFT
-
-
- -
-

1.2. Implies ( ⇒ , 2 )

-
-

-An implication asserts that if the first proposition is true, the -second must be true as well. If the first is false, the implication -holds regardless of the second proposition's value. -

- -

-Truth table: -

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABA ⇒ B
TTT
TFF
FTT
FFT
-
-
- -
-

1.3. OR ( ∨ , 3 )

-
-

-The OR operation, also known as logical disjunction, is true if at -least one of the inputs is true. It asserts that if either proposition -is true, the entire expression is true. -

- -

-Truth table: -

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABA ∨ B
TTT
TFT
FTT
FFF
-
-
- -
-

1.4. AND ( ∧ , 4 )

-
-

-The AND operation, also known as logical conjunction, is true if and -only if both inputs are true. -

- -

-Truth table: -

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABA ∧ B
TTT
TFF
FTF
FFF
-
-
- -
-

1.5. NOT ( ¬ , 5 )

-
-

-The NOT operation, also known as logical negation, inverts the value -of the input. If the input is true, the output is false, and vice -versa. -

- -

-Truth Table: -

- - - - --- -- - - - - - - - - - - - - - - - - - -
A¬A
TF
FT
-
-
-
-
-

2. Examples

-
-
-
-

2.1. Example: (A ∧ B) ∨ ¬C

-
- - - --- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABC(A ∧ B) ∨ ¬C
TTTT
TTFT
TFTF
TFFT
FTTF
FTFT
FFTF
FFFT
-
-
- -
-

2.2. Example: A ⇒ (B ∨ ¬C)

-
- - - --- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABCA ⇒ (B ∨ ¬C)
TTTT
TTFT
TFTF
TFFT
FTTT
FTFT
FFTT
FFFT
-
-
- -
-

2.3. Example: (A ⇔ B) ∧ C

-
-

-Truth Table: -

- - - - --- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABC(A ⇔ B) ∧ C
TTTT
TTFF
TFTF
TFFF
FTTF
FTFF
FFTT
FFFF
-
-
-
-
-
-

Created: 2025-08-21 to 21:56

-

Validate

-
- - diff --git a/Miscellaneous/Mouse driver/index.html b/Miscellaneous/Mouse driver/index.html deleted file mode 100644 index 95d318f..0000000 --- a/Miscellaneous/Mouse driver/index.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - -Mouse driver for QBasic programs - - - - - - -
-

Mouse driver for QBasic programs

- - -
-

1. Overview

-
-

-QBasic, a popular programming language in the DOS era, lacks native -mouse support. This limitation can be a hurdle for developers looking -to create interactive applications. To bridge this gap, I developed a -workaround that allows QBasic to use mouse input. -

-
-
- -
-

2. High-level idea

-
-

-Workaround to access mouse involves a Terminate and Stay Resident -(TSR) program written in x86 assembly. This TSR program must be -started before running QBasic program that depends on mouse. This TSR -program hooks into the system's interrupt mechanism, specifically the -timer interrupt (IRQ 0), allowing it to regularly check for mouse -activity several times per second. -

- -

-When this timer interrupt triggers, the TSR reads the latest mouse's -horizontal and vertical movements and button states using mouse -interrupts. This data is then stored in a dedicated memory location — -a data table within the TSR's memory space. The TSR uses interrupt 79h -as a pointer to this data table, making it accessible to other -programs, including the QBasic application. -

- -

-While QBasic originally is not able to read mouse, it is able to read -(and write) arbitrary location in system RAM. The QBasic demonstration -program begins by retrieving the address of the TSR mouse data table -from the interrupt vector table using interrupt 79h. By checking a -predefined magic number (1983) in the data table, the program confirms -that the mouse driver is loaded. Once verified, the QBasic program -continuously reads mouse data from this shared memory location, while -TSR keeps updating it with latest mouse state simultaneously. -

-
-
- -
-

3. Terminate and Stay Resident module

-
-

-A DOS TSR program that hooks into the system's interrupt mechanism to -regularly read mouse input and store it in a dedicated memory -location. -

- -

-Files: -

- - - -

-Here is the detailed technical specification for an in-memory table -used to exchange mouse coordinates between a TSR program and a QBasic -program. -

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OffsetSize (bytes)Description
0x002Magic Number (1983)
0x022Horizontal Movement (X)
0x042Vertical Movement (Y)
0x062Button Status
0x081Update counter
- -
-
Update counter
Signals to the QBasic program that new mouse data -is available in the shared memory table. It ensures that the QBasic -program only reads fresh data and avoids processing outdated or -repeated data. When the TSR updates the mouse data, it increments -this flag by 1 to signal the QBasic program that new data is -available. QBasic can compare this number against last retrieved -value. If value has been increased, then there had been update -meanwhile.
-
-
-
- -
-

4. QBasic demonstration program

-
-

-A QBasic program that reads mouse data from the memory location -populated by the TSR and demonstrates mouse movement and button -clicks. -

- - - -
-

screenshot.png -

-
- -

-mousedrv.bas - source code -

- -

-Here are more practical examples where this mouse driver is being -used: Within Space themed 3D graphics, see: -

-
    -
  • Galaxy explorer
  • -
  • Universe explorer
  • -
-
-
-
-
-

Created: 2025-08-21 to 21:56

-

Validate

-
- - diff --git a/Networking/Digital data over analog audio/index.html b/Networking/Digital data over analog audio/index.html deleted file mode 100644 index 9914624..0000000 --- a/Networking/Digital data over analog audio/index.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - -Data over analog audio - - - - - - -
-

Data over analog audio

- - -
-

1. msg2xi: Text to Sound Encoder

-
-

-msg2xi is a utility designed to encode arbitrary text messages into an -8-bit sound file. This program allows users to convert digital data -into analog audio signals, making it possible to transmit text -messages over traditional analog mediums such as telephone lines or -magnetic tapes. -

- -

-How It Works: The program reads text from an input file, processing -it byte by byte. Each byte is broken down into its constituent bits. -For each bit, a sine wave is generated. Different waveforms represent -'1's and '0's (implementing frequency modulation). The generated -waveforms are combined into a single audio file, encoding the original -text message. A special pure sinewave header tone is added to the -beginning of the audio file to mark the start of the encoded message, -facilitating synchronization during decoding. -

- -

-Download source code: Source code -

-
-
- -
-

2. xi2msg: Sound to Text Decoder

-
-

-The xi2msg utility is designed to decode digital information from an -audio file, specifically an 8-bit sound file. This program is part of -a suite of utilities that enable the transmission of digital data over -analog audio mediums, such as telephone lines or magnetic tapes. -

- -

-The xi2msg utility works by analyzing the audio file to locate peaks -between waveforms. It calculates the distance between these peaks to -determine whether each segment represents a '0' or a '1' bit. This -process involves several key steps: -

- -
-
Header Detection
The program starts by searching for a special -header tone in the audio file. This header tone marks the beginning -of the encoded message and helps synchronize the decoding process.
- -
Peak Analysis
The utility measures the distance between peaks in -the audio waveform. Long distances between peaks are interpreted as -'0' bits, while short distances are interpreted as '1' bits.
- -
Bit Assembly
The detected bits are sequentially assembled into -bytes. Each byte is then converted into its corresponding character.
- -
Output
The decoded message is displayed on the screen and written -to an output file, making it accessible for further use or analysis.
-
- -

-The program relies on frequency modulation for decoding data, which -was chosen for its resilience to amplitude distortions that can occur -during analog transmission. This makes the utility particularly -effective for decoding messages recorded on cassette tapes or -transmitted over telephone lines. -

- - -
-

screenshot.png -

-
- - -

-Download source code: Source code -

-
-
- -
-

3. aver

-
-

-The aver.bas utility is designed to reduce noise in digitized audio -files by smoothing out noise peaks, which is particularly beneficial -for audio files transmitted over analog mediums like telephone lines -or magnetic tapes, where noise interference is common. -

- -

-The program starts by asking the user for two critical factors: the -averaging factor and the divide factor. These parameters determine the -intensity of the noise reduction applied. -

- -

-For each byte read from the input file, the program stores the last N -values (where N is the averaging factor). These values are averaged, -and the result is scaled by the divide factor. This averaging -technique helps to smooth out noise spikes in the audio data. -

- -

-The program provides a graphical representation of the original and -smoothed audio. This allows for visual comparison of the original and -processed signals on the screen. The smoothed audio data is written to -an output file, which should have reduced noise compared to the input -file. -

- -

-The program uses command-line input to determine the filenames for -input and output, defaulting to appending .awe to the input filename -for the output file. -

- -

-Download source code: Source code -

-
-
-
-
-

Created: 2025-08-21 to 21:57

-

Validate

-
- - diff --git a/Networking/LPT communication driver/index.html b/Networking/LPT communication driver/index.html deleted file mode 100644 index bf5d853..0000000 --- a/Networking/LPT communication driver/index.html +++ /dev/null @@ -1,606 +0,0 @@ - - - - - - - -LPT Communication Driver - - - - - - -
-

LPT Communication Driver

- - -
-

1. Overview

-
-

-This is weird networking solution. It allows to send data using -parallel LPT port serially(!) by bit-banging between two connected -computers :) -

- -

-Out of 25 physical wires in LPT port, only 3 are used: -

- -
-
Pin 14
Carries a synchronization signal which uses a periodic -pattern (e.g., 010101…) to maintain timing alignment between the -communicating computers.
- -
Pin 17
Functions as the bidirectional data line, responsible for -transmitting and receiving data between the connected computers.
- -
Pin 18
Acts as the ground connection, providing a common -reference for electrical signals to ensure consistency in -communication.
-
- - -
-

diagram.png -

-
- -

-By utilizing only three wires and software controlled bit-banging -algorithm, custom, comparatively simple, cheap and long cable can be -built to connect 2 computers in a DIY network setup. -

-
-
- -
-

2. LPT Communication Driver

-
-
-
-

2.1. Overview

-
-

-The LPT Communication Driver is a Terminate and Stay Resident (TSR) -driver designed to facilitate communication between computers using -parallel printer ports (LPT). This driver uses bit-banging to send and -receive data serially over the LPT port, utilizing only three wires -for communication. -

- -

-Driver hooks into the system's IRQ 0 to ensure that system timer -always keeps executing it in the background. While operating as a -background process, it periodically monitors LPT port to detect -incoming transmission. When transmission is detected, driver receives, -decodes and stores it into preallocated 5000 byte receive buffer. -

- -

-Applications can then communicate with the driver on their own -schedule using INT 63h to poll for and retrieve received messages, if -any. Applications can also send outgoing messages into 5000 byte -driver outbox memory buffer. Thereafter driver will transmit those -messages in background mode over the wire. -

- -

-The driver is half-duplex: it prioritizes receiving over sending and -does not transmit while receiving. -

- -

-During active transmission/reception, the driver can consume 100% CPU -due to busy-wait loops in the IRQ handler, potentially causing random -temporary hiccups for application running in the -foreground. Unsuitable for real-time systems. -

- -

-Download: -

- -
-
- -
-

2.2. Data transmission implementation details

-
-

-When there is incoming data transmission, the TSR driver detects it -during its periodic execution in the IRQ 0 (timer) handler, which runs -approximately every 55ms. -

- -

-Driver checks for possible transmission comparatively rarely (every 55 -ms) and for this reason it is important to have quite long -transmission start indicator/header before actual data is sent. This -allows long enough time for recipient computer communication driver to -detect that transmission line is active and start listening to it now -in exclusive busy-wait loop. So, the TSR driver steals 100% of the CPU -for the duration of transmission. -

- -

-The start of transmission is detected by reading the port (37Ah) -value, and checking if bit 3 of the raw input is high. It then enters -a "skip header" loop. Once bit 1 goes low, bit reception begins. The -end is detected via a timeout: during bit reception, a counter -increments on each poll. If there is no change in the port value for -30 consecutive polls (indicating no new bit transition), it assumes -the transmission is complete, appends a 2-byte length to the receive -buffer, and exits the routine. -

- -

-So, both receive and send routines execute within the IRQ 0 handler -using busy-wait polling loops (for receive) or timed output loops (for -send). These can hold the CPU for the full duration of a transmission, -as the handler does not yield until complete. -

- -

-It bit-bangs data by treating the LPT control port (37Ah) as both -output and input, using bit 3 (pin 17, data line) for the serial data -bit and bit 1 (pin 14, sync line) for a clock that alternates (low on -even bit indices, high on odd) to signal transitions. -

- -

-For sending: the port is first set to 0xFF (all bits high) as a -header, held for ~110ms (2 timer ticks). -

- -

-For receiving: after start detection, it polls the port for value -changes (transitions). On each change, it reads the port again (to -ensure that synchronization bit did not arrive ahead data bit over the -separate physical wire), extracts bit 3 as the data bit, shifts it -into a byte accumulator, and resets the timeout counter. Once a full -byte is accumulated, it stores it in the receive buffer. No ACK or -error checking. -

- -

-Driver can receive multiple transmissions into its 5000-byte receive -buffer before the client program reads it out. Each incoming -transmission appends its data bytes followed by a 2-byte length word -directly to the end of the buffer (updating dbufsiz to the new total -used). As long as the cumulative size doesn't exceed 5000 bytes, -multiple can queue up. The buffer acts as a FIFO for concatenated -packets; overflows are not handled (it would corrupt without -checks). The client retrieves the entire buffer contents at once when -polling. -

- -

-When the client program reads received data from the TSR (via INT 63h -AH=2), the driver copies the full buffer contents (up to dbufsiz -bytes) to the client's specified ES:DI pointer, returns the byte count -in AX, and immediately resets dbufsiz to 0, clearing the buffer. This -ensures the data is not served again on subsequent reads, as the -buffer is emptied after each retrieval. If no data is available, AX=0 -is returned. -

-
-
- -
-

2.3. Driver API

-
-

-The driver uses INT 63h for its API, with functions selected via the -AH register. It maintains two internal buffers: -

- -
    -
  • Download Buffer: 5000 bytes for incoming (received) data. Multiple -transmissions can be queued here, each appended with a 2-byte length -footer.
  • -
  • Upload Buffer: 5000 bytes for outgoing (to-be-sent) data. Data is -copied here and transmitted when the line is free.
  • -
- - -

-Communication is polling-based for applications; the driver handles -transmission/reception in the background. -

- -

-No error checking, acknowledgments, or flow control; it's a simple, -unidirectional-per-turn protocol. -

- -

-To use the driver: -

-
    -
  • Load the TSR (e.g., run lptdrv.com).
  • -
  • Activate it via the API.
  • -
  • Poll for received data or queue sends as needed.
  • -
  • Deactivate when done.
  • -
- -

-API overview: -

- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AH registerAPI function
0Deactivate the driver
1Activate the driver
2Retrieve downloaded data from the driver's input buffer
3Upload data to the driver's output buffer for transmission
-
- -
-

2.3.1. Deactivate the driver

-
-

-Disables the driver, stopping background monitoring and -transmission. The LPT port is reset (set to 0). -

- -
    -
  • AH: 0
  • -
  • Parameters: None
  • -
  • Returns: None
  • -
  • Side Effects: Clears the enabled flag.
  • -
  • Usage Notes: Call this before unloading the TSR or when -communication is no longer needed to free system resources.
  • -
-
-
- -
-

2.3.2. Activate the driver

-
-

-Enables the driver, starting background LPT port monitoring for -incoming data. The LPT port is reset (set to 0) upon activation. -

- -
    -
  • AH: 1
  • -
  • Parameters: None
  • -
  • Returns: None
  • -
  • Side Effects: Sets the enabled flag. Existing buffer contents are -preserved.
  • -
  • Usage Notes: Must be called after loading the TSR and before any -send/receive operations. Can be called multiple times; redundant -activations are harmless.
  • -
-
-
- -
-

2.3.3. Retrieve downloaded data from the driver's input buffer

-
-

-Copies all accumulated received data from the driver's download buffer -to the caller's memory location and clears the buffer. -

- -
    -
  • AH : 2
  • -
  • Parameters : -
      -
    • ES:DI : Pointer to the buffer where received data should be -copied (must be large enough to hold up to 5000 bytes).
    • -
  • -
  • Returns : -
      -
    • AX : Number of bytes copied (0 if no data available).
    • -
  • -
  • Side Effects : Resets the download buffer size to 0, preventing -re-retrieval of the same data.
  • -
  • Usage Notes : -
      -
    • Data is retrieved as a concatenated stream of all queued -transmissions.
    • -
    • Each transmission in the buffer ends with a 2-byte length word -(little-endian) indicating its payload size (excluding the length -itself).
    • -
    • Poll this function periodically in a loop to check for new data.
    • -
    • If AX=0, no copy occurs.
    • -
    • Example: In assembly, set ES:DI to your receive buffer and call -INT 63h; then process AX bytes if >0.
    • -
  • -
-
-
- -
-

2.3.4. Upload data to the driver's output buffer for transmission

-
-

-Copies the specified data to the driver's upload buffer for background -transmission. Transmission occurs when the line is free (no incoming -data). -

- -
    -
  • AH : 3
  • -
  • Parameters : -
      -
    • DS:SI : Pointer to the data to upload.
    • -
    • CX : Number of bytes to upload (must not exceed remaining upload -buffer space; no checks performed).
    • -
  • -
  • Returns : None
  • -
  • Side Effects : Appends data to the upload buffer and updates its -size. Transmission is asynchronous.
  • -
  • Usage Notes : -
      -
    • Data is sent as a single transmission (no automatic framing; -caller can add headers if needed).
    • -
    • If the buffer is full (total >5000 bytes), behavior is undefined -(overflow).
    • -
    • Multiple calls can queue data sequentially in the buffer.
    • -
    • Transmission starts in the next IRQ 0 tick if the line is idle.
    • -
    • The driver adds no footer; the receiver sees exactly the sent bytes.
    • -
    • Example: Load DS:SI with your message, CX with length, call INT -63h; the driver handles sending.
    • -
  • -
-
-
-
-
-
-
-

Created: 2025-08-21 to 21:57

-

Validate

-
- - diff --git a/Tools/Update web site b/Tools/Update web site index f162ed4..a623149 100755 --- a/Tools/Update web site +++ b/Tools/Update web site @@ -4,49 +4,75 @@ cd .. # Function to export org to html using emacs in batch mode export_org_to_html() { - local dir=$1 - if [ -d "$dir" ]; then - ( - cd "$dir" || return 1 - if [ -f "index.html" ]; then - rm -f index.html - fi - if [ -f "index.org" ]; then - emacs --batch -l ~/.emacs --visit=index.org --funcall=org-html-export-to-html --kill + local org_file=$1 + local dir=$(dirname "$org_file") + + ( + cd "$dir" || return 1 + local html_file="index.html" + + # Remove existing index.html if it exists + if [ -f "$html_file" ]; then + rm -f "$html_file" + fi + + # Export org to html + if [ -f "index.org" ]; then + echo "Exporting: $dir/index.org → $html_file" + emacs --batch -l ~/.emacs --visit=index.org --funcall=org-html-export-to-html --kill + if [ $? -eq 0 ]; then + echo "✓ Successfully exported $dir" else - echo "Warning: index.org not found in $dir" + echo "✗ Failed to export $dir" fi - ) - else - echo "Warning: Directory $dir not found, skipping..." - fi + else + echo "Warning: index.org not found in $dir" + fi + ) } +echo "🔍 Searching for index.org files recursively..." +echo "=======================================" -# Export org to html for the main index -export_org_to_html "." +# Find all index.org files recursively (including current directory) +# Use -path to match exactly "*/index.org" pattern +mapfile -t ORG_FILES < <(find . -type f -path "*/index.org" | sort) -# 2D graphics -export_org_to_html "2D GFX/Animations" -export_org_to_html "2D GFX/Fractals" -export_org_to_html "2D GFX/Spirals" -export_org_to_html "2D GFX/Textures" +if [ ${#ORG_FILES[@]} -eq 0 ]; then + echo "❌ No index.org files found!" + echo "" + echo "Press ENTER to close this window." + read + exit 1 +fi -export_org_to_html "3D GFX/3D Synthezier/doc" -export_org_to_html "3D GFX/Miscellaneous" -export_org_to_html "3D GFX/Space" +echo "Found ${#ORG_FILES[@]} index.org file(s):" +printf '%s\n' "${ORG_FILES[@]}" +echo "=======================================" -export_org_to_html "Math/Plotting" -export_org_to_html "Math/Simulation" -export_org_to_html "Math/Truth table" +# Export all found org files +SUCCESS_COUNT=0 +FAILED_COUNT=0 -export_org_to_html "Miscellaneous/Mouse driver" +for org_file in "${ORG_FILES[@]}"; do + export_org_to_html "$org_file" + if [ $? -eq 0 ]; then + ((SUCCESS_COUNT++)) + else + ((FAILED_COUNT++)) + fi +done -export_org_to_html "Networking/Digital data over analog audio" -export_org_to_html "Networking/LPT communication driver" +echo "=======================================" +echo "📊 SUMMARY:" +echo " ✓ Successful: $SUCCESS_COUNT" +echo " ✗ Failed: $FAILED_COUNT" +echo " Total: $((SUCCESS_COUNT + FAILED_COUNT))" +echo "" -# Upload project homepage to the server. -rsync -avz --delete -e 'ssh -p 10006' ./ \ +# Upload project homepage to the server (same as before) +echo "📤 Uploading to server..." +rsync -avz --delete -e 'ssh -p 10006' ./ \ --include="*/" \ --include="*.html" \ --include="*.png" \ @@ -60,7 +86,12 @@ rsync -avz --delete -e 'ssh -p 10006' ./ \ --exclude="*" \ n0@www3.svjatoslav.eu:/mnt/big/projects/qbasicapps/ +if [ $? -eq 0 ]; then + echo "✓ Upload completed successfully!" +else + echo "✗ Upload failed!" +fi echo "" echo "Press ENTER to close this window." -read +read \ No newline at end of file diff --git a/Tutorial/index.html b/Tutorial/index.html deleted file mode 100644 index 459b8ee..0000000 --- a/Tutorial/index.html +++ /dev/null @@ -1,16 +0,0 @@ - -QBasic tutorial - - - -

QBasic tutorial

-
-
-
QBasic tutorial. -Is a good for those who like to learn by example. -Package contains a lot of tiny self explainatory -examples quiding you from simplest operations like printing -to console, functions and array access to 2D and 3D graphics. -
Used those successfully as examples when teaching programming for beginners. - - \ No newline at end of file