2 A bug in code generation for restoring registers after a builtin call.
7 #pragma disable_warning 85
9 // Based on code by "Under4Mhz" licensed under GPL 2.0 or later
15 const char TextPunc
[] = ":%! ";
17 #define TEXT_SPACE ( TEXT_PUNC + 3 )
18 #define TEXT_UPPER ( TEXT_NUM + 10 )
19 #define TEXT_PUNC ( TEXT_UPPER + 26 )
20 #define TEXT_NUM ( TEXT_START + 0 )
23 int myprintf( const char *restrict format
, ... );
25 void ImageCompleteText( uint8_t x
, uint8_t y
, const char *text
) {
32 uint8_t start
= TEXT_SPACE
;
37 char *ptr
= strchr( TextPunc
, ch
); // One of the two bytes of the result of this builtin call got corrupted.
40 index
= ptr
- TextPunc
;
45 myprintf( "%d %d %c\n", index
, start
, ch
);
51 int myprintf ( const char *restrict format
, ... )
55 va_start ( v
, format
);
56 index
= va_arg ( v
, int );
58 start
= va_arg ( v
, int );
60 ch
= va_arg ( v
, int );
67 ImageCompleteText(0,0,"!");