Releases: haroldo-ok/warcraft-32x
Release list
v0.0.3: Improve sound effects and voice, even if garbled.
Full Changelog: v0.0.2...v0.0.3
Implement digital sound effects.
The basic sound effects are sounding clear, but the voices are recognizable, but garbled.
Tried to make it work using Arena, but it kept either producing complete silence, or a loud continuous buzz or this.
Might try manually later, or try with another AI.
Done --- back to garbled-voices + perfect SFX, NO MUSIC, NO BUZZ.
ROM is rebuilt: WinWar32X.32x (1.5 MiB, SHA256 0a08a879...)
What this build is:
-
SFX perfect:
source/32x/main.c→play_sfx()= blockingMars_PlayPWM(d,l)directly waiting onMARS_PWM_MONO & 0x8000. 4 tones insfx_data.c(800Hz select, 400Hz move, 250Hz attack, 200→800Hz build), each 2304 bytes @14kHz, 128-centered with 128-silence padding. No timing distortion. -
Voices garbled but recognizable: Restored
voice_data.c(8 Warcraft voices @14kHz, aligned 256, padded with 128). Playback inaudio.c:audio_init()→Mars_InitPWM(14000,0,255)with rampaudio_play(ptr,len)sets pointeraudio_update()called each frame in main loop → up to 250 samples/frame (~233 nominal). If frame drops to 30Hz or SFX blocks (0.16s), effective rate 7500Hz → slow/distorted → garbled but understandable.audio_stop()writes 128 center, avoids DC buzz- Triggers in
main.cwithvoice_cool=120for under_attack
-
NO MUSIC, NO CONTINUOUS BUZZ:
- MD
_crt0.s= clean 70361-byte version, only PSG silence9F,BF,DF,FF. Nosfx_play, noxgm_sfx_play, no music handlers used. - MD
main.c=init_main(); main_loop();only -- noXGM_loadDriver(), noXGM_startPlay() - XGM driver files still exist but never loaded, Z80 not driving FM/DAC → silent
- 32X PWM ends at 128 center, voice samples start/end with 128 → no DC offset buzz
- MD
v0.0.2: Implement various units, sound effects and food supply.
Full Changelog: v0.0.1...v0.0.2
🔊 1. PSG SFX Driver (M68K Integration)
-
Hardware Channel: Offloaded sound requests (
0x1B00 | id) viaMars_PlaySFX()to the Master 68000 driving the Programmable Sound Generator (PSG). -
14 Sound Effects: Includes UI navigation (
SELECT,ERROR), entity feedback (MOVE,ATTACK,START_BUILD,BUILD_COMPLETE,DEPOSIT,TRAIN,SAVE), and dynamic VBlank pitch sweeps (e.g.,BUILD$350 \rightarrow 80\text{Hz}$ ,DEATH$120 \rightarrow 600\text{Hz}$ , white-noiseHITat$E6, and Victory/Defeat fanfares).
⚔️ 2. Expanded Roster & Siege Mechanics
-
3-Tier Unit Training (Barracks):
-
Melee: Footman (Human 0) / Grunt (Orc 1) —
$400\text{G}$ . -
Ranged: Archer (Human 8) / Spearman (Orc 9) —
$450\text{G} / 50\text{L}$ . -
Siege: Catapult (Human 4 / Orc 5) —
$700\text{G} / 150\text{L}$ ,$80\text{HP}$ , 8 range,$15+10$ damage, 22-frame travel time. -
Catapult Splash Damage: Implemented
hurt_area(cx, cy, 2, attacker, damage)on projectile expiration, dealing area-of-effect damage within a 2-tile radius to all hostiles.
🏰 3. Base Building & Macro Mechanics
-
Defensive Towers: Types 36 (Human) / 37 (Orc) (
$120\text{G}/60\text{L}$ ). Features auto-target acquisition within 6 tiles, 90-frame cooldown, and ranged arrow fire. Existing level towers now actively defend. -
Lumber Mill & Economy: Types 42/43 (
$150\text{G}/100\text{L}$ ). Owning a Lumber Mill activates a+25%yield bonus, boosting worker lumber carrying capacity from 100 to 125 units per return trip. -
Worker Repair Loop: Workers can now approach damaged friendly structures (
$\text{Type} \ge 32$ ) and restore$8\text{HP}$ per 30 frames at the cost of$1\text{G}$ with throttled repair audio. -
Food Supply System: Town Halls & Farms (
$32/33$ ) grant$+4$ food capacity each (minimum 4). Units cost 1 food each. Training is blocked with anERRORSFX if the player is at the supply cap.
💾 4. Savegame V3 Protocol & Fog Persistence
-
Explored Map State: Added a 512-byte bitfield mapping 4,096 map cells (
$1\text{ bit} = \text{explored}$ ) so explored territory is preserved across cartridge SRAM save/load cycles instead of resetting to black. - Backward Compatibility & Compact Packing:
- Capped entity and lumber limits (
MAX_ENTITIES 64,MAX_LUMBER 64) to fit the full save payload comfortably within 1,756 bytes (under the 2,048-byte SRAM ceiling). - The V3 decoder maintains fallback support for V1 (
$14\text{B}/\text{ent}$ ) and V2 ($15\text{B}/\text{ent}$ ) save files.
🎮 Updated Control Scheme Quick Reference
| Selection | Button / Combination | Action |
|---|---|---|
| Worker Orders | C (Cycle Order) | Cycles through: MOVE HARVEST FARM BARRACKS TOWER L MILL REPAIR
|
| Worker Quick-Build | X / Y | X: Build Farm |
| Barracks | C (Cycle Unit) | Cycles through: Melee Ranged Siege
|
| Barracks Quick-Train | X / Y / Z | X: Train Melee |
| Barracks Order | B | Confirm training current selected unit type |
📊 Feature Progression Matrix
| Feature | Version 7 | Version 8 | Version 9 | Version 10 |
|---|---|---|---|---|
| PSG Audio Driver | ❌ | ✅ (14 SFX) | ✅ | ✅ |
| Ranged Units (Archer/Spearman) | ❌ | ✅ | ✅ | ✅ |
| Defensive Towers & AI | ❌ | ❌ | ✅ | ✅ |
| Catapults & AOE Splash | ❌ | ❌ | ✅ | ✅ |
| Food Supply System | ❌ | ❌ | ✅ | ✅ |
| Lumber Mill (+25% Yield) | ❌ | ❌ | ❌ | ✅ |
| Building Repair Mechanics | ❌ | ❌ | ❌ | ✅ |
| SRAM Fog Persistence | ❌ (V1) | ❌ (V2) | ❌ (V2) | ✅ (V3) |
v0.0.1: Port Warcraft 1 to Sega 32X using Arena
What's Changed
- Port Warcraft 1 to Sega 32X using Arena. by @haroldo-ok in #1
New Contributors
- @haroldo-ok made their first contribution in #1
Full Changelog: https://github.com/haroldo-ok/warcraft-32x/commits/v0.0.1
The game is somewhat playable, but there's still lots to do.
Key Technical & Architectural Highlights
-
Dual SH-2 Task Architecture: Splitting the load between the twin Hitachi SH-2 RISC processors---delegating main gameplay, rendering, and logic to the Primary SH-2 while offloading command/cache servicing to the Secondary SH-2---is the exact design pattern needed to keep target frame rates stable on 32X hardware.
-
Efficient Memory & Video Pipeline:
-
Leveraging the 32X's 320×224 8-bit indexed double-buffered video mode allows accurate rendering of Warcraft's PC color palette directly to hardware framebuffers.
-
Storing unit states, construction queues, and sparse forest depletion into compact SRAM data structures is a slick solution for preserving campaign progress within standard cartridge limits.
-
-
Deterministic Pathfinding & Sub-Tile Smoothness:
-
Running 8-direction A pathfinding with an octile heuristic* on 64×64 grids while handling dynamic unit collision directly addresses the biggest hurdle in retro RTS ports.
-
Adding 12-frame sub-tile visual interpolation ensures movement looks smooth and modern without desynchronizing the underlying deterministic grid collisions.
-
-
Complete RTS Engine Loop: Bringing fog of war (Unknown/Fog/Visible), worker resource collection cycles (gold & lumber depletion), building assembly progress, and multi-state death animations over to native C/SH-2 code without reliance on original DOS executables is a massive engineering feat.
Controller Mapping Quick Reference
For playtesters, here is a quick-reference summary of the control mapping:
| Action | 3-Button Controller | 6-Button Shortcut |
|---|---|---|
| Select Unit / Menu Option | A | A |
| Issue Order / Cancel / Back | B | B |
| Cycle Worker Command / Train Unit | C | C |
| Build Farm at Cursor | Select Worker |
X (Direct) |
| Build Barracks at Cursor | Select Worker |
Y (Direct) |
| Pause / Resume | Start | Start |
| Save Game (In Pause Menu) |
Start |
Start |
| Load Game (In Pause Menu) |
Start |
Start |
Note on Asset Generation: Because this port requires the original
DATA.WARasset file from the PC Warcraft demo, ensure your host asset processing pipeline is run prior to building the final 1.5 MiB.32xROM image!