Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes in crt0_msxdos_advanced and printf.c #135

Merged
merged 2 commits into from Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/tools/C/crt0_msxdos_advanced.s
Expand Up @@ -129,7 +129,7 @@ cont: ld hl,#0x100
; Termination code for DOS 2 was returned on L.

ld c,#0x62 ;DOS 2 function for program termination (_TERM)
ld b,l
ld b,a
call 5 ;On DOS 2 this terminates; on DOS 1 this returns...
ld c,#0x0
jp 5 ;...and then this one terminates
Expand Down
11 changes: 8 additions & 3 deletions source/tools/C/printf.c
Expand Up @@ -11,7 +11,7 @@
Supported format specifiers:

%d or %i: signed int
%ud or %ui: unsigned int
%u: unsigned int
%x: hexadecimal int
%c: character
%s: string
Expand All @@ -20,7 +20,7 @@
Also if SUPPORT_LONG is defined:

%l: signed long
%ul: unsigned long
%lu: unsigned long
%lx: hexadecimal long
*/

Expand Down Expand Up @@ -160,7 +160,12 @@ static int format_string(const char* buf, const char *fmt, va_list ap)
else if(theChar == 'x') {
base = 16;
}
else if(theChar != 'd' && theChar != 'i') {
#ifdef SUPPORT_LONG
else if(isLong) {
fmtPnt--;
} else
#endif
if(theChar != 'd' && theChar != 'i') {
do_char_inc(theChar);
continue;
}
Expand Down