Patch for Manic Miner

This patch changes the Manic Miner engine so that the following features:

are now controlled by the room definition, rather than special-case code. This allows MM variants to have (for example) multiple Skylab rooms, or no Eugene rooms, or this:

[Solar Power in Eugene's Lair]

Download

Download MMPATCH.ZIP to get the patched engine and a BASIC program that can apply the patch to other Manic Miner variants.

Source

The patch is against the Bug-Byte version, and goes as follows:
;Important addresses
;
BORDER	EQU	8073h	;The border colour for this room
SHEET	EQU	8407h	;Current room number
;
; Some extra flags are stored in the border colour byte. Every time the 
; game wants the border colour, it now calls C934C, which returns the low
; 3 bits of the border byte.
;
	;Original			;New
	ORG	86FCh			ORG	86FCh
	LD	A,(B8073)		CALL	C934C
;
;--------------------------------------------------------------------------
;
; Instead of checking the room number for special values,
; check the border byte
;
	ORG	876Fh			ORG	876Fh
	LD	A,(B8407)		LD	A,(B8073)
	CP	4			AND	80h
	CALL	Z,C8DF8			CALL	NZ,C8DF8 ; Eugene
        LD      A,(B8407)               LD      A,(B8073)
        CP      13                      AND     40h
        JP	Z,L8E75			JP	NZ,L8E75 ; Skylabs
	LD	A,(B8407)		LD	A,(B8073)
	CP	8			AND	20h
	CALL	NC,C8EF1 	 	CALL	NZ,C8EF1 ; Vertical guards
	LD	A,(B8407)		LD	A,(B8073)
	CP	7			AND	10h
	CALL	Z,C9135			CALL	Z,C9135	 ; Kong
	LD	A,(B8407)		LD	A,(B8073)
	CP	11			AND	8
	CALL	Z,C9135	;Kong 2		CALL	NZ,C8D73 ; Solar power
	LD	A,(B8407)		NOP
					NOP
					NOP
	CP	18			NOP
					NOP
	CALL	Z,C8D73	;Solar power	NOP
					NOP
					NOP
;
;--------------------------------------------------------------------------
;
; Some more border colour changes
;
	ORG	884Bh			ORG	884Bh
        LD      A,(B8073)               CALL    C934C

	ORG	8AF2h			ORG	8AF2h
	LD	A,(B8073)		CALL	C934C

	ORG	8B6Dh			ORG	8B6Dh
	LD	A,(B8073)		CALL	C934C
;
;--------------------------------------------------------------------------
;
; Check if guardians are bi-directional. The old code was: They are
; bi-directional in rooms 0-6, 9 and 15. The new code is: They are
; bi-directional unless the room has vertical guardians or a Kong Beast.
;
	ORG	8DD2h			ORG	8DD2h
	LD	A,(B8407) ; Room	LD	A,(B8073)
	CP	7	  		AND	30h
	JR	C,R8DE3			JR	Z,R8DE3
	CP	9			SET	7,E
	JR	Z,R8DE3			NOP
					NOP
	CP	15			NOP
					NOP
	JR	Z,R8DE3			NOP
					NOP
	SET	7,E			NOP
					NOP
;
;--------------------------------------------------------------------------	
;
; Routine to strip surplus bits from the border colour.
; Replaces some of Matthew Smith's source code.
;
	ORG	934Ch			ORG	934Ch
	DEFB	9,'DE'		C934C:	LD	A,(B8073)
	DEFB	'C',9			AND	7
	DEFB	'E'			RET
;
;--------------------------------------------------------------------------