Skip to content

Commit 6a04a76

Browse files
committed
Fix/clarify blit directionality
1 parent 18e9ade commit 6a04a76

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

examples/gfx_sprite_keys/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void draw_sprite(int x, int y) {
2424
/* Draw a bunch of different styled sprites on the screen */
2525
gfx_Sprite(ubuntu, x, y);
2626

27-
/* Draw to the screen */
27+
/* Copy the buffer to the screen */
2828
gfx_BlitBuffer(); // This is the same as gfx_Blit(gfx_buffer)
2929
}
3030

src/graphx/graphx.asm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,13 +1777,13 @@ smcByte _Color
17771777
gfx_Blit:
17781778
; Copies the buffer image to the screen and vice versa
17791779
; Arguments:
1780-
; arg0 : Buffer to copy to (screen = 0, buffer = 1)
1780+
; arg0 : Buffer to copy from (screen = 0, buffer = 1)
17811781
; Returns:
17821782
; None
17831783
pop iy ; iy = return vector
17841784
ex (sp),hl
1785-
ld a,l ; a = buffer to blit to
1786-
call _CheckBlit ; determine which buffer to blit
1785+
ld a,l ; a = buffer to blit from
1786+
call _CheckBlit ; determine blit buffers
17871787
ld bc,LcdSize
17881788
_Blit_Ldir:
17891789
ldir ; just do it
@@ -1793,14 +1793,14 @@ _Blit_Ldir:
17931793
gfx_BlitLines:
17941794
; Copies the buffer image to the screen and vice versa line wise
17951795
; Arguments:
1796-
; arg0 : Buffer to copy to (screen = 0, buffer = 1)
1796+
; arg0 : Buffer to copy from (screen = 0, buffer = 1)
17971797
; arg1 : Y coordinate
17981798
; arg2 : Number of lines to copy
17991799
; Returns:
18001800
; None
18011801
pop iy ; iy = return vector
18021802
pop bc
1803-
ld a,c ; a = buffer to blit to
1803+
ld a,c ; a = buffer to blit from
18041804
pop de ; e = number of lines to copy
18051805
ex (sp),hl ; l = y coordinate
18061806
push de
@@ -1814,7 +1814,7 @@ gfx_BlitLines:
18141814
mlt hl
18151815
add hl,hl ; hl -> offset to start at
18161816
push hl
1817-
call _CheckBlit ; determine which buffer to blit
1817+
call _CheckBlit ; determineblit buffers
18181818
pop bc
18191819
add hl,bc
18201820
ex de,hl
@@ -1827,7 +1827,7 @@ gfx_BlitLines:
18271827
gfx_BlitRectangle:
18281828
; Copies the buffer image to the screen and vice versa rectangularly
18291829
; Arguments:
1830-
; arg0 : Buffer to copy to (screen = 0, buffer = 1)
1830+
; arg0 : Buffer to copy from (screen = 0, buffer = 1)
18311831
; arg1 : X coordinate
18321832
; arg2 : Y coordinate
18331833
; arg3 : Width
@@ -1843,8 +1843,8 @@ gfx_BlitRectangle:
18431843
add hl,hl
18441844
add hl,de ; hl = amount to increment
18451845
push hl ; save amount to increment
1846-
ld a,(iy+3)
1847-
call _CheckBlit ; determine which buffer to blit
1846+
ld a,(iy+3) ; a = buffer to blit from
1847+
call _CheckBlit ; determine blit buffers
18481848
pop bc
18491849
add hl,bc
18501850
ex de,hl

src/graphx/graphx.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@ void gfx_SetDraw(uint8_t location);
726726
* @brief Different locations routines can be drawn to
727727
*/
728728
typedef enum {
729-
gfx_screen = 0, /**< Draw to screen */
730-
gfx_buffer /**< Draw to buffer */
729+
gfx_screen = 0, /**< Screen */
730+
gfx_buffer /**< Buffer */
731731
} gfx_draw_location_t;
732732

733733
/**
@@ -784,34 +784,34 @@ void gfx_Wait(void);
784784
* Copies the input buffer to the opposite buffer
785785
*
786786
* No clipping is performed; as it is a copy not a draw
787-
* @param location gfx_screen - copies screen to buffer
788-
* @param location gfx_buffer - copies buffer to screen
787+
* @param src drawing location to copy from
788+
* @see gfx_draw_location_t
789789
*/
790-
void gfx_Blit(uint8_t location);
790+
void gfx_Blit(uint8_t src);
791791

792792
/**
793793
* Copies lines from the input buffer to the opposite buffer
794794
*
795795
* No clipping is performed; as it is a copy not a draw
796-
* @param location gfx_screen - copies screen to buffer
797-
* @param location gfx_buffer - copies buffer to screen
796+
* @param src drawing location to copy from
798797
* @param y_loc Y Location to begin copying at
799798
* @param num_lines Number of lines to copy
799+
* @see gfx_draw_location_t
800800
*/
801-
void gfx_BlitLines(uint8_t location, uint8_t y_loc, uint8_t num_lines);
801+
void gfx_BlitLines(uint8_t src, uint8_t y_loc, uint8_t num_lines);
802802

803803
/**
804804
* Copies a rectangle from the input buffer to the opposite buffer
805805
*
806806
* No clipping is performed; as it is a copy not a draw
807-
* @param location gfx_screen - copies screen to buffer
808-
* @param location gfx_buffer - copies buffer to screen
807+
* @param src drawing location to copy from
809808
* @param x X coordinate
810809
* @param y Y coordinate
811810
* @param width Width of rectangle
812811
* @param height Height of rectangle
812+
* @see gfx_draw_location_t
813813
*/
814-
void gfx_BlitRectangle(uint8_t location, uint24_t x, uint8_t y, uint24_t width, uint24_t height);
814+
void gfx_BlitRectangle(uint8_t src, uint24_t x, uint8_t y, uint24_t width, uint24_t height);
815815

816816
/**
817817
* Copies the screen to the buffer

0 commit comments

Comments
 (0)