Skip to content

Instantly share code, notes, and snippets.

@tobiasvl
Created November 16, 2017 09:41
Show Gist options
  • Select an option

  • Save tobiasvl/b27a3ac26acefb9e9c4f759725d58008 to your computer and use it in GitHub Desktop.

Select an option

Save tobiasvl/b27a3ac26acefb9e9c4f759725d58008 to your computer and use it in GitHub Desktop.
; C000 = Copy of OAM table
InitSpriteDMA::
; copy spritedma routine into hiram
ld hl,SpriteDMA
ld de,$FF80
ld bc,SpriteDMAEnd - SpriteDMA
call mem_Copy
ret
; SpriteDMA routine (copied to HiRAM at $FF80)
SpriteDMA:
ld a,$C0
ldh [rDMA],a
ld a,$28
.lp
dec a
jr nz,.lp
ret
SpriteDMAEnd:
VBlank_irq::
call $FF80
reti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment