!FreeRamForMode2 = $7F9D00	;Change if it conflicts with other patches (about $40 bytes)

levelinit6D:
LDA #$10
STA $1468
STZ $1469

STZ $1BE4

LDA #$32
STA $2107

LDA #$01
STA $4300	;DMA Control

LDA #$18	;Write to VRAM
STA $4301

LDA.b #BlimpBattlefield
STA $4302
LDA.b #BlimpBattlefield>>8
STA $4303
LDA.b #BlimpBattlefield>>16
STA $4304

REP #$20
LDA #$3000	;VRAM Address
STA $2116

LDA #$1000	;Size
STA $4305
SEP #$20



LDA #$01	;And start
STA $420B



LDA #$32
STA $2107

LDA #$01
STA $4300	;DMA Control

LDA #$18	;Write to VRAM
STA $4301

LDA.b #BlimpBackground
STA $4302
LDA.b #BlimpBackground>>8
STA $4303
LDA.b #BlimpBackground>>16
STA $4304

REP #$20
LDA #$3800	;VRAM Address
STA $2116

LDA #$0800	;Size
STA $4305
SEP #$20



LDA #$01	;And start
STA $420B



LDA #$32
STA $2107

LDA #$01
STA $4300	;DMA Control

LDA #$18	;Write to VRAM
STA $4301

LDA.b #BlimpBackground
STA $4302
LDA.b #BlimpBackground>>8
STA $4303
LDA.b #BlimpBackground>>16
STA $4304

REP #$20
LDA #$3C00	;VRAM Address
STA $2116

LDA #$0800	;Size
STA $4305
SEP #$20



LDA #$01	;And start
STA $420B


LDA #$02
STA $3E
	REP #$20
	LDA #$5000
	STA $2116
;7f2000
	LDX #$00
.loop1    
	CPX #$40
	BEQ .done1
	LDA #$01CE
	STA !FreeRamForMode2,x
	INX
	INX
	BRA .loop1
.done1

.loop2    
	CPX #$80
	BEQ .done2
	LDA #$2005
	STA !FreeRamForMode2,x
	INX
	INX
	BRA .loop2
.done2
	STZ $22
	STZ $24
    	SEP #$20
	RTS