Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |200|00e0: cls
- |202|6000: ld v0, 0 ; Number of letters drawn
- |204|6100: ld v1, 0 ; X variable
- |206|6200: ld v2, 0 ; Y variable
- |208|6304: ld v3, 5 ; I increment
- | |
- |20a| draw_letter:
- | |d125: drw v1, v2, 5 ; Draws the current letter
- |20c|400f: sne v0, 0x0f ; We check if we have drawn all the letters
- x|20e|1222: jp draw_smiley ; We jump to the `draw_smiley` if that's the case
- |210|7001: add v0, 1 ; We increment by 1 the number of letters drawn
- |212|f31e: add i, v3 ; We add 5 to the I register
- |214|413c: sne v1, 60 ; If we reached the width of the screen,
- |216|121c: jp next_line ; we jump to the `next_line` label
- |218|7105: add v1, 5 ; We move the next sprite by five pixels
- x|21a|120a: jp draw_letter ; We draw the next letter
- | |
- |21c| next_line:
- | |6100: ld v1, 0x00 ; We clear X
- |21e|7206: add v2, 6 ; We add 6 to Y
- x|220|120a: jp draw_letter ; We draw the next letter
- | |
- |222| draw_smiley:
- | |601d: ld v0, 29 ; We set our v0 and v1 registers to 24 and 8, representing the
- |224|610c: ld v1, 12 ; middle of the screen minus the width & height of the sprite.
- |226|a22c: ld i, __data_smiley_bitmap ; We load the pointer of the sprite to I
- |228|d017: drw v0, v1, 7 ; We draw our sprite
- | |
- |22a| : halt:
- x| |122a: jp halt ; We loop forever here.
- | |
- |22c| : __data_smiley_bitmap: ; Definition of a smiley bitmap
- | |fe : .binary 0b11111110,
- | | 82: 0b10000010,
- |22e|aa : 0b10101010,
- | | 82: 0b10000010,
- |230|c6 : 0b11000110,
- | | ba: 0b10111010,
- |232|fe00: 0b11111110
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement