Harem Adventures format

From Princed Wiki
Jump to: navigation, search

JAR

The Java ARchive (JAR) of Prince of Persia: Harem Adventures is a MIDlet for the Java ME (J2ME/phoneME) environment. The file is a ZIP-compressed archive. Many different feature phones exist, and (thus) many different versions of Prince of Persia: Harem Adventures. This article describes the format of the version that ships with pophale, which targets a 176x208 screen, does not use the Nokia UI API, includes unpacked PNG files and unpacked levels.

Levels

This section describes the format of the .lvl files.

# Bytes Contents
1 Level width
1 Level height
Back tiles
2 # Unknown
Unknown
2 0x00 0x00
2 # Front types
Front types
2 # Front tiles
Front tiles
4 Prince X, Y
4 Exit trigger X, Y
4 Save trigger X, Y
4 Entrance image X, Y
4 Exit image X, Y
2 # Chompers
Chompers
2 # Spikes
Spikes
2 # Gates
Gates
2 # Raise
Raise
2 # Guards
Guards
2 # Potions
Potions
2 # Loose
Loose
2 0x00 0x00
2 # Text
Text

Back tiles

The back tiles are (level width x level height) bytes.

Their hex values range from 0x00 to 0x37.

Unknown

Unknown are (# Unknown) times 4 bytes:

1 byte: unknown

1 byte: unknown

1 byte: unknown

1 byte: unknown

Front types

Front types are (# Front types) times 3 bytes:

1 byte: unknown (always 0x01)

1 byte: unknown (always 0x00)

1 byte: number (0x30 = torch, 0x31 = pillar front, 0x32 = skeleton, 0x33 = wall top left slash, 0x34 = wall top left dot, 0x35 = wall bottom left, 0x36 = floor climbable)

Front tiles

Front tiles are (# Front tiles) times 7 bytes:

2 bytes: X

2 bytes: Y

1 byte: front type

1 byte: unknown (always 0x00)

1 byte: unknown (always 0x00, except for three torches it's 0x02)

Chompers

Chompers are (# Chompers) times 5 bytes:

2 bytes: X

2 bytes: Y

1 byte: unknown

Spikes

Spikes are (# Spikes) times 5 bytes:

2 bytes: X

2 bytes: Y

1 byte: right (0 = bit more spikes on the right, 1 = without the extra spikes)

Gates

Gates are (# Gates) times 6 bytes:

2 bytes: X

2 bytes: Y

2 bytes: time open

Raise

Raise are (# Raise) times 6 bytes:

2 bytes: gate

2 bytes: X

2 bytes: Y

Guards

Guards are (# Guards) times 12 bytes:

2 bytes: X

2 bytes: Y

1 byte: direction

1 byte: HP

1 byte: unknown

1 byte: imp. block

1 byte: unknown

1 byte: unknown

1 byte: unknown

1 byte: strike delay

Potions

Potions are (# Potions) times 5 bytes:

1 byte: type (0 = 5 HP, 1 = hurt, 2 = 3 HP, 3 = checkpoint animation)

2 bytes: X

2 bytes: Y

Loose

Loose are (# Loose) times 5 bytes:

2 bytes: X

2 bytes: Y

1 byte: right (0 = right side shows floor, 1 = no floor on right)

Text

Text are (# Text) bytes.