14 Commits

Author SHA1 Message Date
Michel Iwaniec
4a714bec8c NES: Move .nes header functionality out of makebin (#750)
NES: Move .nes header functionality out of makebin

- Move all .nes header related functionality into a new utility gbdk-support/makenes

- Update LCC to use makenes for .postproc member of build process, with mapper30 header parameters hard-coded for now

- Update makefiles to build makenes

- Add Makefile commands to generate output for the toolchain settings doc page

- Add documentation section for makenes in 06_toolchain.md
2025-03-21 00:00:13 +00:00
bbbbbr
5c190e014b Update and correct docs and comments related to MBC7
- Source info (pandocs) looks accidentally wrong
- No Rumble, no RAM, no Battery - just ACCELEROMETER and EEPROM
2024-11-09 23:03:37 -08:00
bbbbbr
197d3e31f6 makebin: improve mbc list comment 2024-09-16 02:25:19 -07:00
Toxa
ed346d7159 MAKEBIN: quick fix crash when using -Wm-yS (convert noi output to the no$gmb symbol file format). need further refactoring for the noi2sym(). 2024-01-23 16:27:57 +03:00
bbbbbr
9ec7601943 Makebin: Improve error message when ROM is larger than number of banks 2023-08-05 00:53:27 -07:00
Toxa
5a2d610fe7 MAKEBIN: fix incorrect rom size in the game boy rom header when -autobank is selected and the resulting rom size is 64K 2023-07-26 15:44:34 +03:00
bbbbbr
76c4d572f8 Makebin: If ROM auto-size enabled and SMS/GG has RAM banks, automaitically bump ROM size to 64K
- Required for emulator RAM mapper support
- Improvement for warning added in 32c1e97
2023-07-24 16:30:22 -07:00
bbbbbr
32c1e97239 Makebin: Warn if RAM banks specified and file size of ROM is less than the 64K required to enable them with in emulators
- Fix missing info that yoN and yaN are also used for SMS to actually set number of banks
- Notes in docs
2023-06-06 01:45:05 -07: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
Michel Iwaniec
76af1513d1 NES: Switch to single-screen mirroring in makebin, for easier scrolling logic / less attribute shadow RAM
* Change iNES mapper field from mapperr#2 (UNROM) to mapper#30 (UNROM-512)
* Change iNES mapper 4-screen bit, to specify single-screen nametable mirroring
2022-11-03 00:53:17 +00:00
MichelIwaniec
b858ae8d5c Add iNES output support to makebin
* Add new input parameter -N to output ines
* Add new structure nes_opt_s for describing iNES flags
* Add function write_ines_header to write 16-byte iNES header to file from nes_opt_s
* Set default iNES values to mapper2, 32kB PRG, horizontal mirroring
* Modify read_ihx to allow applying an optional rom_base_offset to addresses, set to 0x8000 for iNES
2022-06-08 19:30:20 +01:00
MichelIwaniec
c0a97c9fd7 Prepare for makebin changes by upgrading its gbdk fork to sdcc's newest version:
* Replace gbdk-support/makebin/makebin.c with sdcc-svn/sdcc/support/makebin/makebin.c@r12975
* Edit Makefile to build this makebin, and install it instead of the one in the patched sdcc build
2022-06-08 19:29:31 +01:00
Toxa
7d04ec5d19 apply -N patch 2022-02-20 19:18:58 +03:00
Toxa
db22361187 initial MSX DOS support 2022-02-19 14:02:41 +03:00