summaryrefslogtreecommitdiff
path: root/home/copy.asm
diff options
context:
space:
mode:
authorU-Daniel-PC\Daniel <corrnondacqb@yahoo.com>2014-09-19 23:19:05 -0400
committerU-Daniel-PC\Daniel <corrnondacqb@yahoo.com>2014-09-19 23:19:05 -0400
commitdac95cb42bb8bc953c7a1e1d345a549846d51abf (patch)
treeb996727e4f739da761fc1fa2418c65415ebf93d8 /home/copy.asm
parent57113a7651ba8a7f88e119ca3de7acb45a77db69 (diff)
parent1185d69819af3493fe8ace9f576fee4b420db55e (diff)
Merge branch 'master' of https://github.com/iimarckus/pokered
Diffstat (limited to 'home/copy.asm')
-rw-r--r--home/copy.asm24
1 files changed, 24 insertions, 0 deletions
diff --git a/home/copy.asm b/home/copy.asm
new file mode 100644
index 00000000..a6c298e4
--- /dev/null
+++ b/home/copy.asm
@@ -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