Analysis model: gpt-5.5 high

# When God Is Having a Malfunction by Orange - Technical Dissection

`When God is Having a Malfunction` is Orange's November 1994 MS-DOS/GUS
under-64K intro. It sits in an awkward but interesting place in Orange's 1994
output: smaller than `Have You Seen My Ham?`, still real-mode, still GUS-only,
but already using a compact one-file renderer with enough precomputed tables
and scripted text to feel like a proper production rather than a simple loader.

The shipped archive is also slightly noisy. The executable that matters is
`PEZ.EXE`. The archive also contains `IE112694.EXE`, but after unpacking that
file reads like a separate BBS/advert intro, not the Orange renderer: its text
names Jeskola board material, "try to find the secret part", and different
credits. I treat it as archive sidecar material and do not use it as evidence
for the Orange intro effects.

## Sources

- Pouet production page: `https://www.pouet.net/prod.php?which=9423`
- Scene.org archive:
  `https://files.scene.org/view/demos/groups/orange/orange11.zip`
- Pouet screenshot:
  `https://content.pouet.net/files/screenshots/00009/00009423.png`

Pouet metadata:

```text
title:        When God is Having a Malfunction
group:        Orange
type:         64k
platform:     MS-Dos/gus
release date: November 1994
```

The included `FILE_ID.DIZ` says the requirements directly:

```text
When God is having a malfunction
req. 386, Gus support
```

## Examined Files

Archive hash:

```text
a670fb176bfe86405bcb8f69bc5cf1224fea06ff9965582ad057b8a92137ba5c  orange11.zip
```

Original extracted hashes:

```text
165f87b0f8789392c095abe0a777b00f060d64e193778dd7fe07bf72b6a8987d  PEZ.EXE
0525aca91e33e2cb79ea3f44cd8d5a6d906c0d04d025a570409a402c34fe9e51  IE112694.EXE
79b03ed435c09c09b1eaf724a025402d05343ed3bc12145e6584de764b15faac  INFOFILE
6cbb1dda6c40eb10c4e5f423ebb7f2cec826e1ee0cea4159695b1e1aad2081c2  FILE_ID.DIZ
```

UNP-expanded working hashes:

```text
925ecf34d8f5d3c8bb56e6c182572008f2b23aea895fbbe6dc5f75d11d6e37e8  PEZ.EXE.unp
cf869495503740d6c6e6ff1d47958f1d58a896f5ef19a84dc52b249d80931e96  IE112694.EXE.unp
6420b24b78053d6b4ceafaf1bfeefc05b7017cb1ff593b14b0efda23381044b0  pouet-screenshot.png
```

The size jump is large:

```text
PEZ.EXE       41,932 -> 346,870 bytes after UNP
IE112694.EXE   9,762 ->  26,890 bytes after UNP
```

That makes the packed 64K archive claim plausible at distribution time while
still leaving a much larger real-mode image to examine after depacking.

## Visual Evidence

The publishable visual frame in this pass is the public Pouet screenshot, copied
unchanged:

```text
320x200 PNG, 8-bit indexed palette
```

![When God is Having a Malfunction Pouet screenshot](images/when-god-malfunction-pouet.png)

I also ran the original `PEZ.EXE` in DOSBox-X. It reaches the GUS port selector
and waits for a numeric choice:

```text
when God is having a malfunction

gus port:    1) 210h
             6) 260h
             3) 230h
             4) 240h
             5) 250h
             2) 220h
```

Selecting `4` for `240h` switches out of the menu and then this local headless
DOSBox-X/GUS run aborts with only a black transition captured. The two native
`dx-capture` AVIs are therefore not used as article media. This page has a
trustworthy public still and code/static evidence, but no runtime GIF.

## Carrier Shape

The original `PEZ.EXE` identifies as an MZ executable with a PKLITE-style
header signature. Its packed MZ header is intentionally not a normal load image:
the entry point computes to a far offset outside the packed file image, which is
consistent with a decompressor stub rather than the final program layout.

After UNP, the MZ header becomes straightforward:

```text
expanded size:        346,870 bytes
MZ header size:           256 bytes
load image size:      346,614 bytes
relocations:               56
entry:                CS:IP 0000:0057
initial stack:        SS:SP 0BDC:1000
minalloc:             0144h paragraphs
```

The first useful image bytes contain the external module name:

```text
00000100: 6d 61 6b 6b 69 2e 6d 6f 64 00  ... makki.mod
```

So the intro is not a pure procedural 64K in the modern 4k/64k sense. It is a
packed real-mode program with an embedded or materialized music payload named
`makki.mod`, then a larger depacked runtime image containing code, tables,
scripted text, and the GUS player path.

## Startup And Video Mode

The early startup performs ordinary real-mode housekeeping, then switches into
VGA mode 13h and uses `A000h` as the linear framebuffer:

```asm
mov ax,0013h
int 10h
mov ax,0A000h
mov es,ax
```

The code uses a full 64,000-byte clear with 32-bit stores:

```asm
mov di,0000h
mov eax,00000000h
mov cx,3E80h
rep stosd
```

`3E80h` dwords equals 16,000 dwords, or exactly 64,000 bytes. That matches a
full 320x200 mode-13h page, not a partial effect buffer.

Palette upload is also direct VGA hardware, not BIOS:

```asm
mov dx,03C8h
mov al,00h
out dx,al
inc dx
mov cx,0300h
rep outsb
```

`0300h` bytes is 256 RGB triples. The palette source segment changes by scene,
but the mechanism is the standard DAC address/data-port pair.

## Retrace And Frame Pacing

The renderer repeatedly synchronizes to input status register `03DAh`:

```asm
mov dx,03DAh
in  al,dx
test al,08h
jne wait_not_vblank
in  al,dx
test al,08h
je  wait_vblank
```

This pattern appears throughout the expanded `PEZ.EXE`, especially around page
copies, palette writes, and CRTC changes. It is an old-school VGA approach:
poll the retrace bit, wait for the inactive edge, then wait for the active edge
so the next visible update lands at a stable point.

The code also touches the CRT controller directly. One early loop writes index
`13h` through port `03D4h`, decreasing a value once per retrace:

```asm
mov cx,0028h
mov ah,28h
mov dx,03D4h
dec ah
mov al,13h
out dx,ax
wait retrace
loop ...
```

CRTC register `13h` is the offset register. Animating it changes the number of
bytes per displayed scanline/page stride. This is a small but real VGA trick:
the intro is not just blitting pixels into a fixed mode-13h screen; it also uses
hardware timing/register effects during transitions.

## Inner Pixel Path

One major drawing loop builds a 320-entry horizontal table, then renders 200
rows with 80 four-byte writes per row. The structure looks like this in the
expanded image:

```asm
mov si,[0327h]
movsx bx,byte ptr [si+0A3Ah]
add bx,00E2h
shr bx,2

mov cx,0140h       ; 320 entries
mov ax,FF60h
imul bx,dx
sar bx,7
mov [di+07BAh],bx

mov bp,00C8h       ; 200 rows
mov cx,0050h       ; 80 dword writes per row
...
mov dl,fs:[bx]
mov dh,fs:[bx]
rol edx,10h
mov dl,fs:[bx]
mov dh,fs:[bx]
mov es:[di],edx
```

This is table-driven chunky rendering: derive a per-column offset table, fetch
four pixels from an effect/texture table through `FS`, pack them into `EDX`,
and write a dword to `ES:A000`. The use of `0x140`, `0xC8`, and `0x50` maps
cleanly onto 320 columns, 200 rows, and four pixels per dword.

The expanded file also contains many long printable gradient/radial-looking
tables such as ordered runs of punctuation, digits, uppercase letters, and
mirrored ramps. Those are not human text; they are precomputed intensity or
shape tables used as data by the pixel path.

## Timeline Variables

The renderer uses a shared timeline/state segment at `1370h`, with fields near
`0FF0h` and `0FF4h` tested by several scene routines:

```asm
mov ax,1370h
mov gs,ax
cmp word ptr gs:[0FF4h],001Dh
jne ...
cmp word ptr gs:[0FF0h],0020h
jb  ...
```

The frame logic reads a 32-bit counter from `gs:[1732h]`, subtracts the previous
value saved at `[0318h]`, scales it, and advances a phase variable:

```asm
mov eax,gs:[1732h]
sub eax,[0318h]
mov [030Ah],eax
imul eax,[0314h]
shr eax,9
add [0327h],ax
cmp word ptr [0327h],0168h
jb  no_wrap
sub word ptr [0327h],0168h
```

`0168h` is 360 decimal, so this phase variable is almost certainly an angular
or sine-table index. That fits the visible shape of the code: lookup tables,
mirrored intensity ramps, and dword-packed screen writes.

## GUS Selector And Hardware Path

The GUS selector is real code, not just a text splash. It switches to text mode,
prints the menu through DOS `AH=09h`, reads one key with `AH=08h`, and loops
until the key is in the range `1` through `6`:

```asm
mov ax,0003h
int 10h
mov ax,1370h
mov ds,ax
mov dx,0F2Eh
mov ah,09h
int 21h

mov ah,08h
int 21h
cmp al,31h
je  gus_210
cmp al,32h
je  gus_220
...
cmp al,36h
je  gus_260
jmp read_again
```

Each case stores the selected base address into `cs:[0FE2h]`:

```asm
key '1' -> 0210h
key '2' -> 0220h
key '3' -> 0230h
key '4' -> 0240h
key '5' -> 0250h
key '6' -> 0260h
```

After a valid selection it initializes music state fields:

```asm
cs:[0FF0h] = 0040h
cs:[0FF4h] = 0000h
cs:[0FECh] = 0006h
cs:[0FEEh] = 0001h
```

Later code derives GUS register ports from the selected base. The pattern
`base + 0102h`, repeated register writes, and `out dx,al` sequences match a
direct Gravis UltraSound hardware driver rather than an abstract sound library
call. The code is consistent with the release's "Gus support" requirement.

## Scripted Text And Credits

The expanded renderer contains a long fixed-width script block. The visible
credit block names:

```text
PLAYER     CASCADA
ART        DER PIIPO
SOUND      DUNE
ROUTINES   HOPLITE
INTRO      ORANGE
```

The same block contains greet and message pages, including Anarchy, Cascada,
Sonic PC, Fascination, Crypton, Chaos, Gredon, and other Finnish scene names.
The `@` characters in the data work as line/page separators, not literal text
intended to be drawn as normal punctuation.

This explains the production's structure: the intro is not just one endless
effect. It is a compact show script: start with GUS selection, set up mode 13h
and palette tables, run table-driven visual parts, and feed fixed-width
credit/greet text into the same VGA presentation path.

## Sidecar: IE112694.EXE

`IE112694.EXE` is in the archive but does not match the Orange intro identity.
Its expanded text contains a board advertisement, "INVALID ENVIRONMENT",
"TRY TO FIND THE SECRET PART", and credits to Phantom/ex-Sonic and
Elwood/Quartex/Leviathan. Its MZ entry and code are separately unpackable, but
its content does not match the Pouet title, `INFOFILE`, or `PEZ.EXE` title
strings.

I therefore keep it out of the effect analysis. It is worth noting as archive
context because otherwise the extra executable is easy to mistake for a second
Orange part.

## Runtime-To-Code Concordance

| Observed or static evidence | Code/data evidence |
| --- | --- |
| Public 320x200 title/effect screenshot | Mode-13h setup, full 64,000-byte `A000h` clear, direct DAC programming |
| GUS-port selector reached in DOSBox-X | Text block at file offset `14731h`, DOS `AH=09h` print, DOS `AH=08h` key read |
| Menu choices 210h through 260h | `cs:[0FE2h]` receives `0210h`, `0220h`, `0230h`, `0240h`, `0250h`, `0260h` |
| Smooth VGA timing implied by demo style | Repeated `03DAh` retrace polling and DAC/CRTC writes around updates |
| Curved/gradient effect in public still | 320-entry table build, 200-row loop, four-pixel dword writes into `ES:A000` |
| Scripted credits and greets | Fixed-width text block with `PLAYER`, `ART`, `SOUND`, `ROUTINES`, `INTRO`, and separator bytes |
| Audio requirement | Embedded `makki.mod` name plus direct GUS base-register programming |

## What Is Still Missing

The obvious missing piece is a clean runtime capture past the GUS selector.
This pass did not publish prompt videos or black-transition AVIs because they
would be misleading. A future pass should use a DOSBox/GUS setup that survives
the mode switch, then add short source-frame GIFs for whichever effect sequence
matches the public screenshot.

Even without that capture, the unpacked code gives a good technical picture:
packed real-mode MZ, embedded module name, GUS-only selector, direct VGA mode
13h, DAC programming, retrace synchronization, CRTC offset manipulation,
phase/timeline variables, and table-driven dword chunky rendering.
