# ASSEMBLER CASINO (KAZIK) ๐ŸŽฐ A retro casino gaming suite powered by a high-performance **pure x86 assembly (MASM32)** engine featuring an interactive **2.5D retro Raycaster 3D Hall** (DOOM / Wolfenstein style) and a catalog of classic and underground gambling games. --- ## ๐Ÿ›๏ธ Architecture Overview The repository is organized into distinct, modular subsystems: ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ASSEMBLER CASINO โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ–ผ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ MASM32 Engine โ”‚ โ”‚ C99 Portable โ”‚ โ”‚ C# GUI Launcher โ”‚ โ”‚ (Root Directory)โ”‚ โ”‚ (src_portable/) โ”‚ โ”‚ (build/ & dist/) โ”‚ โ”‚ - poker.asm โ”‚ โ”‚ - casino_portableโ”‚ โ”‚ - Launcher.cs โ”‚ โ”‚ - casino3d.inc โ”‚ โ”‚ - CMakeLists.txt โ”‚ โ”‚ - Installer GUI โ”‚ โ”‚ - font8x8.inc โ”‚ โ”‚ - Makefile โ”‚ โ”‚ - Setup Wizards โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Offline Pipeline & Tooling โ”‚ โ”‚ (tools/) โ”‚ โ”‚ - tools/previews/ (ANSI / 3D previews) โ”‚ โ”‚ - tools/generators/ (Asset & table packers) โ”‚ โ”‚ - tools/tests/ (Simulators & checks) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` 1. **MASM32 Core Game Engine (Root)** - **`poker.asm`**: Main game binary (~8,500+ lines of hand-crafted x86 assembly). Contains game logic, cheat engine, socket networking, profile save system, and sound triggers. - **`casino3d.inc` / `casino3d_data.inc`**: Software 2.5D Raycaster engine rendering a 32ร—32 grand casino hall at 640ร—480 with DDA wall casting, depth-sorted sprite objects, and interactive tables. - **`font8x8.inc`**: CP1251 1-bit monochrome 8ร—8 bitmap font table for high-speed HUD rendering directly to the Win32 GDI frame buffer. 2. **Portable C99 Core (`src_portable/`)** - Cross-platform implementation (`casino_portable.c`, `casino_portable.h`) allowing gameplay on POSIX / Linux / macOS environments. - Fully standalone build with standard `Makefile` or `CMakeLists.txt`. 3. **Desktop Distribution & Launcher (`build/` & `dist/`)** - **`build/`**: C# source code for the launcher (`AssemblerCasinoLauncher.cs`), setup GUI (`PokerGameSetupGui.cs`), and uninstaller. - **`dist/`**: Ready-to-run compiled desktop executables (`Assembler Casino.exe`, `Uninstall Assembler Casino.exe`). 4. **Offline Development Tooling (`tools/`)** - **`tools/previews/`**: Terminal ANSI animation players (`preview_intro.py`, `preview_hakari.py`, `preview_dbd_hook.py`) and 3D preview runner. - **`tools/generators/`**: Texture pack scripts (`build_graphics_assets.py`), math table generators (`generate_math_and_map.py`), font rasterizer (`generate_font.py`). - **`tools/tests/`**: Software raycaster simulator (`simulate_render.py`), release integrity checks (`release_smoke_check.ps1`), achievement popup modal (`achievement_popup.bat`). 5. **Assets & Documentation (`assets/`, `docs/`, `backups/`)** - **`assets/`**: High-resolution textures, sprites, audio samples (`.wav`), and ANSI cinematics (`.ans`). - **`docs/`**: Design specifications, cheat sheet, networking guides, and engine render previews. - **`backups/`**: Historical milestones and archived releases. --- ## ๐Ÿ“ Repository Directory Structure ``` โ”œโ”€โ”€ poker.asm # Primary MASM32 assembly source โ”œโ”€โ”€ casino3d.inc # 2.5D retro 3D raycaster engine implementation โ”œโ”€โ”€ casino3d_data.inc # 3D engine math tables (sin/cos) & casino hall grid โ”œโ”€โ”€ font8x8.inc # 8x8 CP1251 bitmap font data โ”œโ”€โ”€ poker.wap # Pelles C / Windows project definition โ”œโ”€โ”€ build.bat # One-click build script for MASM32 core โ”œโ”€โ”€ poker.exe # Compiled game binary โ”œโ”€โ”€ AGENTS.md # Engineering guidelines and agent instructions โ”œโ”€โ”€ README.md # Project documentation (this file) โ”œโ”€โ”€ LICENSE # Project license โ”œโ”€โ”€ .gitignore # Git ignore patterns โ”‚ โ”œโ”€โ”€ assets/ # Game assets โ”‚ โ”œโ”€โ”€ animations/ # ANSI animations (casino_intro.ans, hakari_dance.ans, dbd_hook.ans) โ”‚ โ”œโ”€โ”€ audio/ # Sound effects (.wav) for cards, roulette, coins, win/loss โ”‚ โ”œโ”€โ”€ data/ # Dealer dialogues and text tables (CP1251) โ”‚ โ”œโ”€โ”€ icons/ # Game icon assets (.ico, .png) โ”‚ โ”œโ”€โ”€ music/ # Background tracks โ”‚ โ”œโ”€โ”€ sprites/ # Source sprite sheets & cabaret animations โ”‚ โ””โ”€โ”€ textures/ # Packed 128x128 BGRA texture binaries (casino3d-hd.bin) โ”‚ โ”œโ”€โ”€ backups/ # Preserved backups and legacy archives โ”‚ โ”œโ”€โ”€ build/ # Launcher and setup source code (C# .NET) โ”‚ โ”œโ”€โ”€ AssemblerCasinoLauncher.cs โ”‚ โ”œโ”€โ”€ PokerGameSetupGui.cs โ”‚ โ””โ”€โ”€ UninstallAssemblerCasino.cs โ”‚ โ”œโ”€โ”€ dist/ # Compiled desktop distribution binaries โ”‚ โ”œโ”€โ”€ Assembler Casino.exe โ”‚ โ””โ”€โ”€ Uninstall Assembler Casino.exe โ”‚ โ”œโ”€โ”€ docs/ # Project documentation, guides, and plans โ”‚ โ”œโ”€โ”€ intro_code_draft.txt # Opening sequence drafts โ”‚ โ”œโ”€โ”€ render_view.png # Simulated frame render of the 3D casino hall โ”‚ โ”œโ”€โ”€ ะ˜ะ”ะ•ะ˜.txt # Game ideas and development backlog โ”‚ โ”œโ”€โ”€ ะงะ˜ะขะšะžะ”ะซ.txt # Complete list of cheat codes โ”‚ โ””โ”€โ”€ *.txt # Release notes, security guidelines, networking โ”‚ โ”œโ”€โ”€ src_portable/ # Standalone portable C99 implementation โ”‚ โ”œโ”€โ”€ casino_portable.c โ”‚ โ”œโ”€โ”€ casino_portable.h โ”‚ โ”œโ”€โ”€ CMakeLists.txt โ”‚ โ”œโ”€โ”€ Makefile โ”‚ โ””โ”€โ”€ poker_portable.exe โ”‚ โ””โ”€โ”€ tools/ # Developer tooling & offline asset pipeline โ”œโ”€โ”€ README.md # Documentation for tools โ”œโ”€โ”€ previews/ # Animation & 3D preview scripts (.py, .bat) โ”œโ”€โ”€ generators/ # Asset packers, math & font generators (.py) โ””โ”€โ”€ tests/ # Software render simulator & test scripts (.py, .ps1, .bat) ``` --- ## ๐Ÿ› ๏ธ Build Instructions ### 1. MASM32 Game Binary (`poker.exe`) Prerequisites: MASM32 SDK (`ml.exe`, `link.exe`) installed in `D:\MASM32\masm32`, `C:\masm32`, or Visual Studio MSVC BuildTools. Simply run: ```bat build.bat ``` This will assemble `poker.asm` with MASM, link against `kernel32`, `winmm`, `user32`, `ws2_32`, `gdi32`, and produce `poker.exe`. ### 2. C99 Portable Engine (`src_portable/`) With GCC / MinGW: ```bash cd src_portable make ``` Or with CMake: ```bash cd src_portable mkdir build && cd build cmake .. cmake --build . ``` ### 3. Running Previews and Simulators - **Hakari Jackpot Dance Preview**: ```bat tools\previews\preview_hakari.bat ``` - **Casino Intro Animation Preview**: ```bat tools\previews\preview_intro.bat ``` - **3D Engine Software Simulation**: ```bash python tools/tests/simulate_render.py ``` Generates `docs/render_view.png` showing the 3D raycaster view with sprites. --- ## ๐Ÿ”ค Character Encoding Standard - **Game source & strings (`poker.asm`, `assets/data/dealer_phrases.txt`)**: **CP1251 (Windows-1251)**. Never save as UTF-8. - **ANSI animations (`.ans`)**: CP1251 encoding with ANSI escape codes and form feed (`\f`, `0x0C`) frame delimiters. Preview runners execute `chcp 65001` before playback. --- ## ๐ŸŽฎ Games & Features | # | Game | Description | |---|------|-------------| | 1 | **21 / Blackjack** | Classic card game against the dealer with hit/stand mechanics. | | 2 | **Poker** | Texas Hold'em with AI opponents, betting rounds, and pot calculations. | | 3 | **CloverPit** | 5ร—3 video slots with custom bonus features and payouts. | | 4 | **Russian Roulette** | High-stakes survival with revolver chamber simulation. | | 5 | **Skulls & Cups** | Thimblerig shell game testing perception and luck. | | 6 | **Coin Flip** | Double or nothing coin toss. | | 7 | **Dice / Craps** | Classic dice rolling wagering. | | 8 | **Roulette** | European roulette wheel with single and range bets. | | 9 | **Classic Slots** | 3-reel 777 fruit machine. | | 10 | **Durak** | Traditional Russian card game with trump cards and defense logic. | | 11 | **Training** | Practice arena with infinite balance. | | 12 | **Observer (AI vs AI)** | Watch autonomous agents play against each other. | | 3D | **Grand Casino Hall** | Real-time 2.5D raycaster environment to explore and walk up to tables. |