From: Svjatoslav Agejenko Date: Wed, 30 Jul 2025 09:25:25 +0000 (+0300) Subject: Describe windowing system and networking. X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=31cc583378fe254eba00080952ca60fbbcb17db3;p=qbasicapps.git Describe windowing system and networking. --- diff --git a/2D GFX/Fractals/index.html b/2D GFX/Fractals/index.html index f435ae9..14c08e3 100644 --- a/2D GFX/Fractals/index.html +++ b/2D GFX/Fractals/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Fractals @@ -210,11 +210,11 @@

Table of Contents

@@ -236,8 +236,8 @@ -
-

1. Fractal circles

+
+

1. Fractal circles

This QBasic program generates a visually captivating spiral fractal @@ -247,7 +247,7 @@ geometry, recursive programming, and graphical design.

-
+

fractal%20circles.png

@@ -266,8 +266,8 @@ indefinitely.
-
-

2. Fractal circles animated

+
+

2. Fractal circles animated

This QBasic program creates an animated fractal composed of circles, @@ -287,29 +287,29 @@ system to control the animation's progression.

-
-

3. Fractal of squares

+
+

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

+
+

4. Fractal of squares animated

This QBasic program generates an animated fractal pattern composed of @@ -331,8 +331,8 @@ resulting in a dynamic and ever-changing geometric pattern.

-
-

5. Fractal of trees

+
+

5. Fractal of trees

QBasic program that generates a visually appealing fractal tree @@ -355,7 +355,7 @@ resembles a tree, with branches that grow and change over time.

-

Created: 2025-07-30 ke 01:26

+

Created: 2025-07-30 ke 08:54

Validate

diff --git a/2D GFX/Spirals/index.html b/2D GFX/Spirals/index.html index 1fe8864..3508025 100644 --- a/2D GFX/Spirals/index.html +++ b/2D GFX/Spirals/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Spiral series @@ -210,12 +210,12 @@

Table of Contents

@@ -236,11 +236,11 @@ } -
-

1. Spiral with increasing density

+
+

1. Spiral with increasing density

-
+

spiral.png

@@ -320,11 +320,11 @@ userInput$ = INPUT$(1)
-
-

2. Spiral with varying height

+
+

2. Spiral with varying height

-
+

spiral, 2.png

@@ -391,11 +391,11 @@ a$ = INPUT$(1)
-
-

3. Shaded spiral

+
+

3. Shaded spiral

-
+

spiral, 3.png

@@ -497,8 +497,8 @@ a$ = INPUT$(1)
-
-

4. Sphere forming spiral

+
+

4. Sphere forming spiral

Similar to previous spiral, Line segments are connected between the @@ -507,7 +507,7 @@ multiple linked spherical shapes. Initially point cloud in shown:

-
+

spiral, 4, 1.png

@@ -517,7 +517,7 @@ In the next step, points are connected using lines:

-
+

spiral, 4, 2.png

@@ -622,11 +622,11 @@ a$ = INPUT$(1)
-
-

5. Textured spherical spiral

+
+

5. Textured spherical spiral

-
+

spiral, 5.png

@@ -749,11 +749,11 @@ a$ = INPUT$(1)
-
-

6. Textured and shaded spherical spiral

+
+

6. Textured and shaded spherical spiral

-
+

spiral, 6.png

@@ -937,7 +937,7 @@ yStep2 = (oppositePointY2 - oppositePointY1) / stepCount
-

Created: 2025-07-30 ke 01:26

+

Created: 2025-07-30 ke 08:54

Validate

diff --git a/2D GFX/Textures/index.html b/2D GFX/Textures/index.html index 5673da2..913d1b4 100644 --- a/2D GFX/Textures/index.html +++ b/2D GFX/Textures/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Algorithmic textures @@ -210,11 +210,11 @@

Table of Contents

@@ -233,8 +233,8 @@ } -
-

1. Circular waves

+
+

1. Circular waves

This QBasic program creates visually captivating circular wave @@ -313,8 +313,8 @@ algorithms can produce intricate and visually appealing results.

-
-

2. Diamond square clouds

+
+

2. Diamond square clouds

This QBasic program demonstrates the Diamond-Square algorithm, a @@ -429,8 +429,8 @@ WAITa$ = INPUT$(1)

-
-

3. Old paper

+
+

3. Old paper

This QBasic program generates a procedural texture that simulates the @@ -527,8 +527,8 @@ inputKey$ = INPUT$(1)

-
-

4. Wood

+
+

4. Wood

This QBasic program creates a visually appealing simulation of a wood @@ -622,8 +622,8 @@ exitKey$ = INPUT$(1)

-
-

5. Yellow flame

+
+

5. Yellow flame

"Yellow Flame" is a visually captivating program written in QBasic @@ -702,7 +702,7 @@ userInput$ = INPUT$(1)

-

Created: 2025-07-30 ke 01:27

+

Created: 2025-07-30 ke 08:54

Validate

diff --git a/3D GFX/3D Synthezier/doc/index.html b/3D GFX/3D Synthezier/doc/index.html index 3c57508..1e0b353 100644 --- a/3D GFX/3D Synthezier/doc/index.html +++ b/3D GFX/3D Synthezier/doc/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + 3D Synthezier @@ -1103,39 +1103,39 @@ hsAddReviewPanels();

Table of Contents

@@ -1157,8 +1157,8 @@ hsAddReviewPanels(); -
-

1. Operating principle

+
+

1. Operating principle

Parses scene definition language and creates 3D world based on @@ -1221,60 +1221,60 @@ They were produced by importing generated -

1.1. Rectangular city

+
+

1.1. Rectangular city

-
+

rectangular city, 1.jpeg

-
+

rectangular city, 2.jpeg

-
+

rectangular city, 3.jpeg

-
-

1.2. Hexagonal city

+
+

1.2. Hexagonal city

-
+

hexagonal city, 1.jpeg

-
+

hexagonal city, 2.jpeg

-
+

hexagonal city, 3.jpeg

-
-

2. Scene description language

+
+

2. Scene description language

See also examples.

-
-

2.1. here

+
+

2.1. here

 here
@@ -1285,8 +1285,8 @@ defines new segment
 

-
-

2.2. p

+
+

2.2. p

 p  x y z
@@ -1297,8 +1297,8 @@ defines new point
 

-
-

2.3. f

+
+

2.3. f

 f  p1 p2 p3 p4
@@ -1309,8 +1309,8 @@ defines new polygon,  p4  may be unused
 

-
-

2.4. warn

+
+

2.4. warn

 warn  <message>
@@ -1321,8 +1321,8 @@ displays warning message, and wait for key
 

-
-

2.5. end

+
+

2.5. end

 end
@@ -1333,8 +1333,8 @@ terminates parser
 

-
-

2.6. mtl

+
+

2.6. mtl

 mtl  material
@@ -1345,8 +1345,8 @@ selects material
 

-
-

2.7. mtlrnd

+
+

2.7. mtlrnd

 mtlrnd  material ...
@@ -1357,8 +1357,8 @@ selects random material from list
 

-
-

2.8. obj

+
+

2.8. obj

 obj  object xz45 xy20 x+3 y*2
@@ -1373,14 +1373,14 @@ directly from file, and not chached, to allow loading of greater than
 

-
+

rotation.png

-
-

2.9. rnd

+
+

2.9. rnd

 rnd  p^1^2^3 p^7^2^1
@@ -1391,8 +1391,8 @@ select random command to execute, ^ will be converted to spaces.
 

-
-

2.10. #

+
+

2.10. #

 # whatever text
@@ -1403,8 +1403,8 @@ comment
 

-
-

2.11. out

+
+

2.11. out

 out  file
@@ -1415,8 +1415,8 @@ specify output file name, must be first command
 

-
-

2.12. set

+
+

2.12. set

 set  variable  contents
@@ -1428,8 +1428,8 @@ string. max variables is 100. first is 0.
 

-
-

2.13. variables usage

+
+

2.13. variables usage

 anycommand %1 anything
@@ -1440,8 +1440,8 @@ inserts variable 1 contents info line
 

-
-

2.14. cmp

+
+

2.14. cmp

 cmp  flag string1 string2
@@ -1452,8 +1452,8 @@ compares strings, and inserts TRUE to flag, if they are equal, else inserts FALS
 

-
-

2.15. ?

+
+

2.15. ?

 ?flag anycommand
@@ -1468,8 +1468,8 @@ exapmle: ?3 obj car z*2 xy45
 

-
-

2.16. dum

+
+

2.16. dum

 dum
@@ -1482,16 +1482,16 @@ dummy function, does notheing
 
-
-

3. Installation

+
+

3. Installation

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

-
-

3.1. System requirements

+
+

3.1. System requirements

@@ -1522,8 +1522,8 @@ Edit bin/3dparse.bas file and update include path in there. -
-

3.2. Directory layout

+
+

3.2. Directory layout

bin
@@ -1540,8 +1540,8 @@ Edit bin/3dparse.bas file and update include path in there.
-
-

4. Usage

+
+

4. Usage

Make sure you have QB binaries in your PATH. Execute @@ -1566,7 +1566,7 @@ Visualize scene with your favourite renderer.

-

Created: 2025-07-30 ke 01:28

+

Created: 2025-07-30 ke 08:55

Validate

diff --git a/3D GFX/Miscellaneous/index.html b/3D GFX/Miscellaneous/index.html index 7b85e61..69acd20 100644 --- a/3D GFX/Miscellaneous/index.html +++ b/3D GFX/Miscellaneous/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Miscellaneous 3D graphics demos @@ -210,14 +210,14 @@

Table of Contents

@@ -238,8 +238,8 @@ } -
-

1. Rotating exclamation mark

+
+

1. Rotating exclamation mark

Wireframe 3D model of a rotating exclamation mark. @@ -258,8 +258,8 @@ Wireframe 3D model of a rotating exclamation mark.

-
-

2. 3D bouncing ball

+
+

2. 3D bouncing ball

This QBasic program creates a visually engaging 3D animation of a @@ -280,8 +280,8 @@ of early computer graphics techniques.

-
-

3. 3D text in a room

+
+

3. 3D text in a room

Wireframe 3D text hanging in a wireframe 3D room. User can look and @@ -301,8 +301,8 @@ fly around in all directions.

-
-

4. 3D bouncing cubes on grid floor

+
+

4. 3D bouncing cubes on grid floor

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

-
-

5. Matrix math for rotation in 3D space

+
+

5. Matrix math for rotation in 3D space

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

-
-

6. Maze explorer

+
+

6. Maze explorer

The Evolving 3D Maze Explorer is a QBasic program that generates and @@ -355,7 +355,7 @@ changes as they navigate through it.

-
+

Maze%20explorer.png

@@ -366,8 +366,8 @@ changes as they navigate through it.
-
-

7. Tank animation

+
+

7. Tank animation

Animated tank driving through the bridge back and forward. User can @@ -387,8 +387,8 @@ look and fly around in all directions.

-
-

8. Tiled room

+
+

8. Tiled room

Room with some tiles on the wall and on the floor. User can freely fly @@ -409,7 +409,7 @@ around.

-

Created: 2025-07-30 ke 01:28

+

Created: 2025-07-30 ke 08:55

Validate

diff --git a/3D GFX/Space/index.html b/3D GFX/Space/index.html index b4d79a4..7355761 100644 --- a/3D GFX/Space/index.html +++ b/3D GFX/Space/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Space themed 3D graphics @@ -210,10 +210,10 @@

Table of Contents

@@ -234,8 +234,8 @@ } -
-

1. Galaxy explorer

+
+

1. Galaxy explorer

This QBasic program renders a navigable 3D point cloud galaxy, @@ -245,7 +245,7 @@ galaxy with stars distributed in a spiral pattern.

-
+

Galaxy%20explorer.png

@@ -256,8 +256,8 @@ galaxy with stars distributed in a spiral pattern.
-
-

2. Rocket simulator

+
+

2. Rocket simulator

QBasic program that simulates the takeoff and flight of a rocket from @@ -279,8 +279,8 @@ observe the rocket's trajectory from various angles.

-
-

3. Stars

+
+

3. Stars

The 3D Starfield Simulation is a QBasic program that creates a @@ -320,8 +320,8 @@ based on its distance, with closer stars appearing brighter.

-
-

4. Universe explorer

+
+

4. Universe explorer

This QBasic program that simulates a navigable 3D universe. Users can @@ -358,19 +358,19 @@ limiting the number of rendered objects based on distance. -

+

1.png

-
+

2.png

-
+

3.png

@@ -382,7 +382,7 @@ limiting the number of rendered objects based on distance.
-

Created: 2025-07-30 ke 01:28

+

Created: 2025-07-30 ke 08:56

Validate

diff --git a/Math/Plotting/index.html b/Math/Plotting/index.html index 13be060..ff4d269 100644 --- a/Math/Plotting/index.html +++ b/Math/Plotting/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Plotting @@ -210,10 +210,10 @@

Table of Contents

@@ -234,8 +234,8 @@ } -
-

1. 2D graph

+
+

1. 2D graph

The 2D Graph Plotter is a simple yet effective program written in @@ -251,7 +251,7 @@ based on a user-defined mathematical function.

-
+

2D%20graph%20plot.png

@@ -262,8 +262,8 @@ based on a user-defined mathematical function.
-
-

2. 3D graph

+
+

2. 3D graph

The 3D Heightmap Explorer is a QBasic program designed to visualize @@ -299,7 +299,7 @@ grid.

-
+

3D%20graph.png

@@ -310,8 +310,8 @@ grid.
-
-

3. Deriviative calculator

+
+

3. Deriviative calculator

This QBasic program is designed to compute and plot an arbitrary @@ -324,7 +324,7 @@ visualized.

-
+

Deriviative%20calculator.png

@@ -335,8 +335,8 @@ visualized.
-
-

4. Sine and cosine table

+
+

4. Sine and cosine table

The SIN & COS Table Generator is a QBasic program designed to visually @@ -346,7 +346,7 @@ visual representation of these fundamental trigonometric functions.

-
+

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

@@ -358,7 +358,7 @@ visual representation of these fundamental trigonometric functions.
-

Created: 2025-07-30 ke 01:28

+

Created: 2025-07-30 ke 08:56

Validate

diff --git a/Math/Simulation/index.html b/Math/Simulation/index.html index 9bf6f7a..d446fdb 100644 --- a/Math/Simulation/index.html +++ b/Math/Simulation/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Simulation @@ -210,14 +210,14 @@

Table of Contents

@@ -238,8 +238,8 @@ } -
-

1. Explosion simulator

+
+

1. Explosion simulator

This QBasic program simulates the propagation of shock waves in a gas @@ -265,7 +265,7 @@ conditions by setting velocities to zero at wall boundaries.

-
+

Explosion%20simulator.png

@@ -276,8 +276,8 @@ conditions by setting velocities to zero at wall boundaries.
-
-

2. Gravity in 2D

+
+

2. Gravity in 2D

The Gravitation Simulation program is a simple yet insightful QBasic @@ -289,7 +289,7 @@ educational tool for understanding basic orbital mechanics.

-
+

Gravity%20in%202D.png

@@ -300,8 +300,8 @@ educational tool for understanding basic orbital mechanics.
-
-

3. Gravity in 3D

+
+

3. Gravity in 3D

This QBasic program simulates the gravitational interactions between @@ -335,8 +335,8 @@ will reach stable configuration.

-
-

4. Interference

+
+

4. Interference

This QBasic program simulates the interference pattern created by two @@ -364,8 +364,8 @@ displayed as a third waveform.

-
-

5. Interferogram

+
+

5. Interferogram

This QBasic program simulates the interference pattern created by @@ -375,7 +375,7 @@ used in physics and engineering to analyze wave interactions.

-
+

Interferogram.png

@@ -386,8 +386,8 @@ used in physics and engineering to analyze wave interactions.
-
-

6. Surface tension

+
+

6. Surface tension

This QBasic program simulates the behavior of water spills and the @@ -411,7 +411,7 @@ water cell if surrounded by a high density of water cells.

-
+

Surface%20tension.png

@@ -422,8 +422,8 @@ water cell if surrounded by a high density of water cells.
-
-

7. Wave 1

+
+

7. Wave 1

This QBasic program simulates the propagation of waves across a @@ -439,7 +439,7 @@ loss.

-
+

Wave%201.png

@@ -450,8 +450,8 @@ loss.
-
-

8. Wave 2

+
+

8. Wave 2

This QBasic program simulates and visualizes the behavior of water @@ -463,7 +463,7 @@ understanding wave mechanics.

-
+

Wave%202.png

@@ -475,7 +475,7 @@ understanding wave mechanics.
-

Created: 2025-07-30 ke 01:29

+

Created: 2025-07-30 ke 08:56

Validate

diff --git a/Math/Truth table/index.html b/Math/Truth table/index.html index 27ee4b5..ca59ad0 100644 --- a/Math/Truth table/index.html +++ b/Math/Truth table/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Truth table calculator @@ -1103,20 +1103,20 @@ hsAddReviewPanels();

Table of Contents

@@ -1133,12 +1133,12 @@ the input variables, with the corresponding output value. Truth tables are cruci designing and understanding digital circuits, Boolean algebra, and logical expressions.

-
-

1. Implemented logical operations

+
+

1. Implemented logical operations

-
-

1.1. Equivalent ( ⇔ , 1 )

+
+

1.1. Equivalent ( ⇔ , 1 )

The equivalent operation, also known as logical biconditional, is true if and only if @@ -1196,8 +1196,8 @@ Truth Table:

-
-

1.2. Implies ( ⇒ , 2 )

+
+

1.2. Implies ( ⇒ , 2 )

An implication asserts that if the first proposition is true, the @@ -1255,8 +1255,8 @@ Truth table:

-
-

1.3. OR ( ∨ , 3 )

+
+

1.3. OR ( ∨ , 3 )

The OR operation, also known as logical disjunction, is true if at @@ -1314,8 +1314,8 @@ Truth table:

-
-

1.4. AND ( ∧ , 4 )

+
+

1.4. AND ( ∧ , 4 )

The AND operation, also known as logical conjunction, is true if and @@ -1372,8 +1372,8 @@ Truth table:

-
-

1.5. NOT ( ¬ , 5 )

+
+

1.5. NOT ( ¬ , 5 )

The NOT operation, also known as logical negation, inverts the value @@ -1414,12 +1414,12 @@ Truth Table:

-
-

2. Examples

+
+

2. Examples

-
-

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

+
+

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

@@ -1502,8 +1502,8 @@ Truth Table: -
-

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

+
+

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

@@ -1586,8 +1586,8 @@ Truth Table: -
-

2.3. Example: (A ⇔ B) ∧ C

+
+

2.3. Example: (A ⇔ B) ∧ C

Truth Table: @@ -1676,7 +1676,7 @@ Truth Table:

-

Created: 2025-07-30 ke 01:30

+

Created: 2025-07-30 ke 08:57

Validate

diff --git a/Miscellaneous/Mouse driver/index.html b/Miscellaneous/Mouse driver/index.html index 3e67a5a..678471b 100644 --- a/Miscellaneous/Mouse driver/index.html +++ b/Miscellaneous/Mouse driver/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Mouse driver for QBasic programs @@ -210,16 +210,16 @@

Table of Contents

-
-

1. Overview

+
+

1. Overview

QBasic, a popular programming language in the DOS era, lacks native @@ -230,8 +230,8 @@ workaround that allows QBasic to use mouse input.

-
-

2. High-level idea

+
+

2. High-level idea

Workaround to access mouse involves a Terminate and Stay Resident @@ -264,8 +264,8 @@ TSR keeps updating it with latest mouse state simultaneously.

-
-

3. Terminate and Stay Resident module

+
+

3. Terminate and Stay Resident module

A DOS TSR program that hooks into the system's interrupt mechanism to @@ -280,12 +280,79 @@ Files:

  • qbext.asm - x86 Assembly source code
  • qbext.com - binary COM executable for DOS
  • + + +

    +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

    +
    +

    4. QBasic demonstration program

    A QBasic program that reads mouse data from the memory location @@ -295,7 +362,7 @@ clicks. -

    +

    screenshot.png

    @@ -303,11 +370,20 @@ clicks.

    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-07-30 ke 01:30

    +

    Created: 2025-07-30 ke 08:57

    Validate

    diff --git a/Miscellaneous/Windowing system.bas b/Miscellaneous/Windowing system.bas new file mode 100755 index 0000000..ff0d067 --- /dev/null +++ b/Miscellaneous/Windowing system.bas @@ -0,0 +1,274 @@ +' Text mode windowing system. Each window can display text file. +' Window content can be scrolled horizontally and vertically. +' Window can have arbitrary size and location on the screen. +' +' 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 +' 2024-2025, Improved program readability + +DECLARE SUB demo () +DECLARE FUNCTION GetLineFromWindow$ (windowNum%, lineNum%) +DECLARE SUB LoadFileIntoWindow (fileName$, windowNum%) +DECLARE SUB SendLineToWindow (windowNum%, lineNum%, newString$) +DECLARE FUNCTION GetFreeLineIndex% () +DECLARE SUB RefreshAllWindows () +DECLARE FUNCTION AddWindow% (x%, y%, widt%, haigh%, title$) +DECLARE SUB DrawBox (x%, y%, widt%, haigh%, edgeStyle$) +DEFINT A-Z +DECLARE SUB ShowWindow (windowNum) +DECLARE SUB InitializeSystem () + +' Global variables for text storage +DIM SHARED maxStorage% +maxStorage% = 5000 +DIM SHARED textStorage$(1 TO maxStorage%) +DIM SHARED storagePointer% + +' Window-related global arrays +DIM SHARED windowData(1 TO 10, 1 TO 1000) ' Stores line indices for each window +DIM SHARED windowX(1 TO 10), windowY(1 TO 10) ' Position of each window +DIM SHARED windowWidth(1 TO 10), windowHeight(1 TO 10) ' Size of each window +DIM SHARED windowActiveStatus(1 TO 10) ' Whether window is active +DIM SHARED windowTitle$(1 TO 10) ' Title of each window + +' Window scrolling/shifting +DIM SHARED windowShiftX(1 TO 10) ' Horizontal shift +DIM SHARED windowShiftY(1 TO 10) ' Vertical shift + +DIM SHARED currentActiveWindow% ' Currently active window for display + +InitializeSystem + +demo + +FUNCTION AddWindow% (x%, y%, widt%, heigh%, title$) + ' Adds a new window to the system + + ' Find an empty window slot + FOR windowNum% = 1 TO 10 + IF windowActiveStatus(windowNum%) = 0 THEN + foundWindow% = windowNum% + GOTO FoundEmptySlot + END IF + NEXT windowNum% + +FoundEmptySlot: + ' Initialize the window properties + windowActiveStatus(foundWindow%) = 1 + windowX(foundWindow%) = x% + windowY(foundWindow%) = y% + windowWidth(foundWindow%) = widt% + windowHeight(foundWindow%) = heigh% + windowTitle$(foundWindow%) = title$ + + ' Return the window number + AddWindow% = foundWindow% +END FUNCTION + +SUB ClearWindowContent (windowNum%) + ' Clears all content from a window + + FOR lineNum% = 1 TO 1000 + IF windowData(windowNum%, lineNum%) > 0 THEN + textStorage$(windowData(windowNum%, lineNum%)) = "" + windowData(windowNum%, lineNum%) = 0 + END IF + NEXT lineNum% +END SUB + +SUB demo + ' Create three windows with different sizes and titles + window1% = AddWindow%(1, 1, 30, 10, "window 1.") + window2% = AddWindow%(1, 12, 80, 30, "second window") + window3% = AddWindow%(31, 2, 30, 10, "last window") + + ' Load the same file into all windows + LoadFileIntoWindow "wsystem.bas", window2% + LoadFileIntoWindow "wsystem.bas", window1% + LoadFileIntoWindow "wsystem.bas", window3% + +AnimateWindows: + ' Randomly select an active window to animate + currentActiveWindow% = INT(RND * 3) + 1 + RefreshAllWindows + + ' Animate the windows by shifting their content + FOR animationFrame% = 1 TO 100 + windowShiftX(currentActiveWindow%) = SIN(animationFrame% / 10) * 10 + 10 + windowShiftY(currentActiveWindow%) = animationFrame% + ShowWindow currentActiveWindow% + ' split-second delay + SOUND 0, 1 + IF INKEY$ <> "" THEN SYSTEM + NEXT animationFrame% + + GOTO AnimateWindows +END SUB + +FUNCTION GetFreeLineIndex% + ' Finds a free line in text storage + +FindNextLine: + IF storagePointer% > 1000 THEN + storagePointer% = 1 + END IF + + IF textStorage$(storagePointer%) = "" THEN + GetFreeLineIndex% = storagePointer% + storagePointer% = storagePointer% + 1 + ELSE + storagePointer% = storagePointer% + 1 + GOTO FindNextLine + END IF +END FUNCTION + +FUNCTION GetLineFromWindow$ (windowNum%, lineNum%) + ' Retrieve a line from a window's memory + + IF windowData(windowNum%, lineNum%) = 0 THEN + GetLineFromWindow$ = "" + ELSE + GetLineFromWindow$ = textStorage$(windowData(windowNum%, lineNum%)) + END IF +END FUNCTION + +SUB LoadFileIntoWindow (fileName$, windowNum%) + ' Load a file into a window's memory + + OPEN fileName$ FOR INPUT AS #1 + FOR lineNum% = 1 TO 1000 + IF EOF(1) <> 0 THEN + GOTO FileLoaded + END IF + LINE INPUT #1, lineContent$ + SendLineToWindow windowNum%, lineNum%, lineContent$ + NEXT lineNum% + +FileLoaded: + CLOSE #1 + + ' Fill the remaining lines with empty strings + FOR blankLineNum% = lineNum% TO 1000 + SendLineToWindow windowNum%, blankLineNum%, "" + NEXT blankLineNum% +END SUB + +SUB RefreshAllWindows + ' Redraw all active windows + + CLS + FOR windowNum% = 1 TO 10 + IF windowActiveStatus(windowNum%) > 0 THEN + ShowWindow windowNum% + END IF + NEXT windowNum% +END SUB + +SUB SendLineToWindow (windowNum%, lineNum%, newString$) + ' Stores a string in a window's memory + + lineContent$ = newString$ + + ' Remove trailing spaces from the string + IF lineContent$ = SPACE$(LEN(lineContent$)) THEN + lineContent$ = "" + END IF + + IF LEN(lineContent$) > 0 THEN +TrimRight: + IF RIGHT$(lineContent$, 1) = " " THEN + lineContent$ = LEFT$(lineContent$, LEN(lineContent$) - 1) + GOTO TrimRight + END IF + END IF + + ' Update the window memory with the new string + IF lineContent$ = "" THEN + IF windowData(windowNum%, lineNum%) > 0 THEN + textStorage$(windowData(windowNum%, lineNum%)) = "": windowData(windowNum%, lineNum%) = 0 + END IF + ELSE + IF windowData(windowNum%, lineNum%) = 0 THEN + windowData(windowNum%, lineNum%) = GetFreeLineIndex% + END IF + textStorage$(windowData(windowNum%, lineNum%)) = lineContent$ + END IF +END SUB + +SUB ShowWindow (windowNum%) + ' Draws a window on the screen + + ' Determine background color based on active window + IF windowNum% = currentActiveWindow% THEN + bgColor% = 1 + ELSE + bgColor% = 0 + END IF + + x% = windowX(windowNum%) + y% = windowY(windowNum%) + widt% = windowWidth(windowNum%) + heigh% = windowHeight(windowNum%) + title$ = windowTitle$(windowNum%) + + COLOR 11, bgColor% + + ' Create border components + FOR borderSegment% = 1 TO widt% - 2 + topBottom$ = topBottom$ + CHR$(205) + NEXT borderSegment% + borderTop$ = CHR$(201) + topBottom$ + CHR$(187) + borderBottom$ = CHR$(200) + topBottom$ + CHR$(188) + + ' Draw top border + LOCATE y%, x% + PRINT borderTop$ + + ' Draw bottom border + LOCATE y% + heigh% - 1, x% + PRINT borderBottom$ + + ' Draw window content + FOR lineNum% = 1 TO heigh% - 2 + LOCATE y% + lineNum%, x% + lineContent$ = GetLineFromWindow$(windowNum%, lineNum% + windowShiftY(windowNum%)) + lineContent$ = lineContent$ + SPACE$(300) + lineContent$ = RIGHT$(lineContent$, LEN(lineContent$) - windowShiftX(windowNum%)) + lineContent$ = LEFT$(lineContent$, widt% - 2) + PRINT CHR$(186) + lineContent$ + CHR$(186) + NEXT lineNum% + + ' Draw window title + titleX% = INT(x% + (widt% / 2) - (LEN(title$) / 2) - 2) + LOCATE y%, titleX% + PRINT "[ " + titleX% = titleX% + 2 + + COLOR 10 + LOCATE y%, titleX% + PRINT title$ + + titleX% = titleX% + LEN(title$) + COLOR 11 + LOCATE y%, titleX% + PRINT " ]" + COLOR 7, 0 +END SUB + +SUB InitializeSystem + ' Initialize the screen and shared memory + + WIDTH 80, 50 + VIEW PRINT 1 TO 50 + + FOR storageIndex% = 1 TO maxStorage% + textStorage$(storageIndex%) = "" + NEXT storageIndex% + + storagePointer% = 1 +END SUB \ No newline at end of file diff --git a/Miscellaneous/Windowing system.webm b/Miscellaneous/Windowing system.webm new file mode 100644 index 0000000..1a456bb Binary files /dev/null and b/Miscellaneous/Windowing system.webm differ diff --git a/Miscellaneous/windowing system.bas b/Miscellaneous/windowing system.bas deleted file mode 100755 index ff0d067..0000000 --- a/Miscellaneous/windowing system.bas +++ /dev/null @@ -1,274 +0,0 @@ -' Text mode windowing system. Each window can display text file. -' Window content can be scrolled horizontally and vertically. -' Window can have arbitrary size and location on the screen. -' -' 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 -' 2024-2025, Improved program readability - -DECLARE SUB demo () -DECLARE FUNCTION GetLineFromWindow$ (windowNum%, lineNum%) -DECLARE SUB LoadFileIntoWindow (fileName$, windowNum%) -DECLARE SUB SendLineToWindow (windowNum%, lineNum%, newString$) -DECLARE FUNCTION GetFreeLineIndex% () -DECLARE SUB RefreshAllWindows () -DECLARE FUNCTION AddWindow% (x%, y%, widt%, haigh%, title$) -DECLARE SUB DrawBox (x%, y%, widt%, haigh%, edgeStyle$) -DEFINT A-Z -DECLARE SUB ShowWindow (windowNum) -DECLARE SUB InitializeSystem () - -' Global variables for text storage -DIM SHARED maxStorage% -maxStorage% = 5000 -DIM SHARED textStorage$(1 TO maxStorage%) -DIM SHARED storagePointer% - -' Window-related global arrays -DIM SHARED windowData(1 TO 10, 1 TO 1000) ' Stores line indices for each window -DIM SHARED windowX(1 TO 10), windowY(1 TO 10) ' Position of each window -DIM SHARED windowWidth(1 TO 10), windowHeight(1 TO 10) ' Size of each window -DIM SHARED windowActiveStatus(1 TO 10) ' Whether window is active -DIM SHARED windowTitle$(1 TO 10) ' Title of each window - -' Window scrolling/shifting -DIM SHARED windowShiftX(1 TO 10) ' Horizontal shift -DIM SHARED windowShiftY(1 TO 10) ' Vertical shift - -DIM SHARED currentActiveWindow% ' Currently active window for display - -InitializeSystem - -demo - -FUNCTION AddWindow% (x%, y%, widt%, heigh%, title$) - ' Adds a new window to the system - - ' Find an empty window slot - FOR windowNum% = 1 TO 10 - IF windowActiveStatus(windowNum%) = 0 THEN - foundWindow% = windowNum% - GOTO FoundEmptySlot - END IF - NEXT windowNum% - -FoundEmptySlot: - ' Initialize the window properties - windowActiveStatus(foundWindow%) = 1 - windowX(foundWindow%) = x% - windowY(foundWindow%) = y% - windowWidth(foundWindow%) = widt% - windowHeight(foundWindow%) = heigh% - windowTitle$(foundWindow%) = title$ - - ' Return the window number - AddWindow% = foundWindow% -END FUNCTION - -SUB ClearWindowContent (windowNum%) - ' Clears all content from a window - - FOR lineNum% = 1 TO 1000 - IF windowData(windowNum%, lineNum%) > 0 THEN - textStorage$(windowData(windowNum%, lineNum%)) = "" - windowData(windowNum%, lineNum%) = 0 - END IF - NEXT lineNum% -END SUB - -SUB demo - ' Create three windows with different sizes and titles - window1% = AddWindow%(1, 1, 30, 10, "window 1.") - window2% = AddWindow%(1, 12, 80, 30, "second window") - window3% = AddWindow%(31, 2, 30, 10, "last window") - - ' Load the same file into all windows - LoadFileIntoWindow "wsystem.bas", window2% - LoadFileIntoWindow "wsystem.bas", window1% - LoadFileIntoWindow "wsystem.bas", window3% - -AnimateWindows: - ' Randomly select an active window to animate - currentActiveWindow% = INT(RND * 3) + 1 - RefreshAllWindows - - ' Animate the windows by shifting their content - FOR animationFrame% = 1 TO 100 - windowShiftX(currentActiveWindow%) = SIN(animationFrame% / 10) * 10 + 10 - windowShiftY(currentActiveWindow%) = animationFrame% - ShowWindow currentActiveWindow% - ' split-second delay - SOUND 0, 1 - IF INKEY$ <> "" THEN SYSTEM - NEXT animationFrame% - - GOTO AnimateWindows -END SUB - -FUNCTION GetFreeLineIndex% - ' Finds a free line in text storage - -FindNextLine: - IF storagePointer% > 1000 THEN - storagePointer% = 1 - END IF - - IF textStorage$(storagePointer%) = "" THEN - GetFreeLineIndex% = storagePointer% - storagePointer% = storagePointer% + 1 - ELSE - storagePointer% = storagePointer% + 1 - GOTO FindNextLine - END IF -END FUNCTION - -FUNCTION GetLineFromWindow$ (windowNum%, lineNum%) - ' Retrieve a line from a window's memory - - IF windowData(windowNum%, lineNum%) = 0 THEN - GetLineFromWindow$ = "" - ELSE - GetLineFromWindow$ = textStorage$(windowData(windowNum%, lineNum%)) - END IF -END FUNCTION - -SUB LoadFileIntoWindow (fileName$, windowNum%) - ' Load a file into a window's memory - - OPEN fileName$ FOR INPUT AS #1 - FOR lineNum% = 1 TO 1000 - IF EOF(1) <> 0 THEN - GOTO FileLoaded - END IF - LINE INPUT #1, lineContent$ - SendLineToWindow windowNum%, lineNum%, lineContent$ - NEXT lineNum% - -FileLoaded: - CLOSE #1 - - ' Fill the remaining lines with empty strings - FOR blankLineNum% = lineNum% TO 1000 - SendLineToWindow windowNum%, blankLineNum%, "" - NEXT blankLineNum% -END SUB - -SUB RefreshAllWindows - ' Redraw all active windows - - CLS - FOR windowNum% = 1 TO 10 - IF windowActiveStatus(windowNum%) > 0 THEN - ShowWindow windowNum% - END IF - NEXT windowNum% -END SUB - -SUB SendLineToWindow (windowNum%, lineNum%, newString$) - ' Stores a string in a window's memory - - lineContent$ = newString$ - - ' Remove trailing spaces from the string - IF lineContent$ = SPACE$(LEN(lineContent$)) THEN - lineContent$ = "" - END IF - - IF LEN(lineContent$) > 0 THEN -TrimRight: - IF RIGHT$(lineContent$, 1) = " " THEN - lineContent$ = LEFT$(lineContent$, LEN(lineContent$) - 1) - GOTO TrimRight - END IF - END IF - - ' Update the window memory with the new string - IF lineContent$ = "" THEN - IF windowData(windowNum%, lineNum%) > 0 THEN - textStorage$(windowData(windowNum%, lineNum%)) = "": windowData(windowNum%, lineNum%) = 0 - END IF - ELSE - IF windowData(windowNum%, lineNum%) = 0 THEN - windowData(windowNum%, lineNum%) = GetFreeLineIndex% - END IF - textStorage$(windowData(windowNum%, lineNum%)) = lineContent$ - END IF -END SUB - -SUB ShowWindow (windowNum%) - ' Draws a window on the screen - - ' Determine background color based on active window - IF windowNum% = currentActiveWindow% THEN - bgColor% = 1 - ELSE - bgColor% = 0 - END IF - - x% = windowX(windowNum%) - y% = windowY(windowNum%) - widt% = windowWidth(windowNum%) - heigh% = windowHeight(windowNum%) - title$ = windowTitle$(windowNum%) - - COLOR 11, bgColor% - - ' Create border components - FOR borderSegment% = 1 TO widt% - 2 - topBottom$ = topBottom$ + CHR$(205) - NEXT borderSegment% - borderTop$ = CHR$(201) + topBottom$ + CHR$(187) - borderBottom$ = CHR$(200) + topBottom$ + CHR$(188) - - ' Draw top border - LOCATE y%, x% - PRINT borderTop$ - - ' Draw bottom border - LOCATE y% + heigh% - 1, x% - PRINT borderBottom$ - - ' Draw window content - FOR lineNum% = 1 TO heigh% - 2 - LOCATE y% + lineNum%, x% - lineContent$ = GetLineFromWindow$(windowNum%, lineNum% + windowShiftY(windowNum%)) - lineContent$ = lineContent$ + SPACE$(300) - lineContent$ = RIGHT$(lineContent$, LEN(lineContent$) - windowShiftX(windowNum%)) - lineContent$ = LEFT$(lineContent$, widt% - 2) - PRINT CHR$(186) + lineContent$ + CHR$(186) - NEXT lineNum% - - ' Draw window title - titleX% = INT(x% + (widt% / 2) - (LEN(title$) / 2) - 2) - LOCATE y%, titleX% - PRINT "[ " - titleX% = titleX% + 2 - - COLOR 10 - LOCATE y%, titleX% - PRINT title$ - - titleX% = titleX% + LEN(title$) - COLOR 11 - LOCATE y%, titleX% - PRINT " ]" - COLOR 7, 0 -END SUB - -SUB InitializeSystem - ' Initialize the screen and shared memory - - WIDTH 80, 50 - VIEW PRINT 1 TO 50 - - FOR storageIndex% = 1 TO maxStorage% - textStorage$(storageIndex%) = "" - NEXT storageIndex% - - storagePointer% = 1 -END SUB \ No newline at end of file diff --git a/Miscellaneous/windowing system.webm b/Miscellaneous/windowing system.webm deleted file mode 100644 index 1a456bb..0000000 Binary files a/Miscellaneous/windowing system.webm and /dev/null differ diff --git a/Networking/LPT pin control.png b/Networking/LPT pin control.png new file mode 100644 index 0000000..cc6f9a7 Binary files /dev/null and b/Networking/LPT pin control.png differ diff --git a/Networking/Morse.bas b/Networking/Morse.bas new file mode 100755 index 0000000..7d8f3b9 --- /dev/null +++ b/Networking/Morse.bas @@ -0,0 +1,89 @@ +' Plays entered text in morse code audio beeps using PC-speaker. +' 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 +' 2024.08, Improved program readability + +DECLARE SUB say() +DECLARE SUB laus(a$) +DECLARE SUB char(a!) +DIM SHARED mors(0 TO 255, 0 TO 9) +DIM SHARED spd +spd = 1 +CLS + +' Open the Morse code file for reading +OPEN "morse.txt" FOR INPUT AS #1 + +' Label to read each line from the file +2 +IF EOF(1) THEN GOTO 1 +LINE INPUT #1, a$ + +' Process each character in the current line +FOR b = 1 TO LEN(a$) + c = ASC(RIGHT$(LEFT$(a$, b), 1)) + IF b = 1 THEN m = c + IF b > 2 THEN + d = 0 + IF c = ASC(".") THEN d = 1 + IF c = ASC("-") THEN d = 2 + mors(m, b - 2) = d + END IF +NEXT b +GOTO 2 + +' Label to close the file +1 +CLOSE + +' Prompt user for input +PRINT "Type '.bye' to quit" + +' Main loop to read and process user input +3 +PRINT "" +INPUT "", a$ +IF a$ = ".bye" THEN SYSTEM +laus a$ +GOTO 3 + +' Subroutine to play Morse code for a single character +SUB char(a) + PRINT CHR$(a); + + ' Loop through each part of the Morse code sequence + FOR b = 0 TO 9 + IF mors(a, b) = 1 THEN + ' Play short beep for a dot + SOUND 1000, 1 * spd + SOUND 0, 1 * spd + END IF + + IF mors(a, b) = 2 THEN + ' Play long beep for a dash + SOUND 1000, 3 * spd + SOUND 0, 1 * spd + END IF + NEXT b + + ' Short pause between Morse code characters + FOR a = 0 TO 160 + SOUND 0, .1 + NEXT a +END SUB + +' Subroutine to process and play Morse code for an entire string +SUB laus(a$) + ' Loop through each character in the input string + FOR b = 1 TO LEN(a$) + c = ASC(RIGHT$(LEFT$(a$, b), 1)) + + ' Call char subroutine to play Morse code for the current character + char c + NEXT b +END SUB \ No newline at end of file diff --git a/Networking/Morse.png b/Networking/Morse.png new file mode 100644 index 0000000..ce2b441 Binary files /dev/null and b/Networking/Morse.png differ diff --git a/Networking/Morse.txt b/Networking/Morse.txt new file mode 100644 index 0000000..d695202 --- /dev/null +++ b/Networking/Morse.txt @@ -0,0 +1,36 @@ +a .- +b -... +c -.-. +d -.. +e . +f ..-. +g --. +h .... +i .. +j .--- +k -.- +l .-.. +m -- +n -. +o --- +p .--. +q --.- +r .-. +s ... +t - +u ..- +v ...- +w .-- +x -..- +y -.-- +z --.. +0 ----- +1 .---- +2 ..--- +3 ...-- +4 ....- +5 ..... +6 -.... +7 --... +8 ---.. +9 ----. \ No newline at end of file diff --git a/Networking/morse.bas b/Networking/morse.bas deleted file mode 100755 index 7d8f3b9..0000000 --- a/Networking/morse.bas +++ /dev/null @@ -1,89 +0,0 @@ -' Plays entered text in morse code audio beeps using PC-speaker. -' 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 -' 2024.08, Improved program readability - -DECLARE SUB say() -DECLARE SUB laus(a$) -DECLARE SUB char(a!) -DIM SHARED mors(0 TO 255, 0 TO 9) -DIM SHARED spd -spd = 1 -CLS - -' Open the Morse code file for reading -OPEN "morse.txt" FOR INPUT AS #1 - -' Label to read each line from the file -2 -IF EOF(1) THEN GOTO 1 -LINE INPUT #1, a$ - -' Process each character in the current line -FOR b = 1 TO LEN(a$) - c = ASC(RIGHT$(LEFT$(a$, b), 1)) - IF b = 1 THEN m = c - IF b > 2 THEN - d = 0 - IF c = ASC(".") THEN d = 1 - IF c = ASC("-") THEN d = 2 - mors(m, b - 2) = d - END IF -NEXT b -GOTO 2 - -' Label to close the file -1 -CLOSE - -' Prompt user for input -PRINT "Type '.bye' to quit" - -' Main loop to read and process user input -3 -PRINT "" -INPUT "", a$ -IF a$ = ".bye" THEN SYSTEM -laus a$ -GOTO 3 - -' Subroutine to play Morse code for a single character -SUB char(a) - PRINT CHR$(a); - - ' Loop through each part of the Morse code sequence - FOR b = 0 TO 9 - IF mors(a, b) = 1 THEN - ' Play short beep for a dot - SOUND 1000, 1 * spd - SOUND 0, 1 * spd - END IF - - IF mors(a, b) = 2 THEN - ' Play long beep for a dash - SOUND 1000, 3 * spd - SOUND 0, 1 * spd - END IF - NEXT b - - ' Short pause between Morse code characters - FOR a = 0 TO 160 - SOUND 0, .1 - NEXT a -END SUB - -' Subroutine to process and play Morse code for an entire string -SUB laus(a$) - ' Loop through each character in the input string - FOR b = 1 TO LEN(a$) - c = ASC(RIGHT$(LEFT$(a$, b), 1)) - - ' Call char subroutine to play Morse code for the current character - char c - NEXT b -END SUB \ No newline at end of file diff --git a/Networking/morse.txt b/Networking/morse.txt deleted file mode 100644 index d695202..0000000 --- a/Networking/morse.txt +++ /dev/null @@ -1,36 +0,0 @@ -a .- -b -... -c -.-. -d -.. -e . -f ..-. -g --. -h .... -i .. -j .--- -k -.- -l .-.. -m -- -n -. -o --- -p .--. -q --.- -r .-. -s ... -t - -u ..- -v ...- -w .-- -x -..- -y -.-- -z --.. -0 ----- -1 .---- -2 ..--- -3 ...-- -4 ....- -5 ..... -6 -.... -7 --... -8 ---.. -9 ----. \ No newline at end of file diff --git a/index.org b/index.org index fda7e27..e85a250 100644 --- a/index.org +++ b/index.org @@ -95,7 +95,7 @@ as pixel manipulation, geometric shapes, and simple animations. #+attr_latex: :width 1000px [[file:2D%20GFX/Hello%20friend.bas][file:2D%20GFX/Hello%20friend.png]] -[[file:2D%20GFX/Hello%20friend.bas][Hello friend.bas]] +Download source code: [[file:2D%20GFX/Hello%20friend.bas][Hello friend.bas]] #+INCLUDE: "2D GFX/Hello friend.bas" src basic-qb45 @@ -113,7 +113,7 @@ animated transitions and effects.
    #+end_export -[[file:2D%20GFX/People.bas][People.bas]] +Download source code: [[file:2D%20GFX/People.bas][People.bas]] *** Stroboscope @@ -127,7 +127,7 @@ diagrams. #+attr_latex: :width 1000px [[file:2D%20GFX/Stroboscope.bas][file:2D%20GFX/Stroboscope.png]] -[[file:2D%20GFX/Stroboscope.bas][Stroboscope.bas]] +Download source code: [[file:2D%20GFX/Stroboscope.bas][Stroboscope.bas]] *** Truncated cone @@ -141,7 +141,7 @@ the viability of generating images of 3D shapes using code. #+attr_latex: :width 1000px [[file:2D%20GFX/Truncated%20cone.bas][file:2D%20GFX/Truncated%20cone.png]] -[[file:2D%20GFX/Truncated%20cone.bas][Truncated cone.bas]] +Download source code: [[file:2D%20GFX/Truncated%20cone.bas][Truncated cone.bas]] #+INCLUDE: "2D GFX/Truncated cone.bas" src basic-qb45 @@ -223,7 +223,7 @@ into RAM, allowing for the potential rendering of very large worlds. #+attr_latex: :width 1000px [[file:3D%20GFX/Swapping%203D%20engine/screenshot,%202.png]] -[[file:3D%20GFX/Swapping%203D%20engine/engine.bas][engine.bas]] +Download source code: [[file:3D%20GFX/Swapping%203D%20engine/engine.bas][engine.bas]] ** 3D land @@ -289,7 +289,7 @@ specified keys to turn, look up/down, and even jump. #+attr_latex: :width 1000px [[file:3D%20GFX/Ray%20casting%20engine.bas][file:3D%20GFX/Ray%20casting%20engine.png]] -[[file:3D%20GFX/Ray%20casting%20engine.bas][Ray casting engine.bas]] +Download source code: [[file:3D%20GFX/Ray%20casting%20engine.bas][Ray casting engine.bas]] * Games :PROPERTIES: @@ -636,7 +636,6 @@ but with additional extra dimension that I decided to call Q. vertices to define. It is the minimal object in 4D world to have hypervolume (aka. 4D volume). - *** Planes or rotation in 3D world vs 4D world In 3D space, the planes of rotation correspond to rotations around the @@ -717,6 +716,106 @@ novel planes of 4D space. Download source code: [[file:Miscellaneous/4D%20engine.bas][4D engine.bas]] +** Windowing system + +This QBasic program implements a text mode windowing system, allowing +users to create and manage multiple windows on the screen. Each window +can display the contents of a text file and supports horizontal and +vertical scrolling. The program is designed to demonstrate basic +window management and text display functionalities in a text-based +environment. + +Windows are drawn on the screen with borders and titles. + +The program includes a simple animation loop that shifts the content +of the active window, creating a dynamic visual effect. + +#+begin_export html +
    + +
    +#+end_export + +Download source code: [[file:Miscellaneous/Windowing%20system.bas][Windowing system.bas]] + +** Password lock + +This QBasic program simulates a retro-styled rocket control system +interface with a password protection mechanism. The program is +designed to provide a visually engaging experience reminiscent of +early computer systems. + +The password is stored in an external file (passw.dat). + +The program captures and processes user input for password entry, +including handling special keys like Enter and Backspace. + +When the user presses Enter, the program checks the entered password +against the stored password. If the password is correct, the program +exits. If not, it displays an error message and decreases the number +of remaining attempts. + +The user has three attempts to enter the correct password. After three +failed attempts, the program halts and displays a "SYSTEM HALTED" +message. + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Miscellaneous/Password%20lock/passw.bas][file:Miscellaneous/Password%20lock/screenshot,%201.png]] + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Miscellaneous/Password%20lock/passw.bas][file:Miscellaneous/Password%20lock/screenshot,%202.png]] + +Download source code: [[file:Miscellaneous/Password%20lock/passw.bas][passw.bas]] + + +* Networking + +** LPT port pin control + +This QBasic program is designed to control the voltage on individual +pins of an LPT (Line Print Terminal) port, commonly known as a +parallel port. This type of port was traditionally used for connecting +printers to computers but can also be used for simple hardware control +tasks. + +The program allows users to toggle the voltage on each of the 8 pins +of the LPT port using keys 1 through 8 on the keyboard. When a key is +pressed, the corresponding pin's state is toggled between on (high +voltage) and off (low voltage). + +The program uses bit manipulation to control individual pins. + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Networking/LPT%20pin%20control.bas][file:Networking/LPT%20pin%20control.png]] + +Download source code: [[file:Networking/LPT%20pin%20control.bas][LPT pin control.bas]] + +** Morse + +This QBasic program allows users to input text and hear it played back +in Morse code using the PC speaker. It's a fun and educational tool +for anyone interested in learning Morse code. + +It reads Morse code patterns from an external file named +"morse.txt". Each line in the file represents a character and its +corresponding Morse code. + +For each character in the input text, the program looks up its Morse +code pattern and plays it back using the PC speaker. Dots are +represented by short beeps, and dashes by longer beeps. + +#+attr_html: :class responsive-img +#+attr_latex: :width 1000px +[[file:Networking/Morse.bas][file:Networking/Morse.png]] + +Download source code: [[file:Networking/Morse.bas][Morse.bas]] + * Download ** Getting the source code