Skip to content

Commit f3d972f

Browse files
fix #221
1 parent 7ab5052 commit f3d972f

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

examples/gfx_misc/autotester.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"description": "Testing that two rectangles are drawn to the visible screen",
2424
"start": "vram_start",
2525
"size": "vram_16_size",
26-
"expected_CRCs": [ "5BEF2A9D" ]
26+
"expected_CRCs": [ "F15C0070" ]
2727
},
2828
"2": {
29-
"description": "Testing that there are now four rectangles displayed on the screen",
29+
"description": "Testing that there are now four rectangles displayed on the screen, and modified text in the corner",
3030
"start": "vram_start",
3131
"size": "vram_16_size",
32-
"expected_CRCs": [ "6A171265" ]
32+
"expected_CRCs": [ "A9AFBF51" ]
3333
},
3434
"3": {
3535
"description": "Back to the home screen (exit check)",

examples/gfx_misc/src/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#include <tice.h>
22
#include <graphx.h>
3+
#include <stdint.h>
34

45
/* Main function */
56
void main(void) {
67

8+
static const uint8_t char_data[8] = { 0xaa, 0x55, 0xff, 0x00, 0xaa, 0x55, 0xff, 0x00 };
9+
710
/* Start the graphics canvas */
811
gfx_Begin();
912

@@ -29,6 +32,10 @@ void main(void) {
2932
/* Copy the drawn rectangles on the visible screen to the buffer */
3033
gfx_CopyRectangle(gfx_screen, gfx_buffer, 30, 20, 30, 110, 90, 50);
3134

35+
/* Attempt to change a character */
36+
gfx_SetCharData('a', char_data);
37+
gfx_PrintStringXY("aaa", 0, 0);
38+
3239
/* Wait for key input */
3340
while (!os_GetCSC());
3441

src/graphx/graphx.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3576,6 +3576,7 @@ gfx_SetCharData:
35763576
add hl,de
35773577
or a,a
35783578
sbc hl,de ; sets z flag if null
3579+
ret z
35793580
ex de,hl
35803581
or a,a
35813582
sbc hl,hl
@@ -3585,7 +3586,7 @@ gfx_SetCharData:
35853586
add hl,hl
35863587
ld bc,(_TextData)
35873588
add hl,bc
3588-
ret z
3589+
ex de,hl
35893590
ld bc,8
35903591
ldir
35913592
ret

0 commit comments

Comments
 (0)