Jet Set Willy
Home -> Jet Set Willy 128 -> JSW technical information -> Jet Set Willy (Dragon 32) Room Format

_____________________________________________________________________

Jet-Set Willy (Dragon 32) Room Format

Version 1.1: 1 January 2006

by John Elliott

Disclaimer: I do not guarantee this information to be correct. This is my best guess at what is going on inside Dragon 32 JSW, after wandering around inside it with a disassembler.

Dragon 32 JSW is an oddity. Like Spectrum JSW2, it has a very different game engine and data format; room definitions are simplified and compressed mercilessly in order to fit within the Dragon's limited memory. The other obvious difference is that everything is in black and white; items wobble to stand out.

Rooms

Room lookup starts with a table at 7532h-75C5h. It contains 74 words; each is the address of the corresponding room definition.

Room Layout

The first thing we find is the shape of the room. This is stored as a number of 'strips' of character cells. There are vertical strips (one character wide), horizontal strips (one high) and diagonal strips.

	DB	n	;Number of vertical strips that follow
			;Then for each strip:
	  DB	cell	;Cell bitmap to use. 
	  DB	x	;1-based X-coord of vertical slice
	  DB	y	;1-based Y-coord of vertical slice
	  DB	h	;Height of vertical strip.

	DB	n	;Number of horizontal strips that follow
			;Then for each strip:
	  DB	cell	;Cell bitmap to use
	  DB	x	;X-coord
	  DB	y	;Y-coord
	  DB	w	;Width of strip

	DB	n	;Number of diagonal strips
			;If n > 0:
	  DB	direction ; 0=\  1=/
			;Then for each strip:
	  DB	cell	;Cell bitmap to use
	  DB	x	;X-coord of top
	  DB	y	;Y-coord of top
	  DB	len	;Length of ramp	
  1. Coordinates are 1-based, and in character cells.
  2. The cell bitmap is an index into a table at 7472h, with 8 bytes per cell.
  3. Cell types (earth, water or ramp) appear to be fixed. So cell types 0, 8 and 22 are always earth; types 2,3,10,12 and 15 are always ramps; and so on.

Exits, conveyors, ropes, name

The room definition continues with the exits.

	DB	u,d,l,r	;Exits up/down/left/right.

	DB	cflag	;Conveyor type. 
			;0 => no conveyor
			;1 => Default. 
			;2 => The table in Ballroom West.
			;3 => The bath in the Bathroom. This is formed 
			;    from three different 8x8 graphics.
	
			; If cflag is nonzero, the following 4 bytes are 
			; present:
	  DB	cdir	;Conveyor direction  0=right 1=left
	  DB	x	;1-based X coordinate of left-hand end
	  DB	y	;1-based Y coordinate of left-hand end
	  DB	len	;Length of conveyor, in cells
	DB	rflag	;Rope flag. It is either 0, 1 or 0xFF.
			;0 => There is no rope.
			;1 => Rope of length 30 (used in the Beach and 
			;     We Must Perform a Quirkafleeg)
			;0xFF => Rope of length 31 (used everywhere else)

	DB	len	 ;Length of room name
	DB	roomname ; Variable-length. The game engine centres it.

Static 1x1 objects

These immediately follow the room name.

	DB	n	;Number of fire cells in this room
	  		;If n > 0:
	  DB	cell	;Cell bitmap, from a table of 8x8 cells at 7B92h
			;Repeated for each cell:
	  DB	x,y	;1-based coordinates of the fire cell

 	DB	n	;Number of takeable items in this room
	  DB	cell	;Cell bitmap, from a table of 8x8 cells at 7B92h
			;Repeated for each cell:
	  DB	id	;Item ID (unique in the game)
	  DB	x,y	;1-based coordinates of the item.

Guardians

The guardian list describes vertical, horizontal and stationary guardians. Stationary guardians have bounds like vertical ones, but don't appear to use them.

	DB	n	;Number of guardians
			;For each guardian:
	  DB	type	;Guardian type
			; 0 => Vertical
			; 1 => Stationary (Maria or the toilet)
			; 2 => Horizontal
	  DB	sprite	;Sprite number. This refers to a table of words at 
			;5DACh. Each word in the table points to the first
			;bitmap in a set. Unlike the Spectrum version, a 
			;set of bitmaps can have fewer than 8 entries.
	  DB	bound1	;Left or upper bound (in pixels)
	  DB	bound2	;Right or lower bound
	  DB	x	;X-coordinate, zero based, in pixels
	  DB	y	;Y-coordinate, zero based, in pixels
	  DB	dir	;Direction. 0=up / left, 8=down / right
	  DB	frames	;Number of frames in the animation
	  DB	fast	;Vertical guards: fast animation flag 
			;Horizontal guardians: Animation OR mask
	  DB	?	;Always 0
	  DB	speed	;Movement speed. 
	  DB	offset	;Vertical guardians: Animation OR mask

If there are any arrows, these come after the guardian definitions.

	DB	count		;Number of arrows. 
				;Then for each arrow:
	  DB	y		;Y-coordinate of arrow, 1-based, in character
				;cells.
	  DB	direction	;0 => going right
				;1 => going left

Guardian notes

  1. Guardians appear to move faster in the Dragon version than in the Spectrum version (tested by running two emulators side by side). This is because the entire game is run faster on the Dragon than it is on the Spectrum.
  2. The starting direction of vertical guardians is reversed compared to Spectrum JSW (compare the behaviour of the razor blade on the Landing, for instance).
  3. Spectrum JSW moves guardians and then checks their movement bounds. Dragon JSW checks first and then moves, which can lead to annoying problems when trying to convert from one format to the other.

Font

The font is at 7930h, and has 37 characters:

0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ:
_____________________________________________________________________

John Elliott
23-12-2005.