git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit ce6010908f34b2c0e90ef038a110259e19759e7c
parent 7e7c256dd357f22716f577fbb61ed830ccbe6fcd
Author: bbbbbr <bbbbbr@users.noreply.github.com>
Date:   Thu,  8 Sep 2022 16:44:02 -0700

Merge pull request #408 from bbbbbr/docs_4_1_0

Docs: Details about SHOW_WIN, calling conventions, sm83 PORT name
Diffstat:
Mdocs/pages/04_coding_guidelines.md4+++-
Mdocs/pages/08_faq.md8+++++++-
Mdocs/pages/09_migrating_new_versions.md1+
Mgbdk-lib/include/gb/drawing.h13++++++++++---
Mgbdk-lib/include/gb/gb.h8+++++++-
5 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/docs/pages/04_coding_guidelines.md b/docs/pages/04_coding_guidelines.md @@ -249,7 +249,9 @@ For many applications C is fast enough but in intensive functions are sometimes SDCC in common with almost all C compilers prepends a `_` to any function names. For example the function `printf(...)` begins at the label `_printf::.` Note that all functions are declared global. -Functions can be marked with `OLDCALL` which will cause them to use the `__sdcccall(0)` calling convention instead of the new default `__sdcccall(1)` which replaced it. +Functions can be marked with `OLDCALL` which will cause them to use the `__sdcccall(0)` calling convention (the format used prior to in SDCC 4.2 & GBDK-2020 4.1.0). + +Starting with SDCC 4.2 and GBDK-2020 4.1.0 the new default calling convention is`__sdcccall(1)`. For details about the calling convetions, see sections `SM83 calling conventions` and `Z80, Z180 and Z80N calling conventions` in the SDCC manual. - http://sdcc.sourceforge.net/doc/sdccman.pdf diff --git a/docs/pages/08_faq.md b/docs/pages/08_faq.md @@ -32,7 +32,13 @@ # Errors / Compiling / Toolchain @anchor faq_gbz80_sm83_old_port_name_error - What does the error `old "gbz80" SDCC PORT name specified (in "-mgbz80:gb"). Use "sm83" instead. You must update your build settings.` mean? - - The `PORT` name for the Game Boy and related clones changed from `gbz80` to `sm83`. You must change your Makefile, Build settings, etc to use the new name. Additional details in the @ref console_port_plat_settings "Console Port and Platform Settings" section. <!-- --> + - The `PORT` name for the Game Boy and related clones changed from `gbz80` to `sm83` in the SDCC version used in GBDK-2020 4.1.0 and later. You must change your Makefile, Build settings, etc to use the new name. Additional details in the @ref console_port_plat_settings "Console Port and Platform Settings" section. <!-- --> + + - What does the warning `?ASlink-Warning-Conflicting sdcc options: "-msm83" in module "_____" and + "-mgbz80" in module "_____".` mean? + - One object file was compiled with the PORT setting as `gbz80` (meaning a version of SDCC / GBDK-2020 __OLDER than GBDK-2020 4.1.0__). + - The other had the PORT setting as `sm83` (meaning __GBDK-2020 4.1.0 or LATER__). + - You must rebuild the object files using `gbz80` with GBDK-2020 4.1.0 or later so that the linker is able to use them with the other object files. Additional details in the @ref console_port_plat_settings "Console Port and Platform Settings" section. <!-- --> @anchor faq_sdcc_peephole_instruction_error - What does `z80instructionSize() failed to parse line node, assuming 999 bytes` mean? diff --git a/docs/pages/09_migrating_new_versions.md b/docs/pages/09_migrating_new_versions.md @@ -9,6 +9,7 @@ This section contains information that may be useful to know or important when u - GBDK now requires SDCC 4.2 or higher with GBDK-2020 patches for the the z80 linker - The default calling convention changed in SDCC 4.2, see @ref sdcc_calling_convention "Calling Conventions" for more details. - If you are linking to libraries compiled with an older version of SDCC / GBDK then you may have to recompile them. + - If there are functions written in ASM which receive parameters, they should also be reviewed to make sure they work with the new `__sdcccall(1)` calling convention, or have their header declaration changed to use `OLDCALL`. - The SDCC `PORT` name for the Game Boy and related clones changed from `gbz80` to `sm83`. - Additional details in the @ref console_port_plat_settings "Console Port and Platform Settings" section and @ref faq_gbz80_sm83_old_port_name_error "FAQ entry". @ref lcc will error out if the old `PORT` name is passed in. - The library base path changed from `lib/small/asxxxx/` to `lib/`. diff --git a/gbdk-lib/include/gb/drawing.h b/gbdk-lib/include/gb/drawing.h @@ -138,11 +138,18 @@ void wrtchr(char chr) OLDCALL; @see wrtchr() */ void gotogxy(uint8_t x, uint8_t y) OLDCALL; -/** Set the current __foreground__ colour (for pixels), __background__ colour, and +/** Set the current __forecolor__ colour, __backcolor__ colour, and draw __mode__ - Several settings are available for the drawing __mode__ : - `SOLID`, `OR`, `XOR`, `AND`. + @param forecolor The primary drawing color (outlines of + rectangles with @ref box(), letter color + with @ref gprintf(), etc). + @param backcolor Secondary or background color where applicable + (fill color of rectangles with @ref box() when + @ref M_FILL is specifed, background color of text + with @ref gprintf(), etc). + @param mode Drawing style to use. Several settings are available + `SOLID`, `OR`, `XOR`, `AND`. In order to completely overwrite existing pixels use `SOLID` for __mode__ */ diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -770,8 +770,14 @@ void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b, #define HIDE_BKG \ LCDC_REG&=~LCDCF_BGON -/** Turns on the window layer +/** Turns on the Window layer Sets bit 5 of the LCDC register to 1. + + This only controls Window visibility. If either + the Background layer (which the window is part of) + or the Display are not turned then the Window contents + will not be visible. Those can be turned on using + @ref SHOW_BKG and @ref DISPLAY_ON. */ #define SHOW_WIN \ LCDC_REG|=LCDCF_WINON

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.