README.md

This commit is contained in:
2026-08-15 00:11:47 +02:00
parent 7e21caea43
commit dd27c782a7
2 changed files with 107 additions and 66 deletions
+101 -66
View File
@@ -1,88 +1,123 @@
# turbopascal X-LIB UNiT V0.3á*
This Pascal unit, xlibunit, is a graphics library designed for use in Turbo Pascal programs. It provides various procedures for initializing and manipulating VGA graphics modes, handling color palettes, and drawing on the screen. It's particularly useful for creating graphic demos.
# 🎮 Turbo Pascal X-LIB UNiT V0.3á*
## System Requirements
- Turbo Pascal 6.0
- MS-DOS or compatible environment
- VGA graphics card
![License](https://img.shields.io/badge/license-MIT-green.svg)
![Platform](https://img.shields.io/badge/platform-MS--DOS-blue.svg)
## File Structure
**Eine leistungsstarke Grafikbibliothek für Turbo Pascal Programme**
| File | Description |
|------|-------------|
| `xlibunit.pas` | Pascal unit source code |
| `xlibunit.tpu` | Compiled Turbo Pascal Unit |
| `COMPILE.BAT` | Batch script to compile the unit with Turbo Pascal |
| `intel.txt` | Reference documentation for Intel 8086 instruction set |
| `LICENSE` | MIT License |
Dieses Pascal-Modul `xlibunit` ist eine Grafikbibliothek, die speziell für Turbo Pascal Programme entwickelt wurde. Es bietet verschiedene Prozeduren zur Initialisierung und Manipulation von VGA-Grafikmodi, Farbpaletten-Handhabung und Bildschirmzeichnung. Besonders nützlich für die Erstellung von Grafik-Demos! 🚀
---
## 📋 Systemvoraussetzungen
| Komponente | Anforderung |
|------------|-------------|
| 💾 Compiler | Turbo Pascal 6.0 |
| 🖥️ Betriebssystem | MS-DOS oder kompatible Umgebung |
| 🎨 Grafikkarte | VGA-kompatibel |
---
## 📁 Dateistruktur
| Datei | Beschreibung |
|-------|--------------|
| 📄 `xlibunit.pas` | Pascal-Quellcode |
| 🔧 `xlibunit.tpu` | Kompiliertes Turbo Pascal Unit |
| ⚙️ `COMPILE.BAT` | Batch-Skript zum Kompilieren mit Turbo Pascal |
| 📚 `intel.txt` | Referenzdokumentation für Intel 8086 Befehlssatz |
| 📜 `LICENSE` | MIT-Lizenz |
---
## 🚀 Verwendung
Füge das Modul in dein Turbo Pascal Programm ein und rufe die Methoden auf:
## Usage
Include the unit in your Turbo Pascal program and call the methods:
```pascal
program MyGraphicsDemo;
uses xlibunit;
begin
initxlib; { Initialize VGA mode 13 }
{ ... your graphics code ... }
exitxlib; { Return to text mode 3 }
initxlib; { VGA-Modus 13 initialisieren }
{ ... dein Grafikcode ... }
exitxlib; { Zurück zum Textmodus 3 }
end.
```
## Types and Variables
---
| Type / Variable | Description |
|-----------------|-------------|
| `paltype` | Array of 768 bytes (256 RGB triplets) used for palette data |
| `textpal` | Array of 3x16 bytes storing text mode palette on unit initialization |
## 📊 Typen und Variablen
## Compile
Compile.bat uses Turbo Pascal 6.0 installed in c:\progrs\tp\
```
| Typ / Variable | Beschreibung |
|----------------|--------------|
| 🎨 `paltype` | Array mit 768 Bytes (256 RGB-Tripel) für Paletten-Daten |
| 🖼️ `textpal` | Array mit 3x16 Bytes zur Speicherung der Textmodus-Palette bei Modulinitialisierung |
---
## 🔨 Kompilieren
Das `COMPILE.BAT` verwendet Turbo Pascal 6.0, installiert in `c:\progrs\tp\`
```bash
compile.bat
```
## Methods
---
| **Method** | **Description** |
|--------------------|---------------------------------------------------------------------------------|
| `initxlib` | Initializes VGA mode 13. |
| `initxmode` | Initializes extended mode. |
| `clearxmode` | Quickly clears the screen in extended mode. |
| `cleartext` | Quickly clears the screen in text mode. |
| `exitxlib` | Exits the library and initializes VGA mode 3. |
| `point` | Draws a point in extended mode. |
| `blackpal` | Sets all colors to black. |
| `vert_retr` | Waits for vertical retrace. |
| `fadeup` | Fades up the palette. |
| `fadedown` | Fades down the palette. |
| `copypic13` | Copies a picture from a segment and offset to VGA in mode 13. |
| `copypicx` | Copies a picture from a segment and offset to VGA in extended mode. |
| `copypicxd` | Copies a picture in virtual horizontal 640 mode. |
| `copypal` | Copies a palette from a segment and offset to another palette. |
| `startingarea` | Sets the linear starting area. |
| `vert400` | Switches to 320x400 resolution. |
| `vert200` | Switches to 320x200 resolution. |
| `vert100` | Switches to 320x100 resolution (not tested). |
| `hor640` | Switches to virtual horizontal 640 resolution. |
| `hor320` | Switches to normal horizontal 320 resolution. |
| `vpan` | Vertical panning. |
| `hpan` | Horizontal panning. |
| `hbegin` | Sets the horizontal start position. |
| `CRTC_UnProtect` | Unprotects the CRTC (Cathode Ray Tube Controller). |
| `CRTC_Protect` | Protects the CRTC. |
| `unprotect` | Unprotects the screen. |
| `protect` | Protects the screen. |
| `hor_retr` | Waits for horizontal retrace. |
| `moveblock` | Moves a block of memory. |
| `setdac` | Sets the DAC (Digital-to-Analog Converter) color. |
| `print` | Prints text on the screen. |
| `locate` | Sets the cursor position. |
| `key` | Checks if a key is pressed. |
## ⚡ Methoden
## Contributing
| Methode | Beschreibung |
|---------|--------------|
| 🚀 `initxlib` | Initialisiert VGA-Modus 13 |
| 🔧 `initxmode` | Initialisiert erweiterten Modus |
| 🧹 `clearxmode` | Löscht den Bildschirm schnell im erweiterten Modus |
| 🧹 `cleartext` | Löscht den Bildschirm schnell im Textmodus |
| 🚪 `exitxlib` | Beendet die Bibliothek und initialisiert VGA-Modus 3 |
| ✏️ `point` | Zeichnet einen Punkt im erweiterten Modus |
| ⬛ `blackpal` | Setzt alle Farben auf Schwarz |
| ⏳ `vert_retr` | Wartet auf vertikalen Retrace |
| 🌅 `fadeup` | Blendet die Palette ein |
| 🌆 `fadedown` | Blendet die Palette aus |
| 📷 `copypic13` | Kopiert ein Bild von Segment und Offset nach VGA in Modus 13 |
| 📷 `copypicx` | Kopiert ein Bild von Segment und Offset nach VGA im erweiterten Modus |
| 📷 `copypicxd` | Kopiert ein Bild im virtuellen horizontalen 640-Modus |
| 🎨 `copypal` | Kopiert eine Palette von Segment und Offset zu einer anderen Palette |
| 📍 `startingarea` | Setzt den linearen Startbereich |
| 📐 `vert400` | Wechselt zur Auflösung 320x400 |
| 📐 `vert200` | Wechselt zur Auflösung 320x200 |
| 📐 `vert100` | Wechselt zur Auflösung 320x100 (nicht getestet) |
| 📏 `hor640` | Wechselt zur virtuellen horizontalen 640-Auflösung |
| 📏 `hor320` | Wechselt zur normalen horizontalen 320-Auflösung |
| ↕️ `vpan` | Vertikales Panning |
| ↔️ `hpan` | Horizontales Panning |
| 🎯 `hbegin` | Setzt die horizontale Startposition |
| 🔓 `CRTC_UnProtect` | Entschützt den CRTC (Cathode Ray Tube Controller) |
| 🔒 `CRTC_Protect` | Schützt den CRTC |
| 🔓 `unprotect` | Entschützt den Bildschirm |
| 🔒 `protect` | Schützt den Bildschirm |
| ⏳ `hor_retr` | Wartet auf horizontalen Retrace |
| 📦 `moveblock` | Verschiebt einen Speicherblock |
| 🎨 `setdac` | Setzt die DAC (Digital-to-Analog Converter) Farbe |
| 🖨️ `print` | Druckt Text auf den Bildschirm |
| 📍 `locate` | Setzt die Cursor-Position |
| ⌨️ `key` | Prüft, ob eine Taste gedrückt wird |
Contributions are welcome.
---
## Lizenz
## 🤝 Mitwirken
Beiträge sind willkommen! 🎉
---
## 📜 Lizenz
Lizenziert unter der [MIT License](LICENSE) - Copyright (c) 2026 Stefan Koelle (https://stefankoelle.de)
---
<p align="center">
<i>Erstellt mit ❤️ für die Retro-Gaming-Community</i>
</p>