mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 15:12:18 +13:00
Split copy and serial functions out of home.asm.
This commit is contained in:
parent
1cf79b6f15
commit
cf399a8c86
5 changed files with 563 additions and 569 deletions
24
home/copy.asm
Normal file
24
home/copy.asm
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
FarCopyData::
|
||||
; Copy bc bytes from a:hl to de.
|
||||
ld [wBuffer], a
|
||||
ld a, [H_LOADEDROMBANK]
|
||||
push af
|
||||
ld a, [wBuffer]
|
||||
ld [H_LOADEDROMBANK], a
|
||||
ld [MBC3RomBank], a
|
||||
call CopyData
|
||||
pop af
|
||||
ld [H_LOADEDROMBANK], a
|
||||
ld [MBC3RomBank], a
|
||||
ret
|
||||
|
||||
CopyData::
|
||||
; Copy bc bytes from hl to de.
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
dec bc
|
||||
ld a, c
|
||||
or b
|
||||
jr nz, CopyData
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue