33 Commits

Author SHA1 Message Date
Michel Iwaniec
9ec18dbb07 Reduce zeropage use for locals, by making gbdk-nes functions use its own dedicated overlay segment instead of SDCC's overlay segment
* Update gbdk_build_and_package.yml and gbdk_build_examples.yml to use gbdk-4.2.0-Next SDCC build
* Update nes.h to declare all gbdk functions with the new __no_overlay_locals function attribute
* Introduce new dedicated 16-byte overlay segment GBDKOVR, and make all assembly functions use this instead of OSEG
* Update LCC file targets.c to reserve space for both OSEG and GBDKOVR
2023-10-05 02:17:49 +01:00
Michel Iwaniec
640ccd3613 NES: Change nes target to use asm implementation of strcmp function
* Change USE_C_STRCMP in gbdk-lib/include/asm/mos6502/provides.h to 0
2023-07-25 01:15:59 +01:00
Toxa
ae46ed14e6 define NORETURN attribute 2023-07-24 20:12:15 +03:00
Michel Iwaniec
bc8ac49106 NES: Fix missing memcpy implementation for nes target
* Add simple #define in gbdk-lib/include/asm/mos6502/string.h to make memcpy equal __memcpy asm version
2023-07-23 01:07:24 +01:00
Michel Iwaniec
3009f84b09 NES: Add support for bank-switching
Changes to gbdk-lib/include library headers:
* Make NONBANKED / BANKED macros in asm/mos6502/types.h expand to respective keywords instead of being no-ops
* Remove force-zero-bank version of INCBIN macros in gbdk/incbin.h in favour of regular version
* Make BANK / BANKREF macros in nes/nes.h use appropriate implementation instead of stubs
* Add SWITCH_ROM_UNROM macro, and make SWITCH_ROM use it in place of SWITCH_ROM_DUMMY in nes.h
* Add stubbed no-op versions for SWITCH_RAM / ENABLE_RAM / DISABLE_RAM in nes.h, to support cross-platform tests

changes to gbdk-support tools:
* Remove CODEFIXED segment at 0xE000 in lcc/targets.c, relying only on _CODE at 0xC000
* Make ld command use -a nes, to use virtual address translation from sdld_virtual_address_translation.patch
* Update bankpack to support "nes" as option (uses GB platform)
* Update makebin to perform NES specific bank fix (rotates ROM by one bank, putting first bank as last)
* Update png2asset to initialize bank to -1 and write #pragma bank for banks = 0, to remove assumption on bank 0 being the fixed bank

Changes to gbdk-lib/libc implementations:
* Add implementation of to_far_ptr and call__banked in targets/mos6502/far_ptr.s
* Add UNROM bank switching macros in targets/mos6502/nes/mapper_macros.s, and __swith_prg0 function in targets/mos6502/nes/mapper.s
* Add banked call support routine ___sdcc_bcall in targets/mos6502/nes/sdcc_bcall.s
* Add code to initialize switchable bank to 0 at reset in crt0

Depends on sdcc_mos6502_underscored_areas.patch, sdcc_mos6502_bank_support.patch and sdld_virtual_address_translation.patch applied to SDCC
2023-06-02 23:34:20 +01:00
bbbbbr
02471ffbdb Docs: isr handler updates + some release notes 2022-10-17 00:47:29 -07:00
MichelIwaniec
983766b21c Add mos6502.lib build for GBDK installation
* 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
2022-06-06 00:38:21 +01:00
Toxa
48c5e217f5 fix calling conventions for the library functions which are called from SDCC generated code 2022-04-03 23:09:06 +03:00
Toxa
33d83cf106 fix Z88DK_CALLEE definition 2022-04-01 23:12:27 +03:00
Toxa
3bdf668e22 migrate to SDCC 4.2 2022-04-01 18:45:25 +03:00
bbbbbr
9893f998ba Updates for 4.0.6
- Add version number to front of PDF and HTML docs(controlled my version in root makefile)
- Little improvements to memcmp() and strncmp()
2022-02-01 00:17:49 -08:00
Toxa
2d0ad14393 more macro definitions for SDCC features 2021-12-03 23:55:30 +03:00
Toxa
380d0633c8 use defines to wrap SDCC specific features 2021-11-29 20:01:26 +03:00
Toxa
9bdca4da3b fix intellisense: define custom SDCC attributes through macros 2021-11-29 16:33:13 +03:00
Toxa
0287f49e84 remove obsolete type definitions, fix size_t 2021-11-29 15:00:13 +03:00
Toxa
82d5bf7a12 memcmp() implementation 2021-11-28 18:45:02 +03:00
Toxa
6569503c11 define OLDCALL only if not defined previously 2021-09-14 16:46:09 +03:00
Toxa
a270bd6997 prepare for SDCC >= #12608 2021-09-14 12:59:34 +03:00
bbbbbr
3bcf682666 Docs: updates for interrupts and banking 2021-09-10 21:33:44 -07:00
bbbbbr
06e2f31954 Docs: Fix misc doxygen warnings and duplicate entries 2021-09-09 23:50:37 -07:00
Toxa
05078295b4 SMS/GG: memset() 2021-09-06 00:34:37 +03:00
Toxa
216a37aaf1 fix library structure (invalid headers were used because of incorrect using of #if directive) 2021-08-18 17:22:01 +03:00
bbbbbr
92e7c1ffbb Add simplified way of accessing high and low bytes in "fixed" union type
- Access .l and .h directly without requiring .b.l and .b.h
2021-08-03 22:43:14 -07:00
Toxa
bfed3338c6 SMS/GG smoke test example 2021-08-02 22:24:31 +03:00
bbbbbr
f215e8fcfb Docs: Add link to data types 2021-03-15 21:45:48 -07:00
Toxa
0e76940bf9 calloc/malloc/realloc/free and generic memmove 2021-01-31 23:53:03 +03:00
toxa
47f7e526fa CRITICAL and INTERRUPT definition in addition to BANKED and NONBANKED 2020-10-25 14:24:12 +03:00
Zal0
f061e7b4eb ensuring signed types are signed 2020-06-19 21:07:14 +02:00
toxa
e574ac9940 some library unification towards SDCC4 library 2020-05-20 15:03:12 +03:00
toxa
103f4b764e BANKED/NONBANKED defines fixed
(cherry picked from commit 21a34efffb)
2020-05-10 10:07:20 +02:00
Zal0
e77bafbcaa removed z80 files 2020-05-01 10:26:33 +02:00
Zal0
9bb880035f removed sdcc and added maccer, fixed some compilation issues 2020-04-05 10:42:08 +02:00
Zal0
11a44c3cad gbdk 2-96a from sourceforge https://sourceforge.net/projects/gbdk/files/gbdk/2.96/ 2020-04-04 18:34:45 +02:00