mirror of
https://github.com/gbdk-2020/gbdk-2020.git
synced 2026-03-11 09:53:23 +01:00
* Add assembly support routines from sdcc-svn/sdcc/device/lib/mos6502/ to gbdk-lib/libc/asm/mos6502/ * Add gbdk-lib/libc/asm/mos6502/Makefile, based on corresponding sm83 / z80 Makefiles * Add CPU-specific include files to gbdk-lib/include/asm/mos6502/, based on corresponding sm83 / z80 include files * Update gbdk-lib/include/asm/sm83/types.h and gbdk-lib/include/asm/z80.types.h to define REENTRANT as no-op * Update gbdk-lib/include/stdio.h to use REENTRANT keyword for printf and sprintf * Update gbdk-lib/include/stdlib.h to prevent #if-clause from redefining __reentrant as a no-op * Update gbdk-lib/include/stdatomic.h to consider mos6502 in #if-clause * Update gbdk-lib/libc/_divulong.c to consider mos6502 in #if-clause * Add mos6502 to PORTS in Makefile, gbdk-lib/Makefile.common and gbdk-lib/libc/Makefile * Update Makefile to include sdas6500 and sdld in sdcc-install rule
19 lines
529 B
C
19 lines
529 B
C
#ifndef ASM_MOS6502_STDARG_INCLUDE
|
|
#define ASM_MOS6502_STDARG_INCLUDE
|
|
|
|
/* sdcc pushes right to left with the real sizes, not cast up
|
|
to an int.
|
|
so printf(int, char, long)
|
|
results in push long, push char, push int
|
|
On the 6502 the stack grows down, so the things seem to be in
|
|
the correct order.
|
|
*/
|
|
|
|
typedef unsigned char * va_list;
|
|
#define va_start(list, last) list = (unsigned char *)&last + sizeof(last)
|
|
#define va_arg(list, type) *((type *)((list += sizeof(type)) - sizeof(type)))
|
|
|
|
#define va_end(list)
|
|
|
|
#endif
|