playmylevel

by asmagicianmaks

Game: SMW

Description:

CarlModule:
	LDA #$00
	PHA
	PLB
	LDY $0100|!addr
	LDA.l !carl_initialized
	BNE +
CPY #$0B
BNE ++
LDA $0DD5|!addr
AND #$7F
BEQ ++
LDA #$DE
LDX #$C0
LDY #$DE
RTL
++
	CPY #$0F
	BNE .ret
	LDA #$01
	STA.l !carl_initialized
	RTL
+
	DEC
	BNE +
	CPY #$11
	BNE .ret
	LDA #$10	;Prevent running module twice in case of NMI
	STA.l !carl_initialized
	JSR GameMode11
	LDA #$29
	STA $0100|!addr
	LDA #$02
	STA.l !carl_initialized
	RTL
+
	DEC
	BNE +
	STZ $4200
	LDA #$12
	STA $0100|!addr
	LDA #$10	;Prevent running module twice in case of NMI
	STA.l !carl_initialized
	JSR GameMode12
	LDA #$03
	STA.l !carl_initialized
	RTL
+
CMP #$10
BEQ .ret
	LDA #$00
	STA.l !carl_initialized
.ret
	RTL

;Game Mode 11
GameMode11:
	STZ $4200
	STZ $15
	STZ $16
	STZ $17
	STZ $18
	LDA.w $141A|!addr
	BNE +
	LDA.w $141D|!addr
	BEQ +
	JSL $04DC09|!bank
+
	STZ.w $13D5|!addr
	STZ.w $13D9|!addr
	LDA.b #$50
	STA.w $13D6|!addr
	JSL CODE_05D796
	LDX.b #$07
-
	LDA $1A,X
	STA.w $1462|!addr,X
	DEX
	BPL -
	LDA.l $009702|!bank
	CMP #$EA
	BEQ +
	PHK
	PEA.w (+)-1
	PEA.w $84CE
	JML $008134|!bank
+
	PHK
	PEA.w (+)-1
	PEA.w $84CE
	JML $00A635|!bank
+
	LDA.b #$20
	STA $5E
	STZ $13CD|!addr	;LM3 thing, has flags for left facing entrance and BG height
	PHK
	PEA.w (+)-1
	PEA.w $84CE
	JML $00A796|!bank
+
	INC.w $1404|!addr
	JSL $00F6DB|!bank
	JSL CODE_05801E
	PHK
	PEA.w (+)-1
	PEA.w $84CE
	JML $00971A|!bank	;Run the end as normal
+
	;Change timer,music,etc
	RTS

CODE_05801E:
	PHP
	SEP #$20
	REP #$10
	LDX.w #$0000
-
	LDA.b #$25
	STA.l $7EB900,X
	STA.l $7EBB00,X
	INX
	CPX.w #$0200
	BNE -
	STZ.w $1928|!addr
	LDA $6A
	CMP.b #$FF
	BNE +
	REP #$10
	LDY.w #$0000
	LDX $68
	CPX.w #$E8FE
	BCC ++
	LDY.w #$0001
++
	LDX.w #$0000
	TYA
-
	STA.l $7EBD00,X
	STA.l $7EBF00,X
	INX
	CPX.w #$0200
	BNE -
	LDA.b #$0C
	STA $6A
	STZ.w $1932|!addr
	STZ.w $1931|!addr
	LDX.w #$B900
	STX $0D
	REP #$20
	PHK
	PEA.w (+)-1
	PEA.w $8124
	JML $058126|!bank
+
	JML $058074|!bank



CODE_05D796:					;-----------| Primary header loading subroutine. Also handles No-Yoshi and CI2.
	PHB							;$05D796	|
	PHK							;$05D797	|
	PLB							;$05D798	|
	SEP #$30					;$05D799	|
	STZ.w $13CF					;$05D79B	|
	LDA.w $141A					;$05D7AB	|\ 
	BNE CODE_05D7B3				;$05D7AE	|| Jump further down if entering a level for the first time (i.e. not a sublevel).
	JMP CODE_05D83E				;$05D7B0	|/

CODE_05D7B3:					;```````````| Loading a sublevel.
	LDX $95						;$05D7B3	|
	LDA $5B						;$05D7B5	|
	AND.b #$01					;$05D7B7	|
	BEQ CODE_05D7BD				;$05D7B9	|
	LDX $97						;$05D7BB	|
CODE_05D7BD:					;			|
	LDA.w $19B8,X				;$05D7BD	|\ 
	STA.w $17BB					;$05D7C0	|| Get level number to load.
	STA $0E						;$05D7C3	|/
	STZ $0F						;$05D7D2	|
	LDA.w $1B93					;$05D7D4	|\ Branch if this is not a secondary exit.
	BEQ CODE_05D83B				;$05D7D7	|/
	REP #$30					;$05D7D9	|
	LDA.w #$0000				;$05D7DB	|
	SEP #$20					;$05D7DE	|
	LDY $0E						;$05D7E0	|
	LDA.w DATA_05F800,Y			;$05D7E2	|
	STA $0E						;$05D7E5	|
	STA.w $17BB					;$05D7E7	|
	LDA.w DATA_05FA00,Y			;$05D7EA	|
	STA $00						;$05D7ED	|
	AND.b #$0F					;$05D7EF	|
	TAX							;$05D7F1	|
	LDA.l DATA_05D730,X			;$05D7F2	|
	STA $96						;$05D7F6	|
	LDA.l DATA_05D740,X			;$05D7F8	|
	STA $97						;$05D7FC	|
	LDA $00						;$05D7FE	|
	AND.b #$30					;$05D800	|
	LSR							;$05D802	|
	LSR							;$05D803	|
	LSR							;$05D804	|
	LSR							;$05D805	|
	TAX							;$05D806	|
	LDA.l DATA_05D708,X			;$05D807	|
	STA $1C						;$05D80B	|
	LDA $00						;$05D80D	|
	LSR							;$05D80F	|
	LSR							;$05D810	|
	LSR							;$05D811	|
	LSR							;$05D812	|
	LSR							;$05D813	|
	LSR							;$05D814	|
	TAX							;$05D815	|
	LDA.l DATA_05D70C,X			;$05D816	|
	STA $20						;$05D81A	|
	LDA.w DATA_05FC00,Y			;$05D81C	|
	STA $01						;$05D81F	|
	LSR							;$05D821	|
	LSR							;$05D822	|
	LSR							;$05D823	|
	LSR							;$05D824	|
	LSR							;$05D825	|
	TAX							;$05D826	|
	LDA.l DATA_05D750,X			;$05D827	|
	STA $94						;$05D82B	|
	LDA.l DATA_05D758,X			;$05D82D	|
	STA $95						;$05D831	|
	LDA.w DATA_05FE00,Y			;$05D833	|
	AND.b #$07					;$05D836	|
	STA.w $192A					;$05D838	|
CODE_05D83B:					;			|
	JMP CODE_05D8B7				;$05D83B	|



CODE_05D83E:					;-----------| Routine for loading a primary level.
	STZ $0F						;$05D83E	|
	LDY.b #$00					;$05D840	|
	REP #$30					;$05D847	|
	STZ $1A						;$05D849	|
	STZ $1E						;$05D84B	|
	LDX.w $0DD6					;$05D84D	|\ 
	LDA.w $1F1F,X				;$05D850	|| Get location on the map, quadrant format.
	AND.w #$000F				;$05D853	||
	STA $00						;$05D856	|| $00 contains 00000000 0000xxxx...
	LDA.w $1F21,X				;$05D858	||
	AND.w #$000F				;$05D85B	||
	ASL							;$05D85E	||
	ASL							;$05D85F	||
	ASL							;$05D860	||
	ASL							;$05D861	||
	STA $02						;$05D862	|| ...$02 contains 00000000 yyyy0000...
	LDA.w $1F1F,X				;$05D864	||
	AND.w #$0010				;$05D867	||
	ASL							;$05D86A	||
	ASL							;$05D86B	||
	ASL							;$05D86C	||
	ASL							;$05D86D	||
	ORA $00						;$05D86E	||
	STA $00						;$05D870	|| ...$00 now contains 0000000X 0000xxxx...
	LDA.w $1F21,X				;$05D872	||
	AND.w #$0010				;$05D875	||
	ASL							;$05D878	||
	ASL							;$05D879	||
	ASL							;$05D87A	||
	ASL							;$05D87B	||
	ASL							;$05D87C	||
	ORA $02						;$05D87D	|| ...and finally X contains 000000YX yyyyxxxx.
	ORA $00						;$05D87F	||
	TAX							;$05D881	||
	LDA.w $0DD6					;$05D882	||\ 
	AND.w #$00FF				;$05D885	|||
	LSR							;$05D888	|||
	LSR							;$05D889	|||
	TAY							;$05D88A	|||
	LDA.w $1F11,Y				;$05D88B	||| If on submap, change that to 000001YX yyyyxxxx.
	AND.w #$000F				;$05D88E	|||
	BEQ CODE_05D899				;$05D891	|||
	TXA							;$05D893	|||
	CLC							;$05D894	|||
	ADC.w #$0400				;$05D895	|||
	TAX							;$05D898	|//
CODE_05D899:					;			|
	SEP #$20					;$05D899	|
	LDA.l $7ED000,X				;$05D89B	|\ Store level number of the tile Mario is currently on to translevel number.
	STA.w $13BF					;$05D89F	|/
CODE_05D8A2:					;			|
	LDA #$00
	STA $0E						;$05D8AC	||
	STZ $0F						;$05D8B5	|
CODE_05D8B7:					;			|
	REP #$30					;$05D8B7	|
	LDA $0E						;$05D8B9	|\ 
	ASL							;$05D8BB	||
	CLC							;$05D8BC	|| Get index to level data pointer table (multiply by 3).
	ADC $0E						;$05D8BD	||
	TAY							;$05D8BF	|/
	SEP #$20					;$05D8C0	|
	LDA.w Layer1Ptrs,Y			;$05D8C2	|\ 
	STA $65						;$05D8C5	||
	LDA.w Layer1Ptrs+1,Y		;$05D8C7	|| Store Layer 1 data pointer to RAM.
	STA $66						;$05D8CA	||
	LDA.w Layer1Ptrs+2,Y		;$05D8CC	||
	STA $67						;$05D8CF	|/
	LDA.w Layer2Ptrs,Y			;$05D8D1	|\ 
	STA $68						;$05D8D4	||
	LDA.w Layer2Ptrs+1,Y		;$05D8D6	|| Store Layer 2 data pointer to RAM.
	STA $69						;$05D8D9	||
	LDA.w Layer2Ptrs+2,Y		;$05D8DB	||
	STA $6A						;$05D8DE	|/
	LDA.w SprPtrs,Y		
	STA $CE				
	LDA.w SprPtrs+1,Y	
	STA $CF				
	LDA.w SprPtrs+2,y	
	STA $D0				
	LDA [$CE]			
	AND.b #$3F					;$05D8FB	|| Store sprite memory setting.
	STA.w $1692					;$05D8FD	|/
	LDA [$CE]					;$05D900	|\ 
	AND.b #$C0					;$05D902	|| Store sprite buoyancy settings.
	STA.w $190E					;$05D904	|/
	REP #$10					;$05D907	|
	SEP #$20					;$05D909	|
	LDY $0E						;$05D90B	|
	LDA.w DATA_05F000,Y			;$05D90D	|\ 
	LSR							;$05D910	||
	LSR							;$05D911	|| 
	LSR							;$05D912	||
	LSR							;$05D913	|| Store horizontal and vertical scroll settings for Layer 2.
	TAX							;$05D914	||
	LDA.l DATA_05D720,X			;$05D915	||
	STA.w $1413					;$05D919	||
	LDA.l DATA_05D710,X			;$05D91C	||
	STA.w $1414					;$05D920	|/
	LDA.b #$01					;$05D923	|\ Enable horizontal scrolling.
	STA.w $1411					;$05D925	|/
	LDA.w DATA_05F200,Y			;$05D928	|\ 
	AND.b #$C0					;$05D92B	||
	CLC							;$05D92D	||
	ASL							;$05D92E	|| Store Layer 3 settings.
	ROL							;$05D92F	||
	ROL							;$05D930	||
	STA.w $1BE3					;$05D931	|/
	STZ $1D						;$05D934	|\ Zero Layer 1 and 2 high Y positions.
	STZ $21						;$05D936	|/
	LDA.w DATA_05F600,Y			;$05D938	|\ 
	AND.b #$80					;$05D93B	|| Store No Yoshi flag.
	STA.w $141F					;$05D93D	|/
	LDA.w DATA_05F600,Y			;$05D940	|\ 
	AND.b #$60					;$05D943	||
	LSR							;$05D945	||
	LSR							;$05D946	|| Store vertical level flags.
	LSR							;$05D947	||
	LSR							;$05D948	||
	LSR							;$05D949	||
	STA $5B						;$05D94A	|/
	LDA.w $1B93					;$05D94C	|\ Branch if this is a secondary exit.
	BNE CODE_05D9A1				;$05D94F	|/
	LDA.w DATA_05F000,Y			;$05D951	|\ 
	AND.b #$0F					;$05D954	||
	TAX							;$05D956	||
	LDA.l DATA_05D730,X			;$05D957	|| Store entrance Y position.
	STA $96						;$05D95B	||
	LDA.l DATA_05D740,X			;$05D95D	||
	STA $97						;$05D961	|/
	LDA.w DATA_05F200,Y			;$05D963	|\ 
	STA $02						;$05D966	||
	AND.b #$07					;$05D968	||
	TAX							;$05D96A	|| Store entrance X position.
	LDA.l DATA_05D750,X			;$05D96B	||
	STA $94						;$05D96F	||
	LDA.l DATA_05D758,X			;$05D971	||
	STA $95						;$05D975	|/
	LDA $02						;$05D977	|\ 
	AND.b #$38					;$05D979	||
	LSR							;$05D97B	|| Store Mario entrance action.
	LSR							;$05D97C	||
	LSR							;$05D97D	||
	STA.w $192A					;$05D97E	|/
	LDA.w DATA_05F400,Y			;$05D981	|\ 
	STA $02						;$05D984	||
	AND.b #$03					;$05D986	|| Store BG initial position.
	TAX							;$05D988	||
	LDA.l DATA_05D70C,X			;$05D989	||
	STA $20						;$05D98D	|/
	LDA $02						;$05D98F	|\ 
	AND.b #$0C					;$05D991	||
	LSR							;$05D993	||
	LSR							;$05D994	|| Store FG initial position.
	TAX							;$05D995	||
	LDA.l DATA_05D708,X			;$05D996	||
	STA $1C						;$05D99A	|/
	LDA.w DATA_05F600,Y			;$05D99C	|
	STA $01						;$05D99F	|
CODE_05D9A1:					;			|
	LDA $5B						;$05D9A1	|\ 
	AND.b #$01					;$05D9A3	|| Branch if not a vertical level.
	BEQ CODE_05D9B8				;$05D9A5	|/
	LDY.w #$0000				;$05D9A7	|\ 
	LDA [$65],Y					;$05D9AA	|| Store spawn screen number?
	AND.b #$1F					;$05D9AC	||
	STA $97						;$05D9AE	|/
	INC A						;$05D9B0	|\ Store level length (vertical level)
	STA $5F						;$05D9B1	|/
	LDA.b #$01					;$05D9B3	|\ Enable vertical scrolling.
	STA.w $1412					;$05D9B5	|/
CODE_05D9B8:					;			|
	LDA.w $141A					;$05D9B8	|\ If not the first room of the level, end.
	BNE CODE_05D9EC				;$05D9BB	|/
	LDA $02						;$05D9BD	|\ 
	LSR							;$05D9BF	||
	LSR							;$05D9C0	|| Store midway screen.
	LSR							;$05D9C1	||
	LSR							;$05D9C2	||
	STA.w $13CD					;$05D9C3	|/
	STZ.w $13CE					;$05D9C6	| Reset midway point flag.
	LDX.w $13BF
	LDA.l $05D608|!bank,X			;Store the event the level activates.
	STA.w $1DEA
	SEP #$10					;$05D9D2	|
	LDX.w $13BF					;$05D9D4	|\ 
	LDA.w $1EA2,X				;$05D9D7	|| Check if midway flag has been set.
	AND.b #$40					;$05D9DA	|| Branch if not.
	BEQ CODE_05D9EC				;$05D9DC	|/
	STA.w $13CF					;$05D9DE	| Override the No Yoshi entrance cutscene.
	LDA $02						;$05D9E1	|\ 
	LSR							;$05D9E3	||
	LSR							;$05D9E4	|| Store Mario spawn screen position for midpoint.
	LSR							;$05D9E5	||
	LSR							;$05D9E6	||
	STA $95						;$05D9E7	|/
	JMP CODE_05DA17				;$05D9E9	|

CODE_05D9EC:
	REP #$10					;$05D9EC	|
	LDA $01						;$05D9EE	|\ 
	AND.b #$1F					;$05D9F0	|| $01 = eeeee bits of $05F600
	STA $01						;$05D9F2	|/
	LDA $5B						;$05D9F4	|\ 
	AND.b #$01					;$05D9F6	|| Check if Layer 1 is horizontal.
	BNE CODE_05DA01				;$05D9F8	|/
	LDA $01						;$05D9FA	|\ If horizontal, store Mario's spawn screen number (X).
	STA $95						;$05D9FC	|/
	JMP CODE_05DA17				;$05D9FE	|

CODE_05DA01:
	LDA $01						;$05DA01	|\ If vertical, store Mario's spawn screen number (Y).
	STA $97						;$05DA03	|/
	STA $1D						;$05DA05	| Store Layer 1's Y position screen number.
	SEP #$10					;$05DA07	|
	LDY.w $1414					;$05DA09	|\ 
	CPY.b #$03					;$05DA0C	|| If Layer 2's scroll speed isn't "slow", store its Y position screen number.
	BEQ CODE_05DA12				;$05DA0E	||
	STA $21						;$05DA10	|/
CODE_05DA12:					;			|
	LDA.b #$01					;$05DA12	|\ Enable vertical scrolling (always on in vertical levels)
	STA.w $1412					;$05DA14	|/
CODE_05DA17:					;			|
	SEP #$30					;$05DA17	|

CODE_05DA24:
	LDX.b #$04					;$05DA24	|\ 
	LDY.b #$04					;$05DA26	||
	LDA [$65],Y					;$05DA28	||
	AND.b #$0F					;$05DA2A	|| If the level's tileset doesn't use a No Yoshi intro, skip over the load routine.
CODE_05DA2C:					;			||
	CMP.l DATA_05D760,X			;$05DA2C	||
	BEQ CODE_05DA38				;$05DA30	||
	DEX							;$05DA32	||
	BPL CODE_05DA2C				;$05DA33	|/
CODE_05DA35:					;			|
	JMP CODE_05DAD7				;$05DA35	|

CODE_05DA38:
	LDA.w $141A					;$05DA38	|\ 
	BNE CODE_05DA35				;$05DA3B	|| If not the first levelm
	LDA.w $141D					;$05DA3D	||  Mario Start! is disabled,
	BNE CODE_05DA35				;$05DA40	||  or the No Yoshi entrance is disabled,
	LDA.w $141F					;$05DA42	||  don't show the No Yoshi entrance.
	BNE CODE_05DA35				;$05DA45	|/
	LDA.w $13BF					;$05DA47	|
	CMP.b #$31					;$05DA4A	|\ 
	BEQ CODE_05DA5E				;$05DA4C	||
	CMP.b #$32					;$05DA4E	||
	BEQ CODE_05DA5E				;$05DA50	|| Five levels which will use the
	CMP.b #$34					;$05DA52	||  dark-background castle intro if
	BEQ CODE_05DA5E				;$05DA54	||  the level is set to tileset 1.
	CMP.b #$35					;$05DA56	||
	BEQ CODE_05DA5E				;$05DA58	||
	CMP.b #$40					;$05DA5A	||
	BNE CODE_05DA60				;$05DA5C	|/
CODE_05DA5E:					;			|
	LDX.b #$05					;$05DA5E	|
CODE_05DA60:					;			|
	LDA.w $13CF					;$05DA60	|\ Check if No Yoshi intro has been overriden by midpoint.
	BNE CODE_05DAD0				;$05DA63	|/
	LDA.l DATA_05D790,X			;$05DA65	|\ 
	STA $96						;$05DA69	|| Load the No Yoshi cutscene.
	LDA.b #$01					;$05DA6B	||
	STA $97						;$05DA6D	||
	LDA.b #$30					;$05DA6F	||
	STA $94						;$05DA71	||
	STZ $95						;$05DA73	||
	LDA.b #$C0					;$05DA75	||
	STA $1C						;$05DA77	||
	STA $20						;$05DA79	||
	STZ.w $192A					;$05DA7B	||
	LDA.b #$EE					;$05DA7E	||\ 
	STA $CE						;$05DA80	|||
	LDA.b #$C3					;$05DA82	||| Set sprite data pointer to $07C3EE (no sprites).
	STA $CF						;$05DA84	|||
	LDA.b #$07					;$05DA86	||/
	STA $D0						;$05DA88	||
	LDA [$CE]					;$05DA8A	||
	AND.b #$3F					;$05DA8C	||
	STA.w $1692					;$05DA8E	||
	LDA [$CE]					;$05DA91	||
	AND.b #$C0					;$05DA93	||
	STA.w $190E					;$05DA95	||
	STZ.w $1413					;$05DA98	||
	STZ.w $1414					;$05DA9B	||
	STZ.w $1411					;$05DA9E	||
	STZ $5B						;$05DAA1	||
	LDA.l DATA_05D78A,X			;$05DAA3	||
	STA.w $1BE3					;$05DAA7	||
	STX $00						;$05DAAA	||
	TXA							;$05DAAC	||
	ASL							;$05DAAD	||
	CLC							;$05DAAE	||
	ADC $00						;$05DAAF	||
	TAY							;$05DAB1	||
	LDA.w PtrsLong05D766,Y		;$05DAB2	||
	STA $65						;$05DAB5	||
	LDA.w PtrsLong05D766+1,Y	;$05DAB7	||
	STA $66						;$05DABA	||
	LDA.w PtrsLong05D766+2,Y	;$05DABC	||
	STA $67						;$05DABF	||
	LDA.w PtrsLong05D778,Y		;$05DAC1	||
	STA $68						;$05DAC4	||
	LDA.w PtrsLong05D778+1,Y	;$05DAC6	||
	STA $69						;$05DAC9	||
	LDA.w PtrsLong05D778+2,Y	;$05DACB	||
	STA $6A						;$05DACE	|/
CODE_05DAD0:					;			|
	LDA.l DATA_05D760,X			;$05D7D0	|\ Store tileset settings.
	STA.w $1931					;$05DAD4	|/
CODE_05DAD7:					;			|
	PLB							;$05DAEB	|
	SEP #$30					;$05DAEC	|
	RTL							;$05DAEE	|

DATA_05D708:					;$05D708	| FG initial positions.
	db $00,$60,$C0,$00

DATA_05D70C:					;$05D70C	| BG initial positions.
	db $60,$90,$C0,$00

DATA_05D710:					;$05D710	| Vertical scroll settings for Layer 2.
	db $03,$01,$01,$00,$00,$02,$02,$01
	db $00,$00,$00,$00,$00,$00,$00,$00

DATA_05D720:					;$05D720	| Horizontal scroll settings for Layer 2.
	db $02,$02,$01,$00,$01,$02,$01,$00
	db $00,$00,$00,$00,$00,$00,$00,$00

DATA_05D730:					;$05D730	| Initial Mario Y positions for entrances.
	db $00,$30,$60,$80,$A0,$B0,$C0,$E0
	db $10,$30,$50,$60,$70,$90,$00,$00

DATA_05D740:					;$05D740	| Initial Mario Y subscreen positions.
	db $00,$00,$00,$00,$00,$00,$00,$00
	db $01,$01,$01,$01,$01,$01,$01,$01

DATA_05D750:					;$05D750	| Initial Mario X positions for entrances.
	db $10,$80,$00,$E0,$10,$70,$00,$E0

DATA_05D758:					;$05D758	| Initial Mario X subscreen positions.
	db $00,$00,$00,$00,$01,$01,$01,$01

DATA_05D760:					;$05D760	| The tileset each No Yoshi intro is used with.
	db $05,$01,$02,$06,$08,$01				; The last byte is only used for the 5 associated levels at $05DA4A.

PtrsLong05D766:					;$05D766	| Pointers for the No Yoshi intros (layer 1).
	dl $078000				; Ghouse house entrance
	dl $07801E				; Castle entrance 1
	dl $07804E				; Sign entrance 1
	dl $07809F				; Sign entrance 2
	dl $0780B1				; Sign entrance 3
	dl $078090				; Castle entrance 2

PtrsLong05D778:					;$05D778	| Pointers for the No Yoshi intros (layer 2).
	dl $078018
	dl $FFD900
	dl $FFD900
	dl $FFE684
	dl $FFDF59
	dl $FFE8EE

DATA_05D78A:					;$05D78A	| Layer 3 setting for each of the no-Yoshi entrances (for $1BE3).
	db $03,$00,$00,$00,$00,$00

DATA_05D790:					;$05D790	| Initial X positions for Mario in each of the no-Yoshi entrances.
	db $70,$70,$60,$70,$70,$70

Layer1Ptrs:
dl Level0L1,Level1L1,$068636|!bank
Layer2Ptrs:
dl $FFD900,Level1L2,$FFF45A
SprPtrs:
dl Level0Spr,Level1Spr,$07D152|!bank

DATA_05F000:					;$05F000	| Secondary level header first byte. SSSSYYYY
db $5B,$7D,$0B
DATA_05F200:					;$05F200	| Secondary level header second byte. 33AAAXXX.
db $00,$C0,$00
DATA_05F400:					;$05F400	| Secondary level header third byte. MMMMFFBB.
db $5A,$03,$00
DATA_05F600:					;$05F600	| Secondary level header fourth byte. IUVEEEEE
db $00,$67,$00

DATA_05F800:					;$05F800	| Secondary exit data first byte. Low byte of destination.
db $00
DATA_05FA00:					;$05FA00	| Secondary exit data second byte. BBFFYYYY; BG, FG, Y positions.
db $00
DATA_05FC00:					;$05FC00	| Secondary exit data third byte. XXXSSSSS; X position, screen number.
db $00
DATA_05FE00:					;$05FE00	| Secondary exit data fourth byte. S---LAAA; slippery, high level byte, mario action.
db $00









;Game Mode 12
GameMode12:
	;You can modify Map16 pointers here
	PHK
	PEA.w (+)-1
	PEA.w $84CE
	JML $00A59C|!bank
+
	;Load custom graphics
	;Load custom palette
	RTS

Level0L1:
db $2D, $40, $08, $C0, $07, $0C, $00, $01
db $77, $F0, $04, $77, $FE, $12, $F7, $F1
db $02, $77, $F8, $12, $05, $00, $01, $35
db $51, $30, $00, $00, $01, $58, $10, $43
db $77, $FB, $14, $77, $F0, $04, $94, $A0
db $00, $10, $A6, $00, $14, $94, $04, $14
db $A7, $00, $14, $05, $30, $16, $FC, $10
db $77, $F7, $12, $77, $F0, $02, $95, $F6
db $20, $14, $FE, $30, $77, $F9, $13, $94
db $F9, $31, $77, $F0, $04, $77, $FB, $14
db $B8, $34, $25, $38, $37, $23, $14, $9D
db $02, $14, $0E, $30, $58, $18, $0C, $77
db $F0, $02, $77, $F7, $12, $13, $00, $11
db $B8, $35, $25, $38, $39, $23, $10
db $90, $07, $10, $9B, $02, $17, $02, $46
db $10, $AE, $00, $14, $0E, $2C, $58, $1A
db $3D, $77, $F9, $13, $94, $05, $2A, $14
db $94, $00, $14, $AA, $00, $14, $AD, $00
db $10, $0D, $30, $77, $F0, $04, $77, $FB
db $14, $94, $A0, $00, $14, $96, $00, $10
db $99, $02, $77, $F0, $02, $77, $F7, $12
db $90, $90, $03, $14, $91, $01, $10, $A1
db $01, $17, $D6, $00, $16, $D7, $10, $15
db $D8, $20, $77, $F9, $13, $14, $D9, $30
db $14, $DC, $30, $16, $DE, $10, $17, $DF
db $00, $15, $DD, $20, $F7, $F0, $04, $17
db $D4, $00, $16, $D5, $10, $15, $D6, $20
db $14, $DB, $30, $16, $DD, $10, $77, $FE
db $11, $17, $DE, $00, $15, $DC, $20, $14
db $D7, $31, $38, $38, $25, $38, $3B, $23
db $96, $F3, $10, $14, $98, $03, $14, $AA
db $00, $77, $F0, $02, $77, $F7, $12, $97
db $D5, $00, $16, $D6, $10, $15, $D7, $20
db $14, $D8, $30, $16, $F3, $10, $13, $D9
db $40, $12, $DA, $50, $11, $DB, $60, $10
db $DC, $71, $AF, $56, $91, $09, $00, $01
db $58, $1C, $43, $1F, $00, $01, $03, $00
db $00, $01, $FF

Level0Spr:
db $04, $71, $61, $0F, $71, $82, $0F, $71
db $33, $0F, $71, $53, $0F, $F0, $05, $0F
db $F0, $25, $0F, $71, $16, $0F, $71, $36
db $0F, $71, $B6, $04, $71, $27, $0F, $71
db $47, $0F, $71, $C7, $0F, $71, $E7, $0F
db $71, $08, $0F, $71, $28, $0F, $71, $EA
db $0F, $71, $0B, $0F, $71, $7C, $7B, $FF

Level1L1:
db $67, $68, $31, $CB, $11, $60, $C0, $71
db $62, $C0, $16, $62, $C2, $12, $65, $C2
db $13, $69, $C0, $31, $6B, $C0, $14, $6B
db $C2, $12, $6E, $C2, $11, $6E, $C4, $11
db $6E, $C6, $31, $66, $CA, $19, $6E, $CC
db $31, $60, $C8, $71, $0C, $07, $90, $09
db $06, $87, $EE, $C0, $71, $6D, $C8, $12
db $6E, $CA, $21, $0F, $DD, $00, $6B, $CC
db $12, $60, $C0, $41, $60, $C5, $1B, $60
db $C7, $51, $62, $CC, $12, $00, $DD, $00
db $02, $D1, $30, $04, $D1, $30, $06, $D2
db $20, $07, $02, $87, $08, $D2, $20, $0A
db $D2, $20, $E0, $C0, $13, $65, $C0, $11
db $69, $C0, $12, $6D, $C0, $12, $6E, $C2
db $11, $6E, $C4, $51, $6E, $CA, $31, $69
db $CE, $16, $68, $C9, $15, $64, $C9, $13
db $60, $CE, $17, $60, $CB, $21, $60, $C7
db $31, $60, $C2, $41, $07, $D2, $00, $0B
db $A5, $00, $08, $A5, $00, $05, $A5, $00
db $02, $DD, $00, $0A, $0D, $19, $0B, $0D
db $1A, $0C, $0D, $1B, $0D, $0D, $1C, $E0
db $C0, $51, $60, $C6, $22, $60, $C9, $62
db $63, $C6, $61, $63, $CD, $21, $66, $CB
db $41, $66, $C8, $21, $66, $C0, $71, $68
db $CE, $11, $6E, $CB, $41, $6E, $C4, $61
db $6E, $C0, $31, $03, $02, $11, $08, $D2
db $00, $09, $D6, $00, $08, $DA, $10, $EE
db $C0, $11, $6B, $C2, $24, $67, $C5, $18
db $6E, $C7, $61, $6B, $CE, $14, $0B, $5A
db $32, $67, $C7, $61, $66, $CE, $12, $60
db $CE, $13, $60, $C5, $81, $60, $C0, $41
db $02, $95, $04, $05, $05, $2B, $E0, $C2
db $31, $60, $C6, $1A, $60, $C8, $33, $6D
db $C9, $62, $68, $CC, $11, $07, $DC, $30
db $00, $DF, $04, $EE, $C0, $B1, $60, $C3
db $18, $60, $C5, $61, $60, $CC, $34, $0A
db $A8, $02, $0B, $08, $31, $09, $DB, $04
db $EE, $C3, $A1, $64, $CB, $29, $64, $CE
db $1B, $60, $CB, $43, $00, $00, $00, $02
db $FF
Level1L2:
db $07, $68, $31, $CB, $11, $60, $CD, $13
db $E0, $C5, $1C, $6D, $C5, $12, $03, $D4
db $00, $63, $E3, $10, $65, $E3, $10, $67
db $E3, $10, $69, $E3, $10, $6B, $E3, $10
db $6D, $E3, $10, $6F, $E3, $10, $05, $D4
db $00, $07, $D4, $00, $09, $D4, $00, $0B
db $D4, $00, $0D, $D4, $00, $0F, $D4, $00
db $60, $CA, $14, $60, $CE, $16, $70, $C5
db $12, $11, $D3, $10, $73, $CA, $14, $70
db $CE, $17, $03, $00, $01, $71, $C0, $26
db $72, $C3, $12, $75, $C3, $12, $72, $C5
db $15, $70, $C7, $24, $75, $C7, $22, $71
db $CA, $12, $74, $CA, $11, $76, $CA, $31
db $70, $CC, $15, $E0, $C8, $13, $60, $CA
db $31, $62, $CA, $12, $62, $CC, $13, $71
db $C0, $16, $E0, $C0, $1B, $6E, $C0, $11
db $60, $CC, $26, $70, $C0, $17, $72, $CC
db $15, $E0, $C0, $29, $6A, $C9, $25, $70
db $C9, $21, $74, $C4, $13, $E0, $C0, $2B
db $6E, $C9, $11, $70, $C9, $17, $71, $C7
db $16, $74, $C5, $13, $FF
Level1Spr:
db $00, $B0, $90, $32, $D0, $82, $32, $90
db $82, $32, $D0, $D2, $32, $30, $53, $32
db $A0, $44, $32, $70, $55, $32, $40, $55
db $2F, $00, $77, $EF, $FF
back to listings