;--------------------------------------------------------------------------------
; Hash Alphabet
; ALPHA_BOW = $0000
; ALPHA_BOOM = $0001
; ALPHA_HOOK = $0002
; ALPHA_BOMB = $0003
; ALPHA_SHROOM = $0004
; ALPHA_POWDER = $0005
; ALPHA_ROD = $0006
; ALPHA_PENDANT = $0007
; ALPHA_BOMBOS = $0008
; ALPHA_ETHER = $0009
; ALPHA_QUAKE = $000A
; ALPHA_LAMP = $000B
; ALPHA_HAMMER = $000C
; ALPHA_SHOVEL = $000D
; ALPHA_FLUTE = $000E
; ALPHA_NET = $000F
; ALPHA_BOOK = $0010
; ALPHA_BOTTLE = $0011
; ALPHA_POTION = $0012
; ALPHA_CANE = $0013
; ALPHA_CAPE = $0014
; ALPHA_MIRROR = $0015
; ALPHA_BOOTS = $0016
; ALPHA_GLOVES = $0017
; ALPHA_FLIPPERS = $0018
; ALPHA_PEARL = $0019
; ALPHA_SHIELD = $001A
; ALPHA_TUNIC = $001B
; ALPHA_HEART = $001C
; ALPHA_MAP = $001D
; ALPHA_COMPASS = $001E
; ALPHA_KEY = $001F
;--------------------------------------------------------------------------------

;--------------------------------------------------------------------------------
LoadAlphabetTilemap:
	PHB : PHA : PHX : PHY : PHP
		PHK : PLB
		SEP #$10 ; 8-bit index registers
		REP #$20 ; 16-bit accumulator

		LDX.b #$00 : -
			LDA.w FileSelect_PlayerSelectText_Top, X
			STA.l BigRAM, X
			INX #2
		CPX.b #128 : !BLT -

		LDY.b #00
		LDX.b #$00 : -
			PHX : TYX : LDA.l SeedHash, X : PLX
			AND.w #$001F ; mask to alphabet of 32

			ASL #3 : PHY : TAY
			LDA.w HashAlphabetTiles,Y : STA.l BigRAM+24, X
			LDA.w HashAlphabetTiles+2,Y : STA.l BigRAM+24+2, X
			LDA.w HashAlphabetTiles+4,Y : STA.l BigRAM+24+64, X
			LDA.w HashAlphabetTiles+6,Y : STA.l BigRAM+24+64+2, X
			PLY : INX #6 : INY
		CPX.b #25 : !BLT -

		SEP #$20 ;  8-bit accumulator

		JSR DMAAlphabetTilemap
	PLP : PLY : PLX : PLA : PLB
RTL
;--------------------------------------------------------------------------------
; DMAAlphabetTilemap:
;--------------------------------------------------------------------------------
DMAAlphabetTilemap:
        PHA : PHX
        REP #$10
        LDA.b #$01 : STA.w DMAP0
        LDA.b #$80 : STA.w VMAIN
        LDA.b #$18 : STA.w BBAD0
        LDX.w #$6060 : STX.w VMADDL
        LDA.b #BigRAM>>16 : STA.w A1B0
        LDX.w #BigRAM : STX.w A1T0L
        LDX.w #$0080 : STX.w DAS0L
        LDA.b #$01 : STA.w DMAENABLE
        SEP #$10
        PLX : PLA
RTS
;--------------------------------------------------------------------------------
HashAlphabetTilesWithBlank:
;BLANK
dw #$0188, #$0188, #$0188, #$0188
HashAlphabetTiles:
;BOW
dw #$0241|!FS_COLOR_YELLOW, #$0242|!FS_COLOR_YELLOW, #$0251|!FS_COLOR_YELLOW, #$0252|!FS_COLOR_YELLOW
;BOOM
dw #$0245|!FS_COLOR_BLUE, #$0246|!FS_COLOR_BLUE, #$0240|!FS_COLOR_BW, #$0256|!FS_COLOR_BLUE
;HOOK
dw #$0240|!FS_COLOR_RED, #$0255|!FS_COLOR_RED, #$0270|!FS_COLOR_RED, #$0240|!FS_COLOR_BW
;BOMB
dw #$024C|!FS_COLOR_BLUE, #$024D|!FS_COLOR_BLUE, #$025C|!FS_COLOR_BLUE, #$025C|!FS_COLOR_BLUE|!FS_HFLIP
;SHROOM
dw #$02A2|!FS_COLOR_RED, #$02A3|!FS_COLOR_RED, #$02B2|!FS_COLOR_RED, #$02B3|!FS_COLOR_RED
;POWDER
dw #$024A|!FS_COLOR_BROWN, #$024B|!FS_COLOR_BROWN, #$025A|!FS_COLOR_BROWN, #$025B|!FS_COLOR_BROWN
;ROD
dw #$0260|!FS_COLOR_BLUE, #$0261|!FS_COLOR_BLUE, #$0270|!FS_COLOR_BLUE, #$0271|!FS_COLOR_BLUE
;PENDANT
dw #$02C5|!FS_COLOR_GREEN, #$02C6|!FS_COLOR_GREEN, #$02D5|!FS_COLOR_GREEN, #$02D6|!FS_COLOR_GREEN
;BOMBOS
dw #$0247|!FS_COLOR_YELLOW, #$0257|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP, #$0257|!FS_COLOR_YELLOW, #$0247|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP
;ETHER
dw #$0248|!FS_COLOR_YELLOW, #$0258|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP, #$0258|!FS_COLOR_YELLOW, #$0248|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP
;QUAKE
dw #$0249|!FS_COLOR_YELLOW, #$0259|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP, #$0259|!FS_COLOR_YELLOW, #$0249|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP
;LAMP
dw #$026C|!FS_COLOR_RED, #$026C|!FS_COLOR_RED|!FS_HFLIP, #$027C|!FS_COLOR_RED, #$027D|!FS_COLOR_RED
;HAMMER
dw #$0262|!FS_COLOR_BROWN, #$0263|!FS_COLOR_BROWN, #$0272|!FS_COLOR_BROWN, #$0273|!FS_COLOR_BROWN
;SHOVEL
dw #$0264|!FS_COLOR_BROWN, #$0265|!FS_COLOR_BROWN, #$0274|!FS_COLOR_BROWN, #$0275|!FS_COLOR_BROWN
;FLUTE
dw #$0266|!FS_COLOR_BLUE, #$0267|!FS_COLOR_BLUE, #$0276|!FS_COLOR_BLUE, #$0277|!FS_COLOR_BLUE
;NET
dw #$0268|!FS_COLOR_YELLOW, #$0269|!FS_COLOR_YELLOW, #$0278|!FS_COLOR_YELLOW, #$0279|!FS_COLOR_YELLOW
;BOOK
dw #$026A|!FS_COLOR_GREEN, #$026B|!FS_COLOR_GREEN, #$027A|!FS_COLOR_GREEN, #$027B|!FS_COLOR_GREEN
;BOTTLE
dw #$0280|!FS_COLOR_BW, #$0281|!FS_COLOR_BW, #$0290|!FS_COLOR_BW, #$0291|!FS_COLOR_BW
;POTION
dw #$0282|!FS_COLOR_GREEN, #$0282|!FS_COLOR_GREEN|!FS_HFLIP, #$0292|!FS_COLOR_GREEN, #$0293|!FS_COLOR_GREEN
;CANE
dw #$025D|!FS_COLOR_RED, #$025E|!FS_COLOR_RED, #$026D|!FS_COLOR_RED, #$026E|!FS_COLOR_RED
;CAPE
dw #$0288|!FS_COLOR_RED, #$0289|!FS_COLOR_RED, #$0298|!FS_COLOR_RED, #$0299|!FS_COLOR_RED
;MIRROR
dw #$028A|!FS_COLOR_BLUE, #$028B|!FS_COLOR_BLUE, #$029A|!FS_COLOR_BLUE, #$029B|!FS_COLOR_BLUE
;BOOTS
dw #$028C|!FS_COLOR_BOOTS, #$028D|!FS_COLOR_BOOTS, #$029C|!FS_COLOR_BOOTS, #$029D|!FS_COLOR_BOOTS
;GLOVES
dw #$028E|!FS_COLOR_BROWN, #$028F|!FS_COLOR_BROWN, #$029E|!FS_COLOR_BROWN, #$029F|!FS_COLOR_BROWN
;FLIPPERS
dw #$024E|!FS_COLOR_BLUE, #$024F|!FS_COLOR_BLUE, #$025F|!FS_COLOR_BLUE|!FS_HFLIP, #$025F|!FS_COLOR_BLUE
;PEARL
dw #$02A4|!FS_COLOR_RED, #$02A5|!FS_COLOR_RED, #$02B4|!FS_COLOR_RED, #$02B5|!FS_COLOR_RED
;SHIELD
dw #$02AD|!FS_COLOR_YELLOW, #$02AE|!FS_COLOR_YELLOW, #$02BD|!FS_COLOR_YELLOW, #$02BE|!FS_COLOR_YELLOW
;TUNIC
dw #$02AF|!FS_COLOR_GREEN, #$02AF|!FS_COLOR_GREEN|!FS_HFLIP, #$02BF|!FS_COLOR_GREEN, #$02BF|!FS_COLOR_GREEN|!FS_HFLIP
;HEART
dw #$02C1|!FS_COLOR_RED, #$02C1|!FS_COLOR_RED|!FS_HFLIP, #$02D1|!FS_COLOR_RED, #$02D1|!FS_COLOR_RED|!FS_HFLIP
;MAP
dw #$02C2|!FS_COLOR_YELLOW, #$02C3|!FS_COLOR_YELLOW, #$02D2|!FS_COLOR_YELLOW, #$02D3|!FS_COLOR_YELLOW
;COMPASS
dw #$02C4|!FS_COLOR_RED, #$02C4|!FS_COLOR_RED|!FS_HFLIP, #$02D4|!FS_COLOR_RED, #$02D4|!FS_COLOR_RED|!FS_HFLIP
;KEY
dw #$026F|!FS_COLOR_YELLOW|!FS_HFLIP, #$026F|!FS_COLOR_YELLOW, #$027E|!FS_COLOR_YELLOW, #$027F|!FS_COLOR_YELLOW
;--------------------------------------------------------------------------------
FileSelect_PlayerSelectText_Top:
;db $60, $62, $00, $37
dw !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE
dw !FSTILE_BRACKET_OPEN_TOP
dw !FSTILE_SPACE, !FSTILE_C_TOP
dw !FSTILE_O_TOP
dw !FSTILE_D_TOP
dw !FSTILE_E_TOP
dw !FSTILE_SPACE, !FSTILE_SPACE
dw $05A0, $05A1
dw !FSTILE_SPACE, $05A4, $05A5
dw !FSTILE_SPACE, $05A8, $05A9
dw !FSTILE_SPACE, $05AC, $05AD
dw !FSTILE_SPACE, $05B0, $05B1
dw !FSTILE_SPACE
dw !FSTILE_BRACKET_CLOSE_TOP
dw !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE
;--------------------------------------------------------------------------------
FileSelect_PlayerSelectText_Bottom:
;db $60, $82, $00, $37
dw !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE
dw !FSTILE_BRACKET_OPEN_BOTTOM
dw !FSTILE_SPACE, !FSTILE_C_BOTTOM
dw !FSTILE_O_BOTTOM
dw !FSTILE_D_BOTTOM
dw !FSTILE_E_BOTTOM
dw !FSTILE_SPACE, !FSTILE_SPACE
dw $05A2, $05A3
dw !FSTILE_SPACE, $05A6, $05A7
dw !FSTILE_SPACE, $05AA, $05AB
dw !FSTILE_SPACE, $05AE, $05AF
dw !FSTILE_SPACE, $05B2, $05B3
dw !FSTILE_SPACE
dw !FSTILE_BRACKET_CLOSE_BOTTOM
dw !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE
;--------------------------------------------------------------------------------
