mirror of https://github.com/pret/pokecrystal.git
Unown Puzzles
This commit is contained in:
parent
f198dfd862
commit
15a03a2577
|
@ -1,3 +1,6 @@
|
|||
CARDFLIP_LIGHT_OFF EQU $ef
|
||||
CARDFLIP_LIGHT_ON EQU $f5
|
||||
|
||||
_CardFlip: ; e00ee (38:40ee)
|
||||
ld hl, Options
|
||||
set 4, [hl]
|
||||
|
@ -167,7 +170,7 @@ endr
|
|||
ld bc, SCREEN_WIDTH
|
||||
ld a, [wc6e8]
|
||||
call AddNTimes
|
||||
ld [hl], $f5
|
||||
ld [hl], CARDFLIP_LIGHT_ON
|
||||
ld a, $1
|
||||
ld [hBGMapMode], a
|
||||
ld c, 20
|
||||
|
@ -1711,856 +1714,3 @@ Unknown_e110c: ; e110c
|
|||
db $ef, $05, $14, $10, $13, $10, $13, $10, $13, $10, $13
|
||||
db $ef, $16, $24, $20, $23, $20, $23, $20, $23, $20, $23
|
||||
; e1190
|
||||
|
||||
Functione1190: ; e1190
|
||||
ld a, [hInMenu]
|
||||
push af
|
||||
ld a, $1
|
||||
ld [hInMenu], a
|
||||
call ClearBGPalettes
|
||||
call ClearTileMap
|
||||
call ClearSprites
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
call DisableLCD
|
||||
ld hl, wc608
|
||||
ld bc, $1e0
|
||||
xor a
|
||||
call ByteFill
|
||||
ld hl, GFX_e17c5
|
||||
ld de, VTiles1 tile $60
|
||||
ld bc, $40
|
||||
call CopyBytes
|
||||
ld hl, LZ_e1805
|
||||
ld de, VTiles1 tile $6d
|
||||
call Decompress
|
||||
call Functione17a3
|
||||
hlcoord 0, 0
|
||||
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
ld a, $ee
|
||||
call ByteFill
|
||||
hlcoord 4, 3
|
||||
lb bc, 12, 12
|
||||
ld a, $ef
|
||||
call Functione13ee
|
||||
call Functione124e
|
||||
call Functione13fe
|
||||
call Functione127d
|
||||
xor a
|
||||
ld [hSCY], a
|
||||
ld [hSCX], a
|
||||
ld [rWY], a
|
||||
ld [wJumptableIndex], a
|
||||
ld [wcf64], a
|
||||
ld [wcf65], a
|
||||
ld [wcf66], a
|
||||
ld a, $93
|
||||
ld [rLCDC], a
|
||||
call WaitBGMap
|
||||
ld b, SCGB_18
|
||||
call GetSGBLayout
|
||||
ld a, $e4
|
||||
call DmgToCgbBGPals
|
||||
ld a, $24
|
||||
call DmgToCgbObjPal0
|
||||
xor a
|
||||
ld [wd0ec], a
|
||||
call DelayFrame
|
||||
.asm_e1217
|
||||
call JoyTextDelay
|
||||
ld a, [wJumptableIndex]
|
||||
bit 7, a
|
||||
jr nz, .asm_e123d
|
||||
call Functione12ca
|
||||
ld a, [wcf64]
|
||||
and a
|
||||
jr nz, .asm_e1230
|
||||
ld a, [hVBlankCounter]
|
||||
and $10
|
||||
jr z, .asm_e1235
|
||||
|
||||
.asm_e1230
|
||||
call Functione14d9
|
||||
jr .asm_e1238
|
||||
|
||||
.asm_e1235
|
||||
call ClearSprites
|
||||
|
||||
.asm_e1238
|
||||
call DelayFrame
|
||||
jr .asm_e1217
|
||||
|
||||
.asm_e123d
|
||||
pop af
|
||||
ld [hInMenu], a
|
||||
call ClearBGPalettes
|
||||
call ClearTileMap
|
||||
call ClearSprites
|
||||
ld a, $e3
|
||||
ld [rLCDC], a
|
||||
ret
|
||||
; e124e
|
||||
|
||||
Functione124e: ; e124e
|
||||
ld c, $1
|
||||
ld b, $10
|
||||
.asm_e1252
|
||||
call Random
|
||||
and $f
|
||||
ld hl, Unknown_e126d
|
||||
ld e, a
|
||||
ld d, $0
|
||||
add hl, de
|
||||
ld e, [hl]
|
||||
ld hl, wDeck
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr nz, .asm_e1252
|
||||
ld [hl], c
|
||||
inc c
|
||||
dec b
|
||||
jr nz, .asm_e1252
|
||||
ret
|
||||
; e126d
|
||||
|
||||
Unknown_e126d: ; e126d
|
||||
db $00, $01, $02, $03
|
||||
db $04, $05, $06, $0b
|
||||
db $0c, $11, $12, $17
|
||||
db $18, $1d, $1e, $23
|
||||
; e127d
|
||||
|
||||
Functione127d: ; e127d
|
||||
call Functione128d
|
||||
hlcoord 5, 16
|
||||
ld a, $f6
|
||||
ld c, $a
|
||||
.asm_e1287
|
||||
ld [hli], a
|
||||
inc a
|
||||
dec c
|
||||
jr nz, .asm_e1287
|
||||
ret
|
||||
; e128d
|
||||
|
||||
Functione128d: ; e128d
|
||||
hlcoord 4, 15
|
||||
ld a, $f0
|
||||
ld [hli], a
|
||||
ld bc, $a
|
||||
ld a, $f1
|
||||
call ByteFill
|
||||
hlcoord 15, 15
|
||||
ld a, $f2
|
||||
ld [hli], a
|
||||
hlcoord 4, 16
|
||||
ld a, $f3
|
||||
ld [hli], a
|
||||
ld bc, $a
|
||||
ld a, $ef
|
||||
call ByteFill
|
||||
hlcoord 15, 16
|
||||
ld a, $f3
|
||||
ld [hli], a
|
||||
hlcoord 4, 17
|
||||
ld a, $f4
|
||||
ld [hli], a
|
||||
ld bc, $a
|
||||
ld a, $f1
|
||||
call ByteFill
|
||||
hlcoord 15, 17
|
||||
ld a, $f5
|
||||
ld [hl], a
|
||||
ret
|
||||
; e12ca
|
||||
|
||||
Functione12ca: ; e12ca
|
||||
ld a, [wJumptableIndex]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, Jumptable_e12d9
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
jp [hl]
|
||||
; e12d9
|
||||
|
||||
Jumptable_e12d9: ; e12d9
|
||||
dw Functione12db
|
||||
; e12db
|
||||
|
||||
Functione12db: ; e12db
|
||||
ld a, [hJoyPressed]
|
||||
and START
|
||||
jp nz, Functione13de
|
||||
ld a, [hJoyPressed]
|
||||
and A_BUTTON
|
||||
jp nz, Functione1376
|
||||
ld hl, hJoyLast
|
||||
ld a, [hl]
|
||||
and D_UP
|
||||
jr nz, .asm_e1301
|
||||
ld a, [hl]
|
||||
and D_DOWN
|
||||
jr nz, .asm_e130d
|
||||
ld a, [hl]
|
||||
and D_LEFT
|
||||
jr nz, .asm_e1325
|
||||
ld a, [hl]
|
||||
and D_RIGHT
|
||||
jr nz, .asm_e1345
|
||||
ret
|
||||
|
||||
.asm_e1301
|
||||
ld hl, wcf65
|
||||
ld a, [hl]
|
||||
cp $6
|
||||
ret c
|
||||
sub $6
|
||||
ld [hl], a
|
||||
jr .asm_e1364
|
||||
|
||||
.asm_e130d
|
||||
ld hl, wcf65
|
||||
ld a, [hl]
|
||||
cp $19
|
||||
ret z
|
||||
cp $1a
|
||||
ret z
|
||||
cp $1b
|
||||
ret z
|
||||
cp $1c
|
||||
ret z
|
||||
cp $1e
|
||||
ret nc
|
||||
add $6
|
||||
ld [hl], a
|
||||
jr .asm_e1364
|
||||
|
||||
.asm_e1325
|
||||
ld hl, wcf65
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret z
|
||||
cp $6
|
||||
ret z
|
||||
cp $c
|
||||
ret z
|
||||
cp $12
|
||||
ret z
|
||||
cp $18
|
||||
ret z
|
||||
cp $1e
|
||||
ret z
|
||||
cp $23
|
||||
jr z, .asm_e1341
|
||||
dec [hl]
|
||||
jr .asm_e1364
|
||||
|
||||
.asm_e1341
|
||||
ld [hl], $1e
|
||||
jr .asm_e1364
|
||||
|
||||
.asm_e1345
|
||||
ld hl, wcf65
|
||||
ld a, [hl]
|
||||
cp $5
|
||||
ret z
|
||||
cp $b
|
||||
ret z
|
||||
cp $11
|
||||
ret z
|
||||
cp $17
|
||||
ret z
|
||||
cp $1d
|
||||
ret z
|
||||
cp $23
|
||||
ret z
|
||||
cp $1e
|
||||
jr z, .asm_e1362
|
||||
inc [hl]
|
||||
jr .asm_e1364
|
||||
|
||||
.asm_e1362
|
||||
ld [hl], $23
|
||||
|
||||
.asm_e1364
|
||||
ld a, [wcf64]
|
||||
and a
|
||||
jr nz, .asm_e136f
|
||||
ld de, SFX_POUND
|
||||
jr .asm_e1372
|
||||
|
||||
.asm_e136f
|
||||
ld de, SFX_MOVE_PUZZLE_PIECE
|
||||
|
||||
.asm_e1372
|
||||
call PlaySFX
|
||||
ret
|
||||
; e1376
|
||||
|
||||
Functione1376: ; e1376
|
||||
ld a, [wcf64]
|
||||
and a
|
||||
jr nz, .asm_e139f
|
||||
call Functione1475
|
||||
and a
|
||||
jr z, Functione13e4
|
||||
ld de, SFX_MEGA_KICK
|
||||
call PlaySFX
|
||||
ld [hl], $0
|
||||
ld [wcf66], a
|
||||
call Functione14d9
|
||||
call Functione1441
|
||||
call WaitBGMap
|
||||
call WaitSFX
|
||||
ld a, $1
|
||||
ld [wcf64], a
|
||||
ret
|
||||
|
||||
.asm_e139f
|
||||
call Functione1475
|
||||
and a
|
||||
jr nz, Functione13e4
|
||||
ld de, SFX_PLACE_PUZZLE_PIECE_DOWN
|
||||
call PlaySFX
|
||||
ld a, [wcf66]
|
||||
ld [hl], a
|
||||
call Functione141f
|
||||
call WaitBGMap
|
||||
xor a
|
||||
ld [wcf66], a
|
||||
call Functione14d9
|
||||
xor a
|
||||
ld [wcf64], a
|
||||
call WaitSFX
|
||||
call Functione14a0
|
||||
ret nc
|
||||
call Functione128d
|
||||
call ClearSprites
|
||||
ld de, SFX_1ST_PLACE
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
call SimpleWaitPressAorB
|
||||
ld a, $1
|
||||
ld [wd0ec], a
|
||||
|
||||
Functione13de: ; e13de
|
||||
ld hl, wJumptableIndex
|
||||
set 7, [hl]
|
||||
ret
|
||||
|
||||
Functione13e4: ; e13e4
|
||||
ld de, SFX_WRONG
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
ret
|
||||
; e13ee
|
||||
|
||||
Functione13ee: ; e13ee
|
||||
ld de, SCREEN_WIDTH
|
||||
.asm_e13f1
|
||||
push bc
|
||||
push hl
|
||||
.asm_e13f3
|
||||
ld [hli], a
|
||||
dec c
|
||||
jr nz, .asm_e13f3
|
||||
pop hl
|
||||
add hl, de
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .asm_e13f1
|
||||
ret
|
||||
; e13fe
|
||||
|
||||
Functione13fe: ; e13fe
|
||||
xor a
|
||||
ld [wcf65], a
|
||||
ld c, $24
|
||||
.asm_e1404
|
||||
push bc
|
||||
call Functione1475
|
||||
ld [wcf66], a
|
||||
and a
|
||||
jr z, .asm_e1413
|
||||
call Functione141f
|
||||
jr .asm_e1416
|
||||
|
||||
.asm_e1413
|
||||
call Functione1441
|
||||
|
||||
.asm_e1416
|
||||
ld hl, wcf65
|
||||
inc [hl]
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .asm_e1404
|
||||
ret
|
||||
; e141f
|
||||
|
||||
Functione141f: ; e141f
|
||||
ld a, $2
|
||||
call Functione1463
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
push hl
|
||||
call Functione1481
|
||||
pop hl
|
||||
ld de, SCREEN_WIDTH
|
||||
ld b, $3
|
||||
.asm_e1431
|
||||
ld c, $3
|
||||
push hl
|
||||
.asm_e1434
|
||||
ld [hli], a
|
||||
inc a
|
||||
dec c
|
||||
jr nz, .asm_e1434
|
||||
add $9
|
||||
pop hl
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .asm_e1431
|
||||
ret
|
||||
; e1441
|
||||
|
||||
Functione1441: ; e1441
|
||||
ld a, $2
|
||||
call Functione1463
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
push hl
|
||||
ld a, $4
|
||||
call Functione1463
|
||||
ld a, [hl]
|
||||
pop hl
|
||||
ld de, SCREEN_WIDTH
|
||||
ld b, $3
|
||||
.asm_e1456
|
||||
ld c, $3
|
||||
push hl
|
||||
.asm_e1459
|
||||
ld [hli], a
|
||||
dec c
|
||||
jr nz, .asm_e1459
|
||||
pop hl
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .asm_e1456
|
||||
ret
|
||||
; e1463
|
||||
|
||||
Functione1463: ; e1463
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, Unknown_e1559
|
||||
add hl, de
|
||||
ld a, [wcf65]
|
||||
ld e, a
|
||||
rept 4
|
||||
add hl, de
|
||||
endr
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ret
|
||||
; e1475
|
||||
|
||||
Functione1475: ; e1475
|
||||
ld hl, wDeck
|
||||
ld a, [wcf65]
|
||||
ld e, a
|
||||
ld d, $0
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
ret
|
||||
; e1481
|
||||
|
||||
Functione1481: ; e1481
|
||||
ld a, [wcf66]
|
||||
ld hl, Unknown_e148f
|
||||
add l
|
||||
ld l, a
|
||||
ld a, $0
|
||||
adc h
|
||||
ld h, a
|
||||
ld a, [hl]
|
||||
ret
|
||||
; e148f
|
||||
|
||||
Unknown_e148f: ; e148f
|
||||
db $e0
|
||||
db $00, $03, $06, $09
|
||||
db $24, $27, $2a, $2d
|
||||
db $48, $4b, $4e, $51
|
||||
db $6c, $6f, $72, $75
|
||||
; e14a0
|
||||
|
||||
Functione14a0: ; e14a0
|
||||
ld hl, Unknown_e14b5
|
||||
ld de, wDeck
|
||||
ld c, $24
|
||||
.asm_e14a8
|
||||
ld a, [de]
|
||||
cp [hl]
|
||||
jr nz, .asm_e14b3
|
||||
inc de
|
||||
inc hl
|
||||
dec c
|
||||
jr nz, .asm_e14a8
|
||||
scf
|
||||
ret
|
||||
|
||||
.asm_e14b3
|
||||
and a
|
||||
ret
|
||||
; e14b5
|
||||
|
||||
Unknown_e14b5: ; e14b5
|
||||
db $00, $00, $00, $00, $00, $00
|
||||
db $00, $01, $02, $03, $04, $00
|
||||
db $00, $05, $06, $07, $08, $00
|
||||
db $00, $09, $0a, $0b, $0c, $00
|
||||
db $00, $0d, $0e, $0f, $10, $00
|
||||
db $00, $00, $00, $00, $00, $00
|
||||
; e14d9
|
||||
|
||||
Functione14d9: ; e14d9
|
||||
call Functione1481
|
||||
ld [wd002], a
|
||||
xor a
|
||||
call Functione1463
|
||||
ld a, [hli]
|
||||
ld b, [hl]
|
||||
ld c, a
|
||||
ld a, [wd002]
|
||||
cp $e0
|
||||
jr z, .asm_e14f2
|
||||
ld hl, Unknown_e150f
|
||||
jr .asm_e14f5
|
||||
|
||||
.asm_e14f2
|
||||
ld hl, Unknown_e1534
|
||||
|
||||
.asm_e14f5
|
||||
ld de, Sprites
|
||||
.asm_e14f8
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
ret z
|
||||
add b
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, [hli]
|
||||
add c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, [wd002]
|
||||
add [hl]
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
jr .asm_e14f8
|
||||
; e150f
|
||||
|
||||
Unknown_e150f: ; e150f
|
||||
db $f4, $f4, $00, $00
|
||||
db $f4, $fc, $01, $00
|
||||
db $f4, $04, $02, $00
|
||||
db $fc, $f4, $0c, $00
|
||||
db $fc, $fc, $0d, $00
|
||||
db $fc, $04, $0e, $00
|
||||
db $04, $f4, $18, $00
|
||||
db $04, $fc, $19, $00
|
||||
db $04, $04, $1a, $00
|
||||
db $ff
|
||||
|
||||
Unknown_e1534: ; e1534
|
||||
db $f4, $f4, $00, $00
|
||||
db $f4, $fc, $01, $00
|
||||
db $f4, $04, $00, $20
|
||||
db $fc, $f4, $02, $00
|
||||
db $fc, $fc, $03, $00
|
||||
db $fc, $04, $02, $20
|
||||
db $04, $f4, $00, $40
|
||||
db $04, $fc, $01, $40
|
||||
db $04, $04, $00, $60
|
||||
db $ff
|
||||
|
||||
Unknown_e1559: ; e1559
|
||||
|
||||
macro_e1559: macro
|
||||
db \1, \2
|
||||
dwcoord \3, \4
|
||||
db \5, \6
|
||||
endm
|
||||
|
||||
macro_e1559 $1c, $1c, 1, 0, $ee, $00
|
||||
macro_e1559 $34, $1c, 4, 0, $ee, $00
|
||||
macro_e1559 $4c, $1c, 7, 0, $ee, $00
|
||||
macro_e1559 $64, $1c, 10, 0, $ee, $00
|
||||
macro_e1559 $7c, $1c, 13, 0, $ee, $00
|
||||
macro_e1559 $94, $1c, 16, 0, $ee, $00
|
||||
macro_e1559 $1c, $34, 1, 3, $ee, $00
|
||||
macro_e1559 $34, $34, 4, 3, $ef, $00
|
||||
macro_e1559 $4c, $34, 7, 3, $ef, $00
|
||||
macro_e1559 $64, $34, 10, 3, $ef, $00
|
||||
macro_e1559 $7c, $34, 13, 3, $ef, $00
|
||||
macro_e1559 $94, $34, 16, 3, $ee, $00
|
||||
macro_e1559 $1c, $4c, 1, 6, $ee, $00
|
||||
macro_e1559 $34, $4c, 4, 6, $ef, $00
|
||||
macro_e1559 $4c, $4c, 7, 6, $ef, $00
|
||||
macro_e1559 $64, $4c, 10, 6, $ef, $00
|
||||
macro_e1559 $7c, $4c, 13, 6, $ef, $00
|
||||
macro_e1559 $94, $4c, 16, 6, $ee, $00
|
||||
macro_e1559 $1c, $64, 1, 9, $ee, $00
|
||||
macro_e1559 $34, $64, 4, 9, $ef, $00
|
||||
macro_e1559 $4c, $64, 7, 9, $ef, $00
|
||||
macro_e1559 $64, $64, 10, 9, $ef, $00
|
||||
macro_e1559 $7c, $64, 13, 9, $ef, $00
|
||||
macro_e1559 $94, $64, 16, 9, $ee, $00
|
||||
macro_e1559 $1c, $7c, 1, 12, $ee, $00
|
||||
macro_e1559 $34, $7c, 4, 12, $ef, $00
|
||||
macro_e1559 $4c, $7c, 7, 12, $ef, $00
|
||||
macro_e1559 $64, $7c, 10, 12, $ef, $00
|
||||
macro_e1559 $7c, $7c, 13, 12, $ef, $00
|
||||
macro_e1559 $94, $7c, 16, 12, $ee, $00
|
||||
macro_e1559 $1c, $94, 1, 15, $ee, $00
|
||||
macro_e1559 $34, $94, 4, 15, $ee, $00
|
||||
macro_e1559 $4c, $94, 7, 15, $ee, $00
|
||||
macro_e1559 $64, $94, 10, 15, $ee, $00
|
||||
macro_e1559 $7c, $94, 13, 15, $ee, $00
|
||||
macro_e1559 $94, $94, 16, 15, $ee, $00
|
||||
|
||||
Functione1631: ; e1631
|
||||
ld hl, VTiles2
|
||||
ld de, VTiles0
|
||||
ld b, $6
|
||||
.asm_e1639
|
||||
push bc
|
||||
push hl
|
||||
push hl
|
||||
call Functione1654
|
||||
pop hl
|
||||
ld bc, 8
|
||||
add hl, bc
|
||||
call Functione1654
|
||||
pop hl
|
||||
ld bc, $60
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .asm_e1639
|
||||
call Functione16c7
|
||||
ret
|
||||
; e1654
|
||||
|
||||
Functione1654: ; e1654
|
||||
ld c, $6
|
||||
.asm_e1656
|
||||
push bc
|
||||
push hl
|
||||
push hl
|
||||
ld c, $4
|
||||
.asm_e165b
|
||||
push bc
|
||||
ld a, [hli]
|
||||
and $f0
|
||||
swap a
|
||||
call Functione16aa
|
||||
ld c, a
|
||||
ld a, [hli]
|
||||
and $f0
|
||||
swap a
|
||||
call Functione16aa
|
||||
ld b, a
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .asm_e165b
|
||||
pop hl
|
||||
ld c, $4
|
||||
.asm_e1681
|
||||
push bc
|
||||
ld a, [hli]
|
||||
and $f
|
||||
call Functione16aa
|
||||
ld c, a
|
||||
ld a, [hli]
|
||||
and $f
|
||||
call Functione16aa
|
||||
ld b, a
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .asm_e1681
|
||||
pop hl
|
||||
ld bc, $10
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .asm_e1656
|
||||
ret
|
||||
; e16aa
|
||||
|
||||
Functione16aa: ; e16aa
|
||||
push hl
|
||||
ld hl, Unknown_e16b7
|
||||
add l
|
||||
ld l, a
|
||||
ld a, 0
|
||||
adc h
|
||||
ld h, a
|
||||
ld a, [hl]
|
||||
pop hl
|
||||
ret
|
||||
; e16b7
|
||||
|
||||
Unknown_e16b7: ; e16b7
|
||||
db $00, $03, $0c, $0f
|
||||
db $30, $33, $3c, $3f
|
||||
db $c0, $c3, $cc, $cf
|
||||
db $f0, $f3, $fc, $ff
|
||||
; e16c7
|
||||
|
||||
Functione16c7: ; e16c7
|
||||
ld hl, Unknown_e1703
|
||||
ld a, $8
|
||||
.asm_e16cc
|
||||
push af
|
||||
push hl
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld a, [hli]
|
||||
ld d, a
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
call Functione16e2
|
||||
pop hl
|
||||
rept 4
|
||||
inc hl
|
||||
endr
|
||||
pop af
|
||||
dec a
|
||||
jr nz, .asm_e16cc
|
||||
ret
|
||||
; e16e2
|
||||
|
||||
Functione16e2: ; e16e2
|
||||
lb bc, 4, 4
|
||||
.asm_e16e5
|
||||
push bc
|
||||
.asm_e16e6
|
||||
push de
|
||||
push hl
|
||||
ld b, $10
|
||||
.asm_e16ea
|
||||
ld a, [de]
|
||||
or [hl]
|
||||
ld [hli], a
|
||||
inc de
|
||||
dec b
|
||||
jr nz, .asm_e16ea
|
||||
pop hl
|
||||
ld de, $30
|
||||
add hl, de
|
||||
pop de
|
||||
dec c
|
||||
jr nz, .asm_e16e6
|
||||
ld bc, $180
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .asm_e16e5
|
||||
ret
|
||||
; e1703
|
||||
|
||||
Unknown_e1703: ; e1703
|
||||
dw GFX_e1723 + $00, $8000
|
||||
dw GFX_e1723 + $10, $8010
|
||||
dw GFX_e1723 + $20, $8020
|
||||
dw GFX_e1723 + $30, $80c0
|
||||
dw GFX_e1723 + $40, $80e0
|
||||
dw GFX_e1723 + $50, $8180
|
||||
dw GFX_e1723 + $60, $8190
|
||||
dw GFX_e1723 + $70, $81a0
|
||||
; e1723
|
||||
|
||||
GFX_e1723: ; e1723
|
||||
INCBIN "gfx/unknown/0e1723.2bpp"
|
||||
|
||||
Functione17a3: ; e17a3
|
||||
ld a, [ScriptVar]
|
||||
and 3
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, Unknown_e17bd
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld de, VTiles2
|
||||
call Decompress
|
||||
call Functione1631
|
||||
ret
|
||||
; e17bd
|
||||
|
||||
Unknown_e17bd: ; e17bd
|
||||
dw LZ_e1bab
|
||||
dw LZ_e1c9b
|
||||
dw LZ_e19fb
|
||||
dw LZ_e18ab
|
||||
; e17c5
|
||||
|
||||
GFX_e17c5: ; e17c5
|
||||
INCBIN "gfx/unknown/0e17c5.2bpp"
|
||||
|
||||
LZ_e1805: ; e1805
|
||||
INCBIN "gfx/unknown/0e1805.2bpp.lz"
|
||||
|
||||
LZ_e18ab: ; e18ab
|
||||
INCBIN "gfx/unknown/0e18ab.2bpp.lz"
|
||||
|
||||
LZ_e19fb: ; e19fb
|
||||
INCBIN "gfx/unknown/0e19fb.2bpp.lz"
|
||||
|
||||
LZ_e1bab: ; e1bab
|
||||
INCBIN "gfx/unknown/0e1bab.2bpp.lz"
|
||||
|
||||
LZ_e1c9b: ; e1c9b
|
||||
INCBIN "gfx/unknown/0e1c9b.2bpp.lz"
|
||||
|
|
|
@ -380,8 +380,8 @@ MapRadio: ; c355
|
|||
|
||||
Special_UnownPuzzle: ; c360
|
||||
call FadeToMenu
|
||||
callba Functione1190
|
||||
ld a, [wd0ec]
|
||||
callba UnownPuzzle
|
||||
ld a, [wSolvedUnownPuzzle]
|
||||
ld [ScriptVar], a
|
||||
call ExitAllMenus
|
||||
ret
|
||||
|
|
|
@ -0,0 +1,895 @@
|
|||
puzcoord EQUS "* 6 +"
|
||||
PUZZLE_BORDER EQU $ee
|
||||
PUZZLE_VOID EQU $ef
|
||||
|
||||
UnownPuzzle: ; e1190
|
||||
ld a, [hInMenu]
|
||||
push af
|
||||
ld a, $1
|
||||
ld [hInMenu], a
|
||||
call ClearBGPalettes
|
||||
call ClearTileMap
|
||||
call ClearSprites
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
call DisableLCD
|
||||
ld hl, wMisc
|
||||
ld bc, wMiscEnd - wMisc
|
||||
xor a
|
||||
call ByteFill
|
||||
ld hl, UnownPuzzleCursorGFX
|
||||
ld de, VTiles1 tile $60
|
||||
ld bc, 4 tiles
|
||||
call CopyBytes
|
||||
ld hl, UnownPuzzleStartCancelLZ
|
||||
ld de, VTiles1 tile $6d
|
||||
call Decompress
|
||||
call LoadUnownPuzzlePiecesGFX
|
||||
hlcoord 0, 0
|
||||
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
||||
ld a, PUZZLE_BORDER
|
||||
call ByteFill
|
||||
hlcoord 4, 3
|
||||
lb bc, 12, 12
|
||||
ld a, PUZZLE_VOID
|
||||
call UnownPuzzle_FillBox
|
||||
call InitUnownPuzzlePiecePositions
|
||||
call UnownPuzzle_UpdateTilemap
|
||||
call PlaceStartCancelBox
|
||||
xor a
|
||||
ld [hSCY], a
|
||||
ld [hSCX], a
|
||||
ld [rWY], a
|
||||
ld [wJumptableIndex], a
|
||||
ld [wHoldingUnownPuzzlePiece], a
|
||||
ld [wUnownPuzzleCursorPosition], a
|
||||
ld [wUnownPuzzleHeldPiece], a
|
||||
ld a, $93
|
||||
ld [rLCDC], a
|
||||
call WaitBGMap
|
||||
ld b, SCGB_18
|
||||
call GetSGBLayout
|
||||
ld a, $e4
|
||||
call DmgToCgbBGPals
|
||||
ld a, $24
|
||||
call DmgToCgbObjPal0
|
||||
xor a
|
||||
ld [wSolvedUnownPuzzle], a
|
||||
call DelayFrame
|
||||
.loop
|
||||
call JoyTextDelay
|
||||
ld a, [wJumptableIndex]
|
||||
bit 7, a
|
||||
jr nz, .quit
|
||||
call UnownPuzzleJumptable
|
||||
ld a, [wHoldingUnownPuzzlePiece]
|
||||
and a
|
||||
jr nz, .holding_piece
|
||||
ld a, [hVBlankCounter]
|
||||
and $10
|
||||
jr z, .clear
|
||||
.holding_piece
|
||||
call RedrawUnownPuzzlePieces
|
||||
jr .next
|
||||
|
||||
.clear
|
||||
call ClearSprites
|
||||
.next
|
||||
call DelayFrame
|
||||
jr .loop
|
||||
|
||||
.quit
|
||||
pop af
|
||||
ld [hInMenu], a
|
||||
call ClearBGPalettes
|
||||
call ClearTileMap
|
||||
call ClearSprites
|
||||
ld a, $e3
|
||||
ld [rLCDC], a
|
||||
ret
|
||||
; e124e
|
||||
|
||||
InitUnownPuzzlePiecePositions: ; e124e
|
||||
ld c, 1
|
||||
ld b, 16
|
||||
.load_loop
|
||||
call Random
|
||||
and $f
|
||||
ld hl, .PuzzlePieceInitialPositions
|
||||
ld e, a
|
||||
ld d, $0
|
||||
add hl, de
|
||||
ld e, [hl]
|
||||
ld hl, wPuzzlePieces
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr nz, .load_loop
|
||||
ld [hl], c
|
||||
inc c
|
||||
dec b
|
||||
jr nz, .load_loop
|
||||
ret
|
||||
; e126d
|
||||
|
||||
.PuzzlePieceInitialPositions: ; e126d
|
||||
initpuzcoord: macro
|
||||
rept _NARG / 2
|
||||
db \1 puzcoord \2
|
||||
shift
|
||||
shift
|
||||
endr
|
||||
endm
|
||||
initpuzcoord 0,0, 0,1, 0,2, 0,3, 0,4, 0,5
|
||||
initpuzcoord 1,0, 1,5
|
||||
initpuzcoord 2,0, 2,5
|
||||
initpuzcoord 3,0, 3,5
|
||||
initpuzcoord 4,0, 4,5
|
||||
initpuzcoord 5,0, 5,5
|
||||
; START > CANCEL
|
||||
; e127d
|
||||
|
||||
PlaceStartCancelBox: ; e127d
|
||||
call PlaceStartCancelBoxBorder
|
||||
hlcoord 5, 16
|
||||
ld a, $f6
|
||||
ld c, 10
|
||||
.loop
|
||||
ld [hli], a
|
||||
inc a
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ret
|
||||
; e128d
|
||||
|
||||
PlaceStartCancelBoxBorder: ; e128d
|
||||
hlcoord 4, 15
|
||||
ld a, $f0
|
||||
ld [hli], a
|
||||
ld bc, 10
|
||||
ld a, $f1
|
||||
call ByteFill
|
||||
hlcoord 15, 15
|
||||
ld a, $f2
|
||||
ld [hli], a
|
||||
hlcoord 4, 16
|
||||
ld a, $f3
|
||||
ld [hli], a
|
||||
ld bc, 10
|
||||
ld a, $ef
|
||||
call ByteFill
|
||||
hlcoord 15, 16
|
||||
ld a, $f3
|
||||
ld [hli], a
|
||||
hlcoord 4, 17
|
||||
ld a, $f4
|
||||
ld [hli], a
|
||||
ld bc, 10
|
||||
ld a, $f1
|
||||
call ByteFill
|
||||
hlcoord 15, 17
|
||||
ld a, $f5
|
||||
ld [hl], a
|
||||
ret
|
||||
; e12ca
|
||||
|
||||
UnownPuzzleJumptable: ; e12ca
|
||||
ld a, [wJumptableIndex]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .Jumptable
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
jp [hl]
|
||||
; e12d9
|
||||
|
||||
.Jumptable: ; e12d9
|
||||
jumptable_start
|
||||
jumptable .Function
|
||||
; e12db
|
||||
|
||||
.Function: ; e12db
|
||||
ld a, [hJoyPressed]
|
||||
and START
|
||||
jp nz, UnownPuzzle_Quit
|
||||
ld a, [hJoyPressed]
|
||||
and A_BUTTON
|
||||
jp nz, UnownPuzzle_A
|
||||
ld hl, hJoyLast
|
||||
ld a, [hl]
|
||||
and D_UP
|
||||
jr nz, .d_up
|
||||
ld a, [hl]
|
||||
and D_DOWN
|
||||
jr nz, .d_down
|
||||
ld a, [hl]
|
||||
and D_LEFT
|
||||
jr nz, .d_left
|
||||
ld a, [hl]
|
||||
and D_RIGHT
|
||||
jr nz, .d_right
|
||||
ret
|
||||
|
||||
.d_up
|
||||
ld hl, wUnownPuzzleCursorPosition
|
||||
ld a, [hl]
|
||||
cp 1 puzcoord 0
|
||||
ret c
|
||||
sub $6
|
||||
ld [hl], a
|
||||
jr .done_joypad
|
||||
|
||||
.d_down
|
||||
ld hl, wUnownPuzzleCursorPosition
|
||||
ld a, [hl]
|
||||
cp 4 puzcoord 1
|
||||
ret z
|
||||
cp 4 puzcoord 2
|
||||
ret z
|
||||
cp 4 puzcoord 3
|
||||
ret z
|
||||
cp 4 puzcoord 4
|
||||
ret z
|
||||
cp 5 puzcoord 0
|
||||
ret nc
|
||||
add $6
|
||||
ld [hl], a
|
||||
jr .done_joypad
|
||||
|
||||
.d_left
|
||||
ld hl, wUnownPuzzleCursorPosition
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret z
|
||||
cp 1 puzcoord 0
|
||||
ret z
|
||||
cp 2 puzcoord 0
|
||||
ret z
|
||||
cp 3 puzcoord 0
|
||||
ret z
|
||||
cp 4 puzcoord 0
|
||||
ret z
|
||||
cp 5 puzcoord 0
|
||||
ret z
|
||||
cp 5 puzcoord 5
|
||||
jr z, .left_overflow
|
||||
dec [hl]
|
||||
jr .done_joypad
|
||||
|
||||
.left_overflow
|
||||
ld [hl], 5 puzcoord 0
|
||||
jr .done_joypad
|
||||
|
||||
.d_right
|
||||
ld hl, wUnownPuzzleCursorPosition
|
||||
ld a, [hl]
|
||||
cp 0 puzcoord 5
|
||||
ret z
|
||||
cp 1 puzcoord 5
|
||||
ret z
|
||||
cp 2 puzcoord 5
|
||||
ret z
|
||||
cp 3 puzcoord 5
|
||||
ret z
|
||||
cp 4 puzcoord 5
|
||||
ret z
|
||||
cp 5 puzcoord 5
|
||||
ret z
|
||||
cp 5 puzcoord 0
|
||||
jr z, .right_overflow
|
||||
inc [hl]
|
||||
jr .done_joypad
|
||||
|
||||
.right_overflow
|
||||
ld [hl], 5 puzcoord 5
|
||||
|
||||
.done_joypad
|
||||
ld a, [wHoldingUnownPuzzlePiece]
|
||||
and a
|
||||
jr nz, .holding_piece
|
||||
ld de, SFX_POUND
|
||||
jr .play_sfx
|
||||
|
||||
.holding_piece
|
||||
ld de, SFX_MOVE_PUZZLE_PIECE
|
||||
|
||||
.play_sfx
|
||||
call PlaySFX
|
||||
ret
|
||||
; e1376
|
||||
|
||||
UnownPuzzle_A: ; e1376
|
||||
ld a, [wHoldingUnownPuzzlePiece]
|
||||
and a
|
||||
jr nz, .TryPlacePiece
|
||||
call UnownPuzzle_CheckCurrentTileOccupancy
|
||||
and a
|
||||
jr z, UnownPuzzle_InvalidAction
|
||||
ld de, SFX_MEGA_KICK
|
||||
call PlaySFX
|
||||
ld [hl], 0
|
||||
ld [wUnownPuzzleHeldPiece], a
|
||||
call RedrawUnownPuzzlePieces
|
||||
call FillUnoccupiedPuzzleSpace
|
||||
call WaitBGMap
|
||||
call WaitSFX
|
||||
ld a, TRUE
|
||||
ld [wHoldingUnownPuzzlePiece], a
|
||||
ret
|
||||
|
||||
.TryPlacePiece
|
||||
call UnownPuzzle_CheckCurrentTileOccupancy
|
||||
and a
|
||||
jr nz, UnownPuzzle_InvalidAction
|
||||
ld de, SFX_PLACE_PUZZLE_PIECE_DOWN
|
||||
call PlaySFX
|
||||
ld a, [wUnownPuzzleHeldPiece]
|
||||
ld [hl], a
|
||||
call PlaceUnownPuzzlePieceGFX
|
||||
call WaitBGMap
|
||||
xor a
|
||||
ld [wUnownPuzzleHeldPiece], a
|
||||
call RedrawUnownPuzzlePieces
|
||||
xor a
|
||||
ld [wHoldingUnownPuzzlePiece], a
|
||||
call WaitSFX
|
||||
call CheckSolvedUnownPuzzle
|
||||
ret nc
|
||||
|
||||
; You solved the puzzle!
|
||||
call PlaceStartCancelBoxBorder
|
||||
call ClearSprites
|
||||
ld de, SFX_1ST_PLACE
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
call SimpleWaitPressAorB
|
||||
ld a, TRUE
|
||||
ld [wSolvedUnownPuzzle], a
|
||||
UnownPuzzle_Quit: ; e13de
|
||||
ld hl, wJumptableIndex
|
||||
set 7, [hl]
|
||||
ret
|
||||
|
||||
UnownPuzzle_InvalidAction: ; e13e4
|
||||
ld de, SFX_WRONG
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
ret
|
||||
; e13ee
|
||||
|
||||
UnownPuzzle_FillBox: ; e13ee
|
||||
ld de, SCREEN_WIDTH
|
||||
.row
|
||||
push bc
|
||||
push hl
|
||||
.col
|
||||
ld [hli], a
|
||||
dec c
|
||||
jr nz, .col
|
||||
pop hl
|
||||
add hl, de
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .row
|
||||
ret
|
||||
; e13fe
|
||||
|
||||
UnownPuzzle_UpdateTilemap: ; e13fe
|
||||
xor a
|
||||
ld [wUnownPuzzleCursorPosition], a
|
||||
ld c, 6 * 6
|
||||
.loop
|
||||
push bc
|
||||
call UnownPuzzle_CheckCurrentTileOccupancy
|
||||
ld [wUnownPuzzleHeldPiece], a
|
||||
and a
|
||||
jr z, .not_holding_piece
|
||||
call PlaceUnownPuzzlePieceGFX
|
||||
jr .next
|
||||
|
||||
.not_holding_piece
|
||||
call FillUnoccupiedPuzzleSpace
|
||||
|
||||
.next
|
||||
ld hl, wUnownPuzzleCursorPosition
|
||||
inc [hl]
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ret
|
||||
; e141f
|
||||
|
||||
PlaceUnownPuzzlePieceGFX: ; e141f
|
||||
ld a, $2 ; tilemap coords
|
||||
call GetUnownPuzzleCoordData
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
push hl
|
||||
call GetCurrentPuzzlePieceVTileCorner
|
||||
pop hl
|
||||
ld de, SCREEN_WIDTH
|
||||
ld b, 3
|
||||
.row
|
||||
ld c, 3
|
||||
push hl
|
||||
.col
|
||||
ld [hli], a
|
||||
inc a
|
||||
dec c
|
||||
jr nz, .col
|
||||
add 9
|
||||
pop hl
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .row
|
||||
ret
|
||||
; e1441
|
||||
|
||||
FillUnoccupiedPuzzleSpace: ; e1441
|
||||
ld a, 2 ; tilemap coords
|
||||
call GetUnownPuzzleCoordData
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
push hl
|
||||
ld a, 4 ; tile
|
||||
call GetUnownPuzzleCoordData
|
||||
ld a, [hl]
|
||||
pop hl
|
||||
ld de, SCREEN_WIDTH
|
||||
ld b, 3
|
||||
.row
|
||||
ld c, 3
|
||||
push hl
|
||||
.col
|
||||
ld [hli], a
|
||||
dec c
|
||||
jr nz, .col
|
||||
pop hl
|
||||
add hl, de
|
||||
dec b
|
||||
jr nz, .row
|
||||
ret
|
||||
; e1463
|
||||
|
||||
GetUnownPuzzleCoordData: ; e1463
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, UnownPuzzleCoordData
|
||||
add hl, de
|
||||
ld a, [wUnownPuzzleCursorPosition]
|
||||
ld e, a
|
||||
rept 6
|
||||
add hl, de
|
||||
endr
|
||||
ret
|
||||
; e1475
|
||||
|
||||
UnownPuzzle_CheckCurrentTileOccupancy: ; e1475
|
||||
ld hl, wPuzzlePieces
|
||||
ld a, [wUnownPuzzleCursorPosition]
|
||||
ld e, a
|
||||
ld d, $0
|
||||
add hl, de
|
||||
ld a, [hl]
|
||||
ret
|
||||
; e1481
|
||||
|
||||
GetCurrentPuzzlePieceVTileCorner: ; e1481
|
||||
ld a, [wUnownPuzzleHeldPiece]
|
||||
ld hl, .Corners
|
||||
add l
|
||||
ld l, a
|
||||
ld a, $0
|
||||
adc h
|
||||
ld h, a
|
||||
ld a, [hl]
|
||||
ret
|
||||
; e148f
|
||||
|
||||
.Corners: ; e148f
|
||||
; 00, 01, 02
|
||||
; 0c, 0d, 0e
|
||||
; 18, 19, 1a
|
||||
db $e0 ; no piece selected
|
||||
db $00, $03, $06, $09
|
||||
db $24, $27, $2a, $2d
|
||||
db $48, $4b, $4e, $51
|
||||
db $6c, $6f, $72, $75
|
||||
; e14a0
|
||||
|
||||
CheckSolvedUnownPuzzle: ; e14a0
|
||||
ld hl, .SolvedPuzzleConfiguration
|
||||
ld de, wPuzzlePieces
|
||||
ld c, 6 * 6
|
||||
.loop
|
||||
ld a, [de]
|
||||
cp [hl]
|
||||
jr nz, .not_solved
|
||||
inc de
|
||||
inc hl
|
||||
dec c
|
||||
jr nz, .loop
|
||||
scf
|
||||
ret
|
||||
|
||||
.not_solved
|
||||
and a
|
||||
ret
|
||||
; e14b5
|
||||
|
||||
.SolvedPuzzleConfiguration: ; e14b5
|
||||
db $00, $00, $00, $00, $00, $00
|
||||
db $00, $01, $02, $03, $04, $00
|
||||
db $00, $05, $06, $07, $08, $00
|
||||
db $00, $09, $0a, $0b, $0c, $00
|
||||
db $00, $0d, $0e, $0f, $10, $00
|
||||
db $00, $00, $00, $00, $00, $00
|
||||
; e14d9
|
||||
|
||||
RedrawUnownPuzzlePieces: ; e14d9
|
||||
call GetCurrentPuzzlePieceVTileCorner
|
||||
ld [wd002], a
|
||||
xor a
|
||||
call GetUnownPuzzleCoordData ; get pixel positions
|
||||
ld a, [hli]
|
||||
ld b, [hl]
|
||||
ld c, a
|
||||
ld a, [wd002]
|
||||
cp $e0
|
||||
jr z, .NoPiece
|
||||
ld hl, .OAM_HoldingPiece
|
||||
jr .load
|
||||
|
||||
.NoPiece
|
||||
ld hl, .OAM_NotHoldingPiece
|
||||
|
||||
.load
|
||||
ld de, Sprites
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp -1
|
||||
ret z
|
||||
add b
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, [hli]
|
||||
add c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, [wd002]
|
||||
add [hl]
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
jr .loop
|
||||
; e150f
|
||||
|
||||
.OAM_HoldingPiece: ; e150f
|
||||
dsprite -1, -4, -1, -4, $00, $00
|
||||
dsprite -1, -4, 0, -4, $01, $00
|
||||
dsprite -1, -4, 0, 4, $02, $00
|
||||
dsprite 0, -4, -1, -4, $0c, $00
|
||||
dsprite 0, -4, 0, -4, $0d, $00
|
||||
dsprite 0, -4, 0, 4, $0e, $00
|
||||
dsprite 0, 4, -1, -4, $18, $00
|
||||
dsprite 0, 4, 0, -4, $19, $00
|
||||
dsprite 0, 4, 0, 4, $1a, $00
|
||||
db -1
|
||||
|
||||
.OAM_NotHoldingPiece: ; e1534
|
||||
dsprite -1, -4, -1, -4, $00, $00
|
||||
dsprite -1, -4, 0, -4, $01, $00
|
||||
dsprite -1, -4, 0, 4, $00, $20 ; xflip
|
||||
dsprite 0, -4, -1, -4, $02, $00
|
||||
dsprite 0, -4, 0, -4, $03, $00
|
||||
dsprite 0, -4, 0, 4, $02, $20 ; xflip
|
||||
dsprite 0, 4, -1, -4, $00, $40 ; yflip
|
||||
dsprite 0, 4, 0, -4, $01, $40 ; yflip
|
||||
dsprite 0, 4, 0, 4, $00, $60 ; xflip, yflip
|
||||
db -1
|
||||
|
||||
UnownPuzzleCoordData: ; e1559
|
||||
|
||||
puzzle_coords: macro
|
||||
dbpixel \1, \2, \3, \4
|
||||
dwcoord \5, \6
|
||||
db \7, \8
|
||||
endm
|
||||
; OAM coords, tilemap coords, vacant tile, filler
|
||||
puzzle_coords 3, 3, 4, 4, 1, 0, PUZZLE_BORDER, 0
|
||||
puzzle_coords 6, 3, 4, 4, 4, 0, PUZZLE_BORDER, 0
|
||||
puzzle_coords 9, 3, 4, 4, 7, 0, PUZZLE_BORDER, 0
|
||||
puzzle_coords 12, 3, 4, 4, 10, 0, PUZZLE_BORDER, 0
|
||||
puzzle_coords 15, 3, 4, 4, 13, 0, PUZZLE_BORDER, 0
|
||||
puzzle_coords 18, 3, 4, 4, 16, 0, PUZZLE_BORDER, 0
|
||||
|
||||
puzzle_coords 3, 6, 4, 4, 1, 3, PUZZLE_BORDER, 0
|
||||
puzzle_coords 6, 6, 4, 4, 4, 3, PUZZLE_VOID, 0
|
||||
puzzle_coords 9, 6, 4, 4, 7, 3, PUZZLE_VOID, 0
|
||||
puzzle_coords 12, 6, 4, 4, 10, 3, PUZZLE_VOID, 0
|
||||
puzzle_coords 15, 6, 4, 4, 13, 3, PUZZLE_VOID, 0
|
||||
puzzle_coords 18, 6, 4, 4, 16, 3, PUZZLE_BORDER, 0
|
||||
|
||||
puzzle_coords 3, 9, 4, 4, 1, 6, PUZZLE_BORDER, 0
|
||||
puzzle_coords 6, 9, 4, 4, 4, 6, PUZZLE_VOID, 0
|
||||
puzzle_coords 9, 9, 4, 4, 7, 6, PUZZLE_VOID, 0
|
||||
puzzle_coords 12, 9, 4, 4, 10, 6, PUZZLE_VOID, 0
|
||||
puzzle_coords 15, 9, 4, 4, 13, 6, PUZZLE_VOID, 0
|
||||
puzzle_coords 18, 9, 4, 4, 16, 6, PUZZLE_BORDER, 0
|
||||
|
||||
puzzle_coords 3, 12, 4, 4, 1, 9, PUZZLE_BORDER, 0
|
||||
puzzle_coords 6, 12, 4, 4, 4, 9, PUZZLE_VOID, 0
|
||||
puzzle_coords 9, 12, 4, 4, 7, 9, PUZZLE_VOID, 0
|
||||
puzzle_coords 12, 12, 4, 4, 10, 9, PUZZLE_VOID, 0
|
||||
puzzle_coords 15, 12, 4, 4, 13, 9, PUZZLE_VOID, 0
|
||||
puzzle_coords 18, 12, 4, 4, 16, 9, PUZZLE_BORDER, 0
|
||||
|
||||
puzzle_coords 3, 15, 4, 4, 1, 12, PUZZLE_BORDER, 0
|
||||
puzzle_coords 6, 15, 4, 4, 4, 12, PUZZLE_VOID, 0
|
||||
puzzle_coords 9, 15, 4, 4, 7, 12, PUZZLE_VOID, 0
|
||||
puzzle_coords 12, 15, 4, 4, 10, 12, PUZZLE_VOID, 0
|
||||
puzzle_coords 15, 15, 4, 4, 13, 12, PUZZLE_VOID, 0
|
||||
puzzle_coords 18, 15, 4, 4, 16, 12, PUZZLE_BORDER, 0
|
||||
|
||||
puzzle_coords 3, 18, 4, 4, 1, 15, PUZZLE_BORDER, 0
|
||||
puzzle_coords 6, 18, 4, 4, 4, 15, PUZZLE_BORDER, 0
|
||||
puzzle_coords 9, 18, 4, 4, 7, 15, PUZZLE_BORDER, 0
|
||||
puzzle_coords 12, 18, 4, 4, 10, 15, PUZZLE_BORDER, 0
|
||||
puzzle_coords 15, 18, 4, 4, 13, 15, PUZZLE_BORDER, 0
|
||||
puzzle_coords 18, 18, 4, 4, 16, 15, PUZZLE_BORDER, 0
|
||||
|
||||
ConvertLoadedPuzzlePieces: ; e1631
|
||||
ld hl, VTiles2
|
||||
ld de, VTiles0
|
||||
ld b, 6
|
||||
.loop
|
||||
push bc
|
||||
push hl
|
||||
push hl
|
||||
call .EnlargePuzzlePieceTiles
|
||||
pop hl
|
||||
ld bc, 1 tiles / 2
|
||||
add hl, bc
|
||||
call .EnlargePuzzlePieceTiles
|
||||
pop hl
|
||||
ld bc, 6 tiles
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .loop
|
||||
call UnownPuzzle_AddPuzzlePieceBorders
|
||||
ret
|
||||
; e1654
|
||||
|
||||
.EnlargePuzzlePieceTiles: ; e1654
|
||||
; double size
|
||||
ld c, 6
|
||||
.loop1
|
||||
push bc
|
||||
push hl
|
||||
push hl
|
||||
ld c, 4
|
||||
.loop2
|
||||
push bc
|
||||
ld a, [hli]
|
||||
and $f0
|
||||
swap a
|
||||
call .GetEnlargedTile
|
||||
ld c, a
|
||||
ld a, [hli]
|
||||
and $f0
|
||||
swap a
|
||||
call .GetEnlargedTile
|
||||
ld b, a
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .loop2
|
||||
pop hl
|
||||
ld c, 4
|
||||
.loop3
|
||||
push bc
|
||||
ld a, [hli]
|
||||
and $f
|
||||
call .GetEnlargedTile
|
||||
ld c, a
|
||||
ld a, [hli]
|
||||
and $f
|
||||
call .GetEnlargedTile
|
||||
ld b, a
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, c
|
||||
ld [de], a
|
||||
inc de
|
||||
ld a, b
|
||||
ld [de], a
|
||||
inc de
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .loop3
|
||||
pop hl
|
||||
ld bc, 1 tiles
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec c
|
||||
jr nz, .loop1
|
||||
ret
|
||||
; e16aa
|
||||
|
||||
.GetEnlargedTile: ; e16aa
|
||||
push hl
|
||||
ld hl, .EnlargedTiles
|
||||
add l
|
||||
ld l, a
|
||||
ld a, 0
|
||||
adc h
|
||||
ld h, a
|
||||
ld a, [hl]
|
||||
pop hl
|
||||
ret
|
||||
; e16b7
|
||||
|
||||
.EnlargedTiles: ; e16b7
|
||||
doubletile: MACRO
|
||||
rept _NARG
|
||||
x = 0
|
||||
y = 0
|
||||
rept 4
|
||||
x = x + (3 * (1 << (2 * y))) * ((\1 >> y) & 1)
|
||||
y = y + 1
|
||||
endr
|
||||
db x
|
||||
shift
|
||||
endr
|
||||
endm
|
||||
|
||||
__x__ = 0
|
||||
rept 16
|
||||
doubletile __x__
|
||||
__x__ = __x__ + 1
|
||||
endr
|
||||
|
||||
; db $00, $03, $0c, $0f
|
||||
; db $30, $33, $3c, $3f
|
||||
; db $c0, $c3, $cc, $cf
|
||||
; db $f0, $f3, $fc, $ff
|
||||
; e16c7
|
||||
|
||||
UnownPuzzle_AddPuzzlePieceBorders: ; e16c7
|
||||
ld hl, GFXHeaders
|
||||
ld a, 8
|
||||
.loop
|
||||
push af
|
||||
push hl
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
ld a, [hli]
|
||||
ld d, a
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
call .LoadGFX
|
||||
pop hl
|
||||
rept 4
|
||||
inc hl
|
||||
endr
|
||||
pop af
|
||||
dec a
|
||||
jr nz, .loop
|
||||
ret
|
||||
; e16e2
|
||||
|
||||
.LoadGFX: ; e16e2
|
||||
lb bc, 4, 4
|
||||
.loop1
|
||||
push bc
|
||||
|
||||
.loop2
|
||||
push de
|
||||
push hl
|
||||
|
||||
ld b, 1 tiles
|
||||
.loop3
|
||||
ld a, [de]
|
||||
or [hl]
|
||||
ld [hli], a
|
||||
inc de
|
||||
dec b
|
||||
jr nz, .loop3
|
||||
|
||||
pop hl
|
||||
ld de, 3 tiles
|
||||
add hl, de
|
||||
pop de
|
||||
dec c
|
||||
jr nz, .loop2
|
||||
|
||||
ld bc, 24 tiles
|
||||
add hl, bc
|
||||
pop bc
|
||||
dec b
|
||||
jr nz, .loop1
|
||||
ret
|
||||
; e1703
|
||||
|
||||
GFXHeaders: ; e1703
|
||||
dw .TileBordersGFX + $00, VTiles0 tile $00
|
||||
dw .TileBordersGFX + $10, VTiles0 tile $01
|
||||
dw .TileBordersGFX + $20, VTiles0 tile $02
|
||||
dw .TileBordersGFX + $30, VTiles0 tile $0c
|
||||
dw .TileBordersGFX + $40, VTiles0 tile $0e
|
||||
dw .TileBordersGFX + $50, VTiles0 tile $18
|
||||
dw .TileBordersGFX + $60, VTiles0 tile $19
|
||||
dw .TileBordersGFX + $70, VTiles0 tile $1a
|
||||
; e1723
|
||||
|
||||
.TileBordersGFX: ; e1723
|
||||
INCBIN "gfx/unown_puzzle/tile_borders.2bpp"
|
||||
|
||||
LoadUnownPuzzlePiecesGFX: ; e17a3
|
||||
ld a, [ScriptVar]
|
||||
and 3
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, .LZPointers
|
||||
rept 2
|
||||
add hl, de
|
||||
endr
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld de, VTiles2
|
||||
call Decompress
|
||||
call ConvertLoadedPuzzlePieces
|
||||
ret
|
||||
; e17bd
|
||||
|
||||
.LZPointers: ; e17bd
|
||||
dw KabutoPuzzleLZ
|
||||
dw OmanytePuzzleLZ
|
||||
dw AerodactylPuzzleLZ
|
||||
dw HoOhPuzzleLZ
|
||||
; e17c5
|
||||
|
||||
UnownPuzzleCursorGFX: ; e17c5
|
||||
INCBIN "gfx/unown_puzzle/cursor.2bpp"
|
||||
|
||||
UnownPuzzleStartCancelLZ: ; e1805
|
||||
INCBIN "gfx/unown_puzzle/start_cancel.2bpp.lz"
|
||||
|
||||
HoOhPuzzleLZ: ; e18ab
|
||||
INCBIN "gfx/unown_puzzle/hooh.2bpp.lz"
|
||||
|
||||
AerodactylPuzzleLZ: ; e19fb
|
||||
INCBIN "gfx/unown_puzzle/aerodactyl.2bpp.lz"
|
||||
|
||||
KabutoPuzzleLZ: ; e1bab
|
||||
INCBIN "gfx/unown_puzzle/kabuto.2bpp.lz"
|
||||
|
||||
OmanytePuzzleLZ: ; e1c9b
|
||||
INCBIN "gfx/unown_puzzle/omanyte.2bpp.lz"
|
1
main.asm
1
main.asm
|
@ -19902,6 +19902,7 @@ ret_e00ed: ; e00ed (38:40ed)
|
|||
; e00ee (38:40ee)
|
||||
|
||||
INCLUDE "engine/card_flip.asm"
|
||||
INCLUDE "engine/unown_puzzle.asm"
|
||||
INCLUDE "engine/dummy_game.asm"
|
||||
INCLUDE "engine/billspc.asm"
|
||||
|
||||
|
|
15
wram.asm
15
wram.asm
|
@ -809,12 +809,23 @@ wSlotsEnd::
|
|||
ds wSlots - @
|
||||
|
||||
; Card Flip
|
||||
; c6d0
|
||||
wCardFlip::
|
||||
wDeck:: ds 24
|
||||
wDeckEnd::
|
||||
; c6e8
|
||||
wCardFlipNumCardsPlayed:: ds 1
|
||||
wCardFlipEnd::
|
||||
ds wCardFlip - @
|
||||
|
||||
; Unown Puzzle
|
||||
wUnownPuzzle::
|
||||
wPuzzlePieces::
|
||||
ds 6 * 6
|
||||
wUnownPuzzleEnd::
|
||||
ds wUnownPuzzle - @
|
||||
|
||||
; Battle RAM
|
||||
wc6d0::
|
||||
PlayerSDefLevel:: ; c6d0
|
||||
ds 1
|
||||
|
@ -1423,13 +1434,16 @@ wcf63:: ds 1
|
|||
wNrOfBeatenBattleTowerTrainers::
|
||||
wMomBankDigitCursorPosition::
|
||||
wIntroSceneFrameCounter::
|
||||
wHoldingUnownPuzzlePiece::
|
||||
wcf64:: ds 1
|
||||
IF !DEF(CRYSTAL11)
|
||||
wPokedexStatus::
|
||||
ENDC
|
||||
wTitleScreenTimerLo::
|
||||
wUnownPuzzleCursorPosition::
|
||||
wcf65:: ds 1
|
||||
wTitleScreenTimerHi::
|
||||
wUnownPuzzleHeldPiece::
|
||||
wcf66:: ds 1
|
||||
|
||||
Requested2bpp:: ; cf67
|
||||
|
@ -1842,6 +1856,7 @@ wPlayerAction::
|
|||
; 0 - use move
|
||||
; 1 - use item
|
||||
; 2 - switch
|
||||
wSolvedUnownPuzzle::
|
||||
wd0ec:: ds 1
|
||||
|
||||
VramState:: ; d0ed
|
||||
|
|
Loading…
Reference in New Issue