;==========================================================================================
;
;   UNOFFICIAL SNES POWERPAK FIRMWARE V2.02 (CODENAME: "SIMBA")
;   (c) 2012/2013 by ManuLöwe (http://www.manuloewe.de/)
;
;	*** MAIN BOOTLOADER ROM LAYOUT ***
;
;==========================================================================================



; ********************** ROM makeup, SNES header ***********************

.MEMORYMAP
	DEFAULTSLOT	0
	SLOTSIZE	$8000
	SLOT 0		$8000
.ENDME



.ROMBANKMAP
	BANKSTOTAL	4
	BANKSIZE	$8000			; ROM banks are 32 KBytes in size
	BANKS		4			; 4 ROM banks = 1Mbit
.ENDRO



.SNESHEADER					; this also calculates ROM checksum & complement
	ID		"SNES"
	NAME		"SNES PowerPak Loader "
	LOROM
	SLOWROM
	CARTRIDGETYPE	$00
	ROMSIZE		$07
	SRAMSIZE	$00
	COUNTRY		$01
	LICENSEECODE	$00
	VERSION		$00
.ENDSNES



.EMPTYFILL		$FF



.BANK 0 SLOT 0
.ORG $7FB0

	.DB		"00"			; new licensee code (likely irrelevant)



; *************************** Vector tables ****************************

.SNESNATIVEVECTOR
	COP		EmptyHandler
	BRK		EmptyHandler
	ABORT		EmptyHandler
	NMI		VBlank
	UNUSED		$0000
	IRQ		EmptyHandler
.ENDNATIVEVECTOR



.SNESEMUVECTOR
	COP		EmptyHandler
	UNUSED		$0000
	ABORT		EmptyHandler
	NMI		EmptyHandler
	RESET		Main
	IRQBRK		EmptyHandler
.ENDEMUVECTOR



.BANK 0 SLOT 0
.ORG 0

.SECTION "EmptyVectors" SEMIFREE

EmptyHandler:
	rti

.ENDS



; ************************** Global variables **************************

	.INCLUDE "global_variables.asm"		; global variables



; ********************** Library routines, macros **********************

.BANK 0 SLOT 0
.ORG 0

.SECTION "InitSNESCode" FORCE

	.INCLUDE "loader_initsnes.inc.asm"	; SNES initialization routines

.ENDS



.SECTION "Joypads" SEMIFREE

	.INCLUDE "loader_joypads.inc.asm"	; SNES joypad routines

.ENDS



.SECTION "QuickCodeSection" SEMIFREE

	.INCLUDE "loader_quicksetup.inc.asm"	; SNES screen setup/Vblank/scrolling routines

.ENDS



.SECTION "SpriteInit"

	.INCLUDE "loader_sprites.inc.asm"	; SNES sprite setup routines

.ENDS



; ************************** Main loader code **************************

.SECTION "MainCode"

	.INCLUDE "loader_maincode.inc.asm"	; main bootloader code

	.INCLUDE "loader_strings.inc.asm"	; text engine

	.INCLUDE "loader_snesmod.inc.asm"	; SNESMod

	.INCLUDE "loader_sm_spc_alek.inc"	; SPC700 machine code

.ENDS



; *************************** Graphics data ****************************

.BANK 1 SLOT 0
.ORG 0

.SECTION "CharacterData"

	.INCLUDE "loader_gfxdata.inc"		; sprites, fonts, palettes

.ENDS



; ******************************* Music ********************************

.BANK 2 SLOT 0
.ORG 0

.SECTION "Music"

SOUNDBANK:

	.INCBIN "soundbnk.bnk"			; music (for developer's note)

.ENDS

; **********************************************************************
