pokecrystal-board/home/gfx.asm

310 lines
3.8 KiB
NASM
Raw Normal View History

DEF TILES_PER_CYCLE EQU 8
DEF MOBILE_TILES_PER_CYCLE EQU 6
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
Get2bppViaHDMA::
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jp z, Copy2bpp
2020-05-17 17:59:15 -07:00
homecall HDMATransfer2bpp
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ret
Get1bppViaHDMA::
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jp z, Copy1bpp
2020-05-17 17:59:15 -07:00
homecall HDMATransfer1bpp
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ret
FarCopyBytesDouble_DoubleBankSwitch::
2020-04-06 10:02:23 -07:00
ldh [hTempBank], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [hROMBank]
push af
2020-04-06 10:02:23 -07:00
ldh a, [hTempBank]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
rst Bankswitch
call FarCopyBytesDouble
pop af
rst Bankswitch
ret
UpdatePlayerSprite::
farcall _UpdatePlayerSprite
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ret
LoadStandardFont::
farcall _LoadStandardFont
ret
LoadFontsBattleExtra::
farcall _LoadFontsBattleExtra
ret
LoadFrame::
farcall _LoadFrame
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ret
LoadOverworldFontAndFrame::
farcall _LoadOverworldFontAndFrame
ret
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
DecompressRequest2bpp::
push de
ld a, BANK(sScratch)
call OpenSRAM
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
push bc
ld de, sScratch
ld a, b
call FarDecompress
pop bc
pop hl
ld de, sScratch
call Request2bpp
call CloseSRAM
ret
FarCopyBytes::
; copy bc bytes from a:hl to de
2020-04-06 10:02:23 -07:00
ldh [hTempBank], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [hROMBank]
push af
2020-04-06 10:02:23 -07:00
ldh a, [hTempBank]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
rst Bankswitch
call CopyBytes
pop af
rst Bankswitch
ret
FarCopyBytesDouble:
; Copy bc bytes from a:hl to bc*2 bytes at de,
; doubling each byte in the process.
2020-04-06 10:02:23 -07:00
ldh [hTempBank], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [hROMBank]
push af
2020-04-06 10:02:23 -07:00
ldh a, [hTempBank]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
rst Bankswitch
; switcheroo, de <> hl
ld a, h
ld h, d
ld d, a
ld a, l
ld l, e
ld e, a
inc b
inc c
jr .dec
.loop
ld a, [de]
inc de
ld [hli], a
ld [hli], a
.dec
dec c
jr nz, .loop
dec b
jr nz, .loop
pop af
rst Bankswitch
ret
Request2bpp::
; Load 2bpp at b:de to occupy c tiles of hl.
ldh a, [hBGMapMode]
push af
xor a
ldh [hBGMapMode], a
ldh a, [hROMBank]
push af
ld a, b
rst Bankswitch
ldh a, [hTilesPerCycle]
push af
2020-06-16 12:49:32 -07:00
ld a, TILES_PER_CYCLE
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh [hTilesPerCycle], a
ld a, e
ld [wRequested2bppSource], a
ld a, d
ld [wRequested2bppSource + 1], a
ld a, l
ld [wRequested2bppDest], a
ld a, h
ld [wRequested2bppDest + 1], a
.loop
ld a, c
ld hl, hTilesPerCycle
cp [hl]
2020-06-16 12:49:32 -07:00
jr nc, .cycle
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ld [wRequested2bppSize], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
.wait
call DelayFrame
ld a, [wRequested2bppSize]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
and a
jr nz, .wait
pop af
ldh [hTilesPerCycle], a
pop af
rst Bankswitch
pop af
ldh [hBGMapMode], a
ret
2020-06-16 12:49:32 -07:00
.cycle
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [hTilesPerCycle]
ld [wRequested2bppSize], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
.wait2
call DelayFrame
ld a, [wRequested2bppSize]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
and a
jr nz, .wait2
ld a, c
ld hl, hTilesPerCycle
sub [hl]
ld c, a
jr .loop
Request1bpp::
; Load 1bpp at b:de to occupy c tiles of hl.
ldh a, [hBGMapMode]
push af
xor a
ldh [hBGMapMode], a
ldh a, [hROMBank]
push af
ld a, b
rst Bankswitch
ldh a, [hTilesPerCycle]
push af
2020-06-16 12:49:32 -07:00
ld a, TILES_PER_CYCLE
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh [hTilesPerCycle], a
ld a, e
ld [wRequested1bppSource], a
ld a, d
ld [wRequested1bppSource + 1], a
ld a, l
ld [wRequested1bppDest], a
ld a, h
ld [wRequested1bppDest + 1], a
.loop
ld a, c
ld hl, hTilesPerCycle
cp [hl]
2020-06-16 12:49:32 -07:00
jr nc, .cycle
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ld [wRequested1bppSize], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
.wait
call DelayFrame
ld a, [wRequested1bppSize]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
and a
jr nz, .wait
pop af
ldh [hTilesPerCycle], a
pop af
rst Bankswitch
pop af
ldh [hBGMapMode], a
ret
2020-06-16 12:49:32 -07:00
.cycle
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [hTilesPerCycle]
ld [wRequested1bppSize], a
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
.wait2
call DelayFrame
ld a, [wRequested1bppSize]
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
and a
jr nz, .wait2
ld a, c
ld hl, hTilesPerCycle
sub [hl]
ld c, a
jr .loop
Get2bpp::
2020-06-29 16:35:47 -07:00
; copy c 2bpp tiles from b:de to hl
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jp nz, Request2bpp
; fallthrough
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
Copy2bpp:
push hl
ld h, d
ld l, e
pop de
; bank
ld a, b
2020-06-16 12:49:32 -07:00
; bc = c * LEN_2BPP_TILE
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
push af
swap c
ld a, $f
and c
ld b, a
ld a, $f0
and c
ld c, a
pop af
jp FarCopyBytes
Get1bpp::
2020-06-29 16:35:47 -07:00
; copy c 1bpp tiles from b:de to hl
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
ldh a, [rLCDC]
bit rLCDC_ENABLE, a
jp nz, Request1bpp
; fallthrough
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
Copy1bpp::
push de
ld d, h
ld e, l
; bank
ld a, b
2020-06-16 12:49:32 -07:00
; bc = c * LEN_1BPP_TILE
Small home/ reorganization Time to move everything out of home.asm: - InexplicablyEmptyFunction was moved to home/map.asm - The wDebugFlags functions and xor_a brothers were moved to home/flag.asm because they're all flag-related. - ret_2f3e was moved into home/region.asm - The register alias sisters were moved to a new file called home/call_regs.asm - IsInArray and SkipNames were joined by AddNTimes from home/math.asm into home/array.asm, as they're all used to index arrays. - CallPointerAt was moved into home/print_text.asm because given the contents of that file it doesn't feel very out of place (that file isn't very aptly named...) - CountSetBits was moved into home/pokedex_flags.asm because it's unique use is counting the amount of seen/caught mon in the podedex. GetWeekday was pulled into this by proximity. Other changes were also made: - PushLYOverrides was moved from home/sprite_anims.asm to home/battle.asm, because it's almost exclusively used for battle animations, with the lone exception being the Magnet Train. - home/copy.asm was renamed to home/gfx.asm, as it's all gfx-related - home/copy2.asm was renamed to home/copy.asm, now it's the only file called copy. - SetHPPal and GetHPPal were moved from home/hp_pals.asm to home/tilemap.asm, as they're attrmap related, like many functions in that file are. - home/rtc.asm was renamed to home/time_palettes.asm, as it had very little to do with the RTC at all, all RTC functions being in home/time.asm - home/handshake.asm was renamed to home/printer.asm. - home/mon_data_2.asm was renamed to home/mon_party.asm.
2020-02-21 14:48:51 -08:00
push af
ld h, 0
ld l, c
add hl, hl
add hl, hl
add hl, hl
ld b, h
ld c, l
pop af
pop hl
jp FarCopyBytesDouble