pokecrystal-board/engine/events/print_unown_2.asm
Rangi 32ed487a47 Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts:
#	audio/engine.asm
#	constants/gfx_constants.asm
#	constants/map_data_constants.asm
#	constants/pokemon_data_constants.asm
#	constants/sprite_constants.asm
#	constants/wram_constants.asm
#	data/maps/data.asm
#	engine/battle/ai/scoring.asm
#	engine/battle/core.asm
#	engine/battle/effect_commands.asm
#	engine/battle/misc.asm
#	engine/battle_anims/getpokeballwobble.asm
#	engine/breeding.asm
#	engine/buy_sell_toss.asm
#	engine/decorations.asm
#	engine/events/battle_tower/battle_tower.asm
#	engine/events/battle_tower/rules.asm
#	engine/events/buena.asm
#	engine/events/bug_contest/contest_2.asm
#	engine/events/daycare.asm
#	engine/events/dratini.asm
#	engine/events/halloffame.asm
#	engine/events/happiness_egg.asm
#	engine/events/kurt.asm
#	engine/events/lucky_number.asm
#	engine/events/magnet_train.asm
#	engine/events/overworld.asm
#	engine/events/pokerus/pokerus.asm
#	engine/events/print_unown.asm
#	engine/events/print_unown_2.asm
#	engine/events/unown_walls.asm
#	engine/item_effects.asm
#	engine/link.asm
#	engine/mon_menu.asm
#	engine/player_object.asm
#	engine/routines/playslowcry.asm
#	engine/scripting.asm
#	engine/search.asm
#	engine/search2.asm
#	engine/specials.asm
#	engine/start_menu.asm
#	engine/timeset.asm
#	home/battle_vars.asm
#	home/map.asm
#	maps/GoldenrodUndergroundSwitchRoomEntrances.asm
#	maps/IlexForest.asm
#	maps/KrissHouse2F.asm
#	maps/Route39Barn.asm
#	mobile/mobile_12_2.asm
#	mobile/mobile_40.asm
#	mobile/mobile_5f.asm
#	wram.asm
2018-02-03 19:42:56 -05:00

112 lines
1.3 KiB
NASM

RotateUnownFrontpic: ; e0000
; something to do with Unown printer
push de
xor a ; sScratch
call GetSRAMBank
ld hl, sScratch
ld bc, 0
.loop
push bc
push hl
push bc
ld de, wd002
call .Copy
call .Rotate
ld hl, UnownPrinter_OverworldMapRectangle
pop bc
add hl, bc
add hl, bc
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wd012
call .Copy
pop hl
ld bc, $10
add hl, bc
pop bc
inc c
ld a, c
cp 7 * 7
jr c, .loop
ld hl, wOverworldMap
ld de, sScratch
ld bc, 7 * 7 tiles
call CopyBytes
pop hl
ld de, sScratch
ld c, 7 * 7
ld a, [hROMBank]
ld b, a
call Get2bpp
call CloseSRAM
ret
.Copy: ; e004e
ld c, $10
.loop_copy
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .loop_copy
ret
.Rotate: ; e0057
ld hl, wd012
ld e, %10000000
ld d, 8
.loop_decompress
push hl
ld hl, wd002
call .CountSetBit
pop hl
ld a, b
ld [hli], a
push hl
ld hl, wd003
call .CountSetBit
pop hl
ld a, b
ld [hli], a
srl e
dec d
jr nz, .loop_decompress
ret
.CountSetBit: ; e0078
ld b, 0
ld c, 8
.loop_count
ld a, [hli]
and e
jr z, .clear
scf
jr .apply
.clear
and a
.apply
rr b
inc hl
dec c
jr nz, .loop_count
ret
overworldmaprect: MACRO
y = 0
rept \1
x = \1 * (\2 + -1) + y
rept \2
dw wOverworldMap tile x
x = x + -\2
endr
y = y + 1
endr
ENDM
UnownPrinter_OverworldMapRectangle: ; e008b
overworldmaprect 7, 7