diff --git a/docs/api/01__getting__started_8md.html b/docs/api/01__getting__started_8md.html index 4953e2ba..f2428d2d 100644 --- a/docs/api/01__getting__started_8md.html +++ b/docs/api/01__getting__started_8md.html @@ -29,7 +29,7 @@
|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
+Files | |
| file | laptop_io.h [code] |
| file | laptop_keycodes.h [code] |
| file | model.h [code] |
Writing games and other programs with GBDK will be much easier with a basic understanding of the C language. In particular, understanding how to use C on "Embedded Platforms" (small computing systems, such as the Game Boy) can help you write better code (smaller, faster, less error prone) and avoid common pitfalls.
-In addition to understanding the C language it's important to learn how the Game Boy hardware works. What it is capable of doing, what it isn't able to do, and what resources are available to work with. A good way to do this is by reading the Pandocs and checking out the awesome_gb list.
-The following guidelines can result in better code for the Game Boy, even though some of the guidance may be contrary to typical advice for general purpose computers that have more resources and speed.
-Important: The old GBTD/GBMB fails to include the const keyword when exporting to C source files for GBDK. That causes arrays to be created in RAM instead of ROM, which wastes RAM, uses a lot of ROM to initialize the RAM arrays and slows the compiler down a lot.
__Use of toxa's updated GBTD/GBMB is highly recommended.__
If you wish to use the original tools, you must add the const keyword every time the graphics are re-exported to C source files.
In general avoid reading from VRAM since that memory is not accessible at all times. If GBDK a API function which reads from VRAM (such as get_bkg_tile_xy()) is called during a video mode when VRAM is not accessible, then that function call will delay until VRAM becomes accessible again. This can cause unnecessary slowdowns when running programs on the Game Boy. It is also not supported by GBDK on the NES platform.
Instead it is better to store things such as map data in general purpose RAM which does not have video mode access limitations.
For more information about video modes and VRAM access see the pan docs:
https://gbdev.io/pandocs/STAT.html#stat-modes
-#include .c source files into other .c source files. Instead create .h header files for them and include those. https://www.tutorialspoint.com/cprogramming/c_header_files.htminline keyword, such as inline uint8_t myFunction() { ... }).There are a some scenarios where the compiler will warn about overflows with constants. They often have to do with mixed signedness between constants and variables. To avoid problems use care about whether or not constants are explicitly defined as unsigned and what type of variables they are used with.
WARNING: overflow in implicit constant conversion
Parameters (chars, ints, etc) to printf / sprintf should always be explicitly cast to avoid type related parameter passing issues.
For example, below will result in the likely unintended output:
In standard C when chars are passed to a function with variadic arguments (varargs, those declared with ... as a parameter), such as printf(), those chars get automatically promoted to ints. For an 8 bit CPU such as the Game Boy's, this is not as efficient or desirable in most cases. So the default SDCC behavior, which GBDK-2020 expects, is that chars will remain chars and not get promoted to ints when explicitly cast as chars while calling a varargs function.
Also See:
For many applications C is fast enough but in intensive functions are sometimes better written in assembly. This section deals with interfacing your core C program with fast assembly sub routines.
-When functions are written assembly it's generally better to not mix the inline ASM with C code and instead write the whole function in assembly.
If they are mixed then descriptive named labels should not be used for inline ASM. This is due to descriptive labels interfering with the expected scope of the reusable local labels generated from the compiled C code. The compiler will not detect this problem and the resulting code may fail to execute correctly without warning.
Instead use reusable local symbols/labels (for example 1$:). To learn more about them check the SDAS manual section "1.3.3 Reusable Symbols"
Getting at C variables is slightly tricky due to how local variables are allocated on the stack. However you shouldn't be using the local variables of a calling function in any case. Global variables can be accessed by name by adding an underscore.
-The use of segments/areas for code, data and variables is more noticeable in assembler. GBDK and SDCC define a number of default ones. The order they are linked is determined by crt0.s and is currently as follows for the Game Boy and related clones.
The following is primarily oriented toward the Game Boy and related clones (sm83 devices), other targets such as sms/gg may vary.
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.
gbz80/sm83 generally share this subheading with z80 (Game Boy is partially a sub-port of z80 in SDCC). https://sdcc.sourceforge.net/doc/sdccman.pdf#subsection.4.3.9The following is primarily oriented toward the Game Boy and related clones (sm83 devices), other targets such as sms/gg may vary.
Key Points:
GBDK includes several example programs both in C and in assembly. They are located in the examples directory, and in its subdirectories. They can be built by typing make in the correnponding directory.
There are several different projects showing how to use ROM banking with GBDK.
-Illustrates how to use communication routines.
-Demonstrates how to use the optional GBDK crash handler which dumps debug info to the Game Boy screen in the event of a program crash.
-The colorbar program, written by Mr. N.U. of TeamKNOx, illustrates the use of colors on a Color GameBoy.
-Deep Scan is a game written by Mr. N.U. of TeamKNOx that supports the Color GameBoy. Your aim is to destroy the submarines from your boat, and to avoid the projectiles that they send to you. The game should be self-explanatory. The following keys are used:
RIGHT/LEFT : Move your boat A/B : Send a bomb from one side of your boat @@ -114,28 +114,28 @@ When game is paused: SELECT : Invert A and B buttons RIGHT/LEFT : Change speed UP/DOWN : Change level -
Demonstrates various graphics routines.
-Examples of how to work with the built in font and printing features.
-A C translation of the space.s assembly program.
-The gb-dtmf, written by Osamu Ohashi, is a Dual Tone Multi-Frequency (DTMF) generator.
-Demonstrates using gbdecompress to load a compressed tile set into VRAM.
-Illustrates how to install interrupt handlers.
-Shows how to scroll with maps larger than 32 x 32 tiles using set_bkg_submap(). It fills rows and columns at the edges of the visible viewport (of the hardware Background Map) with the desired sub-region of the large map as it scrolls.
-Demonstrates using the metasprite features to move and animate a large sprite.
An example of how to use the LCD ISR for visual special effects.
-The paint example is a painting program. It supports different painting tools, drawing modes, and colors. At the moment, it only paints individual pixels. This program illustrates the use of the full-screen drawing library. It also illustrates the use of generic structures and big sprites.
Arrow keys : Move the cursor SELECT : Display/hide the tools palette A : Select tool -
The rand program, written by Luc Van den Borre, illustrates the use of the GBDK random generator.
-The ram_fn example illustrates how to copy functions to RAM or HIRAM, and how to call them from C.
-A basic RPN calculator. Try entering expressions like 12 134* and then 1789+.
-Demonstration of playing a sound sample.
-A collection of examples showing how to use the Super Game Boy API features.
-The sound example is meant for experimenting with the sound generator of the GameBoy (to use on a real GameBoy). The four different sound modes of the GameBoy are available. It also demonstrates the use of bit fields in C (it's a quick hack, so don't expect too much from the code). The following keys are used:
UP/DOWN : Move the cursor RIGHT/LEFT : Increment/decrement the value @@ -177,14 +177,14 @@ START : Play the current mode's sound (or all modes if in control screen) START+A : Play a little music with the current mode's sound SELECT : Change the sound mode (1, 2, 3, 4 and control) SELECT+A : Dump the sound registers to the screen -
The space example is an assembly program that demonstrates the use of sprites, window, background, fixed-point values and more. The following keys are used:
Arrow keys : Change the speed (and direction) of the sprite Arrow keys + A : Change the speed (and direction) of the window Arrow keys + B : Change the speed (and direction) of the background START : Open/close the door SELECT : Basic fading effect -
Two basic template examples are provided as a starting place for writing your GBDK programs.
old "gbz80" SDCC PORT name specified (in "-mgbz80:gb"). Use "sm83" instead. You must update your build settings. mean?.sym) compatible with an emulator?.noi output (LCC argument: -Wl-j or -debug and then use -Wm-yS with LCC (or -yS with makebin directly). .noi output (LCC argument: -Wl-j or -debug and then use -Wm-yS with LCC (or -yS with makebin directly).Follow the steps in this section to start using GBDK-2020.
-You can get the latest releases from here: https://github.com/gbdk-2020/gbdk-2020/releases
-There is a known issue on Windows where sdcc will fail when run from folder names with spaces on non-C drives.
For the time being the workaround is as follows (with D:\My Stuff\ as an example folder):
Make sure your GBDK-2020 installation is working correctly by compiling some of the included example projects.
If everything works in the steps below and there are no errors reported then each project that was built should have its own .gb ROM file (or suitable extension for the other supported targets).
-Navigate to a project within the example projects folder ("examples\gb\" under your GBDK-2020 install folder) and open a command line. Then type:
compile
or
compile.bat
This should build the example project. You can also navigate into other example project folders and build in the same way.
-Navigate to the example projects folder ("examples/gb/" under your GBDK-2020 install folder) and open a command line. Then type:
make
This should build all of the examples sequentially. You can also navigate into an individual example project's folder and build it by typing make.
If you get a security warning on macOS that says ("`... developer cannot be verified, macOS cannot verify that this app is free from malware`"), it does not mean that GBDK is malware. It just means the GBDK toolchain binaries are not signed by Apple, so it won't run them without an additional step.
You will need to unquarrantine the files in the bin folder in order to run them. This can be fixed using the following steps.
Open a terminal and navigate to the gbdk bin folder ("bin/" under your GBDK-2020 install folder). Then type:
xattr -d com.apple.quarantine * -
To create a new project use a template!
There are template projects included in the GBDK example projects to help you get up and running. Their folder names start with template_.
make on the command line in that folder to verify it still builds.If you plan to use GBTD / GBMB for making graphics, make sure to get the version with the const fix and other improvements. See const_gbtd_gbmb.
Take a look at the coding guidelines, even if you have experience writing software for other platforms. There is important information to help you get good results and performance on the Game Boy.
If you haven't written programs in C before, check the C tutorials section.
-If you have a specific project in mind, consider what hardware you want to target. It isn't something that has to be decided up front, but it can influence design and implementation.
What size will your game or program be?
Tracking down problems in code is easier with a debugger. Emulicious has a debug adapter that provides C source debugging with GBDK-2020.
-You might want to start off with a guided GBDK tutorial from the GBDK Tutorials section.
Check out the links for online community and support and read the FAQ.
-Several popular GBDK Tutorials, Videos and How-to's were made before GBDK-2020 was available, as a result some information they include is outdated or incompatible. The following summarizes changes that should be made for best results.
-GBDK-2020 now supports auto-banking (rom_autobanking). In most cases using auto-banking will be easier and less error prone than manually assigning source and assets to banks.
banks_autobank project.The old GBDK types UINT8, INT8, UINT16, INT16 are non-standard and less portable.
The following should be used instead: uint8_t, int16_t, uint16_t, int32_t, uint32_t and bool.
These are standard types defined in stdint.h (#include <stdint.h>) and stdbool.h (#include <stdbool.h>).
If you plan to use GBTD / GBMB for making graphics, make sure to get the version with the const fix and other improvements. See const_gbtd_gbmb.
The following flag is no longer needed with lcc and sdcc, it can be removed without any loss of performance.
-DUSE_SFRSetting ROM bytes directly with -Wl-yp0x<address>=0x<value> is no longer supported. Instead use makebin flags. For example, use -Wm-yC instead of -Wl-yp0x143=0xC0. See faq_gb_type_header_setting.
The following header files which are now cross platform were moved from gb/ to gbdk/: bcd.h, console.h, far_ptr.h, font.h, gbdecompress.h, gbdk-lib.h, incbin.h, metasprites.h, platform.h, version.h
#include <gbdk/...> instead of #include <gb/>Do not #include .c source files into other .c source files. Instead create .h header files for them and include those.
Modern project templates are included with GBDK-2020. Using them (and their Makefile or compile.bat) as a starting point for projects is recommended and can help ensure better default settings and project organization.
-hUGEtracker and its driver hUGEdriver are smaller, more efficient and more versatile than gbt_player.
This is a brief list of useful tools and information. It is not meant to be complete or exhaustive, for a larger list see the Awesome Game Boy Development list.
-Intellisense in VSCode may have trouble identifying some GBDK types or functions, and therefore flag them as warnings or unidentified.
GBDK platform constants can be declared so that header files are parsed more completely in VSCode. The following c_cpp_properties.json example may be adapted for your own project.
{
@@ -220,7 +241,7 @@ Emulators
"version": 4
}
-This section contains information that may be useful to know or important when upgrading to a newer GBDK release.
-uint16_t) to signed int16 (int16_t) for coordinates with the family of ...metasprite...() functions-N flag with sdas since the the -n flag was removed--no-optsdcc-in-asm for building user programs and the GBDK librarybgb_emu.h to emu_debug.h and BGB_* functions to EMU_*WRAM memory region is no longer automatically initialized to zeros during startup.set_*_tiles() now wrap maps around horizontal and vertical boundaries correctly. Code relying on it not wrapping correctly may be affected.-Wl-yp0x<address>=0x<value> is no longer supported. Instead use makebin flags. For example, use -Wm-yC instead of -Wl-yp0x143=0xC0. See faq_gb_type_header_setting._shadow_OAM, that allows accessing shadow OAM directly from C code#ifdef anymore). check here why: https://gbdev.gg8.se/forums/viewtopic.php?id=697The GBDK-2020 releases can be found on Github: https://github.com/gbdk-2020/gbdk-2020/releases
-2025/...
-N flag with sdas since the the -n flag was removed_vbl_done (VBL_DONE), a flag indicating the VBlank ISR has runuint16_t) to signed int16 (int16_t) for coordinates with the family of ...metasprite...() functions--no-optsdcc-in-asm for building user programs and the GBDK libraryA,b, B, -dn, -g, -n, -O, P, -p, -static, -t, -w-area option to specify linker area name (such as -area LIT for SMS/GG)-source_tileset option-b:HEXVAL:[...]-nMEM:RAM)-p:NES1) .noi/.map files--palendbit for indicating end of data--addendcolor=N for appending color to clear the background on non-full height images--precompiled mode-s to specify variable/symbol name in C output~2024/05
2024/06
0..3 instead of 4..7di/ei protectiondi/ei protection2023/08
2022/11
2022/10
2022/02
NONBANKED) with #ifdef __SDCCuint8_t instead of int8_t (closer to the standard)uint8_t instead of int8_t (closer to the standard)size_t to be unsigned int instead of int2021/09
2021/06
2021/03
2021/01/17
2020/11/14
2020/10/01
2020/06/05
2020/05/17
2020/05/16
2020/04/12
2020/04/12
17 April, 2000 Many changes.
19th August, 2000
This is an experimental release for those who feel keen. The main change is a new lexer (the first part in the compilation process which recognises words and symbols like '!=' and 'char' and turns them into a token number) which speeds up compilation of large initialised arrays like tile data by a factor of three. Please report any bugs that show up - this is a big change.
I have also included a 'minimal' release for win32 users which omits the documentation, library sources, and examples. If this is useful I will keep doing it.
-5th August, 2000 Just a small update. From the README:
22nd July, 2000
Decent rgbds support. All the libraries and most of the examples can now compile with rgbds as the assembler. Banked function support. It is now easier to break the 32k barrier from within C. Functions can live in and be called transparently from any bank. Only works with rgbds Fixed some decent bugs with RSH, LSH, and a nasty bug with + and - for int's and pointers. Various optimisations in the code generator.
7th July, 2000 Information on float and long support. Someone asked about the state of float/long support recently. Heres my reply:
long support is partly there, as is float support. The compiler will correctly recognise the long and float keywords, and will generate the code for most basic ops (+, -, &, | etc) for longs correctly and will generate the function calls for floats and hard long operations (*, /, %) correctly. However it wont generate float constants in the correct format, nor will it 'return' a long or float - gbdk doesn't yet support returning types of 4 bytes. Unfortunately its not going to make it into 2.95 as there's too much else to do, but I should be able to complete long support for 2.96
-7th May, 2000 Many fixes - see the README for more.
7th May - Library documentation up. A good size part of the libraries that go with gbdk have been documented - follow the HTML link above to have a look. Thanks to quang for a good chunk of the gb.h documentation. Please report any errors :)
6th April, 2000 From the README
26th March, 2000 This is a maintenance release for win32 which fixes some of the niggly install problems, especially:
See the ChangeLog section in the README for more information.
21st March, 2000 Problems with the installer. It seems that the demo of InstallVISE has an unreasonably short time limit. I had planed to use the demo until the license key came through, but there's no sign of the key yet and the 3 day evaluation is up. If anyone knows of a free Windows installer with the ability to modify environment variables, please contact me. I hear that temporarily setting you clock back to the 15th works...
18th March, 2000 libc5 version available / "Error creating temp file" Thanks to Rodrigo Couto there is now a Linux/libc5 version of gbdk3-2.92 available - follow the download link above. At least it will be there when the main sourceforge site comes back up... Also some people have reported a bug where the compiler reports '*** Error creating temp file'. Try typing "mkdir c: tmp" from a DOS prompt and see if that helps.
-8th March, 2000 Better than 2.91 :). Can now be installed anywhere. All the demos work. See the README for more.
27th Feb, 2000 Better than 2.90 and includes Linux, win32 and a source tar ball. Some notes:
Read the README first Linux users need libgc-4 or above. Debian users try apt-get install libgc5. All the types have changed. Again, please read the README first. I prefer release early, release often. The idea is to get the bugs out there so that they can be squashed quickly. I've split up the libs so that they can be used on other platforms and so that the libs can be updated without updating the compiler. One side effect is that gb specific files have been shifted into their own directory i.e. gb.h is now gb/gb.h.
@@ -964,27 +1085,27 @@ GBDK 2.918th Jan, 2000 Moved over to sourceforge.net. Thanks must go to David Pfeffer for gbdk's previous resting place, www.gbdev.org. The transition is not complete, but cvs and web have been shifted. Note that the cvs download instructions are stale - you should now look to cvs.gbdk.sourceforge.net. I am currently working on porting sdcc over to the Z80. David Nathan is looking at porting it to the GB.
6th Jan, 2000 Icehawk wrote "I did write some rumble pack routines. Just make sure to remind people to add -Wl-yt0x1C or -Wl-yt0x1D or -Wl-yt0x1E depending on sram and battery usage. Find the routines on my site (as usual). =)"
18th Oct, 1999 Bug tracking / FAQ up. Try the link on the left to report any bugs with GBDK. It's also the first place to look if your having problems.
-17th Oct, 1999
The compiler is the same, but some of the libraries have been improved. memset() and memcpy() are much faster, malloc() is fixed, and a high speed fixed block alternative malloc() was added.
-\GBDK-2.0 directory on DOS machines.The standard Game Boy cartridge with no MBC has a fixed 32K bytes of ROM. In order to make cartridges with larger ROM sizes (to store more code and graphics) MBCs can be used. They allow switching between multiple ROM banks that use the same memory region. Only one of the banks can be selected as active at a given time, while all the other banks are inactive (and so, inaccessible).
The majority of this section about banking is focused on the Game Boy since that is the original GBDK platform. Much of it still applies for the Game Gear(GG) and Sega Master System(SMS). For additional details about banking specifically related to these two systems see the SMS/GG Banking section.
-Cartridges with no MBC controller are non-banked, they have 32K bytes of fixed ROM space and no switchable banks. For these cartridges the ROM space between 0000h and 7FFFh can be treated as a single large bank of 32K bytes, or as two contiguous banks of 16K bytes in Bank 0 at 0000h - 3FFFh and Bank 1 at 4000h to 7FFFh.
Cartridges with MBCs allow the the Game Boy to work with ROMS up to 8MB in size and with RAM up to 128kB. Each bank is 16K Bytes. The following are usually true, with some exceptions:
0 of the ROM is located in the region at 0000h - 3FFFh. It is fixed (non-banked) and cannot be switched out for another bank.0 for source files, that will happen by default if no bank is specified.See the Pandocs for more details about the individual MBCs and their capabilities.
-For most projects we recommend MBC5.
When using MBCs and bank switching the space used in the lower fixed Bank 0 must be <= 16K bytes. Otherwise it's data will overflow into Bank 1 and may be overwriten or overwrite other data, and can get switched out when banks are changed.
See the FAQ entry about bank overflow errors.
-When using MBCs, Bank 0 is the only bank which is always active and it's code can run regardless of what other banks are active. This means it is a limited resource and should be prioritized for data and functions which must be accessible regardless of which bank is currently active.
To assign code and constant data (such as graphics) to a ROM bank and use it:
The ROM and RAM bank for a source file can be set in a couple different ways. Multiple different banks cannot be assigned inside the same source file (unless the __addressmod method is used), but multiple source files can share the same bank.
If no ROM and RAM bank are specified for a file then the default _CODE, _BSS and _DATA segments are used.
@@ -136,13 +136,13 @@ Setting the ROM bank for a Source fileNote: You can use the NONBANKED keyword to define a function as non-banked if it resides in a source file which has been assigned a bank.
-Wf-ba<N>. Example (Cartridge SRAM bank 3): -Wf-ba3At the link stage this is done with lcc using pass-through switches for makebin.
-Wm-yo<N> where <N> is the number of ROM banks. 2, 4, 8, 16, 32, 64, 128, 256, 512For SMS/GG, the ROM file size must be at least 64K to enable mapper support for RAM banks in emulators.
-yo 4 for makebin (or -Wm-yo4 for LCC) can be used to set the size to 64K.| Hex Code | MBC Type | SRAM | Battery | RTC | Rumble | Extra | Max ROM Size (1) | Hex Code | MBC Type | Cart SRAM (7) | Battery Save (8) | RTC | Extra Feature | Max ROM Size (1) | Max SRAM Size |
|---|---|---|---|---|---|---|---|
| 0x00 | ROM ONLY | 32 K | 0x00 | ROM ONLY | 32 K | 0 | |
| 0x01 | MBC-1 (2) | 2 MB | 0x01 | MBC-1 (2) | 2 MB | 0 | |
| 0x02 | MBC-1 (2) | SRAM | 2 MB | 0x02 | MBC-1 (2) | SRAM | 2 MB | 32 K (5) |
| 0x03 | MBC-1 (2) | SRAM | BATTERY | 2 MB | 0x03 | MBC-1 (2) | SRAM | BATTERY | 2 MB | 32 K (5) |
| 0x05 | MBC-2 | 256 K | 0x05 | MBC-2 | 256 K | 512 x 4 bits (6) | |
| 0x06 | MBC-2 | BATTERY | 256 K | 0x06 | MBC-2 | SRAM (6) | BATTERY | 256 K | 512 x 4 bits (6) |
| 0x08 | ROM (3) | SRAM | 32 K | 0x08 | ROM (3) | SRAM | 32 K | 8 K |
| 0x09 | ROM (3) | SRAM | BATTERY | 32 K | 0x09 | ROM (3) | SRAM | BATTERY | 32 K | 8 K |
| 0x0B | MMM01 | 8 MB / N | 0x0B | MMM01 | 8 MB / N | ||
| 0x0C | MMM01 | SRAM | 8 MB / N | 0x0C | MMM01 | SRAM | 8 MB / N | 128K / N |
| 0x0D | MMM01 | SRAM | BATTERY | 8 MB / N | 0x0D | MMM01 | SRAM | BATTERY | 8 MB / N | 128K / N |
| 0x0F | MBC-3 | BATTERY | RTC | 2 MB | 0x0F | MBC-3 | BATTERY (9) | RTC | 2 MB |
| 0x10 | MBC-3 (4) | SRAM | BATTERY | RTC | 2 MB | 0x10 | MBC-3 (4) | SRAM | BATTERY | RTC | 2 MB | 32 K |
| 0x11 | MBC-3 | 2 MB | 0x11 | MBC-3 | 2 MB | ||
| 0x12 | MBC-3 (4) | SRAM | 2 MB | 0x12 | MBC-3 (4) | SRAM | 2 MB | 32 K |
| 0x13 | MBC-3 (4) | SRAM | BATTERY | 2 MB | 0x13 | MBC-3 (4) | SRAM | BATTERY | 2 MB | 32 K |
| 0x19 | MBC-5 | 8 MB | 0x19 | MBC-5 | 8 MB | ||
| 0x1A | MBC-5 | SRAM | 8 MB | 0x1A | MBC-5 | SRAM | 8 MB | 128 K |
| 0x1B | MBC-5 | SRAM | BATTERY | 8 MB | 0x1B | MBC-5 | SRAM | BATTERY | 8 MB | 128 K |
| 0x1C | MBC-5 | RUMBLE | 8 MB | 0x1C | MBC-5 | RUMBLE | 8 MB |
| 0x1D | MBC-5 | SRAM | RUMBLE | 8 MB | 0x1D | MBC-5 | SRAM | RUMBLE | 8 MB | 128 K |
| 0x1E | MBC-5 | SRAM | BATTERY | RUMBLE | 8 MB | 0x1E | MBC-5 | SRAM | BATTERY | RUMBLE | 8 MB | 128 K |
| 0x20 | MBC-6 | ~2MB | 0x20 | MBC-6 | ~2MB | ||
| 0x22 | MBC-7 | SRAM | BATTERY | RUMBLE | SENSOR | 2MB | 0x22 | MBC-7 | EEPROM | ACCELEROMETER | 2MB | 256 byte EEPROM |
| 0xFC | POCKET CAMERA | To Do | 0xFC | POCKET CAMERA | 1MB | 128KB RAM | |
| 0xFD | BANDAI TAMA5 | To Do | 0xFD | BANDAI TAMA5 | To Do | To Do | |
| 0xFE | HuC3 | RTC | To Do | 0xFE | HuC3 | RTC | To Do | To Do |
| 0xFF | HuC1 | SRAM | BATTERY | IR | To Do | 0xFF | HuC1 | SRAM | BATTERY | IR | To Do | To Do |
1: Max possible size for MBC is shown. When used with generic SWITCH_ROM() the max size may be smaller. For example:
2: For MBC1 some banks in it's range are unavailable. See pandocs for more details https://gbdev.io/pandocs/MBC1
-3: No licensed cartridge makes use of this option. Exact behaviour is unknown.
-4: MBC3 with RAM size 64 KByte refers to MBC30, used only in Pocket Monsters Crystal Version for Japan.
-3: No licensed cartridge makes use of this option. Exact behavior is unknown.
+4: MBC-3 with RAM size 64 KByte refers to MBC30, used only in Pocket Monsters Crystal Version for Japan.
+5: For MBC-1 the 32 K SRAM is only available for ROM sizes <= 512 K.
+6: MBC-2 uses integrated RAM with 512 x 4 bits, the upper 4 bits of each byte should be disregarded.
+7: Additional RAM on the cartridge in the memory range of 0xA000 - 0xBFFF. Contents do not persist after power-off unless the cart has Battery Save.
8: With Battery Save the contents of the cartridge SRAM will persist after power-off. The electronic implementation on cart may vary, for example it may use FRAM or RAM backed with a coin cell battery.
9: The battery for MBC-3 type 0x0F is only used for the RTC, there is no cartridge SRAM present.
The bank number for a banked function, variable or source file can be stored and retrieved using the following macros:
BANKED (is a calling convention):Functions in banks can be called as follows:
BANKED keyword. Example: void my_function() BANKED { do stuff } in a source file which has had its bank set (see above).Calling Convention:
Data declared as const (read only) will be stored in ROM in the bank associated with it's source file (if none is specified it defaults to Bank 0). If that bank is a switchable bank then the data is only accesible while the given bank is active.
Far pointers include a segment (bank) selector so they are able to point to addresses (functions or data) outside of the current bank (unlike normal pointers which are not bank-aware). A set of macros is provided by GBDK 2020 for working with far pointers.
Warning: Do not call the far pointer function macros from inside interrupt routines (ISRs). The far pointer function macros use a global variable that would not get restored properly if a function called that way was interrupted by another one called the same way. However, they may be called recursively.
See FAR_CALL, TO_FAR_PTR and the banks_farptr example project.
You can manually switch banks using the SWITCH_ROM(), SWITCH_RAM(), and other related macros. See banks.c project for an example.
Note: You can only do a switch_rom_bank call from non-banked _CODE since otherwise you would switch out the code that was executing. Global routines that will be called without an expectation of bank switching should fit within the limited 16k of non-banked _CODE.
In order to load Data in one bank from code running in another bank a NONBANKED wrapper function can be used. It can save the current bank, switch to another bank, operate on some data, restore the original bank and then return.
An example function which can :
The global variable CURRENT_BANK (a macro for _current_bank) is updated automatically when calling SWITCH_ROM(), SWITCH_ROM_MBC1() and SWITCH_ROM_MBC5, or when a BANKED function is called.
Normaly banked calls are used and the active bank does not need to be directly managed, but in the case that it does the following shows how to save and restore it.
@@ -364,7 +369,7 @@ Currently active bank: CURRENT_BANKA ROM bank auto-assignment feature was added in GBDK 2020 4.0.2.
Instead of having to manually specify which bank a source file will reside in, the banks can be assigned automatically to make the best use of space. The bank assignment operates on object files, after compiling/assembling and before linking.
@@ -386,13 +391,13 @@ Auto-BankingAccessing that data: main.c
Features and Notes:
A bank overflow during compile/link time (in 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.
See the FAQ entry about bank overflow errors.
The current toolchain can only detect and warn (using ihxcheck) when one bank overflows into another bank that has data at its start. It cannot warn if a bank overflows into an empty one. For more complete detection, you can use the romusage tool.
-In order to see how much space is used or remains available in a bank you can use the romusage tool.
-There are several projects in the GBDK 2020 examples folder which demonstrate different ways to use banking.
Banks: a basic banking exampleBanks_autobank: shows how to use the bank auto-assignment feature in GBDK 2020 4.0.2 or later, instead of having to manually specify which bank a source file will reside it.The memory banking setup for SMS and Game Gear in GBDK is different than it is for the Game Boy. Instead of a single switchable bank in the 0x4000 - 0x7FFF range, there are two switchable frames at different address ranges. The configuration is as follows:
Banked code and any pointers associated with it will only work correctly when active in Frame 1 (at 0x4000), so it must use CODE_<N>. Graphics and other assets may go in either Frame 1 (at 0x4000) or, if designed for it then Frame 2 (at 0x8000).
CODE and LIT cannot share the same bank number. For example, if CODE is assigned to bank 3 then LIT cannot be in bank 3 as well.
bankpack is aware of this requirement and will group CODE and LIT separately when packing for autobanking. It's process is as follows:
As of version 4.2.0 GBDK includes support for other consoles in addition to the Game Boy.
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 capabilities, memory layouts, processor type (z80 vs gbz80/sm83) and speed.
-When compiling and building through lcc use the -m<port>:<plat> flag to select the desired console via its port and platform combination. See below for available settings.
When building directly with the sdcc toolchain, the following must be specified manually (when using lcc it will populate these automatically based on -m<port>:<plat>).
When compiling with sdcc:
makecom <image.bin> [<image.noi>] <output.com>Note: Starting with GBDK-2020 4.1.0 and SDCC 4.2, the Game Boy and related clones use sm83 for the port instead of gbz80
There are several constant #defines that can be used to help select console specific code during compile time (with #ifdef, #ifndef) .
<gb/gb.h> is included (either directly or through <gbdk/platform.h>)Constants that describe properties of the console hardware are listed below. Their values will change to reflect the current console target that is being built.
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> @@ -252,15 +252,15 @@ Using <gbdk/...> headers
and
#include <sms/sms.h> #include <sms/metasprites.h>-
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.
The cross-platform Logo example project shows how assets can be managed for multiple different console targets together.
In the example utility_png2asset is used to generate assets in the native format for each console at compile-time from separate source PNG images. The Makefile is set to use the source PNG folder which matches the current console being compiled, and the source code uses set_bkg_native_data() to load the assets tiles in native format to the tile memory used for background tiles on that platform.
-The specs below reflect the typical configuration of hardware when used with GBDK and is not meant as a complete list of their capabilities.
GB/AP/DUCK
GB/AP
These are some of the main hardware differences between the Regular Game Boy and the Game Boy Color.
These are some of the main GBDK API features for the CGB. Many of the items listed below link to additional information.
#include <gb/cgb.h>)Several examples in GBDK show how to use CGB features, including the following:
gb/colorbar, gb/dscan, cross-platform/large_map, cross-platform/logo, cross-platform/metaspritesThe Analogue Pocket operating in .pocket mode is (for practical purposes) functionally identical to the Game Boy / Color though it has a couple changes listed below. These are handled automatically in GBDK as long as the practices outlined below are followed.
In order for software to be easily ported to the Analogue Pocket, or to run on both, use the following practices.
-Use API defined registers and register flags instead of hardwired ones.
As long as the target console is set during build time then the correct boot logo will be automatically selected.
-Use the following api calls when assets are avaialble in the native format for each platform.
The SMS/GG have 2 x 16 color palettes:
On the Game Boy Color, VBK_REG is used to select between the regular background tile map and the background attribute tile map (for setting tile color palette and other properties).
This behavior is emulated for the SMS/GG when using set_bkg_tiles() and VBK_REG. It allows writing a 1-byte tile map separately from a 1-byte attributes map.
The NES graphics architecture is similar to the GB's. However, there are a number of design choices in the NES hardware that make the NES a particularly cumbersome platform to develop for, and that will require special attention.
Most notably:
To provide an easier experience, gbdk-nes attempts to hide most of these quirks so that in theory the programming experience for gbdk-nes should be as close as possible to that of the GB/GBC. However, to avoid surprises it is recommended to familiarize yourself with the NES-specific quirks and implementation choices mentioned here.
This entire section is written as a guide on porting GB projects to NES. If you are new to GBDK, you may wish to familiarize yourself with using GBDK for GB development first as the topics covered will make a lot more sense after gaining experience with GB development.
-Currently the NES support in GBDK uses UNROM-512 (Mapper30) with single-screen mirroring.
-On the GB, the vblank period serves as an optimal time to write data to PPU memory, and PPU memory can also be written efficiently with VRAM DMA.
On the NES, writing PPU memory during the vblank period is not optional. Whenever rendering is turned on the PPU is in a state where accessing PPU memory results in undefined behavior outside the short vblank period. The NES also has no VRAM DMA hardware to help with data writes. This makes the vblank period not only more precious, but important to never exceed to avoid glitched games.
@@ -547,7 +547,7 @@ Buffered mode vs direct modeThe following sections describe how the buffered / direct modes work in more detail. As buffered / direct mode is mostly hidden by the API calls, feel free to skip these sections if you wish.
-To take maximum advantage of the short vblank period, gbdk-nes implements a popular optimization: An unrolled loop that pulls prepared data bytes from the stack.
PLA STA PPUDATA @@ -561,15 +561,13 @@ RTSBy doing writes to this buffer during game logic, your game will effectively keep writing data transfer commands for the vblank NMI handler to process in the next vblank period, without having to wait until the vblank.
Given that the transfer buffer only has space for around 100 data bytes, it is important to not overfill the buffer, as this will bring code execution to a screeching halt, until the NMI handler empties the old contents of the buffer to free up space and allow new commands to be written.
Buffered mode is typically used for scrolling updates or dynamically animated tiles, where only a small amount of bytes need updating per frame.
-+
Direct mode implementation details
During direct mode, all graphics routines will write directly to the PPUADDR / PPUDATA ports and the transfer buffer limit is never a concern because the transfer buffer is effectively bypassed.
Direct mode is typically used for initializing large amounts of tile data at boot and/or level loading time. Unless you plan to have an animated loading screen and decompress a lot of data, it makes more sense to just fade the screen to black and allow direct mode to write data as fast as possible.
--Caveat: Make sure the transfer buffer is emptied before switching to direct mode
-Because the switch to direct mode is instant and doesn't wait for the next invocation of the vblank, it is possible to create situations where there is still remaining data in the transfer buffer that would only get written once the system is switched back to buffered mode.
-To avoid this situation, make sure to always "drain" the buffer by doing a call to vsync when you expect your code to finish.
-+
Direct mode also affects how (fake) interrupt handlers are processed. As long as vsync() is called on each frame, the VBL and LCD handlers will still be executed in direct mode - but no graphics registers will be written.
+The TIM handler will still be executed as normal.
+Caveat: Only update the PPU palette during buffered mode
The oddity that PPU palette values are accessed through the same mechanism as other PPU memory bytes comes with the side effect that the vblank NMI handler will only write the palette values in buffered mode.
The reason for this design choice is two-fold:
To work around this, you are advised to never fully turn the display off during a palette fade. If you don't follow this advice all your palette updates will get delayed until the screen is turned back on.
-Like the SMS, the NES hardware is designed to only allow loading the full X/Y scroll on the very first scanline. i.e., under normal operation you are only allowed to change the Y-scroll once.
In contrast to the SMS, this limitation can be circumvented with a specific set of out-of-order writes to the PPUSCROLL/PPUADDR registers, taking advantage of the quirk that the PPUADDR and PPUSCROLL share register bits. But this write sequence is very timing-sensitive as the writes need to fall into (a smaller portion of) the hblank period in order to avoid race conditions when the CPU and PPU both try to update the same register during scanline rendering.
To simplify the programming interface, gbdk-nes functions like move_bkg / scroll_bkg only ever update shadow registers in RAM. The vblank NMI handler will later pick these values up and write them to the actual PPU registers registers.
-GBDK provides an API for installing Interrupt Service Routines that execute on start of vblank (VBL handler), or on a specific scanline (LCD handler).
-But the base NES system has no suitable scanline interrupts that can provide such functionality. So instead, gbdk-nes API allows fake handlers to be installed in the goal of keeping code compatible with other platforms.
+But the base NES system has no suitable scanline interrupts that can provide the exact equivalent functionality. So instead, gbdk-nes API allows fake handlers to be installed in the goal of keeping code compatible with other platforms.
Because the LCD "ISR" is actually implemented with a delay loop, it will burn a lot of CPU cycles in the frame - the further down the requested scanline is the larger the CPU cycle loss. In practice this makes this faked-LCD-ISR functionality mostly suitable for status bars at the top of the screen screen. Or for simple parallax cutscenes where the CPU has little else to do.
-To make porting between user VBL / LCD handlers written in C easier, gbdk-nes also provides aliases for the shadow registers that correspond to the GB hardware registers.
+Because these are shadow registers that are interpreted by the GBDK library to mimick GB behaviour, they won't behave exactly how the GB hardware registers do under all conditions. However, for most practical purposes they allow writing portable VBL / LCD handlers in C.
+Negative coordinates won't work correctly due to the wrapping from 239 to 0. Instead, they need to be corrected with this wrapping in mind. i.e. a negative coordinate of -1 needs to be converted to 239 before being written to bkg_scroll_y.
+A portable way to do this is to check for a negative offset, and use the screen height define:
+SCY_REG = offset < 0 ? (uint8_t)(DEVICE_SCREEN_BUFFER_HEIGHT*8 + offset) : offset;
+On the GB, the call to vsync is an optional call that serves two purposes:
On gbdk-nes the second point is no longer true, because writes need to be made to the shadow registers before vsync is called.
+On gbdk-nes the second point is no longer true, because writes need to be made to the shadow registers either before vsync is called, or in a user VBL isr handler.
But the vsync call serves three other very important purposes:
A. It calls the optional VBL handler, where shadow registers can be written (and will later be picked up by the actual vblank NMI handler) B. It repeatedly calls the optional LCD handler up to MAX_LCD_ISR_CALLS times. After each call, PPU shadow registers are stored into a buffer that will later be used by timed code in the NMI to handle mid-frame changes for screen splits / sprite hiding / etc. C. It calls flush_shadow_attributes so that updates to background attributes actually get written to PPU memory
For these reasons you should always include a call to vsync if you expect to see any graphical updates on the screen.
-The fake LCD ISR system is not bullet-proof. In particular, it has a problem where lag frames can cause the shadow register updates in LCD handlers not to be ready in time for when the timed code in the NMI handler would be called. This will effectively cause all those updates to be missing for one frame, and result in glitched scroll updates.
-There is currently no complete work-around for this problem other than avoiding lag frames altogether. But the glitch can be made less distracting by making sure only the status bar glitches rather than the main background.
-If you are using LCD handlers to achieve a top-screen stationary status bar, it is recommended that you follow the following guidelines to make sure the background itself has consistent scrolling:
The nature of the deferred handling for fake VBL and LCD handlers in gbdk-nes means that lag frames will cause these handlers to be called at delayed irregular times.
+For graphics updates this is the behaviour you usually want. But for non-graphics tasks like music playback it will cause distracting stutter.
+The timer overflow handler (TIM) provides an alternative method that is guaranteed to be stutter-free. The TIM handler is always called if timer overflow occurs at the end of the NMI handler in both buffered and direct mode.
+The TMA_REG and TAC_REG hardware registers are emulated via RAM variable with the same names. The timer emulation matches the values of these registers for a GBC running in double-speed mode. But there will be a small variation in exact frequency compared to real GBC hardware, and the nature of the timer emulation via vblank means the execution is not as evenly paced as on GBC hardware.
+The TIMA_REG should not be written or read in gbdk-nes, as the emulation does not handle its contents exactly as on GB.
+At reset, TAC_REG is set to clock rate 00 and timer enabled, and TMA_REG is set to either of two values, depending on the detected system:
+In short: Ensuring that the last called LCD handler sets the scroll back to the original value means the PPU rendering keeps rendering the background from the same scrolling position even when the NMI handling was missed.
-These default values ensure that the TIM emulation will always call the TIM handler exactly once for every vblank, resulting in 60Hz vs 50Hz depending on the system.
+Changing TMA_REG allows setting a slower or faster frequency for this emulated timer overflow interrupt if your GB game uses the timer overflow hardware for regular events like music that are slower or faster than 60Hz (50Hz for PAL).
+If you are porting a GB game to gbdk-nes where the music handler is called in the VBL or LCD handler then it is advisable to move this call to the timer handler, in order to achieve reliable music playback at 60Hz (50Hz for PAL).
+Keep in mind that you should NOT write any graphics registers in the TIM handler. This will likely not do what you want, and it may result in bad graphical glitches.
+Tweaking the playback rate by setting TMA_REG / TAC_REG is a decent way to achieve the same average playback rate as on a GB game that uses a different rate than the vblank tick rate and allow similar music speed for different regions.
+However, it is recommended to use the default vblank parity mode whenever remaking the music specifically for 60Hz / 50Hz is an option, as keeping the music tick rate steady will give more pleasant sound playback for rates that are already close to native vblank rate of 60Hz / 50Hz.
+#pragma nooverlay command. This makes memory for local variables and function parameters unique to this function instead of being shared with other functions' allocations in the reusable overlay segment. #pragma save
+#pragma nooverlay
+void tim_isr(void)
+{
+ // Do TIM isr things
+}
+#pragma restore
+ Without this pragma the calls in your TIM handler could end up overwriting local variables or function parameters that the main program was using when it was interrupted. You should also avoid calls to the standard library, and even multiplications and division / modulo operations in your TIM handlers. These more expensive math operations in SDCC are currently implemented with functions that use the overlay segment and would cause similar conflicts. For more details on overlay segment and interrupts, please see section 3.7 in the SDCC manual.Use the following api calls when assets are available in the native format for each platform.
Platform specific API calls:
On the Game Boy Color, VBK_REG is used to select between the regular background tile map and the background attribute tile map (for setting tile color palette and other properties).
This behavior of setting VBK_REG to specify tile indices/attributes is not supported on the NES platform. Instead the dedicated functions for attribute setting should be used. These will work on other platforms as well and are the preferred way to set attributes.
@@ -663,10 +687,10 @@ Game Boy Color map attributes on the NESThe Mega Duck is (for practical purposes) functionally identical to the Original Game Boy though it has a couple changes listed below.
-0x0001 (many Game Boy MBCs use 0x2000 - 0x3FFF)In order for software to be easily ported to the Mega Duck, or to run on both, use these practices. That will allow GBDK to automatically handle most of the differences (for the exceptions see Sound Register Value Changes).
There are two hardware changes which will not be handled automatically when following the practices mentioned above.
These changes may be required when using existing Sound Effects and Music Drivers written for the Game Boy.
@@ -704,7 +729,7 @@ Sound Register Value Changes -These changes are handled automatically when their GBDK definitions are used.
| LCDCF_B_BGON | .0 | .6 | Bit for Background Display Visible Hidden Select |
These changes are handled automatically when their GBDK definitions are used.
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
@@ -91,7 +91,7 @@ $(document).ready(function(){initNavTree('docs_toolchain.html',''); initResizabl
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
@@ -91,50 +91,38 @@ $(document).ready(function(){initNavTree('docs_toolchain_settings.html',''); ini
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
@@ -90,7 +90,7 @@ $(document).ready(function(){initNavTree('docs_using_gbdk.html',''); initResizab
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
diff --git a/docs/api/drawing_8h_source.html b/docs/api/drawing_8h_source.html
index 667c48e4..d967250f 100644
--- a/docs/api/drawing_8h_source.html
+++ b/docs/api/drawing_8h_source.html
@@ -29,7 +29,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
diff --git a/docs/api/far__ptr_8h.html b/docs/api/far__ptr_8h.html
index 69439d05..4c2e51e7 100644
--- a/docs/api/far__ptr_8h.html
+++ b/docs/api/far__ptr_8h.html
@@ -29,7 +29,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
diff --git a/docs/api/far__ptr_8h_source.html b/docs/api/far__ptr_8h_source.html
index 7426e67a..3cf7ae1e 100644
--- a/docs/api/far__ptr_8h_source.html
+++ b/docs/api/far__ptr_8h_source.html
@@ -29,7 +29,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
diff --git a/docs/api/files.html b/docs/api/files.html
index 0348f5f5..520aa38f 100644
--- a/docs/api/files.html
+++ b/docs/api/files.html
@@ -29,7 +29,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
GBDK 2020 Docs
- 4.3.0
+ 4.4.0
API Documentation for GBDK 2020
|
@@ -113,66 +113,70 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ gb | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bgb_emu.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgb.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| crash_handler.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drawing.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emu_debug.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gb.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hblankcpy.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isr.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sgb.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ gbdk | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emu_debug.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| far_ptr.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdk-lib.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| incbin.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| platform.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rledecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ msx | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| msx.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ nes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nes.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rgb_to_nes_macro.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ sms | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sms.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ctype.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| limits.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rand.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setjmp.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdarg.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdatomic.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdbool.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stddef.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdint.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdio.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdlib.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdnoreturn.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| time.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| typeof.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ duck | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| laptop_io.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| laptop_keycodes.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| model.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ gb | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bgb_emu.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgb.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| crash_handler.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drawing.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emu_debug.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gb.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hblankcpy.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isr.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sgb.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ gbdk | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emu_debug.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| far_ptr.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdk-lib.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| incbin.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| platform.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rledecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ msx | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| msx.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ nes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nes.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rgb_to_nes_macro.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▼ sms | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bcd.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gbdecompress.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hardware.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metasprites.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sms.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ctype.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| limits.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rand.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setjmp.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdarg.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdatomic.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdbool.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stddef.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdint.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdio.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdlib.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stdnoreturn.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| time.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| typeof.h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| types.h |
| #define MBC7_LATCH_ERASE 0x55u | +
| #define MBC7_LATCH_CAPTURE 0xAAu | +
| #define MBC7_SRAM_ENABLE_KEY_1 0x0Au | +
| #define MBC7_SRAM_ENABLE_KEY_2 0x40u | +
| __BYTE_REG rMBC7_SRAM_ENABLE_1 | +
MBC7 registers
+ +| __BYTE_REG rMBC7_SRAM_ENABLE_2 | +
| __BYTE_REG rMBC7_LATCH_1 | +
| __BYTE_REG rMBC7_LATCH_2 | +
| __BYTE_REG rMBC7_ACCEL_X_LO | +
| __BYTE_REG rMBC7_ACCEL_X_HI | +
| __BYTE_REG rMBC7_ACCEL_Y_LO | +
| __BYTE_REG rMBC7_ACCEL_Y_HI | +
A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.
The api supports metasprites in both SPRITES_8x8 and SPRITES_8x16 mode. If 8x16 mode is used then the height of the metasprite must be a multiple of 16.
The origin (pivot) for the metasprite is not required to be in the upper left-hand corner as with regular hardware sprites.
Use the utility_png2asset tool to convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions.
-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 good practice to clear out (hide) unused sprites in the shadow_OAM that have been set by previous frames.
When the move_metasprite_*() functions are called they update all properties for the affected sprites in the Shadow OAM. This means any existing property flags set for a sprite (CGB palette, BG/WIN priority, Tile VRAM Bank) will get overwritten.
How to use sprite property flags with metasprites:
Timer Interrupt when the timer TIMA_REG overflows.
Timer Interrupt when the timer TIMA_REG overflows.
The resulting format is four greyscale colors packed into a single unsigned byte.
Example:
Macro returns TRUE if device supports color
+| #define VBL_DONE _vbl_done | +
Adds a timer interrupt handler.
Can not be used together with add_low_priority_TIM
-This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.
+This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.
Up to 4 handlers may be added, with the last added being called last.
+Adds a timer interrupt handler, that could be interrupted by the other interrupts, as well as itself, if it runs too slow.
Can not be used together with add_TIM
-This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.
+This interrupt occurs when the TIMA_REG register ($FF05) changes from $FF to $00.
Up to 4 handlers may be added, with the last added being called last.
|
+ +inline | +
Performs a soft reset.
For the Game Boy and related it does this by jumping to address 0x0150 which is in crt0.s (the c-runtime that executes before main() is called).
@@ -3316,7 +3343,7 @@ VariablesExample:
Increments once per Frame
Will wrap around every ~18 minutes (unsigned 16 bits = 65535 / 60 / 60 = 18.2)
+| __REG _vbl_done | +
Flag indicating the VBlank ISR has run
+Flag gets cleared at the start of vsync() / wait_vbl_done() and set in the default VBlank ISR handler.
+Warning: to correctly pass chars for printing as chars, they must be explicitly re-cast as such when calling the function. See docs_chars_varargs for more details.
-Currently supported in the Emulicious emulator
+Currently supported in the Emulicious emulator, may be supported by bgb
diff --git a/docs/api/gbdk_2emu__debug_8h_source.html b/docs/api/gbdk_2emu__debug_8h_source.html index 4e84cb2c..13570d9c 100644 --- a/docs/api/gbdk_2emu__debug_8h_source.html +++ b/docs/api/gbdk_2emu__debug_8h_source.html @@ -29,7 +29,7 @@Welcome to GBDK-2020! The best thing to do is head over to the Getting Started section to get up and running.
If you are upgrading please check GBDK Release Notes and Migrating to new GBDK Versions
-This documentation is partially based on material written by the original GBDK authors in 1999 and updated for GBDK-2020. The API docs are automatically generated from the C header files using Doxygen.
GBDK-2020 is an updated version of the original GBDK with a modernized SDCC toolchain and many API improvements and fixes. It can be found at: https://github.com/gbdk-2020/gbdk-2020/.
The original GBDK sources, documentation and website are at: http://gbdk.sourceforge.net/
-The GameBoy Developer's Kit (GBDK, GBDK-2020) is used to develop games and programs for the Nintendo Game Boy (and some other consoles) in C and assembly. GBDK includes a set of libraries for the most common requirements and generates image files for use with a real GameBoy or emulators.
GBDK features:
GBDK is freeware. Most of the tooling code is under the GPL. The runtime libraries should be under the LGPL. Please consider mentioning GBDK in the credits of projects made with it.
Work on the original GBDK (pre-2020) was by:
Pascal Felber, Lars Malmborg, Michael Hope, David Galloway (djmips), John Fuge, and others.
diff --git a/docs/api/index.js b/docs/api/index.js index 66a44fb5..244c2b9a 100644 --- a/docs/api/index.js +++ b/docs/api/index.js @@ -1,367 +1,372 @@ var index = [ - [ "Introduction", "index.html#autotoc_md300", null ], - [ "About the Documentation", "index.html#autotoc_md301", null ], - [ "About GBDK", "index.html#autotoc_md302", null ], - [ "Historical Info and Links", "index.html#autotoc_md303", null ], + [ "Introduction", "index.html#autotoc_md306", null ], + [ "About the Documentation", "index.html#autotoc_md307", null ], + [ "About GBDK", "index.html#autotoc_md308", null ], + [ "Historical Info and Links", "index.html#autotoc_md309", null ], [ "Getting Started", "docs_getting_started.html", [ - [ "1. Download a Release and unzip it", "docs_getting_started.html#autotoc_md8", [ - [ "Known Issue: Windows and folder names with spaces on non-C drives", "docs_getting_started.html#autotoc_md9", null ] + [ "1. Download a Release and unzip it", "docs_getting_started.html#autotoc_md9", [ + [ "Known Issue: Windows and folder names with spaces on non-C drives", "docs_getting_started.html#autotoc_md10", null ] ] ], - [ "2. Compile Example projects", "docs_getting_started.html#autotoc_md10", [ - [ "Windows (without Make installed):", "docs_getting_started.html#autotoc_md11", null ], - [ "Linux / macOS / Windows with Make installed:", "docs_getting_started.html#autotoc_md12", [ - [ "macOS security warnings", "docs_getting_started.html#autotoc_md13", null ] + [ "2. Compile Example projects", "docs_getting_started.html#autotoc_md11", [ + [ "Windows (without Make installed):", "docs_getting_started.html#autotoc_md12", null ], + [ "Linux / macOS / Windows with Make installed:", "docs_getting_started.html#autotoc_md13", [ + [ "macOS security warnings", "docs_getting_started.html#autotoc_md14", null ] ] ] ] ], - [ "3. Use a Template", "docs_getting_started.html#autotoc_md14", null ], - [ "4. If you use GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md15", null ], - [ "5. Review Coding Guidelines", "docs_getting_started.html#autotoc_md16", null ], - [ "6. Hardware and Resources", "docs_getting_started.html#autotoc_md17", null ], - [ "7. Set up C Source debugging", "docs_getting_started.html#autotoc_md18", null ], - [ "8. Try a GBDK Tutorial", "docs_getting_started.html#autotoc_md19", null ], - [ "9. Read up!", "docs_getting_started.html#autotoc_md20", null ], - [ "10. Need help?", "docs_getting_started.html#autotoc_md21", null ], - [ "Migrating From Pre-GBDK-2020 Tutorials", "docs_getting_started.html#autotoc_md22", [ - [ "Also see:", "docs_getting_started.html#autotoc_md23", null ], - [ "Use auto-banking", "docs_getting_started.html#autotoc_md24", null ], - [ "Non-standard types (UINT8, etc)", "docs_getting_started.html#autotoc_md25", null ], - [ "If using GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md26", null ], - [ "LCC and SDCC flags that are not needed", "docs_getting_started.html#autotoc_md27", null ], - [ "ROM Header Settings (such as Color, SGB, etc)", "docs_getting_started.html#autotoc_md28", null ], - [ "GBDK Header include changes", "docs_getting_started.html#autotoc_md29", null ], - [ "Include .h headers, not .c source files", "docs_getting_started.html#autotoc_md30", null ], - [ "Use the Template Projects", "docs_getting_started.html#autotoc_md31", null ], - [ "Use hUGEtracker instead of gbt_player", "docs_getting_started.html#autotoc_md32", null ] + [ "3. Use a Template", "docs_getting_started.html#autotoc_md15", null ], + [ "4. If you use GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md16", null ], + [ "5. Review Coding Guidelines", "docs_getting_started.html#autotoc_md17", null ], + [ "6. Hardware and Resources", "docs_getting_started.html#autotoc_md18", null ], + [ "7. Set up C Source debugging", "docs_getting_started.html#autotoc_md19", null ], + [ "8. Try a GBDK Tutorial", "docs_getting_started.html#autotoc_md20", null ], + [ "9. Read up!", "docs_getting_started.html#autotoc_md21", null ], + [ "10. Need help?", "docs_getting_started.html#autotoc_md22", null ], + [ "Migrating From Pre-GBDK-2020 Tutorials", "docs_getting_started.html#autotoc_md23", [ + [ "Also see:", "docs_getting_started.html#autotoc_md24", null ], + [ "Use auto-banking", "docs_getting_started.html#autotoc_md25", null ], + [ "Non-standard types (UINT8, etc)", "docs_getting_started.html#autotoc_md26", null ], + [ "If using GBTD / GBMB, get the fixed version", "docs_getting_started.html#autotoc_md27", null ], + [ "LCC and SDCC flags that are not needed", "docs_getting_started.html#autotoc_md28", null ], + [ "ROM Header Settings (such as Color, SGB, etc)", "docs_getting_started.html#autotoc_md29", null ], + [ "GBDK Header include changes", "docs_getting_started.html#autotoc_md30", null ], + [ "Include .h headers, not .c source files", "docs_getting_started.html#autotoc_md31", null ], + [ "Use the Template Projects", "docs_getting_started.html#autotoc_md32", null ], + [ "Use hUGEtracker instead of gbt_player", "docs_getting_started.html#autotoc_md33", null ] ] ] ] ], [ "Links, Tools and Debugging", "docs_links_and_tools.html", [ - [ "SDCC Compiler Suite User Manual", "docs_links_and_tools.html#autotoc_md33", null ], - [ "Getting Help", "docs_links_and_tools.html#autotoc_md34", null ], - [ "Game Boy Documentation", "docs_links_and_tools.html#autotoc_md35", null ], - [ "Sega Master System / Game Gear Documentation", "docs_links_and_tools.html#autotoc_md36", null ], - [ "Tutorials", "docs_links_and_tools.html#autotoc_md37", null ], - [ "Example code", "docs_links_and_tools.html#autotoc_md38", null ], - [ "Graphics Tools", "docs_links_and_tools.html#autotoc_md39", null ], - [ "Music And Sound Effects", "docs_links_and_tools.html#autotoc_md40", null ], - [ "Emulators", "docs_links_and_tools.html#autotoc_md41", null ], - [ "Debugging tools", "docs_links_and_tools.html#autotoc_md42", null ], - [ "Optimizing Assembly", "docs_links_and_tools.html#autotoc_md43", null ], - [ "Continuous Integration and Deployment", "docs_links_and_tools.html#autotoc_md44", null ] + [ "SDCC Compiler Suite User Manual", "docs_links_and_tools.html#autotoc_md34", null ], + [ "Getting Help", "docs_links_and_tools.html#autotoc_md35", null ], + [ "Game Boy Documentation", "docs_links_and_tools.html#autotoc_md36", null ], + [ "Sega Master System / Game Gear Documentation", "docs_links_and_tools.html#autotoc_md37", null ], + [ "Mega Duck / Cougar Boy Documentation", "docs_links_and_tools.html#autotoc_md38", null ], + [ "Tutorials", "docs_links_and_tools.html#autotoc_md39", null ], + [ "Example code", "docs_links_and_tools.html#autotoc_md40", null ], + [ "Graphics Tools", "docs_links_and_tools.html#autotoc_md41", null ], + [ "Music And Sound Effects for the Game Boy", "docs_links_and_tools.html#autotoc_md42", null ], + [ "Music And Sound Effects for the SMS/Game Gear", "docs_links_and_tools.html#autotoc_md43", null ], + [ "Emulators", "docs_links_and_tools.html#autotoc_md44", null ], + [ "Debugging tools", "docs_links_and_tools.html#autotoc_md45", null ], + [ "Optimizing Assembly", "docs_links_and_tools.html#autotoc_md46", null ], + [ "Continuous Integration and Deployment", "docs_links_and_tools.html#autotoc_md47", null ] ] ], [ "Using GBDK", "docs_using_gbdk.html", [ - [ "Interrupts", "docs_using_gbdk.html#autotoc_md45", [ - [ "Available Interrupts", "docs_using_gbdk.html#autotoc_md46", null ], - [ "Adding your own interrupt handler", "docs_using_gbdk.html#autotoc_md47", null ], - [ "Using your own Interrupt Dispatcher", "docs_using_gbdk.html#autotoc_md48", null ], - [ "Returning from Interrupts and STAT mode", "docs_using_gbdk.html#autotoc_md49", null ] + [ "Interrupts", "docs_using_gbdk.html#autotoc_md48", [ + [ "Available Interrupts", "docs_using_gbdk.html#autotoc_md49", null ], + [ "Adding your own interrupt handler", "docs_using_gbdk.html#autotoc_md50", null ], + [ "Using your own Interrupt Dispatcher", "docs_using_gbdk.html#autotoc_md51", null ], + [ "Returning from Interrupts and STAT mode", "docs_using_gbdk.html#autotoc_md52", null ] ] ], - [ "What GBDK does automatically and behind the scenes", "docs_using_gbdk.html#autotoc_md50", [ - [ "NES console", "docs_using_gbdk.html#autotoc_md51", null ], - [ "OAM (VRAM Sprite Attribute Table)", "docs_using_gbdk.html#autotoc_md52", null ], - [ "Graphics Tile Maps and Data on Startup", "docs_using_gbdk.html#autotoc_md53", null ], - [ "Font tiles when using stdio.h", "docs_using_gbdk.html#autotoc_md54", null ], - [ "Default Interrupt Service Handlers (ISRs)", "docs_using_gbdk.html#autotoc_md55", null ], - [ "Ensuring Safe Access to Graphics Memory", "docs_using_gbdk.html#autotoc_md56", null ] + [ "What GBDK does automatically and behind the scenes", "docs_using_gbdk.html#autotoc_md53", [ + [ "NES console", "docs_using_gbdk.html#autotoc_md54", null ], + [ "OAM (VRAM Sprite Attribute Table)", "docs_using_gbdk.html#autotoc_md55", null ], + [ "Graphics Tile Maps and Data on Startup", "docs_using_gbdk.html#autotoc_md56", null ], + [ "Font tiles when using stdio.h", "docs_using_gbdk.html#autotoc_md57", null ], + [ "Default Interrupt Service Handlers (ISRs)", "docs_using_gbdk.html#autotoc_md58", null ], + [ "Ensuring Safe Access to Graphics Memory", "docs_using_gbdk.html#autotoc_md59", null ] ] ], - [ "Compression", "docs_using_gbdk.html#autotoc_md57", null ], - [ "Copying Functions to RAM and HIRAM", "docs_using_gbdk.html#autotoc_md58", null ], - [ "Mixing C and Assembly", "docs_using_gbdk.html#autotoc_md59", [ - [ "Inline ASM within C source files", "docs_using_gbdk.html#autotoc_md60", null ], - [ "In Separate ASM files", "docs_using_gbdk.html#autotoc_md61", null ] + [ "Compression", "docs_using_gbdk.html#autotoc_md60", null ], + [ "Copying Functions to RAM and HIRAM", "docs_using_gbdk.html#autotoc_md61", null ], + [ "Mixing C and Assembly", "docs_using_gbdk.html#autotoc_md62", [ + [ "Inline ASM within C source files", "docs_using_gbdk.html#autotoc_md63", null ], + [ "In Separate ASM files", "docs_using_gbdk.html#autotoc_md64", null ] ] ], - [ "Including binary files in C source with incbin", "docs_using_gbdk.html#autotoc_md62", null ], - [ "Known Issues and Limitations", "docs_using_gbdk.html#autotoc_md63", [ - [ "SDCC", "docs_using_gbdk.html#autotoc_md64", null ] + [ "Including binary files in C source with incbin", "docs_using_gbdk.html#autotoc_md65", null ], + [ "Known Issues and Limitations", "docs_using_gbdk.html#autotoc_md66", [ + [ "SDCC", "docs_using_gbdk.html#autotoc_md67", null ] ] ] ] ], [ "Coding Guidelines", "docs_coding_guidelines.html", [ - [ "Learning C / C fundamentals", "docs_coding_guidelines.html#autotoc_md65", [ - [ "General C tutorials", "docs_coding_guidelines.html#autotoc_md66", null ], - [ "Embedded C introductions", "docs_coding_guidelines.html#autotoc_md67", null ], - [ "Game Boy games in C", "docs_coding_guidelines.html#autotoc_md68", null ] + [ "Learning C / C fundamentals", "docs_coding_guidelines.html#autotoc_md68", [ + [ "General C tutorials", "docs_coding_guidelines.html#autotoc_md69", null ], + [ "Embedded C introductions", "docs_coding_guidelines.html#autotoc_md70", null ], + [ "Game Boy games in C", "docs_coding_guidelines.html#autotoc_md71", null ] ] ], - [ "Understanding the hardware", "docs_coding_guidelines.html#autotoc_md69", null ], - [ "Writing optimal C code for the Game Boy and SDCC", "docs_coding_guidelines.html#autotoc_md70", [ - [ "Tools", "docs_coding_guidelines.html#autotoc_md71", [ - [ "GBTD / GBMB, Arrays and the \"const\" keyword", "docs_coding_guidelines.html#autotoc_md72", null ] + [ "Understanding the hardware", "docs_coding_guidelines.html#autotoc_md72", null ], + [ "Writing optimal C code for the Game Boy and SDCC", "docs_coding_guidelines.html#autotoc_md73", [ + [ "Tools", "docs_coding_guidelines.html#autotoc_md74", [ + [ "GBTD / GBMB, Arrays and the \"const\" keyword", "docs_coding_guidelines.html#autotoc_md75", null ] ] ], - [ "Avoid Reading from VRAM", "docs_coding_guidelines.html#autotoc_md73", null ], - [ "Variables", "docs_coding_guidelines.html#autotoc_md74", null ], - [ "Code structure", "docs_coding_guidelines.html#autotoc_md75", null ], - [ "GBDK API/Library", "docs_coding_guidelines.html#autotoc_md76", null ], - [ "Toolchain", "docs_coding_guidelines.html#autotoc_md77", null ], - [ "Constants, Signed-ness and Overflows", "docs_coding_guidelines.html#autotoc_md78", null ], - [ "Chars and vararg functions", "docs_coding_guidelines.html#autotoc_md79", [ - [ "Chars", "docs_coding_guidelines.html#autotoc_md80", null ] + [ "Avoid Reading from VRAM", "docs_coding_guidelines.html#autotoc_md76", null ], + [ "Variables", "docs_coding_guidelines.html#autotoc_md77", null ], + [ "Code structure", "docs_coding_guidelines.html#autotoc_md78", null ], + [ "GBDK API/Library", "docs_coding_guidelines.html#autotoc_md79", null ], + [ "Toolchain", "docs_coding_guidelines.html#autotoc_md80", null ], + [ "Constants, Signed-ness and Overflows", "docs_coding_guidelines.html#autotoc_md81", null ], + [ "Chars and vararg functions", "docs_coding_guidelines.html#autotoc_md82", [ + [ "Chars", "docs_coding_guidelines.html#autotoc_md83", null ] ] ] ] ], - [ "When C isn't fast enough", "docs_coding_guidelines.html#autotoc_md81", [ - [ "Reusable Local Labels and Inline ASM", "docs_coding_guidelines.html#autotoc_md82", null ], - [ "Variables and registers", "docs_coding_guidelines.html#autotoc_md83", null ], - [ "Segments / Areas", "docs_coding_guidelines.html#autotoc_md84", null ], - [ "Calling convention", "docs_coding_guidelines.html#autotoc_md85", [ - [ "Banked Calling Convention", "docs_coding_guidelines.html#autotoc_md86", null ] + [ "When C isn't fast enough", "docs_coding_guidelines.html#autotoc_md84", [ + [ "Reusable Local Labels and Inline ASM", "docs_coding_guidelines.html#autotoc_md85", null ], + [ "Variables and registers", "docs_coding_guidelines.html#autotoc_md86", null ], + [ "Segments / Areas", "docs_coding_guidelines.html#autotoc_md87", null ], + [ "Calling convention", "docs_coding_guidelines.html#autotoc_md88", [ + [ "Banked Calling Convention", "docs_coding_guidelines.html#autotoc_md89", null ] ] ] ] ] ] ], [ "ROM/RAM Banking and MBCs", "docs_rombanking_mbcs.html", [ - [ "ROM/RAM Banking and MBCs (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md87", [ - [ "Non-banked cartridges", "docs_rombanking_mbcs.html#autotoc_md88", null ], - [ "MBC Banked cartridges (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md89", null ], - [ "Recommended MBC type", "docs_rombanking_mbcs.html#autotoc_md90", [ - [ "Bank 0 Size Limit and Overflows When Using MBCs", "docs_rombanking_mbcs.html#autotoc_md91", null ], - [ "Conserving Bank 0 for Important Functions and Data", "docs_rombanking_mbcs.html#autotoc_md92", null ] + [ "ROM/RAM Banking and MBCs (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md90", [ + [ "Non-banked cartridges", "docs_rombanking_mbcs.html#autotoc_md91", null ], + [ "MBC Banked cartridges (Memory Bank Controllers)", "docs_rombanking_mbcs.html#autotoc_md92", null ], + [ "Recommended MBC type", "docs_rombanking_mbcs.html#autotoc_md93", [ + [ "Bank 0 Size Limit and Overflows When Using MBCs", "docs_rombanking_mbcs.html#autotoc_md94", null ], + [ "Conserving Bank 0 for Important Functions and Data", "docs_rombanking_mbcs.html#autotoc_md95", null ] ] ] ] ], - [ "Working with Banks", "docs_rombanking_mbcs.html#autotoc_md93", [ - [ "Setting the ROM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md94", null ], - [ "Setting the RAM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md95", null ], - [ "Setting the MBC and number of ROM & RAM banks available", "docs_rombanking_mbcs.html#autotoc_md96", null ], - [ "MBC Type Chart", "docs_rombanking_mbcs.html#autotoc_md97", null ], - [ "Getting Bank Numbers", "docs_rombanking_mbcs.html#autotoc_md98", null ], - [ "Banking and Functions", "docs_rombanking_mbcs.html#autotoc_md99", [ - [ "BANKED/NONBANKED Keywords for Functions", "docs_rombanking_mbcs.html#autotoc_md100", null ], - [ "Banked Function Calls", "docs_rombanking_mbcs.html#autotoc_md101", null ] + [ "Working with Banks", "docs_rombanking_mbcs.html#autotoc_md96", [ + [ "Setting the ROM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md97", null ], + [ "Setting the RAM bank for a Source file", "docs_rombanking_mbcs.html#autotoc_md98", null ], + [ "Setting the MBC and number of ROM & RAM banks available", "docs_rombanking_mbcs.html#autotoc_md99", null ], + [ "MBC Type Chart", "docs_rombanking_mbcs.html#autotoc_md100", null ], + [ "Getting Bank Numbers", "docs_rombanking_mbcs.html#autotoc_md101", null ], + [ "Banking and Functions", "docs_rombanking_mbcs.html#autotoc_md102", [ + [ "BANKED/NONBANKED Keywords for Functions", "docs_rombanking_mbcs.html#autotoc_md103", null ], + [ "Banked Function Calls", "docs_rombanking_mbcs.html#autotoc_md104", null ] ] ], - [ "Const Data (Variables in ROM)", "docs_rombanking_mbcs.html#autotoc_md102", null ], - [ "Variables in RAM", "docs_rombanking_mbcs.html#autotoc_md103", null ], - [ "Far Pointers", "docs_rombanking_mbcs.html#autotoc_md104", null ], - [ "Bank switching", "docs_rombanking_mbcs.html#autotoc_md105", null ], - [ "Wrapper Function for Accessing Banked Data", "docs_rombanking_mbcs.html#autotoc_md106", null ], - [ "Currently active bank: CURRENT_BANK", "docs_rombanking_mbcs.html#autotoc_md107", null ] + [ "Const Data (Variables in ROM)", "docs_rombanking_mbcs.html#autotoc_md105", null ], + [ "Variables in RAM", "docs_rombanking_mbcs.html#autotoc_md106", null ], + [ "Far Pointers", "docs_rombanking_mbcs.html#autotoc_md107", null ], + [ "Bank switching", "docs_rombanking_mbcs.html#autotoc_md108", null ], + [ "Wrapper Function for Accessing Banked Data", "docs_rombanking_mbcs.html#autotoc_md109", null ], + [ "Currently active bank: CURRENT_BANK", "docs_rombanking_mbcs.html#autotoc_md110", null ] ] ], - [ "Auto-Banking", "docs_rombanking_mbcs.html#autotoc_md108", null ], - [ "Errors related to banking (overflow, multiple writes to same location)", "docs_rombanking_mbcs.html#autotoc_md109", null ], - [ "Bank space usage", "docs_rombanking_mbcs.html#autotoc_md110", [ - [ "Other important notes", "docs_rombanking_mbcs.html#autotoc_md111", null ] + [ "Auto-Banking", "docs_rombanking_mbcs.html#autotoc_md111", null ], + [ "Errors related to banking (overflow, multiple writes to same location)", "docs_rombanking_mbcs.html#autotoc_md112", null ], + [ "Bank space usage", "docs_rombanking_mbcs.html#autotoc_md113", [ + [ "Other important notes", "docs_rombanking_mbcs.html#autotoc_md114", null ] ] ], - [ "Banking example projects", "docs_rombanking_mbcs.html#autotoc_md112", null ], - [ "SMS/Game Gear Banking", "docs_rombanking_mbcs.html#autotoc_md113", [ - [ "Auto-Banking", "docs_rombanking_mbcs.html#autotoc_md114", null ] + [ "Banking example projects", "docs_rombanking_mbcs.html#autotoc_md115", null ], + [ "SMS/Game Gear Banking", "docs_rombanking_mbcs.html#autotoc_md116", [ + [ "Auto-Banking", "docs_rombanking_mbcs.html#autotoc_md117", null ] ] ] ] ], [ "Supported Consoles & Cross Compiling", "docs_supported_consoles.html", [ - [ "Consoles Supported by GBDK", "docs_supported_consoles.html#autotoc_md142", null ], - [ "Cross Compiling for Different Consoles", "docs_supported_consoles.html#autotoc_md143", [ - [ "lcc", "docs_supported_consoles.html#autotoc_md144", null ], - [ "sdcc", "docs_supported_consoles.html#autotoc_md145", null ], - [ "Console Port and Platform Settings", "docs_supported_consoles.html#autotoc_md146", null ] + [ "Consoles Supported by GBDK", "docs_supported_consoles.html#autotoc_md146", null ], + [ "Cross Compiling for Different Consoles", "docs_supported_consoles.html#autotoc_md147", [ + [ "lcc", "docs_supported_consoles.html#autotoc_md148", null ], + [ "sdcc", "docs_supported_consoles.html#autotoc_md149", null ], + [ "Console Port and Platform Settings", "docs_supported_consoles.html#autotoc_md150", null ] ] ], - [ "Cross-Platform Constants", "docs_supported_consoles.html#autotoc_md147", [ - [ "Console Identifiers", "docs_supported_consoles.html#autotoc_md148", null ], - [ "Console Hardware Properties", "docs_supported_consoles.html#autotoc_md149", null ] + [ "Cross-Platform Constants", "docs_supported_consoles.html#autotoc_md151", [ + [ "Console Identifiers", "docs_supported_consoles.html#autotoc_md152", null ], + [ "Console Hardware Properties", "docs_supported_consoles.html#autotoc_md153", null ] ] ], - [ "Using|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
Go to the source code of this file.
++Functions | |
| void | duck_io_send_byte (uint8_t tx_byte) |
| uint8_t | duck_io_read_byte_no_timeout (void) |
| void | duck_io_enable_read_byte (void) |
| bool | duck_io_laptop_init (void) |
| bool | duck_io_printer_detected (void) |
| uint8_t | duck_io_printer_type (void) |
| bool | duck_io_read_byte_with_msecs_timeout (uint8_t timeout_len_ms) |
| bool | duck_io_send_byte_and_check_ack_msecs_timeout (uint8_t tx_byte, uint8_t timeout_len_ms, uint8_t expected_reply) |
| bool | duck_io_send_cmd_and_buffer (uint8_t io_cmd) |
| bool | duck_io_send_cmd_and_receive_buffer (uint8_t io_cmd) |
+Variables | |
| volatile bool | duck_io_rx_byte_done |
| volatile uint8_t | duck_io_rx_byte |
| uint8_t | duck_io_rx_buf [DUCK_IO_LEN_RX_MAX] |
| uint8_t | duck_io_rx_buf_len |
| uint8_t | duck_io_tx_buf [DUCK_IO_LEN_TX_MAX] |
| uint8_t | duck_io_tx_buf_len |
The MegaDuck Laptop models (Spanish and German) have several built-in hardware peripherals which are attached via a controller that is communicated with using the serial link port.
+To use any functions here, duck_io_laptop_init() must be called first (just once).
+For the present time all of the serial operations are blocking, they do not return until completed.
+| #define _MEGADUCK_LAPTOP_IO_H | +
| #define DUCK_IO_CMD_INIT_START 0x00u | +
Command to request starting the hardware init counter sequence process
+ +| #define DUCK_IO_CMD_GET_KEYS 0x00u | +
Command to get hardware keyboard data by receiving a multi-byte packet
+ +| #define DUCK_IO_CMD_DONE_OR_OK 0x01u | +
| #define DUCK_IO_CMD_ABORT_OR_FAIL 0x04u | +
| #define DUCK_IO_CMD_PLAY_SPEECH 0x05u | +
| #define DUCK_IO_CMD_RUN_CART_IN_SLOT 0x08u | +
| #define DUCK_IO_CMD_PRINT_INIT_MAYBE_EXT_IO 0x09u | +
Command to init the printer and return status + model type
+ +| #define DUCK_IO_CMD_SET_RTC 0x0Bu | +
Command to set hardware RTC by sending a multi-byte packet
+ +| #define DUCK_IO_CMD_GET_RTC 0x0Cu | +
Command to get hardware RTC by receiving a a multi-byte packet
+ +| #define DUCK_IO_CMD_PRINT_SEND_BYTES 0x11u | +
Send printer data
+ +| #define DUCK_IO_REPLY_BOOT_UNSET 0x00u | +
| #define DUCK_IO_REPLY_BOOT_FAIL 0x01u | +
| #define DUCK_IO_REPLY_BUFFER_XFER_OK 0x01u | +
| #define DUCK_IO_REPLY_SEND_BUFFER_OK 0x03u | +
| #define DUCK_IO_REPLY_BOOT_OK 0x01u | +
| #define DUCK_IO_LEN_KBD_GET 2u | +
Get Keyboard key payload size: 2 bytes Payload (excludes 1 length header byte, 1 byte Checksum)
+ +| #define DUCK_IO_LEN_RTC_GET 8u | +
Get RTC payload size: 8 bytes Payload (excludes 1 length header byte, 1 byte Checksum)
+ +| #define DUCK_IO_LEN_RTC_SET 8u | +
Set RTC payload size: 8 bytes Payload (excludes 1 length header byte, 1 byte Checksum)
+ +| #define DUCK_IO_LEN_PLAY_SPEECH 1u | +
Play Speech payload size: 1 byte Payload (excludes 1 length header byte, 1 byte Checksum)
+ +| #define DUCK_IO_REPLY_NO_CART_IN_SLOT 06u | +
| #define DUCK_IO_LEN_RX_MAX 14u | +
| #define DUCK_IO_LEN_TX_MAX 14u | +
| #define DUCK_IO_TIMEOUT_2_MSEC 2u | +
| #define DUCK_IO_TIMEOUT_100_MSEC 100u | +
| #define DUCK_IO_TIMEOUT_200_MSEC 200u | +
| #define DUCK_IO_SPEECH_CMD_MIN 1 | +
| #define DUCK_IO_SPEECH_CMD_MAX 6 | +
| #define DUCK_IO_RTC_YEAR 0u | +
| #define DUCK_IO_RTC_MON 1u | +
| #define DUCK_IO_RTC_DAY 2u | +
| #define DUCK_IO_RTC_WEEKDAY 3u | +
| #define DUCK_IO_RTC_AMPM 4u | +
| #define DUCK_IO_RTC_HOUR 5u | +
| #define DUCK_IO_RTC_MIN 6u | +
| #define DUCK_IO_RTC_SEC 7u | +
| #define DUCK_IO_KBD_FLAGS 0u | +
| #define DUCK_IO_KBD_KEYCODE 1u | +
| #define DUCK_IO_PRINTER_INIT_MASK 0x01u | +
| #define DUCK_IO_PRINTER_INIT_OK 0x01u | +
| #define DUCK_IO_PRINTER_INIT_FAIL 0x00u | +
| #define DUCK_IO_PRINTER_TYPE_MASK 0x02u | +
| #define DUCK_IO_PRINTER_TYPE_2_PASS 0x00u | +
| #define DUCK_IO_PRINTER_TYPE_1_PASS 0x02u | +
| void duck_io_send_byte | +( | +uint8_t | +tx_byte | ) | ++ |
Sends a byte over serial to the MegaDuck laptop peripheral
+| tx_byte | Byte to send |
| uint8_t duck_io_read_byte_no_timeout | +( | +void | +) | ++ |
Reads a byte over serial from the MegaDuck laptop peripheral with NO timeout
+Returns: the received byte
+If there is no reply then it will hang forever
+ +| void duck_io_enable_read_byte | +( | +void | +) | ++ |
Prepares to receive serial data from the MegaDuck laptop peripheral
+| bool duck_io_laptop_init | +( | +void | +) | ++ |
Performs init sequence over serial with the MegaDuck laptop peripheral
+Returns true if successful, otherwise false
Needs to be done just once any time system is powered on or a cartridge is booted.
+Sends count up sequence + some commands, then waits for a matching count down sequence in reverse.
+ +| bool duck_io_printer_detected | +( | +void | +) | ++ |
Returns whether the MegaDuck Printer was detected during duck_io_laptop_init()
+Returns true if successful, otherwise false
duck_io_laptop_init() must be called first
+ +| uint8_t duck_io_printer_type | +( | +void | +) | ++ |
Returns which type of MegaDuck Printer was detected during duck_io_laptop_init()
+Return value should be one of the following:
duck_io_laptop_init() must be called first
+ +Waits to receive a byte over serial from the MegaDuck laptop peripheral with a timeout
+| timeout_len_ms | Unit size is in msec (100 is about ~ 103 msec or 6.14 frames) |
Returns:
true: Success, received byte will be in duck_io_rx_byte global false: Read timed out with no reply | bool duck_io_send_byte_and_check_ack_msecs_timeout | +( | +uint8_t | +tx_byte, | +
| + | + | uint8_t | +timeout_len_ms, | +
| + | + | uint8_t | +expected_reply | +
| + | ) | ++ |
Sends a byte over over serial to the MegaDuck laptop peripheral and waits for a reply with a timeout
+| tx_byte | Byte to send |
| timeout_len_ms | Unit size is in msec (100 is about ~ 103 msec or 6.14 frames) |
| expected_reply | The expected value of the reply byte |
Returns:
true: Success false: if timed out or reply byte didn't match expected value Sends a command and a multi-byte buffer over serial to the MegaDuck laptop peripheral
+| io_cmd | Command byte to send |
The data should be pre-loaded into these globals:
Returns: true if succeeded
Sends a command and then receives a multi-byte buffer over serial from the MegaDuck laptop peripheral
+| io_cmd | Command byte to send |
If successful, the received data and length will be in these globals:
Returns: true if succeeded, false if failed (could be no reply, failed checksum, etc)
+
|
+ +extern | +
+
|
+ +extern | +
+
|
+ +extern | +
+
|
+ +extern | +
+
|
+ +extern | +
+
|
+ +extern | +
|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
Go to the source code of this file.
+| #define DUCK_IO_KEY_FLAG_KEY_REPEAT 0x01u | +
| #define DUCK_IO_KEY_FLAG_KEY_REPEAT_BIT 0x0u | +
| #define DUCK_IO_KEY_FLAG_CAPSLOCK 0x02u | +
| #define DUCK_IO_KEY_FLAG_CAPSLOCK_BIT 0x1u | +
| #define DUCK_IO_KEY_FLAG_SHIFT 0x04u | +
| #define DUCK_IO_KEY_FLAG_SHIFT_BIT 0x2u | +
| #define DUCK_IO_KEY_FLAG_PRINTSCREEN_LEFT 0x08u | +
| #define DUCK_IO_KEY_FLAG_PRINTSCREEN_LEFT_BIT 0x3u | +
| #define DUCK_IO_KEY_BASE_BIT 0x7u | +
| #define DUCK_IO_KEY_BASE 0x80u | +
| #define DUCK_IO_KEY_F1 0x80u | +
| #define DUCK_IO_KEY_F2 0x84u | +
| #define DUCK_IO_KEY_F3 0x88u | +
| #define DUCK_IO_KEY_F4 0x8Cu | +
| #define DUCK_IO_KEY_F5 0x90u | +
| #define DUCK_IO_KEY_F6 0x94u | +
| #define DUCK_IO_KEY_F7 0x98u | +
| #define DUCK_IO_KEY_F8 0x9Cu | +
| #define DUCK_IO_KEY_F9 0xA0u | +
| #define DUCK_IO_KEY_F10 0xA4u | +
| #define DUCK_IO_KEY_F11 0xA8u | +
| #define DUCK_IO_KEY_F12 0xACu | +
| #define DUCK_IO_KEY_ESCAPE 0x81u | +
| #define DUCK_IO_KEY_1 0x85u | +
| #define DUCK_IO_KEY_2 0x89u | +
| #define DUCK_IO_KEY_3 0x8Du | +
| #define DUCK_IO_KEY_4 0x91u | +
| #define DUCK_IO_KEY_5 0x95u | +
| #define DUCK_IO_KEY_6 0x99u | +
| #define DUCK_IO_KEY_7 0x9Du | +
| #define DUCK_IO_KEY_8 0xA1u | +
| #define DUCK_IO_KEY_9 0xA5u | +
| #define DUCK_IO_KEY_0 0xA9u | +
| #define DUCK_IO_KEY_SINGLE_QUOTE 0xADu | +
| #define DUCK_IO_KEY_EXCLAMATION_FLIPPED 0xB1u | +
| #define DUCK_IO_KEY_BACKSPACE 0xB5u | +
| #define DUCK_IO_KEY_HELP 0x82u | +
| #define DUCK_IO_KEY_Q 0x86u | +
| #define DUCK_IO_KEY_W 0x8Au | +
| #define DUCK_IO_KEY_E 0x8Eu | +
| #define DUCK_IO_KEY_R 0x92u | +
| #define DUCK_IO_KEY_T 0x96u | +
| #define DUCK_IO_KEY_Y 0x9Au | +
| #define DUCK_IO_KEY_U 0x9Eu | +
| #define DUCK_IO_KEY_I 0xA2u | +
| #define DUCK_IO_KEY_O 0xA6u | +
| #define DUCK_IO_KEY_P 0xAAu | +
| #define DUCK_IO_KEY_BACKTICK 0xAEu | +
| #define DUCK_IO_KEY_RIGHT_SQ_BRACKET 0xB2u | +
| #define DUCK_IO_KEY_ENTER 0xB6u | +
| #define DUCK_IO_KEY_A 0x87u | +
| #define DUCK_IO_KEY_S 0x8Bu | +
| #define DUCK_IO_KEY_D 0x8Fu | +
| #define DUCK_IO_KEY_F 0x93u | +
| #define DUCK_IO_KEY_G 0x97u | +
| #define DUCK_IO_KEY_H 0x9Bu | +
| #define DUCK_IO_KEY_J 0x9Fu | +
| #define DUCK_IO_KEY_K 0xA3u | +
| #define DUCK_IO_KEY_L 0xA7u | +
| #define DUCK_IO_KEY_N_TILDE 0xABu | +
| #define DUCK_IO_KEY_U_UMLAUT 0xAFu | +
| #define DUCK_IO_KEY_O_OVER_LINE 0xB3u | +
| #define DUCK_IO_KEY_Z 0xB8u | +
| #define DUCK_IO_KEY_X 0xBCu | +
| #define DUCK_IO_KEY_C 0xC0u | +
| #define DUCK_IO_KEY_V 0xC4u | +
| #define DUCK_IO_KEY_B 0xC8u | +
| #define DUCK_IO_KEY_N 0xCCu | +
| #define DUCK_IO_KEY_M 0xD0u | +
| #define DUCK_IO_KEY_COMMA 0xD4u | +
| #define DUCK_IO_KEY_PERIOD 0xD8u | +
| #define DUCK_IO_KEY_DASH 0xDCu | +
| #define DUCK_IO_KEY_DELETE 0xE0u | +
| #define DUCK_IO_KEY_SPACE 0xB9u | +
| #define DUCK_IO_KEY_LESS_THAN 0xBDu | +
| #define DUCK_IO_KEY_PAGE_UP 0xC1u | +
| #define DUCK_IO_KEY_PAGE_DOWN 0xC5u | +
| #define DUCK_IO_KEY_MEMORY_MINUS 0xC9u | +
| #define DUCK_IO_KEY_MEMORY_PLUS 0xCDu | +
| #define DUCK_IO_KEY_MEMORY_RECALL 0xD1u | +
| #define DUCK_IO_KEY_SQUAREROOT 0xD5u | +
| #define DUCK_IO_KEY_MULTIPLY 0xD9u | +
| #define DUCK_IO_KEY_ARROW_DOWN 0xDDu | +
| #define DUCK_IO_KEY_MINUS 0xE1u | +
| #define DUCK_IO_KEY_ARROW_LEFT 0xE5u | +
| #define DUCK_IO_KEY_EQUALS 0xE9u | +
| #define DUCK_IO_KEY_ARROW_RIGHT 0xEDu | +
| #define DUCK_IO_KEY_DIVIDE 0xE4u | +
| #define DUCK_IO_KEY_ARROW_UP 0xE8u | +
| #define DUCK_IO_KEY_PLUS 0xECu | +
| #define DUCK_IO_KEY_PIANO_DO_SHARP 0xBAu | +
| #define DUCK_IO_KEY_PIANO_RE_SHARP 0xBEu | +
| #define DUCK_IO_KEY_PIANO_FA_SHARP 0xC6u | +
| #define DUCK_IO_KEY_PIANO_SOL_SHARP 0xCAu | +
| #define DUCK_IO_KEY_PIANO_LA_SHARP 0xCEu | +
| #define DUCK_IO_KEY_PIANO_DO_2_SHARP 0xD6u | +
| #define DUCK_IO_KEY_PIANO_RE_2_SHARP 0xDAu | +
| #define DUCK_IO_KEY_PRINTSCREEN_RIGHT 0xDEu | +
| #define DUCK_IO_KEY_PIANO_FA_2_SHARP 0xE2u | +
| #define DUCK_IO_KEY_PIANO_SOL_2_SHARP 0xE6u | +
| #define DUCK_IO_KEY_PIANO_LA_2_SHARP 0xEAu | +
| #define DUCK_IO_KEY_PIANO_DO 0xBBu | +
| #define DUCK_IO_KEY_PIANO_RE 0xBFu | +
| #define DUCK_IO_KEY_PIANO_MI 0xC3u | +
| #define DUCK_IO_KEY_PIANO_FA 0xC7u | +
| #define DUCK_IO_KEY_PIANO_SOL 0xCBu | +
| #define DUCK_IO_KEY_PIANO_LA 0xCFu | +
| #define DUCK_IO_KEY_PIANO_SI 0xD3u | +
| #define DUCK_IO_KEY_PIANO_DO_2 0xD7u | +
| #define DUCK_IO_KEY_PIANO_RE_2 0xDBu | +
| #define DUCK_IO_KEY_PIANO_MI_2 0xDFu | +
| #define DUCK_IO_KEY_PIANO_FA_2 0xE3u | +
| #define DUCK_IO_KEY_PIANO_SOL_2 0xE7u | +
| #define DUCK_IO_KEY_PIANO_LA_2 0xEBu | +
| #define DUCK_IO_KEY_PIANO_SI_2 0xEFu | +
| #define DUCK_IO_KEY_LAST_KEY (DUCK_IO_KEY_PIANO_SI_2u) | +
| #define DUCK_IO_KEY_MAYBE_SYST_CODES_START 0xF0u | +
| #define DUCK_IO_KEY_MAYBE_RX_NOT_A_KEY 0xF6u | +
|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
Go to the source code of this file.
++Macros | |
| #define | MEGADUCK_HANDHELD_STANDARD 0u |
| #define | MEGADUCK_LAPTOP_SPANISH 1u |
| #define | MEGADUCK_LAPTOP_GERMAN 2u |
+Functions | |
| uint8_t | duck_check_model (void) |
| #define MEGADUCK_HANDHELD_STANDARD 0u | +
| #define MEGADUCK_LAPTOP_SPANISH 1u | +
| #define MEGADUCK_LAPTOP_GERMAN 2u | +
| uint8_t duck_check_model | +( | +void | +) | ++ |
Returns which MegaDuck Model the program is being run on
+Possible models are:
This detection should be called immediately at the start of the program for most reliable results, since it relies on inspecting uncleared VRAM contents.
+It works by checking for distinct font VRAM Tile Patterns (which aren't cleared before cart program launch) between the Spanish and German Laptop models which have slightly different character sets.
+So VRAM must not be cleared or modified at program startup until after this function is called (not by the crt0.s, not by the program itself).
+|
+ GBDK 2020 Docs
+ 4.4.0
+
+ API Documentation for GBDK 2020
+ |
+
Macro returns TRUE if device supports color (it always does on MSX)
+| #define VBL_DONE _vbl_done | +
Sets the OAM Property Flags of sprite number nb to those defined in prop.
Increments once per Frame
Will wrap around every ~18 minutes (unsigned 16 bits = 65535 / 60 / 60 = 18.2)
+ + + +
+
|
+ +extern | +
Flag indicating the VBlank ISR has run
+Flag gets cleared at the start of vsync() / wait_vbl_done() and set in the default VBlank ISR handler.
+Functions | |
| __SHADOW_REG | bkg_scroll_y |
| __SHADOW_REG | _lcd_scanline |
| volatile UBYTE | TIMA_REG |
| volatile UBYTE | TMA_REG |
| volatile UBYTE | TAC_REG |
Defines that let the NES hardware registers be accessed from C.
@@ -602,6 +626,122 @@ Variables| #define SCY_REG bkg_scroll_y | +
Scroll Y
+ +| #define rSCY SCY_REG | +
| #define SCX_REG bkg_scroll_x | +
Scroll X
+ +| #define rSCX SCX_REG | +
| #define LY_REG _lcd_scanline | +
LCDC Y-coordinate
+ +| #define rLY LY_REG | +
| #define LYC_REG _lcd_scanline | +
LY compare
+ +| #define rLYC LYC_REG | +
| __SHADOW_REG _lcd_scanline | +
+
|
+ +extern | +
Timer counter
+ +
+
|
+ +extern | +
Timer modulo
+ +
+
|
+ +extern | +
Timer control
+A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.
See the main metasprite docs under the game Boy platform for additional details.
diff --git a/docs/api/nes_2metasprites_8h_source.html b/docs/api/nes_2metasprites_8h_source.html index ca71ea69..d24ef776 100644 --- a/docs/api/nes_2metasprites_8h_source.html +++ b/docs/api/nes_2metasprites_8h_source.html @@ -29,7 +29,7 @@| #define TIMER_VBLANK_PARITY_MODE_SYSTEM_60HZ 0x78 | +
| #define TIMER_VBLANK_PARITY_MODE_SYSTEM_50HZ 0x5D | +
Defines how palette number is encoded in OAM. Required for the png2asset tool's metasprite output.
+| #define EMPTY_IFLAG 0x00U | +
Disable calling of interrupt service routines
+ +| #define VBL_IFLAG 0x01U | +
VBlank Interrupt occurs at the start of the vertical blank.
+During this period the video ram may be freely accessed.
| #define LCD_IFLAG 0x02U | +
LCD Interrupt when triggered by the STAT register.
| #define TIM_IFLAG 0x04U | +
Timer Interrupt when the timer TIMA_REG overflows.
Removes the LCD interrupt handler.
| void remove_TIM | +( | +int_handler | +h | ) | ++ |
Removes the TIM interrupt handler.
Adds a LCD interrupt handler.
+ + + +| void add_TIM | +( | +int_handler | +h | ) | ++ |
Adds a timer interrupt handler.
+Can not be used together with add_low_priority_TIM
+This interrupt handler is invoked at the end of the NMI handler for gbdk-nes, after first processing the registers writes done by the VBL and and LCD handlers. It is therefore currently limited to 60Hz / 50Hz (depending on system).
+Enables unmasked interrupts
Disables interrupts
This function may be called as many times as you like; however the first call to enable_interrupts will re-enable them.
-| void set_interrupts | +( | +uint8_t | +flags | ) | ++ |
Sets the interrupt mask to flags.
| flags | A logical OR of *_IFLAGS |
Clears any pending interrupts and sets the interrupt mask register IO to flags.
| flags | A logical OR of *_IFLAGS |
+
|
+ +inline | +
Performs a soft reset.
+For the Game Boy and related it does this by jumping to address 0x0150 which is in crt0.s (the c-runtime that executes before main() is called).
+This performs various startup steps such as resetting the stack, clearing WRAM and OAM, resetting initialized variables and some display registers (scroll, window, LCDC), etc.
+This is not the same a hard power reset.
Sets the OAM Property Flags of sprite number nb to those defined in prop.
Variables | |
| uint16_t | __rand_seed |
| uint8_t | c |
Random generator using the linear congruential method
@@ -182,12 +184,12 @@ VariablesThe seed should be different each time, otherwise the same pseudo-random sequence will be generated.
One way to do this is sampling (DIV_REG) up to 2 times (high byte of seed value then the low byte) at variable, non-deterministic points in time (such as when the player presses buttons on the title screen or in a menu).
It only needs to be called once to be initialized.
- + - -Returns a random byte (8 bit) value.
-initrand() should be used to initialize the random number generator before using rand()
+initrand() should be used to initialize the random number generator before using rand()
Returns a random word (16 bit) value.
-initrand() should be used to initialize the random number generator before using rand()
+initrand() should be used to initialize the random number generator before using rand()
Note: initarand() calls initrand() with the same seed value, and uses rand() to initialize the random generator.
-Note: initarand() calls initrand() with the same seed value, and uses rand() to initialize the random generator.
+Returns a random number generated with the linear lagged additive method.
-initarand() should be used to initialize the random number generator before using arand()
+initarand() should be used to initialize the random number generator before using arand()
| uint8_t c | +
+
|
+ +extern | +
Timer counter
+ +
+
|
+ +extern | +
Timer modulo
+ +
+
|
+ +extern | +
Timer control
+A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.
See the main metasprite docs under the game Boy platform for additional details.
-A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.
See the main metasprite docs under the game Boy platform for additional details.
@@ -289,8 +289,8 @@ Metasprite supportMacro returns TRUE if device supports color (it always does on SMS/GG)
+| #define VBL_DONE _vbl_done | +
Increments once per Frame
Will wrap around every ~18 minutes (unsigned 16 bits = 65535 / 60 / 60 = 18.2)
+
+
|
+ +extern | +
Flag indicating the VBlank ISR has run
+Flag gets cleared at the start of vsync() / wait_vbl_done() and set in the default VBlank ISR handler.
+The string may be of the format
i.e. any number of spaces, an optional + or -, then an arbitrary number of digits.
The result is undefined if the number doesnt fit in an int.
Returns: Int value of string
diff --git a/docs/api/stdlib_8h_source.html b/docs/api/stdlib_8h_source.html index 0cc355af..71748f21 100644 --- a/docs/api/stdlib_8h_source.html +++ b/docs/api/stdlib_8h_source.html @@ -29,7 +29,7 @@Macros | |
| #define | __GBDK_VERSION 430 |
| #define | __GBDK_VERSION 440 |
| #define __GBDK_VERSION 430 | +#define __GBDK_VERSION 440 |