Skip to content

Instantly share code, notes, and snippets.

@dekuNukem
Created March 9, 2016 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekuNukem/9028e8edad183ef857af to your computer and use it in GitHub Desktop.
Save dekuNukem/9028e8edad183ef857af to your computer and use it in GitHub Desktop.
fills up VRAM of FAP's video card
org 0x0
start: xor d
xor e
xor b ; clear d, e, b
ld hl, 0x92c0 ; load hl with address of back of the VRAM
ld de, 2400 ; 2400 bytes of attributes
ld b, 0x1b ; color, 0x1b is 011011, should be purple
attri: ld (hl), b ; store the color into VRAM address at hl
dec hl ; decrease hl to move on to next VRAM address
dec de ; decrease the counter
ld a,d
or e ; check if counter is 0
jp nz,attri ; continue looping if it's not
ld de, 2400 ; now attributes have been filled, reload the counter
ld b, 65 ; ASCII code for letter A
char: ld (hl), b ; similarly loop as above, fill the chatacter VRAM
dec hl
dec de
ld a,d
or e
jp nz,char
end: jp end ; all done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment