gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit e9da8c295b1492b749b6a38c0dc852c334656f8c parent 5e7b8b4429edc44cf0c29d257051a8bb4fe559e1 Author: bbbbbr <reg+github@roughhousing.com> Date: Mon, 6 Sep 2021 00:47:08 -0700 Merge pull request #246 from bbbbbr/docs_4_0_5 Docs: Start of updates for 4.0.5 release Diffstat:
| M | docs/pages/05_banking_mbcs.md | 35 | ++++++++++++++++++++++++++--------- |
| M | docs/pages/06_toolchain.md | 10 | +++++----- |
| A | docs/pages/06b_supported_consoles.md | 75 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | docs/pages/08_faq.md | 7 | ++++--- |
| M | docs/pages/09_migrating_new_versions.md | 5 | +++++ |
| M | docs/pages/10_release_notes.md | 35 | +++++++++++++++++++++++++++++++++-- |
| M | docs/pages/20_toolchain_settings.md | 233 | ++++++++++--------------------------------------------------------------------- |
| M | docs/pages/docs_index.md | 1 | + |
| M | gbdk-lib/include/gb/metasprites.h | 6 | +++--- |
| M | gbdk-lib/include/sms/metasprites.h | 4 | ++-- |
| M | gbdk-support/lcc/lcc.c | 2 | +- |
11 files changed, 182 insertions(+), 231 deletions(-)
diff --git a/docs/pages/05_banking_mbcs.md b/docs/pages/05_banking_mbcs.md @@ -78,15 +78,35 @@ The following MBC settings are available when using the makebin MBC switch. ``` -## Banked Functions +## Getting Bank Numbers +The bank number for a banked function, variable or source file can be stored and retrieved using the following macros: + - @ref BANKREF(): Create a reference for retrieving the bank number of a variable or function + - @ref BANK(): Retrieve a bank number using a reference created with @ref BANKREF() + - @ref BANKREF_EXTERN() - Make a @ref BANKREF() reference residing in another source + file accessible in the current file for use with @ref BANK(). + + +## Banking and Functions + +@anchor banked_keywords +### BANKED/NONBANKED keywords +- `BANKED`: + - The function will use banked sdcc calls + - Placed in the bank selected by it's source file (or compiler switches) +- `NONBANKED`: + - Placed in the non-banked lower 16K region (bank 0), regardless of the bank selected by it's source file. +- `<not-specified>`: + - The function does not use sdcc banked calls (`near` instead of `far`) + - Placed in the bank selected by it's source file (or compiler switches) + @anchor banked_calls +### Banked Function Calls Banked functions can be called as follows. - When defined with the `BANKED` keyword. Example: `void my_function() BANKED { do stuff }` in a source file which has had it's bank set (see above). - Using @ref far_pointers - When defined with an area set up using the `__addressmod` keyword (See the `banks_new` example project and the SDCC manual for details) - Using @ref SWITCH_ROM_MBC1() (and related functions for other MBCs) to manually switch in the required bank and then call the function. - Non-banked functions (either in fixed Bank 0, or in an non-banked ROM with no MBC) - May call functions in any bank: __YES__ - May use data in any bank: __YES__ @@ -140,23 +160,23 @@ It should be: ``` void vbl_music_isr(void) { - // Save the current bank + // Save the current bank uint8_t _saved_bank = _current_bank; - // A function which changes the bank and + // A function which changes the bank and // *doesn't* restore it after changing. some_function(); - // Now restore the current bank + // Now restore the current bank SWITCH_ROM_MBC5(_saved_bank); } ``` - ## Currently active bank: _current_bank The global variable @ref _current_bank is updated automatically when calling @ref SWITCH_ROM_MBC1() and @ref SWITCH_ROM_MBC5, or when a `BANKED` function is called. + # Auto-Banking @anchor rom_autobanking A ROM bank auto-assignment feature was added in GBDK 2020 4.0.2. @@ -206,9 +226,6 @@ Making sure bankpack checks all files: - See @ref bankpack for more options and settings -Limitations: - - At this time, the constant entries that get rewritten with the assigned bank (const void __at(255) __bank_<name-you-want-to-use-for-that-source-file>;) __cannot__ be used from the source file they are declared in. In that case SDCC converts the bank number before @ref bankpack has a chance to rewrite it. It may be referenced from any other source file, but not it's own. - # Errors related to banking (overflow, multiple writes to same location) A _bank overflow_ during compile/link time (in @ref makebin) is when more code and data are allocated to a ROM bank than it has capacity for. The address for any overflowed data will be incorrect and the data is potentially unreachable since it now resides at the start of a different bank instead of the end of the expected bank. diff --git a/docs/pages/06_toolchain.md b/docs/pages/06_toolchain.md @@ -203,17 +203,17 @@ For detailed settings see @ref gbcompress-settings Compresses (and decompresses) binary file data with the gbcompress algorithm (also used in GBTD/GBMB). Decompression support is available in GBDK, see @ref gb_decompress(). -@anchor utility_png2mtspr -## PNG to Metasprite +@anchor utility_png2asset +## PNG to Asset Tool for converting PNGs into GBDK format MetaSprites Convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions. -For detailed settings see @ref png2mtspr-settings +For detailed settings see @ref png2asset-settings For working with sprite properties (including cgb palettes), see @ref metasprite_and_sprite_properties For API support see @ref move_metasprite() and related functions in @ref metasprites.h -### Working with png2mtspr +### Working with png2asset - The origin (pivot) for the metasprite is not required to be in the upper left-hand corner as with regular hardware sprites. - The conversion process supports using both SPRITES_8x8 and SPRITES_8x16 mode. If 8x16 mode is used then the height of the metasprite must be a multiple of 16. @@ -236,7 +236,7 @@ For API support see @ref move_metasprite() and related functions in @ref metaspr OBP Index 2: Medium OBP Index 3: Darkest/Black - - If you want to assign different colors then you can either change the settings in @ref OBP0_REG / @ref OBP1_REG in your _source code_ or change the colors of your _input image_ to produce different output, but the output of the png2mtspr tool itself cannot be altered (for now). + - If you want to assign different colors then you can either change the settings in @ref OBP0_REG / @ref OBP1_REG in your _source code_ or change the colors of your _input image_ to produce different output, but the output of the png2asset tool itself cannot be altered (for now). For best graphics conversion results: - Input images should only have 3 colors + transparent and which are spaced along the brightness spectrum based on the mapping described above. diff --git a/docs/pages/06b_supported_consoles.md b/docs/pages/06b_supported_consoles.md @@ -0,0 +1,75 @@ +@page docs_supported_consoles Supported Consoles + +@anchor docs_consoles_supproted_list +# Consoles Supported by GBDK +As of version `4.0.5` GBDK includes support for other consoles in addition to the Game Boy. + + - Nintendo Game Boy / Game Boy Color + - Analogue Pocket + - Sega Master System + - Sega Game Gear + +While the GBDK API has many convenience functions that work the same or similar across different consoles, it's important to keep their different capabilities in mind when writing code intended to run on more than one. Some (but not all) of the differences are screen sizes, color abilities, memory layouts, processor type (z80 vs gbz80/sm83) and speed. + + +@anchor docs_consoles_port_plat_settings +# Port and Platform settings + + +## lcc +When building through @ref lcc use the `-m<port>:<plat>` flag to select the desired console via it's port and platform combination. + + +## sdcc +When compiling directly with @ref sdcc use: `-m<port>`, `-D__PORT_<port>` and `-D__TARGET_<plat> ` + + +## Console Settings + - Nintendo Game Boy / Game Boy Color + - @ref lcc : `-mgbz80:gb` + - port:`gbz80`, plat:`gb` + - Analogue Pocket + - @ref lcc : `-mgbz80:ap` + - port:`gbz80`, plat:`ap` + - The Analogue Pocket is functionally identical to the Game Boy / Color, but has a couple different register flag / address definitions and a different boot logo. + + - Sega Master System + - @ref lcc : `-mz80:sms` + - port:`z80`, plat:`sms` + - Sega Game Gear + - @ref lcc : `-mz80:gg` + - port:`z80`, plat:`gg` + + +## gbdk/ include path +Some include files under `<gbdk/..>` are cross platform and others allow the build process to auto-select the correct include file for the current target port and platform (console). + +For example, the following can be used + + #include <gbdk/platform.h> + #include <gbdk/metasprites.h> + +Instead of + + #include <gb/gb.h> + #include <gb/metasprites.h> + +and + + #include <sms/sms.h> + #include <sms/metasprites.h> + + +## NINTENDO and SEGA #defines + - When `<gb/gb.h>` is included (either directly or through <gbdk/platform.h>) + then `NINTENDO` will be `#defined` + + - When `<sms/sms.h >` is included (either directly or through <gbdk/platform.h>) + then `SEGA` will be `#defined` + + +@anchor docs_consoles_cross_platform_examples +# Cross Platform Example Projects +GBDK includes an number of cross platform example projects. These projects show how to write code that can be compiled and run on multiple different consoles (for example Game Boy and Game Gear) with, in some cases, minimal differences. + +They also show how to build for multiple target consoles with a single build command and `Makefile`. The `Makefile.targets` allows selecting different `port` and `plat` settings when calling the build stages. diff --git a/docs/pages/08_faq.md b/docs/pages/08_faq.md @@ -53,7 +53,8 @@ - [Variables](globals_vars.html) <!-- --> - Can I use the `float` type to do floating point math? - - There is no support for 'float' in GBDK-2020. <!-- --> + - There is no support for 'float' in GBDK-2020. + - Instead consider various kinds of `fixed point` math (including the @ref fixed type included in GBDK) <!-- --> - Why are 8 bit numbers not printing correctly with printf()? - To correctly pass chars/uint8s for printing, they must be explicitly re-cast as such when calling the function. See docs_chars_varargs for more details. <!-- --> @@ -69,6 +70,6 @@ - How can CGB palettes and other sprite properties be used with metasprites? - See @ref metasprite_and_sprite_properties "Metasprites and sprite properties" <!-- --> - - Weird things are happening to my sprite colors when I use png2mtspr and metasprites. What's going on and how does it work? - - See @ref utility_png2mtspr for details of how the conversion process works. + - Weird things are happening to my sprite colors when I use png2asset and metasprites. What's going on and how does it work? + - See @ref utility_png2asset for details of how the conversion process works. diff --git a/docs/pages/09_migrating_new_versions.md b/docs/pages/09_migrating_new_versions.md @@ -4,6 +4,11 @@ This section contains information that may be useful to know or important when u # GBDK 2020 versions +## Porting to GBDK 2020 4.0.5 +- GBDK now requires SDCC 12259 or higher with GBDK-2020 patches +- @ref utility_png2asset is the new name for the `png2mtspr` utility +- @ref lcc : Changed default output format when not specified from `.ihx` to `.gb` (or other active rom extension) + ## Porting to GBDK 2020 4.0.4 - GBDK now requires SDCC 12238 or higher - Made sample.h, cgb.h and sgb.h independent from gb.h diff --git a/docs/pages/10_release_notes.md b/docs/pages/10_release_notes.md @@ -6,6 +6,37 @@ https://github.com/gbdk-2020/gbdk-2020/releases # GBDK 2020 Release Notes +## GBDK 2020 4.0.5 + 2021/09 + - Overall + - Added support for new consoles + - Analogue Pocket (`ap`) + - Sega Master System (`sms`) and Game Gear (`gg`) + - The windows make.bat files were renamed to compile.bat + - Library + - Examples + - Added cross-platorm examples (build multiple targets: gb, ap, sms, gg) + - Toolchain / Utilities + - @ref utility_png2asset "png2asset" + - @ref utility_png2asset "png2asset" is the new name for the `png2mtspr` utility + - Added collision rectangle width and height (`-pw`, `-ph`) + - Added option to use the palette from the source png (`-keep_palette_order`) + - Added option to disable tile flip (`-noflip`) + - Added export as map: tileset + bg (`-map`) + - Added option to use CGB BG Map attributes (`-use_map_attributes`) + - Added option to group the exported info into structs (`-use_structs`) + - @ref lcc + - Use `-m` to select target port and platform: "-m[port]:[plat]" ports:`gbz80,z80` plats:`ap,gb,sms,gg` + - Changed default output format when not specified from `.ihx` to `.gb` (or other active rom extension) + - + - @ref bankpack + - Added linkerfile input and output: `-lkin=<file>`, `-lkout=<file>` + - Added selector for platform specific behavior `plat=<plat>` (Default:gb, Avaialble:`gb,sms`). sms/gg targets prohibits packing `LIT_N` areas in the same banks as `CODE_N` areas + - Added randomization for auto-banks (`-random`) for debugging and testing + + - Docs + + ## GBDK 2020 4.0.4 2021/06 - Library @@ -39,7 +70,7 @@ https://github.com/gbdk-2020/gbdk-2020/releases - Added rewrite .o files -> .rel for linking when called with `-autobank` and `-Wb-ext=.rel` - Workaround @ref makebin `-Wl-yp` formatting segfault - Docs - - Improved @ref utility_png2mtspr documentation + - Improved utility_png2mtspr documentation - Various doc updates and improvements @@ -65,7 +96,7 @@ https://github.com/gbdk-2020/gbdk-2020/releases - Improved sgb_border - Toolchain / Utilities - Added @ref utility_gbcompress utility - - Added @ref utility_png2mtspr metasprite utility + - Added utility_png2mtspr metasprite utility - Docs - Added extensive documentation (some of which is imported and updated from the old gbdk docs) - Added PDF version of docs diff --git a/docs/pages/20_toolchain_settings.md b/docs/pages/20_toolchain_settings.md @@ -18,6 +18,7 @@ -Idir add `dir' to the beginning of the list of #include directories -K don't run ihxcheck test on linker ihx output -lx search library `x' +-m select port and platform: "-m[port]:[plat]" ports:gbz80,z80 plats:ap,gb,sms,gg -N do not search the standard directories for #include files -n emit code to check for dereferencing zero pointers -no-crt do not auto-include the gbdk crt0.o runtime in linker list @@ -41,7 +42,7 @@ @anchor sdcc-settings # sdcc settings ``` -SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/gbz80/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.1.4 #12246 (Linux) +SDCC : z80/gbz80 4.1.6 #12539 (Linux) published under GNU General Public License (GPL) Usage : sdcc [options] filename Options :- @@ -151,16 +152,6 @@ Linker options: --idata-loc --no-optsdcc-in-asm Do not emit .optsdcc in asm -Special options for the mcs51 port: - --model-small internal data space is used (default) - --model-medium external paged data space is used - --model-large external data space is used - --model-huge functions are banked, data in external space - --stack-size Tells the linker to allocate this space for stack - --parms-in-bank1 use Bank1 for parameter passing - --acall-ajmp Use acall/ajmp instead of lcall/ljmp - --no-ret-without-call Do not use ret independent of acall/lcall - Special options for the z80 port: --callee-saves-bc Force a called function to always save BC --portmode= Determine PORT I/O mode (z80/z180) @@ -176,66 +167,6 @@ Special options for the z80 port: --legacy-banking Use legacy method to call banked functions --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 -Special options for the z180 port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - -Special options for the r2k port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - -Special options for the r2ka port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - -Special options for the r3ka port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - Special options for the gbz80 port: -bo <num> use code bank <num> -ba <num> use data bank <num> @@ -246,129 +177,6 @@ Special options for the gbz80 port: --dataseg <name> use this name for the data segment --no-std-crt0 For the z80/gbz80 do not link default crt0.rel --legacy-banking Use legacy method to call banked functions - -Special options for the tlcs90 port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - -Special options for the ez80_z80 port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - -Special options for the z80n port: - --callee-saves-bc Force a called function to always save BC - --portmode= Determine PORT I/O mode (z80/z180) - --asm= Define assembler name (rgbds/asxxxx/isas/z80asm/gas) - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --dataseg <name> use this name for the data segment - --no-std-crt0 For the z80/gbz80 do not link default crt0.rel - --reserve-regs-iy Do not use IY (incompatible with --fomit-frame-pointer) - --oldralloc Use old register allocator (deprecated) - --fno-omit-frame-pointer Do not omit frame pointer - --emit-externs Emit externs list in generated asm - --legacy-banking Use legacy method to call banked functions - --nmos-z80 Generate workaround for NMOS Z80 when saving IFF2 - -Special options for the ds390 port: - --model-flat24 use the flat24 model for the ds390 (default) - --stack-8bit use the 8bit stack for the ds390 (not supported yet) - --stack-size Tells the linker to allocate this space for stack - --stack-10bit use the 10bit stack for ds390 (default) - --use-accelerator generate code for ds390 arithmetic accelerator - --protect-sp-update will disable interrupts during ESP:SP updates - --parms-in-bank1 use Bank1 for parameter passing - -Special options for the pic16 port: - --pstack-model= use stack model 'small' (default) or 'large' - -y --extended enable Extended Instruction Set/Literal Offset Addressing mode - --pno-banksel do not generate BANKSEL assembler directives - --obanksel= set banksel optimization level (default=0 no) - --denable-peeps explicit enable of peepholes - --no-optimize-goto do NOT use (conditional) BRA instead of GOTO - --optimize-cmp try to optimize some compares - --optimize-df thoroughly analyze data flow (memory and time intensive!) - --asm= Use alternative assembler - --mplab-comp enable compatibility mode for MPLAB utilities (MPASM/MPLINK) - --link= Use alternative linker - --preplace-udata-with= Place udata variables at another section: udata_acs, udata_ovr, udata_shr - --ivt-loc= Set address of interrupt vector table. - --nodefaultlibs do not link default libraries when linking - --use-crt= use <crt-o> run-time initialization module - --no-crt do not link any default run-time initialization module - --debug-xtra show more debug info in assembly output - --debug-ralloc dump register allocator debug file *.d - --pcode-verbose dump pcode related info - --calltree dump call tree in .calltree file - --gstack trace stack pointer push/pop to overflow - --no-warn-non-free suppress warning on absent --use-non-free option - -Special options for the pic14 port: - --debug-xtra show more debug info in assembly output - --no-pcode-opt disable (slightly faulty) optimization on pCode - --stack-size sets the size if the argument passing stack (default: 16, minimum: 4) - --no-extended-instructions forbid use of the extended instruction set (e.g., ADDFSR) - --no-warn-non-free suppress warning on absent --use-non-free option - -Special options for the TININative port: - --model-flat24 use the flat24 model for the ds390 (default) - --stack-8bit use the 8bit stack for the ds390 (not supported yet) - --stack-size Tells the linker to allocate this space for stack - --stack-10bit use the 10bit stack for ds390 (default) - --use-accelerator generate code for ds390 arithmetic accelerator - --protect-sp-update will disable interrupts during ESP:SP updates - --parms-in-bank1 use Bank1 for parameter passing - --tini-libid <nnnn> LibraryID used in -mTININative - -Special options for the ds400 port: - --model-flat24 use the flat24 model for the ds400 (default) - --stack-8bit use the 8bit stack for the ds400 (not supported yet) - --stack-size Tells the linker to allocate this space for stack - --stack-10bit use the 10bit stack for ds400 (default) - --use-accelerator generate code for ds400 arithmetic accelerator - --protect-sp-update will disable interrupts during ESP:SP updates - --parms-in-bank1 use Bank1 for parameter passing - -Special options for the hc08 port: - --model-small 8-bit address space for data - --model-large 16-bit address space for data (default) - --out-fmt-elf Output executable in ELF format - --oldralloc Use old register allocator - -Special options for the s08 port: - --model-small 8-bit address space for data - --model-large 16-bit address space for data (default) - --out-fmt-elf Output executable in ELF format - --oldralloc Use old register allocator - -Special options for the stm8 port: - --model-medium 16-bit address space for both data and code (default) - --model-large 16-bit address space for data, 24-bit for code - --codeseg <name> use this name for the code segment - --constseg <name> use this name for the const segment - --out-fmt-elf Output executable in ELF format ``` @anchor sdasgb-settings # sdasgb settings @@ -417,6 +225,8 @@ Use: Read .o files and auto-assign areas with bank=255. Options -h : Show this help +-lkin=<file> : Load object files specified in linker file <file> +-lkout=<file>: Write list of object files out to linker file <file> -yt<mbctype> : Set MBC type per ROM byte 149 in Decimal or Hex (0xNN) (see pandocs) -mbc=N : Similar to -yt, but sets MBC type directly to N instead of by intepreting ROM byte 149 @@ -429,6 +239,8 @@ Options -sym=<prefix>: Add symbols starting with <prefix> to match + update list. Default entry is "___bank_" (see below) -cartsize : Print min required cart size as "autocartsize:<NNN>" +-plat=<plat> : Select platform specific behavior (default:gb) (gb,sms) +-random : Distribute banks randomly for testing (honors -min/-max) -v : Verbose output, show assignments Example: "bankpack -ext=.rel -path=some/newpath/ file1.o file2.o" @@ -462,6 +274,7 @@ Libraries: Relocation: -b area base address = expression -g global symbol = expression + -a (platform) Select platform specific virtual address translation Map format: -m Map output generated as (out)file[.map] -w Wide listing format for map file @@ -519,6 +332,7 @@ GameBoy format options (applicable only with -Z option): -ys Super GameBoy -yS Convert .noi file named like input file to .sym -yj set non-Japanese region flag + -yN do not copy big N validation logo into ROM header -yp addr=value Set address in ROM to given value (address 0x100-0x1FE) Arguments: <in_file> optional IHX input file, '-' means stdin. (default: stdin) @@ -540,17 +354,24 @@ Options Example: "gbcompress binaryfile.bin compressed.bin" Example: "gbcompress -d compressedfile.bin decompressed.bin" ``` -@anchor png2mtspr-settings -# png2mtspr settings +@anchor png2asset-settings +# png2asset settings ``` -usage: png2mtspr <file>.png [options] --c ouput file (default: <png file>.c) --sw <width> metasprites width size (default: png width) --sh <height> metasprites height size (default: png height) --sp <props> change default for sprite OAM property bytes (in hex) (default: 0x00) --px <x coord> metasprites pivot x coordinate (default: metasprites width / 2) --py <y coord> metasprites pivot y coordinate (default: metasprites height / 2) --spr8x8 use SPRITES_8x8 (default: SPRITES_8x16) --spr8x16 use SPRITES_8x16 (default: SPRITES_8x16) --b <bank> bank (default 0) +usage: png2asset <file>.png [options] +-c ouput file (default: <png file>.c) +-sw <width> metasprites width size (default: png width) +-sh <height> metasprites height size (default: png height) +-sp <props> change default for sprite OAM property bytes (in hex) (default: 0x00) +-px <x coord> metasprites pivot x coordinate (default: metasprites width / 2) +-py <y coord> metasprites pivot y coordinate (default: metasprites height / 2) +-pw <width> metasprites collision rect widht (default: metasprites width) +-ph <height> metasprites collision rect height (default: metasprites height) +-spr8x8 use SPRITES_8x8 (default: SPRITES_8x16) +-spr8x16 use SPRITES_8x16 (default: SPRITES_8x16) +-b <bank> bank (default 0) +-keep_palette_order use png palette +-noflip disable tile flip +-map Export as map (tileset + bg) +-use_map_attributes Use CGB BG Map attributes (default: palettes are stored for each tile in a separate array) +-use_structs Group the exported info into structs (default: false) ``` diff --git a/docs/pages/docs_index.md b/docs/pages/docs_index.md @@ -6,6 +6,7 @@ - @subpage docs_using_gbdk - @subpage docs_coding_guidelines - @subpage docs_rombanking_mbcs +- @subpage docs_supported_consoles - @subpage docs_toolchain - @subpage docs_example_programs - @subpage docs_faq diff --git a/gbdk-lib/include/gb/metasprites.h b/gbdk-lib/include/gb/metasprites.h @@ -16,14 +16,14 @@ to be in the upper left-hand corner as with regular hardware sprites. - Use the @ref utility_png2mtspr tool to convert single + Use the @ref utility_png2asset tool to convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions. # Metasprites composed of variable numbers of sprites - When using png2mtspr, it's common for the output of + When using png2asset, it's common for the output of different frames to be composed of different numbers of hardware sprites (since it's trying to create each frame as efficiently as possible). Due to that, it's @@ -52,7 +52,7 @@ property flags can be modified at runtime. - The metasprite structures can have the property flags modified before compilation (such as with `-sp <props>` - in the @ref utility_png2mtspr "png2mtspr" tool). + in the @ref utility_png2asset "png2asset" tool). - Update properties for the affected sprites after calling a move_metasprite_*() function. */ diff --git a/gbdk-lib/include/sms/metasprites.h b/gbdk-lib/include/sms/metasprites.h @@ -16,14 +16,14 @@ to be in the upper left-hand corner as with regular hardware sprites. - Use the @ref utility_png2mtspr tool to convert single + Use the @ref utility_png2asset tool to convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions. # Metasprites composed of variable numbers of sprites - When using png2mtspr, it's common for the output of + When using png2asset, it's common for the output of different frames to be composed of different numbers of hardware sprites (since it's trying to create each frame as efficiently as possible). Due to that, it's diff --git a/gbdk-support/lcc/lcc.c b/gbdk-support/lcc/lcc.c @@ -746,7 +746,7 @@ static void help(void) { "-Idir add `dir' to the beginning of the list of #include directories\n", "-K don't run ihxcheck test on linker ihx output\n", "-lx search library `x'\n", -"-m select port and platform: \"-m[port]:[plat]\" ports:mgbz80,z80 plats:ap,gb,sms,gg\n", +"-m select port and platform: \"-m[port]:[plat]\" ports:gbz80,z80 plats:ap,gb,sms,gg\n", "-N do not search the standard directories for #include files\n", "-n emit code to check for dereferencing zero pointers\n", "-no-crt do not auto-include the gbdk crt0.o runtime in linker list\n",
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.