SURPRISE! reversed cards!

This commit is contained in:
Shoofle 2025-09-27 22:00:06 -04:00
parent 74ace20310
commit e70b752ec2
32 changed files with 1000 additions and 336 deletions

View File

@ -12,6 +12,10 @@ def Card_Offset_description equ @-TheFool
db 9, "beginning" db 9, "beginning"
db 9, "leap " db 9, "leap "
db 9, "naivete " db 9, "naivete "
def Card_Offset_description_rev equ @-TheFool
db 9, "beginning"
db 9, "reluctant"
db 9, "reckless "
def Card_Offset_tilemap equ @-TheFool def Card_Offset_tilemap equ @-TheFool
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy

View File

@ -4,6 +4,9 @@ TheMagician:
db 9, "capacity " db 9, "capacity "
db 9, "knowing " db 9, "knowing "
db 9, "manifest " db 9, "manifest "
db 9, "cunning "
db 9, "greed "
db 9, "unclear "
dw MagicianMapEnd - MagicianMap dw MagicianMapEnd - MagicianMap
dw MagicianMap dw MagicianMap
dw MagicianTilesEnd - MagicianTiles dw MagicianTilesEnd - MagicianTiles

View File

@ -4,6 +4,9 @@ TheHighPriestess:
db 9, "secrets " db 9, "secrets "
db 9, "mystery " db 9, "mystery "
db 9, "unknown " db 9, "unknown "
db 9, "secrets "
db 9, "mystery "
db 9, "unknown "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,9 @@ TheEmpress:
db 9, "diplomacy" db 9, "diplomacy"
db 9, "fecundity" db 9, "fecundity"
db 9, "nature " db 9, "nature "
db 9, "dependent"
db 9, "no growth"
db 9, "smother "
dw EmpressMapEnd - EmpressMap dw EmpressMapEnd - EmpressMap
dw EmpressMap dw EmpressMap
dw EmpressTilesEnd - EmpressTiles dw EmpressTilesEnd - EmpressTiles

View File

@ -4,6 +4,9 @@ TheEmperor:
db 9, "authority" db 9, "authority"
db 9, "control " db 9, "control "
db 9, "stability" db 9, "stability"
db 9, "tyranny "
db 9, "control "
db 9, "reckless "
dw EmperorMapEnd - EmperorMap dw EmperorMapEnd - EmperorMap
dw EmperorMap dw EmperorMap
dw EmperorTilesEnd - EmperorTiles dw EmperorTilesEnd - EmperorTiles

View File

@ -6,12 +6,18 @@ TheHierophant:
db 9, "tradition" db 9, "tradition"
db 9, "marriage " db 9, "marriage "
db 9, "religion " db 9, "religion "
db 9, "question "
db 9, "restrict "
db 9, "defiant "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles
dw .KeyArtTiles dw .KeyArtTiles
dw .SpriteTilesEnd - .SpriteTiles dw .SpriteTilesEnd - .SpriteTiles
dw .SpriteTiles dw .SpriteTiles
dw .fInit dw .fInit
dw .fUpdate dw .fUpdate
dw .fDraw dw .fDraw

View File

@ -4,6 +4,11 @@ TheLovers:
db 9, "harmony " db 9, "harmony "
db 9, "choices " db 9, "choices "
db 9, "desire " db 9, "desire "
db 9, "imbalance"
db 9, "conflict "
db 9, "detached "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ TheChariot:
db 9, "control " db 9, "control "
db 9, "direction" db 9, "direction"
db 9, "power " db 9, "power "
db 9, "forceful "
db 9, "aggress "
db 9, "obstacles"
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -1,9 +1,15 @@
Strength: Strength:
db 10, "STRENGTH " db 10, "STRENGTH "
db 10, " " db 10, " "
db 9, "courage " db 9, "courage "
db 9, "mercy " db 9, "mercy "
db 9, "grace " db 9, "grace "
db 9, "doubt "
db 9, "cowardice"
db 9, "forceful "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -1,9 +1,15 @@
TheHermit: TheHermit:
db 10, "THE HERMIT" db 10, "THE HERMIT"
db 10, " " db 10, " "
db 9, "solitary " db 9, "solitary "
db 9, "enlighten" db 9, "enlighten"
db 9, "reflect " db 9, "reflect "
db 9, "lonely "
db 9, "isolation"
db 9, "return "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -1,9 +1,15 @@
WheelOfFortune: WheelOfFortune:
db 10, "WHEEL OF " db 10, "WHEEL OF "
db 10, "FORTUNE " db 10, "FORTUNE "
db 9, "chance " db 9, "chance "
db 9, "cycles " db 9, "cycles "
db 9, "destiny " db 9, "destiny "
db 9, "bad luck "
db 9, "reluctant"
db 9, "resist "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ Justice:
db 9, "truth " db 9, "truth "
db 9, "law " db 9, "law "
db 9, "integrity" db 9, "integrity"
db 9, "injustice"
db 9, "unfair "
db 9, "revenge "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ TheHangedMan:
db 9, "surrender" db 9, "surrender"
db 9, "time " db 9, "time "
db 9, "patience " db 9, "patience "
db 9, "stagnant "
db 9, "apathy "
db 9, "impulse "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,10 @@ Death:
db 9, "change " db 9, "change "
db 9, "endings " db 9, "endings "
db 9, "upheaval " db 9, "upheaval "
db 9, "fear "
db 9, "dependent"
db 9, "repeating"
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,10 @@ Temperance:
db 9, "balance " db 9, "balance "
db 9, "moderate " db 9, "moderate "
db 9, "effort " db 9, "effort "
db 9, "discord "
db 9, "reckless "
db 9, "excess "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ TheDevil:
db 9, "obsession" db 9, "obsession"
db 9, "greed " db 9, "greed "
db 9, "powerless" db 9, "powerless"
db 9, "detached "
db 9, "reveal "
db 9, "reclaim "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ TheTower:
db 9, "calamity " db 9, "calamity "
db 9, "collapse " db 9, "collapse "
db 9, "change " db 9, "change "
db 9, "delay "
db 9, "avoid "
db 9, "avert "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ TheStar:
db 9, "hope " db 9, "hope "
db 9, "healing " db 9, "healing "
db 9, "purpose " db 9, "purpose "
db 9, "hopeless "
db 9, "monotony "
db 9, "despair "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ TheMoon:
db 9, "doubt " db 9, "doubt "
db 9, "fear " db 9, "fear "
db 9, "dreams " db 9, "dreams "
db 9, "fear "
db 9, "deception"
db 9, "unveiled "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles
@ -32,59 +37,7 @@ TheMoon:
ld [hl+], a ; CVS+6 x of cloud 5 ld [hl+], a ; CVS+6 x of cloud 5
call SetUpEdgeMasks call SetUpEdgeMasks
ret
.fUpdate:
ld hl, CVS
call IncrementTimer
ld a, [CVS+1] ; checking the high byte of the timer
cp a, $02 ; $10 = 1 second, $02 = 1/8 of a second
ret c
ld a, 0
ld [CVS], a
ld [CVS+1], a
ld a, [CVS+2]
sub a, 1
cp a, 100
jp c, :+
ld a, 100
: ld [CVS+2], a
ld a, [CVS+3]
sub a, 1
cp a, 80
jp c, :+
ld a, 80
: ld [CVS+3], a
ld a, [CVS+4]
sub a, 2
cp a, 105
jp c, :+
ld a, 105
: ld [CVS+4], a
ld a, [CVS+5]
sub a, 1
cp a, 120
jp c, :+
ld a, 120
: ld [CVS+5], a
ld a, [CVS+6]
sub a, 2
cp a, 110
jp c, :+
ld a, 110
: ld [CVS+6], a
call .drawClouds
ret
.drawClouds:
ld hl, .cloud1 ld hl, .cloud1
ld de, MY_OAM + 10*4 ld de, MY_OAM + 10*4
ld b, 76 ld b, 76
@ -132,8 +85,101 @@ TheMoon:
ld a, $15 ld a, $15
call BuildMetaSprite call BuildMetaSprite
ret
.fUpdate:
ld a, 1
ld [cvNeedsCleanup], a
call CleanUpOutsideSprites ld hl, CVS
call IncrementTimer
ld a, [CVS+1] ; checking the high byte of the timer
cp a, $02 ; $10 = 1 second, $02 = 1/8 of a second
ret c
ld a, 0
ld [CVS], a
ld [CVS+1], a
ld a, [CVS+2]
sub a, 1
cp a, 100
jr c, :+
ld a, 100
: ld [CVS+2], a
ld a, [CVS+3]
sub a, 1
cp a, 80
jr c, :+
ld a, 80
: ld [CVS+3], a
ld a, [CVS+4]
sub a, 2
cp a, 105
jr c, :+
ld a, 105
: ld [CVS+4], a
ld a, [CVS+5]
sub a, 1
cp a, 120
jr c, :+
ld a, 120
: ld [CVS+5], a
ld a, [CVS+6]
sub a, 2
cp a, 110
jr c, :+
ld a, 110
: ld [CVS+6], a
call .drawClouds
ret
.drawClouds:
ld de, MY_OAM + 10*4
ld b, 76
ld a, [CVS+2]
sub a, 0
ld c, a
ld a, $11
call PositionMetaSprite
ld de, MY_OAM + 11*4
ld b, 68
ld a, [CVS+3]
sub a, 0
ld c, a
ld a, $11
call PositionMetaSprite
ld de, MY_OAM + 12*4
ld b, 60
ld a, [CVS+4]
sub a, 16
ld c, a
ld a, $15
call PositionMetaSprite
ld de, MY_OAM + 18*4
ld b, 40
ld a, [CVS+5]
sub a, 40
ld c, a
ld a, $27
call PositionMetaSprite
ld de, MY_OAM + 31*4
ld b, 32
ld a, [CVS+6]
sub a, 32
ld c, a
ld a, $15
call PositionMetaSprite
ret ret
.fDraw: ret .fDraw: ret

View File

@ -4,6 +4,11 @@ TheSun:
db 9, "joy " db 9, "joy "
db 9, "warmth " db 9, "warmth "
db 9, "success " db 9, "success "
db 9, "pessimism"
db 9, "conceit "
db 9, "optimism "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -4,6 +4,11 @@ Judgement:
db 9, "judgement" db 9, "judgement"
db 9, "renewal " db 9, "renewal "
db 9, "finality " db 9, "finality "
db 9, "doubt "
db 9, "held back"
db 9, "reflect "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -12,6 +12,12 @@ TheWorld:
db 9, "success " db 9, "success "
db 9, "wholeness" db 9, "wholeness"
db 9, "travel " db 9, "travel "
db 9, "empty "
db 9, "missing "
db 9, "burdened "
dw .BackgroundCopyEnd - .BackgroundCopy dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles dw .KeyArtTilesEnd - .KeyArtTiles

View File

@ -2,6 +2,7 @@
PUSHS "Card Helper Vars", WRAM0[CARD_HELPER_VARS_START] PUSHS "Card Helper Vars", WRAM0[CARD_HELPER_VARS_START]
cvCardBank: db cvCardBank: db
cvCardAddress: dw cvCardAddress: dw
cvNeedsCleanup: db
POPS POPS
FindCardTileMap: ; puts the tilemap into hl FindCardTileMap: ; puts the tilemap into hl
@ -111,20 +112,47 @@ LoadCardDataAsync:
ld a, [hl+] ld a, [hl+]
ld [cvCardAddress + 1], a ld [cvCardAddress + 1], a
ld b, a ld b, a
ld h, b
ld l, c ; hl now contains the address of the card data.
ld a, [vCurrentCardReversed]
call OneRandomByte
ld a, [rLFSR]
and a, 1
ld [vCurrentCardReversed], a
cp a, 0
jp z, LoadUpright
jp nz, LoadReversed
ret ; shouldn't ever get here
LoadUpright:
; card struct starts with a sequence of length-prefixed strings in memory ; card struct starts with a sequence of length-prefixed strings in memory
; so when we're done writing one, hl will be correctly placed to read the next ; so when we're done writing one, hl will be correctly placed to read the next
; length-prefixed print doesn't require passing a length ; length-prefixed print doesn't require passing a length
; so all we have to set is the destination for each ; so all we have to set is the destination for each
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_title ; jump straight to sprite tiles length and location!
add hl, bc
ld de, _SCRN0 + 32*11 + 10 ld de, _SCRN0 + 32*11 + 10
call PrintString call PrintString
ld de, _SCRN0 + 32*12 + 10 ld de, _SCRN0 + 32*12 + 10
call PrintString call PrintString
; write the "(reversed)" string
ld hl, EmptyString
ld de, _SCRN0 + 32*13 + 10
call PrintString
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_description ; jump straight to sprite tiles length and location!
add hl, bc
ld de, _SCRN0 + 32*14 + 10 ld de, _SCRN0 + 32*14 + 10
call PrintString call PrintString
ld de, _SCRN0 + 32*15 + 10 ld de, _SCRN0 + 32*15 + 10
@ -132,7 +160,13 @@ LoadCardDataAsync:
ld de, _SCRN0 + 32*16 + 10 ld de, _SCRN0 + 32*16 + 10
call PrintString call PrintString
; hl now contains the address after all the strings.
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_tilemap ; jump straight to sprite tiles length and location!
add hl, bc
; [hl+] and [hl+] read the length first, into bc ; [hl+] and [hl+] read the length first, into bc
ld a, [hl+] ld a, [hl+]
ld c, a ld c, a
@ -230,6 +264,155 @@ LoadCardDataAsync:
call CopyRangeBy8s call CopyRangeBy8s
ret ret
LoadReversed: ; same as LoadRightSideUp but loads in the reversed data
; card struct starts with a sequence of length-prefixed strings in memory
; so when we're done writing one, hl will be correctly placed to read the next
; length-prefixed print doesn't require passing a length
; so all we have to set is the destination for each
; draw the title
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_title ; jump straight to sprite tiles length and location!
add hl, bc
ld de, _SCRN0 + 32*11 + 10
call PrintString
ld de, _SCRN0 + 32*12 + 10
call PrintString
; write the "(reversed)" string
ld hl, ReverseString
ld de, _SCRN0 + 32*13 + 10
call PrintString
; draw the description
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_description_rev ; jump straight to sprite tiles length and location!
add hl, bc
ld de, _SCRN0 + 32*14 + 10
call PrintString
ld de, _SCRN0 + 32*15 + 10
call PrintString
ld de, _SCRN0 + 32*16 + 10
call PrintString
; move the tilemap into memory
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_tilemap ; jump straight to sprite tiles length and location!
add hl, bc
; [hl+] and [hl+] read the length first, into bc
ld a, [hl+]
ld c, a
ld a, [hl+]
ld b, a ; bc has length
ld a, [hl+]
ld e, a
ld a, [hl+]
ld d, a ; de has source of tile range copy
ld h, d
ld l, e ; source
ld de, _SCRN0 + 32 + 1 ; destination
ld b, 16 ; height
ld c, 8 ; width
call CopyTilesToMapButRotated
; move key tile data into vram
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_functions ; jump straight to function handles
add hl, bc ; hl now points to the card functions
di ; make sure we never call any callbacks without them being fully set
nop
ld a, [hl+]
ld [CARD_INIT], a
ld a, [hl+]
ld [CARD_INIT+1], a
ld a, [hl+]
ld [CARD_UPDATE], a
ld a, [hl+]
ld [CARD_UPDATE+1], a
ld a, [hl+]
ld [CARD_DRAW], a
ld a, [hl+]
ld [CARD_DRAW+1], a
ld a, [hl+]
ld [CARD_PRINT_PREP], a
ld a, [hl+]
ld [CARD_PRINT_PREP+1], a
ei
call CardInit
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_keytiles ; jump straight to keytiles length and location!
add hl, bc
ld a, [hl+]
ld c, a
ld a, [hl+]
ld b, a ; bc has length of tile data
ld a, [hl+]
ld e, a
ld a, [hl+]
ld d, a ; de has source of tile range copy
ld h, d
ld l, e ; hl takes the source
ld de, _VRAM + $1000 + VARIABLE_TILES_START*$10 ; always load tile data into the same spot in vram
call CopyRangeOfTilesButRotated
ld a, [cvCardAddress]
ld l, a
ld a, [cvCardAddress + 1]
ld h, a ; hl now contains the address of the card data.
ld bc, Card_Offset_spritetiles ; jump straight to sprite tiles length and location!
add hl, bc
ld a, [hl+]
ld c, a
ld a, [hl+]
ld b, a ; bc has length of tile data
ld a, [hl+]
ld e, a
ld a, [hl+]
ld d, a ; de has source of tile range copy
ld h, d
ld l, e ; hl takes the source
ld de, _VRAM ; sprite tiles get loaded into the bottom of vram
call CopyRangeOfTilesButRotated
ret
ReverseString:
db 10, "(reversed)"
EmptyString:
db 10, " "
CardInit: CardInit:
ld a, [rLCDC] ld a, [rLCDC]
@ -245,14 +428,33 @@ CardInit:
ld [rOBP0], a ld [rOBP0], a
ld [rOBP1], a ld [rOBP1], a
ld a, [vCurrentCardReversed]
cp a, 0
call nz, RotateSprites180
call CARD_INIT - 1 call CARD_INIT - 1
ret ret
CardUpdate: CardUpdate:
ld a, 0
ld [cvNeedsCleanup], a
ld a, [vCurrentCardReversed]
cp a, 0
call nz, RotateSprites180
call CARD_UPDATE - 1 call CARD_UPDATE - 1
ld a, [vCurrentCardReversed]
cp a, 0
call nz, RotateSprites180
ld a, [cvNeedsCleanup]
cp a, 0
call nz, CleanUpOutsideSprites
ret ret
CardDraw: CardDraw:
call CARD_DRAW - 1 call CARD_DRAW - 1
ret ret
@ -261,6 +463,53 @@ CardPrintPrep:
call CARD_PRINT_PREP - 1 call CARD_PRINT_PREP - 1
ret ret
RotateSprites180:
ld hl, MY_OAM
.loop
ld a, 0
cp a, [hl] ; if y value is nonzero,
jr nz, :+ ; if y value is nonzero, skip this block where we jump to the next oam entry
inc l
inc l
inc l
inc l
ld a, l
cp a, $A0 ; this indicates we've reached the end of the mirror OAM
jr nz, .loop
ret
:
ld a, 168
sub a, [hl]
ld [hl+], a
ld b, [hl]
ld a, 0
cp a, [hl]
jr nz, :+ ; if x value is nonzero, skip this block where we jump to the next oam entry
inc l
inc l
inc l
ld a, l
cp a, $A0 ; this indicates we've reached the end of the mirror OAM
jr nz, .loop
ret
:
ld a, 88
sub a, [hl]
ld [hl+], a
inc l
inc l
ld a, l
cp a, $A0 ; this indicates we've reached the end of the mirror OAM
jp nz, .loop
ret
IncrementTimer: IncrementTimer:
; hl is the location in memory of a timer ; hl is the location in memory of a timer
@ -305,222 +554,185 @@ EdgeMasks:
CleanUpOutsideSprites: CleanUpOutsideSprites:
ld hl, MY_OAM + 10*4 ld hl, MY_OAM + 10*4
call HideObviousTiles
; now we hide the overlapping edges
ld hl, MY_OAM + 10*4
ld de, MY_OAM
.hideEdgesOfSprite
ld a, 0
cp a, [hl]
jp z, .skipFromY
inc l
cp a, [hl]
jp z, .skipFromX
; now we know that the sprite does not have y=0 or x=0.
;dec hl
;call WriteTopEdgeMaskIfNecessary
;call WriteBottomEdgeMaskIfNecessary
;inc hl
call WriteLeftEdgeMaskIfNecessary
dec l
inc l
call WriteRightEdgeMaskIfNecessary
dec l
.skipFromY
inc l
.skipFromX
inc l
inc l
inc l
ld a, $A0
cp a, l
jp nz, .hideEdgesOfSprite
ret
HideObviousTiles:
.processSprite .processSprite
;hl points at an OAM entry's y value ;hl points at an OAM entry's y value
ld a, 17 ; sprites are visible if y value >= 17 ld a, 16 ; sprites are visible if y value >= 17
cp a, [hl] cp a, [hl]
jp c, :+ ; skip if 17-y < 0 jr c, :+ ; skip if 17-y < 0
ld [hl], 0 ld [hl], 0
: :
ld a, 152 ; sprites are visible if y value is < 152 ld a, 152 ; sprites are visible if y value is < 152
cp a, [hl] cp a, [hl]
jp nc, :+ ; skip if 152 - y < 0 jr nc, :+ ; skip if 152 - y < 0
ld [hl], 0 ld [hl], 0
: :
inc hl ; look at x value inc hl ; look at x value
ld a, 8 ; sprites are visible if y value >= 8 ld a, 8 ; sprites are visible if x value >= 8
cp a, [hl] cp a, [hl]
jp c, :+ ; skip if 8-y <= 0 jr c, :+ ; skip if 8-y <= 0
ld [hl], 0 ld [hl], 0
: :
ld a, 80 ; sprites are visible if x value < 80 ld a, 80 ; sprites are visible if x value < 80
cp a, [hl] cp a, [hl]
jp nc, :+ jr nc, :+
ld [hl], 0 ld [hl], 0
: :
inc hl ; now pointing at tile ID inc l ; now pointing at tile ID
inc hl ; now pointing at attributes inc l ; now pointing at attributes
inc hl ; now pointing at next OAM y value inc l ; now pointing at next OAM y value
ld a, l ld a, l
cp a, $A0 cp a, $A0
jp nz, .processSprite jr nz, .processSprite
; now we hide the overlapping edges
ld hl, MY_OAM + 10*4
ld de, MY_OAM
.hideEdges
ld a, 0 ; check if y value is zero; if so, skip this sprite
cp a, [hl]
jp nz, :+
inc hl ; x
inc hl ; tile id
inc hl ; attr
inc hl ; next y
ld a, l
cp a, $A0
jp nz, .hideEdges
ret ret
:
inc hl ; check if x value is zero; if so, skip this WriteTopEdgeMaskIfNecessary:
ld a, 0 ;hl points at an OAM entry, de points at an empty OAM spot for masks
cp a, [hl]
jp nz, :+
inc hl
inc hl
inc hl
ld a, l
cp a, $A0
jp nz, .hideEdges
ret
: dec hl
;hl points at an OAM entry's y value
ld a, 24 ; sprites are clear if y value > 24 ld a, 24 ; sprites are clear if y value > 24
cp a, [hl] cp a, [hl]
jp c, :+ ; skip if 24-y < 0 ret c ; skip if 24-y < 0
; writing an edge mask on the TOP ; writing an edge mask on the TOP
; else write an edge sprite ; else write an edge sprite
ld a, 16 ; y value should be 16 (covers top row) ld a, 16 ; y value should be 16 (covers top row)
ld [de], a ; y value in first slot ld [de], a ; y value in first slot
inc de ;write head moves forward to x inc e ;write head moves forward to x
inc hl ; read head moves forward to x inc l ; read head moves forward to x
ld a, [hl] ; x value matches the sprite we're mirroring ld a, [hl] ; x value matches the sprite we're mirroring
ld [de], a ld [de], a
inc de ; write head moves forward to tile ID inc e ; write head moves forward to tile ID
inc hl ; read head moves forward to tile id
ld a, 8*16 + 8 ld a, 8*16 + 8
ld [de], a ; tile ID 1 for the hidden ones
inc de ; write head moves forward to attribute
inc hl ; read head moves forward to attributes
ld a, [de]
set OAMB_PRI, a
set OAMB_PAL1, a
ld [de], a ld [de], a
inc de ; point at next slot for both mask and source inc e ; write head moves forward to attribute
inc hl ld a, OAMF_PRI | OAMF_PAL1
ld [de], a
ld a, l dec l
cp a, $A0 inc e
jp nz, .hideEdges
ret ret
:
WriteBottomEdgeMaskIfNecessary:
ld a, 145 ; sprites don't overlap edge if y value is <= 145 ld a, 145 ; sprites don't overlap edge if y value is <= 145
cp a, [hl] cp a, [hl]
jp nc, :+ ; skip if 145 - y >= 0 ret nc ; skip if 145 - y >= 0
; writing an edge mask on the BOTTOM ; writing an edge mask on the BOTTOM
ld a, 144 ; y value should be 144 (covers bottom row) ld a, 144 ; y value should be 144 (covers bottom row)
ld [de], a ; y value in first slot ld [de], a ; y value in first slot
inc de ;write head moves forward to x inc e ;write head moves forward to x
inc hl ; read head moves forward to x inc l ; read head moves forward to x
ld a, [hl] ; x value matches the sprite we're mirroring ld a, [hl] ; x value matches the sprite we're mirroring
ld [de], a ld [de], a
inc de ; write head moves forward to tile ID inc e ; write head moves forward to tile ID
inc hl ; read head moves forward to tile id
ld a, 8*16 + 8 ld a, 8*16 + 8
ld [de], a ; tile ID 1 for the hidden ones ld [de], a ; tile ID 1 for the hidden ones
inc de ; write head moves forward to attribute inc e ; write head moves forward to attribute
inc hl ; read head moves forward to attributes ld a, OAMF_PRI | OAMF_PAL1 ;OAM_PRIO | OAM_PAL1
ld a, [de]
set OAMB_PRI, a
set OAMB_PAL1, a
ld [de], a ld [de], a
inc de dec l
inc hl inc e
ld a, l
cp a, $A0
jp nz, .hideEdges
ret ret
:
inc hl ; look at x value WriteLeftEdgeMaskIfNecessary:
ld a, 16 ; sprites dno't need coverage if x value > 16 ld a, 16 ; sprites dno't need coverage if x value > 16
cp a, [hl] cp a, [hl]
jp c, :+ ; skip if 16-y < 0 ret c ; skip if 16-y < 0
; else write an edge mask on the LEFT ; else write an edge mask on the LEFT
dec hl ; step back so we're looking at y dec l
ld a, [hl] ; copy y over from sprite ld a, [hl] ; copy y over from sprite
ld [de], a ld [de], a
inc hl ; point at x now inc l ; point at x now
inc de ; point at x now inc e ; point at x now
ld a, 8 ; x value should be 8 (covers left edge) ld a, 8 ; x value should be 8 (covers left edge)
ld [de], a ; x value ld [de], a ; x value
inc de ; write head moves forward to tile ID inc e ; write head moves forward to tile ID
inc hl ; read head moves forward to tile id
ld a, 1 ld a, 1
ld [de], a ; tile ID 1 for the hidden ones ld [de], a ; tile ID 1 for the hidden ones
inc de ; write head moves forward to attribute inc e ; write head moves forward to attribute
inc hl ; read head moves forward to attributes ld a, OAMF_PRI | OAMF_PAL1
ld a, [de]
set OAMB_PRI, a
set OAMB_PAL1, a
ld [de], a ld [de], a
inc de inc e
inc hl
ld a, l
cp a, $A0
jp nz, .hideEdges
ret ret
: WriteRightEdgeMaskIfNecessary:
ld a, 72 ; sprites dont needd coverage if x value < 72 ld a, 72 ; sprites dont needd coverage if x value < 72
cp a, [hl] cp a, [hl]
jp nc, :+ ret nc
; else write an edge mask on the RIGHT ; else write an edge mask on the RIGHT
dec hl ; step back so we're looking at y dec l
ld a, [hl] ; copy y over from sprite ld a, [hl] ; copy y over from sprite
ld [de], a ld [de], a
inc hl ; point at x now inc l ; point at x now
inc de ; point at x now inc e ; point at x now
ld a, [hl] ; x value should match the sprite we're masking... ld a, [hl] ; x value should match the sprite we're masking...
ld [de], a ; x value ld [de], a ; x value
inc de ; write head moves forward to tile ID inc e ; write head moves forward to tile ID
inc hl ; read head moves forward to tile id
; a currently holds the x coordinate ; a currently holds the x coordinate
sub a, 72 ; subtract off 72 to get the amount that we're overlapping sub a, 72 ; subtract off 72 to get the amount that we're overlapping
add a, 8*16 ; add the offset for the mask sprites... add a, 8*16 ; add the offset for the mask sprites...
ld [de], a ; that makes the tile ID for the mask we want! ld [de], a ; that makes the tile ID for the mask we want!
inc de ; write head moves forward to attribute inc e ; write head moves forward to attribute
inc hl ; read head moves forward to attributes ld a, OAMF_PRI | OAMF_PAL1
ld a, [de]
set OAMB_PRI, a
set OAMB_PAL1, a
ld [de], a ld [de], a
inc de inc e
inc hl
ld a, l ret
cp a, $A0
jp nz, .hideEdges
ret
:
inc hl ; now pointing at tile ID
inc hl ; now pointing at attributes
inc hl ; now pointing at next OAM y value
ld a, l
cp a, $A0
jp nz, .hideEdges
ret

View File

@ -178,7 +178,6 @@ INCLUDE "02TheHighPriestess.inc"
INCLUDE "03TheEmpress.inc" INCLUDE "03TheEmpress.inc"
INCLUDE "04TheEmperor.inc" INCLUDE "04TheEmperor.inc"
SECTION "Second Eight Cards", ROMX SECTION "Second Eight Cards", ROMX
INCLUDE "05TheHierophant.inc" INCLUDE "05TheHierophant.inc"
INCLUDE "06TheLovers.inc" INCLUDE "06TheLovers.inc"
@ -186,7 +185,6 @@ INCLUDE "07TheChariot.inc"
INCLUDE "08Strength.inc" INCLUDE "08Strength.inc"
INCLUDE "09TheHermit.inc" INCLUDE "09TheHermit.inc"
SECTION "Third Eight Cards", ROMX SECTION "Third Eight Cards", ROMX
INCLUDE "10WheelOfFortune.inc" INCLUDE "10WheelOfFortune.inc"
INCLUDE "11Justice.inc" INCLUDE "11Justice.inc"

View File

@ -43,4 +43,91 @@ CopyOneTileData:
ld [de], a ld [de], a
inc de inc de
endr endr
reti reti
CopyRangeOfTilesButRotated:
ld a, b
or a, c
ret z
.loop
push bc ; save bc so we can use it in the loop
; add 15 to e, we're writing to the destination in reverse order
ld a, e
add a, 16
ld e, a
ld a, d
adc a, 0
ld d, a
rept 8 ; copy 8 tiles
dec de
dec de ; step back two bytes (one tile)
; copy half the tile (one byte)
ld a, [hl]
call ReverseBits ; reverse the order of a
ld [de], a
inc hl
inc de ; step forward because we want to preserve the order of the pair
; copy the second half of the tile (one byte)
ld a, [hl]
call ReverseBits
ld [de], a
inc hl
dec de ; step backwards to be ready for the next pair
endr
pop bc ; restore bc to be the count to copy, and decrement it by 16
ld a, c
sub a, 16
ld c, a
ld a, b
sbc a, 0
ld b, a
; add 16 to properly increment the destination to be for the next tile
ld a, e
add a, 16
ld e, a
ld a, d
adc a, 0
ld d, a
ld a, b
or a, c
jp nz, .loop
ret
ReverseBits: ; overwrites bc and a, and reverses the bits of a. thanks to https://stackoverflow.com/a/2602885 for the algo
swap a ; swap high nibble with low nibble
; swap 0b11001100 with 0b00110011
ld b, a
and a, 0b11001100 ; select upper half of nibbles
srl a ; swap the upper half to the lower half
srl a
ld c, a ; c now holds the upper half and lower half swapped
ld a, b ; get back the whole byte
and a, 0b00110011 ; select lower halves of nibbles
sla a
sla a ; swap the lower half to the upper half
or a, c
; swap 0b10101010 with 0b01010101
ld b, a
and a, 0b10101010
srl a
ld c, a
ld a, b
and a, 0b01010101
sla a
or a, c
ret

View File

@ -28,6 +28,111 @@ CopyTilesToMap:
jr nz, CopyTilesToMap jr nz, CopyTilesToMap
ret ret
CopyTilesToMapButRotated:
; copy tiles from where they are linearly packed at an origin (hl)
; to a rectangle in the tilemap in vram (de)
; assuming it has height in b and width in c.
;
; however! also rotate by 180 degrees!
push bc ; quick little add-multiply; hl should increase by b*c, we're gonna squash em so save to stack
ld a, b ; saving
ld b, 0 ; zero out b so that bc is just c
.multLoop
add hl, bc ; step forward by c
dec a ; take off a row
jp nz, .multLoop ; if we've got rows left, repeat
dec hl
pop bc
.body
ld a, b
or a, c
ret z
push bc
.copyTile
ld a, [hl-] ; load from the tile map into a
ld [de], a ; load from a into the destination
inc de
dec c
jr nz, .copyTile ; if there's lines left to copy, jump back and redo
.doneWithLine
pop bc
; this adds 32-c to de
ld a, 32
sub a, c ; first calculate 32-c
add a, e
ld e, a
ld a, d
adc a, 0
ld d, a
dec b
jr nz, .body
ret
PositionMetaSprite:
; location in memory to write to: de
; y and x in b and c
; height and width in a & %11110000 and a & %00001111 ??? that's deranged
ld h, d
ld l, e
ld d, a
push bc ; hold onto the upper-left corner so we can update it each row
.writeRow
pop bc
ld a, d
push bc ; refresh af and bc from their authoritative versions
and a, $0F ; take only the horizontal tile count
.buildSprite
;
ld [hl], b ; write y byte
inc l
ld [hl], c ; write x byte
inc l
inc l
res OAMB_XFLIP, [hl] ; make sure xflip is turned off
inc l ; skip the attributes byte
; we're going to wait to get our a value (number of tiles left to draw in this
; row) until after we've used a for changing c
;we've written a whole sprite. hl and de are in the right state, we need to
; update a and bc.
; update bc
ld e, a
ld a, c
add a, 8
ld c, a
ld a, e
dec a
jp nz, .buildSprite ; if there are still tiles left to draw in this row, do it!
; otherwise we have no more tiles to write this row bc needs to be updated
pop bc
ld a, b
add a, 8
ld b, a ; add 8 to the y coordinate
ld a, d
sub a, $10
ld d, a
push bc
and a, $F0
; stakc has bc and af, ready for repeating from the top
jp nz, .writeRow ; last numerical operation was and a, $F0 so checking if upper byte is zero
pop bc
ret
; this function is used by practically all the card animations and all over the place. ; this function is used by practically all the card animations and all over the place.
; it uses every register. this was a bad idea and i should have just used the stack. ; it uses every register. this was a bad idea and i should have just used the stack.
; if i were rewriting this, i would like to do it differently. ; if i were rewriting this, i would like to do it differently.

View File

@ -2,7 +2,8 @@ PUSHS UNION "Global Variables", WRAM0[GLOBAL_VARS_START]
vCurrentSpread: dw vCurrentSpread: dw
vSelectedSpreadIndex: db vSelectedSpreadIndex: db
vSelectedSpreadCard: db vSelectedSpreadCard: db
vSelectedCardIndex: db vSelectedCardIndex: db ; the number of the card which is currently selected and being displayed
vCurrentCardReversed: db ; whether the card should be displayed reversed
vFrameCountSquares: db vFrameCountSquares: db
vCurrentBackgroundTile: dw vCurrentBackgroundTile: dw
vTime: dw vTime: dw
@ -41,6 +42,9 @@ MainMenuSetup:
call Async_Kill ; ensure we're not loading anything elsewhere call Async_Kill ; ensure we're not loading anything elsewhere
ld a, BANK("Main Menu Data")
ld [rROMB0], a
ld hl, SquaresTileset8 ld hl, SquaresTileset8
ld de, _VRAM + $1000 + $10 ld de, _VRAM + $1000 + $10
ld bc, SquaresTilesetEnd - SquaresTileset8 ld bc, SquaresTilesetEnd - SquaresTileset8
@ -209,6 +213,9 @@ MainMenuUpdate:
; if in animation state: ; if in animation state:
; increment timer ; increment timer
; if timer is max, turn off animation state and unblock? ; if timer is max, turn off animation state and unblock?
ld a, BANK("Main Menu Data")
ld [rROMB0], a
ld hl, rMYBTNP ld hl, rMYBTNP
ld a, [vMenuIndex] ld a, [vMenuIndex]
@ -250,6 +257,7 @@ MainMenuUpdate:
.option3 .option3
ld a, 0 ld a, 0
ld [vSelectedCardIndex], a ld [vSelectedCardIndex], a
ld [vCurrentCardReversed], a
ld hl, ScreenCardBrowse ld hl, ScreenCardBrowse
call ChangeScene call ChangeScene
ret ret
@ -275,7 +283,6 @@ MainMenuUpdate:
ld [vTime], a ld [vTime], a
ld [vTime+1], a ld [vTime+1], a
ld hl, Coords ld hl, Coords
; and advance the frame counts ; and advance the frame counts
@ -821,7 +828,8 @@ DrawTile: ; b: y. c: x. a: part id. hl: location of sprite in OAM
inc hl inc hl
inc hl inc hl
ret ret
PUSHS "Main Menu Data", ROMX
MenuCount: MenuCount:
db 3 db 3
StringRead: StringRead:
@ -1066,6 +1074,29 @@ CardBackSprites17:
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; empty db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; empty
CardBackSprites17End: CardBackSprites17End:
MainUITilemap:
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $09, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $08, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $06, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $07, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
MainUITilemapEnd:
POPS
ScrollBackgroundTile: ScrollBackgroundTile:
ld hl, vTime ld hl, vTime
@ -1134,24 +1165,3 @@ SquaresTileset8:
SquaresTilesetEnd: SquaresTilesetEnd:
MainUITilemap:
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
db $01, $01, $09, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $08, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $03, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $04, $01, $01
db $01, $01, $06, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $05, $07, $01, $01
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
MainUITilemapEnd:

View File

@ -4,112 +4,101 @@
KeyArtTiles: KeyArtTiles:
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $80,$80,$00,$00,$00,$00,$00,$00,$00,$01,$03,$03,$00,$04,$00,$04 db $00,$00,$00,$00,$01,$01,$03,$03,$07,$07,$0f,$0f,$0f,$0f,$0f,$0f
db $01,$05,$08,$07,$1c,$01,$3d,$01,$75,$0d,$ec,$1c,$d0,$30,$f0,$31 db $00,$00,$00,$00,$00,$00,$a3,$a3,$be,$be,$d9,$d9,$e3,$e3,$ef,$ef
db $80,$83,$00,$80,$80,$fc,$90,$fe,$30,$fe,$20,$ff,$00,$ff,$00,$ff db $00,$00,$00,$00,$5f,$5f,$3f,$3f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$04,$00,$08,$00,$10,$00,$30,$00,$20,$00,$60,$00,$40,$00,$40 db $00,$00,$00,$00,$80,$80,$c0,$c0,$c0,$c0,$e0,$e0,$e0,$e0,$d0,$d0
db $00,$60,$c8,$30,$ec,$10,$f4,$08,$f6,$08,$3b,$c4,$0d,$f2,$00,$ff db $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$03,$03,$03,$01,$01
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$00,$70,$80 db $ef,$ef,$ce,$ce,$d9,$d9,$d7,$d7,$cf,$cf,$85,$85,$85,$85,$c3,$c3
db $06,$01,$0e,$01,$1c,$03,$f8,$07,$e7,$18,$8f,$70,$1f,$e0,$5f,$e0 db $ff,$ff,$00,$00,$f8,$f8,$fe,$fe,$fe,$fe,$fe,$fe,$fe,$fe,$7e,$7e
db $00,$ff,$00,$ff,$00,$fe,$00,$f0,$c0,$30,$00,$e0,$00,$80,$00,$80 db $b0,$b0,$70,$70,$f0,$f0,$f8,$f8,$f8,$f8,$f8,$f8,$f0,$f0,$f0,$f0
db $00,$e0,$00,$c0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$3f,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$1f,$1f,$1f,$1f,$0f,$0f,$07,$07
db $01,$00,$03,$00,$06,$00,$08,$04,$10,$08,$30,$00,$60,$10,$c0,$20 db $3c,$3c,$6a,$6a,$7e,$7e,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe
db $5f,$a0,$0a,$f5,$00,$ff,$e0,$ff,$3f,$ff,$00,$ff,$00,$ff,$00,$ff db $00,$00,$00,$00,$00,$00,$00,$00,$80,$80,$81,$81,$01,$01,$00,$00
db $ff,$00,$af,$50,$0a,$f5,$00,$ff,$9f,$ff,$f0,$ff,$00,$ff,$00,$ff db $40,$40,$00,$00,$61,$61,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $d1,$2f,$43,$bf,$0c,$ff,$70,$ff,$80,$ff,$00,$ff,$00,$ff,$00,$ff db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $c3,$fc,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff db $74,$74,$37,$37,$b7,$b7,$87,$87,$cf,$cf,$ff,$ff,$ff,$ff,$ff,$ff
db $7f,$80,$7f,$80,$00,$ff,$00,$ff,$00,$f0,$00,$e0,$00,$c0,$00,$e0 db $00,$00,$00,$00,$c0,$c0,$e0,$e0,$f0,$f0,$fc,$fc,$ff,$ff,$ff,$ff
db $ff,$00,$f8,$07,$00,$fe,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$80
db $00,$c1,$00,$03,$00,$07,$00,$0f,$00,$1f,$00,$3f,$00,$7f,$00,$ff db $03,$03,$03,$03,$01,$01,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01
db $00,$00,$20,$00,$60,$10,$c0,$30,$90,$60,$30,$c0,$f0,$00,$f0,$00 db $fc,$fc,$fc,$fc,$f8,$f8,$f0,$f0,$60,$60,$60,$60,$f0,$f0,$f0,$f0
db $00,$c1,$00,$b8,$00,$60,$00,$40,$00,$c0,$00,$fe,$00,$03,$00,$01 db $00,$00,$01,$01,$01,$01,$03,$03,$0f,$0f,$1f,$1f,$1f,$1f,$3f,$3f
db $11,$ae,$1c,$e3,$1e,$61,$1c,$23,$00,$1e,$00,$00,$00,$00,$80,$00 db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$df,$df,$df,$df
db $00,$c0,$00,$80,$00,$80,$00,$00,$03,$00,$07,$00,$0c,$03,$01,$0e db $c0,$c0,$c0,$c0,$e0,$e0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
db $00,$03,$01,$06,$03,$0c,$87,$18,$8f,$10,$8f,$30,$cf,$30,$de,$21 db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00
db $40,$80,$00,$c0,$a0,$40,$90,$60,$cf,$30,$c0,$3f,$c3,$2c,$87,$68 db $f8,$f8,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$63,$63,$60,$60
db $f8,$00,$f8,$00,$f8,$00,$f8,$00,$7c,$80,$7c,$80,$3e,$c0,$1f,$e0 db $7f,$7f,$bf,$bf,$df,$df,$df,$df,$ef,$ef,$ef,$ef,$f7,$f7,$07,$07
db $ce,$31,$ea,$15,$09,$f6,$04,$0b,$01,$0e,$00,$00,$00,$00,$00,$00 db $ff,$ff,$ff,$ff,$fd,$fd,$fd,$fd,$fb,$fb,$fb,$fb,$fb,$fb,$f7,$f7
db $80,$5f,$00,$f0,$38,$c0,$20,$c0,$e0,$00,$00,$00,$00,$00,$00,$00 db $df,$df,$9f,$9f,$0f,$0f,$00,$00,$07,$07,$0f,$0f,$0f,$0f,$9e,$9e
db $0f,$f0,$87,$78,$c3,$3c,$f1,$0e,$38,$07,$3c,$03,$0f,$00,$02,$01 db $f0,$f0,$f0,$f0,$e0,$e0,$00,$00,$c0,$c0,$80,$80,$00,$00,$00,$00
db $07,$f8,$b4,$4b,$a5,$5a,$3c,$c3,$00,$ff,$b8,$47,$80,$78,$80,$70 db $00,$00,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$f3,$00,$03,$01,$02,$00,$03,$01,$02,$00,$03,$01,$02,$00,$07 db $f0,$f0,$fc,$fc,$fc,$fc,$f0,$f0,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$80,$7f,$31,$fe,$78,$7f,$28,$79 db $03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$e6,$00,$c6,$80,$4e,$00,$ce,$80,$5f,$00,$ff,$96,$69,$74,$8b db $e3,$e3,$03,$03,$01,$01,$00,$00,$01,$01,$01,$01,$03,$03,$07,$07
db $16,$e9,$30,$ce,$04,$fa,$84,$7b,$b4,$4b,$a4,$5b,$bd,$42,$01,$fe db $fc,$fc,$f8,$f8,$f0,$f0,$e0,$e0,$c0,$c0,$80,$80,$00,$00,$00,$00
db $07,$08,$01,$1e,$05,$7a,$87,$f8,$f0,$8f,$12,$ed,$b3,$4c,$80,$7f db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01
db $80,$ff,$80,$ff,$40,$fe,$43,$fb,$1f,$1f,$ff,$f1,$f9,$07,$e3,$1a db $0f,$0f,$1f,$1f,$3f,$3f,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff
db $f7,$08,$07,$f8,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$0e,$00,$7f db $80,$80,$00,$00,$80,$80,$80,$80,$c0,$c0,$c0,$c0,$e0,$e0,$e0,$e0
db $fa,$07,$e3,$1e,$fe,$0d,$f0,$ff,$0c,$33,$05,$1a,$04,$1b,$00,$3f db $03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$01,$01,$00,$00
db $03,$02,$03,$02,$03,$02,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00 db $f0,$f0,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
db $f3,$ff,$fc,$1f,$ff,$07,$7f,$80,$ff,$00,$ff,$06,$ff,$03,$ff,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01
db $fe,$ff,$fb,$ff,$ff,$ff,$ff,$fe,$7f,$7e,$7f,$7e,$7f,$7e,$7e,$7f db $0f,$0f,$70,$70,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $7e,$7e,$7c,$7c,$7c,$7c,$7c,$7c,$ed,$ee,$f0,$ff,$f0,$fc,$80,$86 db $ff,$ff,$ff,$ff,$1f,$1f,$c0,$c0,$87,$87,$87,$87,$07,$07,$03,$03
db $fc,$ff,$ff,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$1f,$ff db $ff,$ff,$ff,$ff,$fc,$fc,$00,$00,$fc,$fc,$fc,$fc,$fc,$fc,$fc,$fc
db $ff,$00,$7d,$82,$bf,$d2,$fb,$cf,$ff,$67,$ff,$3f,$f1,$08,$00,$f0 db $f0,$f0,$e0,$e0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7d,$3f,$3e,$1f,$1f,$0f,$0f,$07,$07,$e1,$c1,$30,$f0,$08,$40,$bc db $01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$07,$07,$07,$07,$07,$07
db $df,$d4,$9f,$94,$9f,$94,$9f,$94,$1f,$14,$1f,$1c,$07,$06,$03,$03 db $ff,$ff,$fe,$fe,$fe,$fe,$fc,$fc,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00 db $03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$07 db $fc,$fc,$fc,$fc,$fc,$fc,$fc,$fc,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
db $ff,$0f,$ff,$0f,$ff,$1f,$ff,$1f,$ff,$1f,$ff,$1f,$ff,$3f,$fe,$3f db $07,$07,$0f,$0f,$0f,$0f,$0f,$0f,$1f,$1f,$1f,$1f,$1f,$1f,$1f,$1f
db $3f,$f0,$3f,$f8,$1f,$fc,$8f,$fe,$cf,$fe,$8f,$fe,$cf,$ff,$c3,$ff db $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f0,$f0,$f0,$f0,$f0,$f0,$e0,$e0
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$03 db $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$03
db $f9,$3f,$f3,$3f,$f4,$7f,$fd,$7e,$fd,$7a,$fc,$ff,$fe,$fd,$fe,$fd db $f8,$f8,$f8,$f8,$fc,$fc,$fc,$fc,$f8,$f8,$f8,$f8,$f8,$f8,$f0,$f0
db $f3,$ff,$03,$ff,$ff,$ff,$ff,$fe,$ff,$0c,$fb,$0c,$ff,$88,$ff,$78 db $00,$00,$00,$00,$00,$00,$03,$03,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01 db $00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$07,$fe,$0f,$f8,$0f,$e7,$1f,$fe,$3e,$e0,$70,$c0,$c0,$80,$80 db $1f,$1f,$07,$07,$18,$18,$df,$df,$bf,$bf,$bf,$bf,$bf,$bf,$3f,$3f
db $df,$70,$ff,$78,$ff,$78,$ff,$fc,$ff,$fc,$ff,$fe,$fb,$ff,$f9,$7f db $e0,$e0,$c0,$c0,$00,$00,$7f,$7f,$7f,$7f,$7f,$7f,$bf,$bf,$7f,$7f
db $ff,$01,$ff,$03,$ff,$03,$fe,$06,$fe,$06,$fc,$0c,$fc,$0c,$f8,$08 db $03,$03,$03,$03,$08,$08,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd
db $ff,$80,$ff,$80,$ff,$c0,$7f,$40,$ff,$c0,$7f,$c0,$7f,$c0,$7f,$c0 db $f0,$f0,$f0,$f0,$00,$00,$fb,$fb,$f7,$f7,$f7,$f7,$f7,$f7,$f7,$f7
db $f8,$10,$f0,$20,$e0,$20,$e0,$20,$e0,$40,$c0,$40,$c0,$80,$81,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$c0,$c0,$ff,$ff,$ff,$ff,$ff,$ff
db $7f,$c0,$7f,$c0,$ff,$c0,$ff,$80,$ff,$80,$ff,$80,$ff,$80,$ff,$80 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f0,$f0,$ff,$ff,$ff,$ff
db $ff,$e0,$3f,$30,$1f,$18,$0f,$0c,$0f,$0e,$07,$07,$01,$03,$80,$00 db $fc,$fc,$e3,$e3,$df,$df,$bf,$bf,$bf,$bf,$d8,$d8,$e7,$e7,$ff,$ff
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$80,$ff,$c0 db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f0,$f0,$0f,$0f,$ff,$ff,$ff,$ff
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$fc,$93,$ff,$41,$ff db $fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$3f,$c0,$ff,$e0 db $fb,$fb,$fd,$fd,$fe,$fe,$fe,$fe,$ff,$ff,$7f,$7f,$8f,$8f,$f0,$f0
db $01,$00,$03,$0c,$04,$0b,$0d,$0f,$07,$07,$80,$00,$f0,$00,$ff,$00 db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$7f,$7f,$bf,$bf,$bf,$bf,$7f,$7f
db $a3,$63,$67,$e5,$5f,$f9,$bf,$fb,$ff,$fb,$0f,$11,$07,$08,$f7,$08 db $ff,$ff,$c7,$c7,$cb,$cb,$cd,$cd,$c1,$c1,$cd,$cd,$cd,$cd,$cd,$cd
db $01,$1e,$01,$1e,$01,$3e,$00,$3f,$80,$7f,$38,$c7,$f8,$07,$fc,$03 db $ff,$ff,$87,$87,$9b,$9b,$9f,$9f,$9f,$9f,$91,$91,$9b,$9b,$c3,$c3
db $00,$07,$00,$03,$00,$03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00 db $ff,$ff,$03,$03,$9f,$9f,$9f,$9f,$87,$87,$9f,$9f,$9f,$9f,$c3,$c3
db $80,$ff,$80,$ff,$80,$ff,$80,$bf,$80,$9f,$80,$9f,$80,$8f,$80,$87 db $ff,$ff,$ff,$ff,$c7,$c7,$9b,$9b,$9b,$9b,$9b,$9b,$c7,$c7,$ff,$ff
db $60,$7f,$10,$7f,$7c,$8f,$fe,$07,$fe,$03,$fd,$03,$ff,$31,$ff,$75 db $ff,$ff,$f1,$f1,$e7,$e7,$c3,$c3,$e7,$e7,$e7,$e7,$e7,$e7,$ff,$ff
db $b1,$4e,$a2,$5f,$b1,$49,$00,$f0,$00,$e0,$00,$00,$00,$00,$00,$00 db $ff,$ff,$c3,$c3,$8d,$8d,$9d,$9d,$9f,$9f,$9f,$9f,$9d,$9d,$c3,$c3
db $f0,$00,$f8,$00,$ec,$f0,$18,$1d,$07,$06,$03,$02,$03,$02,$03,$02 db $ff,$ff,$bf,$bf,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$c3,$c3
db $57,$a8,$00,$ff,$07,$ff,$ff,$f8,$fc,$f0,$1c,$f0,$1c,$f0,$1c,$f0 db $ff,$ff,$c7,$c7,$9b,$9b,$9f,$9f,$c7,$c7,$fb,$fb,$9b,$9b,$c7,$c7
db $1c,$f0,$1c,$f1,$1c,$f1,$1c,$f1,$1c,$f1,$1e,$f0,$1e,$f0,$1e,$f0 db $ff,$ff,$83,$83,$cd,$cd,$cd,$cd,$c1,$c1,$cf,$cf,$cf,$cf,$ef,$ef
db $60,$ff,$30,$ff,$1e,$ff,$03,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff db $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $1e,$f0,$17,$f8,$0f,$f8,$0b,$fc,$07,$fc,$05,$fe,$03,$fe,$03,$fe db $fe,$fe,$fd,$fd,$01,$01,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $03,$fe,$03,$ff,$04,$ff,$1c,$fc,$f0,$f0,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0e,$0e,$1e,$1e
db $00,$00,$00,$00,$50,$00,$fa,$00,$ff,$00,$bf,$40,$17,$e8,$c2,$fd db $ff,$ff,$ff,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff db $fe,$fe,$fe,$fe,$fe,$fe,$00,$00,$fe,$fe,$fe,$fe,$fe,$fe,$ff,$ff
db $00,$00,$00,$00,$00,$00,$01,$00,$03,$00,$af,$00,$ff,$00,$fc,$03 db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe
db $07,$00,$03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$ff,$00,$ff,$0f,$ff,$06,$ff,$06,$ff,$03,$ff,$03,$ff,$01,$ff
db $00,$ff,$00,$ff,$ff,$ff,$06,$ff,$06,$ff,$0c,$ff,$0c,$ff,$98,$ff
db $01,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$00,$ff,$00,$ff
db $98,$ff,$f0,$ff,$f0,$ff,$60,$ff,$60,$ff,$ff,$ff,$00,$ff,$00,$ff
db $00,$ff,$00,$ff,$ff,$ff,$66,$ff,$66,$ff,$66,$ff,$66,$ff,$66,$ff
db $66,$ff,$66,$ff,$66,$ff,$66,$ff,$66,$ff,$ff,$ff,$00,$ff,$00,$ff
db $00,$ff,$00,$ff,$f0,$ff,$60,$ff,$60,$ff,$60,$ff,$60,$ff,$60,$ff
db $60,$ff,$60,$ff,$60,$ff,$60,$ff,$60,$ff,$f0,$ff,$00,$ff,$00,$ff
db $00,$00,$00,$00,$00,$00,$a8,$00,$fa,$00,$ff,$00,$ff,$00,$ff,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$a8,$00,$fa,$00,$ff,$00,$ff,$00
KeyArt: KeyArt:
db $47, $47, $47, $47, $47, $47, $47, $47 db $1a, $1a, $1b, $1c, $1d, $1e, $1a, $1a
db $47, $47, $48, $57, $58, $47, $47, $47 db $1a, $65, $1f, $20, $21, $22, $1a, $1a
db $47, $47, $49, $43, $4a, $47, $47, $47 db $23, $24, $25, $26, $64, $28, $29, $2a
db $47, $4b, $4c, $40, $4d, $47, $47, $47 db $2b, $2c, $2d, $27, $27, $27, $2e, $2f
db $4e, $4f, $41, $44, $50, $47, $47, $47 db $30, $31, $32, $33, $27, $68, $34, $35
db $51, $1b, $42, $38, $45, $52, $47, $47 db $36, $37, $38, $39, $66, $67, $3a, $1a
db $53, $1c, $1d, $37, $39, $54, $47, $47 db $1a, $1a, $3b, $3c, $27, $27, $3d, $1a
db $59, $5a, $3c, $3b, $3a, $55, $56, $47 db $1a, $1a, $3e, $27, $27, $27, $3f, $1a
db $61, $3d, $3e, $36, $5f, $60, $5e, $67 db $1a, $1a, $40, $41, $42, $43, $44, $1a
db $62, $2d, $2e, $2f, $2c, $3f, $46, $5d db $1a, $1a, $45, $46, $47, $48, $1a, $1a
db $64, $30, $31, $5b, $32, $1e, $1a, $5c db $1a, $1a, $49, $4a, $4b, $4c, $1a, $1a
db $65, $33, $34, $69, $35, $1f, $20, $1a db $4d, $4e, $4f, $50, $51, $52, $53, $54
db $66, $72, $73, $68, $21, $22, $23, $24 db $27, $55, $56, $63, $57, $58, $59, $27
db $63, $25, $26, $27, $28, $29, $2a, $2b db $27, $27, $62, $5a, $5b, $5c, $27, $27
db $67, $67, $6a, $6b, $6e, $70, $67, $67 db $27, $27, $27, $5d, $5e, $27, $27, $27
db $67, $67, $6c, $6d, $6f, $71, $67, $67 db $27, $27, $5f, $60, $62, $61, $27, $27

Binary file not shown.

134
cups11page.inc Normal file
View File

@ -0,0 +1,134 @@
; this is a card struct
; starts with five length-prefixed strings in memory
; then a 16bit value of the offset between the tile set and the end
; then the 16bit address of the tile set
; then a 16bit value of the offset between tile map and end
; then the 16bit address of the tile map
TheFool:
db 10, "PAGE OF "
db 10, "CUPS "
db 9, "dreamer "
db 9, "new love "
db 9, "imagine "
dw .BackgroundCopyEnd - .BackgroundCopy
dw .BackgroundCopy
dw .KeyArtTilesEnd - .KeyArtTiles
dw .KeyArtTiles
dw .SpriteTilesEnd - .SpriteTiles
dw .SpriteTiles
dw .fInit
dw .fUpdate
dw .fDraw
dw .fPrintPrep
.fInit: ret
.fUpdate: ret
.fDraw: ret
.fPrintPrep: ret
.SpriteTiles:
.SpriteTilesEnd:
.KeyArtTiles:
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$01,$01,$03,$03,$07,$07,$0f,$0f,$0f,$0f,$0f,$0f
db $00,$00,$00,$00,$00,$00,$a3,$a3,$be,$be,$d9,$d9,$e3,$e3,$ef,$ef
db $00,$00,$00,$00,$5f,$5f,$3f,$3f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$80,$80,$c0,$c0,$c0,$c0,$e0,$e0,$e0,$e0,$d0,$d0
db $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$03,$03,$03,$01,$01
db $ef,$ef,$ce,$ce,$d9,$d9,$d7,$d7,$cf,$cf,$85,$85,$85,$85,$c3,$c3
db $ff,$ff,$00,$00,$f8,$f8,$fe,$fe,$fe,$fe,$fe,$fe,$fe,$fe,$7e,$7e
db $b0,$b0,$70,$70,$f0,$f0,$f8,$f8,$f8,$f8,$f8,$f8,$f0,$f0,$f0,$f0
db $00,$00,$00,$00,$00,$00,$00,$00,$1f,$1f,$1f,$1f,$0f,$0f,$07,$07
db $3c,$3c,$6a,$6a,$7e,$7e,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe
db $00,$00,$00,$00,$00,$00,$00,$00,$80,$80,$81,$81,$01,$01,$00,$00
db $40,$40,$00,$00,$61,$61,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $74,$74,$37,$37,$b7,$b7,$87,$87,$cf,$cf,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$c0,$c0,$e0,$e0,$f0,$f0,$fc,$fc,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$80
db $03,$03,$03,$03,$01,$01,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01
db $fc,$fc,$fc,$fc,$f8,$f8,$f0,$f0,$60,$60,$60,$60,$f0,$f0,$f0,$f0
db $00,$00,$01,$01,$01,$01,$03,$03,$0f,$0f,$1f,$1f,$1f,$1f,$3f,$3f
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$df,$df,$df,$df
db $c0,$c0,$c0,$c0,$e0,$e0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00
db $f8,$f8,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$63,$63,$60,$60
db $7f,$7f,$bf,$bf,$df,$df,$df,$df,$ef,$ef,$ef,$ef,$f7,$f7,$07,$07
db $ff,$ff,$ff,$ff,$fd,$fd,$fd,$fd,$fb,$fb,$fb,$fb,$fb,$fb,$f7,$f7
db $df,$df,$9f,$9f,$0f,$0f,$00,$00,$07,$07,$0f,$0f,$0f,$0f,$9e,$9e
db $f0,$f0,$f0,$f0,$e0,$e0,$00,$00,$c0,$c0,$80,$80,$00,$00,$00,$00
db $00,$00,$03,$03,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $f0,$f0,$fc,$fc,$fc,$fc,$f0,$f0,$00,$00,$00,$00,$00,$00,$00,$00
db $03,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $e3,$e3,$03,$03,$01,$01,$00,$00,$01,$01,$01,$01,$03,$03,$07,$07
db $fc,$fc,$f8,$f8,$f0,$f0,$e0,$e0,$c0,$c0,$80,$80,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01
db $0f,$0f,$1f,$1f,$3f,$3f,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff
db $80,$80,$00,$00,$80,$80,$80,$80,$c0,$c0,$c0,$c0,$e0,$e0,$e0,$e0
db $03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$01,$01,$00,$00
db $f0,$f0,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01
db $0f,$0f,$70,$70,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$ff,$ff,$ff,$1f,$1f,$c0,$c0,$87,$87,$87,$87,$07,$07,$03,$03
db $ff,$ff,$ff,$ff,$fc,$fc,$00,$00,$fc,$fc,$fc,$fc,$fc,$fc,$fc,$fc
db $f0,$f0,$e0,$e0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $01,$01,$01,$01,$01,$01,$03,$03,$03,$03,$07,$07,$07,$07,$07,$07
db $ff,$ff,$fe,$fe,$fe,$fe,$fc,$fc,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
db $03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03
db $fc,$fc,$fc,$fc,$fc,$fc,$fc,$fc,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8
db $07,$07,$0f,$0f,$0f,$0f,$0f,$0f,$1f,$1f,$1f,$1f,$1f,$1f,$1f,$1f
db $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f0,$f0,$f0,$f0,$f0,$f0,$e0,$e0
db $07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$03,$03
db $f8,$f8,$f8,$f8,$fc,$fc,$fc,$fc,$f8,$f8,$f8,$f8,$f8,$f8,$f0,$f0
db $00,$00,$00,$00,$00,$00,$03,$03,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $1f,$1f,$07,$07,$18,$18,$df,$df,$bf,$bf,$bf,$bf,$bf,$bf,$3f,$3f
db $e0,$e0,$c0,$c0,$00,$00,$7f,$7f,$7f,$7f,$7f,$7f,$bf,$bf,$7f,$7f
db $03,$03,$03,$03,$08,$08,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd
db $f0,$f0,$f0,$f0,$00,$00,$fb,$fb,$f7,$f7,$f7,$f7,$f7,$f7,$f7,$f7
db $00,$00,$00,$00,$00,$00,$00,$00,$c0,$c0,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f0,$f0,$ff,$ff,$ff,$ff
db $fc,$fc,$e3,$e3,$df,$df,$bf,$bf,$bf,$bf,$d8,$d8,$e7,$e7,$ff,$ff
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f0,$f0,$0f,$0f,$ff,$ff,$ff,$ff
db $fd,$fd,$fd,$fd,$fd,$fd,$fd,$fd,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff
db $fb,$fb,$fd,$fd,$fe,$fe,$fe,$fe,$ff,$ff,$7f,$7f,$8f,$8f,$f0,$f0
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$7f,$7f,$bf,$bf,$bf,$bf,$7f,$7f
db $ff,$ff,$c7,$c7,$cb,$cb,$cd,$cd,$c1,$c1,$cd,$cd,$cd,$cd,$cd,$cd
db $ff,$ff,$87,$87,$9b,$9b,$9f,$9f,$9f,$9f,$91,$91,$9b,$9b,$c3,$c3
db $ff,$ff,$03,$03,$9f,$9f,$9f,$9f,$87,$87,$9f,$9f,$9f,$9f,$c3,$c3
db $ff,$ff,$ff,$ff,$c7,$c7,$9b,$9b,$9b,$9b,$9b,$9b,$c7,$c7,$ff,$ff
db $ff,$ff,$f1,$f1,$e7,$e7,$c3,$c3,$e7,$e7,$e7,$e7,$e7,$e7,$ff,$ff
db $ff,$ff,$c3,$c3,$8d,$8d,$9d,$9d,$9f,$9f,$9f,$9f,$9d,$9d,$c3,$c3
db $ff,$ff,$bf,$bf,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$9d,$c3,$c3
db $ff,$ff,$c7,$c7,$9b,$9b,$9f,$9f,$c7,$c7,$fb,$fb,$9b,$9b,$c7,$c7
db $ff,$ff,$83,$83,$cd,$cd,$cd,$cd,$c1,$c1,$cf,$cf,$cf,$cf,$ef,$ef
db $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$fe,$fd,$fd,$01,$01,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0e,$0e,$1e,$1e
db $ff,$ff,$ff,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$fe,$fe,$fe,$fe,$fe,$00,$00,$fe,$fe,$fe,$fe,$fe,$fe,$ff,$ff
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe
.KeyArtTilesEnd:
.BackgroundCopy: ; tiles start at 26
db $1a, $1a, $1b, $1c, $1d, $1e, $1a, $1a
db $1a, $65, $1f, $20, $21, $22, $1a, $1a
db $23, $24, $25, $26, $64, $28, $29, $2a
db $2b, $2c, $2d, $27, $27, $27, $2e, $2f
db $30, $31, $32, $33, $27, $68, $34, $35
db $36, $37, $38, $39, $66, $67, $3a, $1a
db $1a, $1a, $3b, $3c, $27, $27, $3d, $1a
db $1a, $1a, $3e, $27, $27, $27, $3f, $1a
db $1a, $1a, $40, $41, $42, $43, $44, $1a
db $1a, $1a, $45, $46, $47, $48, $1a, $1a
db $1a, $1a, $49, $4a, $4b, $4c, $1a, $1a
db $4d, $4e, $4f, $50, $51, $52, $53, $54
db $27, $55, $56, $63, $57, $58, $59, $27
db $27, $27, $62, $5a, $5b, $5c, $27, $27
db $27, $27, $27, $5d, $5e, $27, $27, $27
db $27, $27, $5f, $60, $62, $61, $27, $27
.BackgroundCopyEnd:

View File

@ -89,6 +89,7 @@ SECTION "Header", ROM0[$100]
db CART_ROM_128KB db CART_ROM_128KB
ds $150 - @, 0 ; Make room for the header ds $150 - @, 0 ; Make room for the header
SECTION "Main Program", ROM0[$150]
EntryPoint: EntryPoint:
cp a, BOOTUP_A_CGB cp a, BOOTUP_A_CGB
call nz, SetupForDMG call nz, SetupForDMG
@ -101,21 +102,6 @@ EntryPoint:
ldh [rIE], a ldh [rIE], a
ldh [rIF], a ldh [rIF], a
; TODO remove this
; just setting up hram with clears and sentinel values for bugfinding
ld a, 0
ld hl, $ff80
rept 16*8 - 1
ld [hl+], a
endr
ld a, %01110111
ld hl, $ffc0
rept 16
ld [hl+], a
endr
ld a, 0 ld a, 0
ld hl, ZEROES ld hl, ZEROES
ld bc, $200 ld bc, $200
@ -297,7 +283,6 @@ Loop:
ld a, [hl] ld a, [hl]
ld a, [hl] ld a, [hl]
ld a, [hl] ld a, [hl]
ld a, [hl]
cpl cpl
and a, %00001111 and a, %00001111
ld b, a ld b, a
@ -305,7 +290,6 @@ Loop:
ld a, [hl] ld a, [hl]
ld a, [hl] ld a, [hl]
ld a, [hl] ld a, [hl]
ld a, [hl]
cpl cpl
and a, %00001111 and a, %00001111
swap a swap a
@ -334,7 +318,7 @@ println "scene draw is ", SCENE_DRAW - 1
; either way it's going to eat into the update timing ; either way it's going to eat into the update timing
; at this point we want to make sure that scanline 153 has passed ; at this point we want to make sure that scanline 153 has passed
; we should check if we're past there and skip this await if necessary ; we should check if we're past there and skip this await if necessary
ld b, 5 ld b, 2
call AwaitLine call AwaitLine
jp Loop jp Loop

Binary file not shown.