diff options
author | Juan J. Martinez <jjm@usebox.net> | 2020-12-30 19:07:31 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2020-12-30 19:23:41 +0000 |
commit | 2682bc5d1d864341aaeb42a449db73c3ecd16d70 (patch) | |
tree | 9116764364b4ee0ce7f6037305077807b57776de /src/ubox/ubox_set_sprite_pat8_flip.z80 | |
download | ubox-msx-lib-2682bc5d1d864341aaeb42a449db73c3ecd16d70.tar.gz ubox-msx-lib-2682bc5d1d864341aaeb42a449db73c3ecd16d70.zip |
Initial import1.0
Diffstat (limited to 'src/ubox/ubox_set_sprite_pat8_flip.z80')
-rw-r--r-- | src/ubox/ubox_set_sprite_pat8_flip.z80 | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/ubox/ubox_set_sprite_pat8_flip.z80 b/src/ubox/ubox_set_sprite_pat8_flip.z80 new file mode 100644 index 0000000..a3f8d1d --- /dev/null +++ b/src/ubox/ubox_set_sprite_pat8_flip.z80 @@ -0,0 +1,48 @@ +.globl _ubox_set_sprite_pat8_flip + +WRTVRM = 0x004d + +_ubox_set_sprite_pat8_flip:: + ld hl, #2 + add hl, sp + + ld e, (hl) + inc hl + ld d, (hl) + inc hl + + ld l, (hl) + ld h, #0 + add hl, hl + add hl, hl + add hl, hl + ld bc, #0x3800 + add hl, bc + + ld b, #8 +flip0: + call flip_and_copy + inc hl + inc de + djnz flip0 + ret + +flip_and_copy: + ld a, (de) + ld c, a + rlca + rlca + xor c + and #0xaa + xor c + ld c, a + rlca + rlca + rlca + rrc c + xor c + and #0x66 + xor c + + jp WRTVRM + |