diff --git a/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.html b/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.html index c137dabf..272d74ca 100644 --- a/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.html +++ b/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.html @@ -93,6 +93,8 @@ $(document).ready(function(){initNavTree('dir_af92cb28f7f9115544c8de6a3c7e6d6b.h + + diff --git a/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.js b/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.js index a844df2d..22ff93fa 100644 --- a/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.js +++ b/docs/api/dir_af92cb28f7f9115544c8de6a3c7e6d6b.js @@ -1,5 +1,6 @@ var dir_af92cb28f7f9115544c8de6a3c7e6d6b = [ + [ "bcd.h", "nes_2bcd_8h.html", "nes_2bcd_8h" ], [ "hardware.h", "nes_2hardware_8h.html", "nes_2hardware_8h" ], [ "metasprites.h", "nes_2metasprites_8h.html", "nes_2metasprites_8h" ], [ "nes.h", "nes_8h.html", "nes_8h" ], diff --git a/docs/api/docs_example_programs.html b/docs/api/docs_example_programs.html index 0042e3e0..83104f57 100644 --- a/docs/api/docs_example_programs.html +++ b/docs/api/docs_example_programs.html @@ -91,19 +91,19 @@ $(document).ready(function(){initNavTree('docs_example_programs.html',''); initR

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.

-

+

banks (various projects)

There are several different projects showing how to use ROM banking with GBDK.

-

+

comm

Illustrates how to use communication routines.

-

+

crash

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.

-

+

colorbar

The colorbar program, written by Mr. N.U. of TeamKNOx, illustrates the use of colors on a Color GameBoy.

-

+

dscan

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
-

+

filltest

Demonstrates various graphics routines.

-

+

fonts

Examples of how to work with the built in font and printing features.

-

+

galaxy

A C translation of the space.s assembly program.

-

+

gb-dtmf

The gb-dtmf, written by Osamu Ohashi, is a Dual Tone Multi-Frequency (DTMF) generator.

-

+

gbdecompress

Demonstrates using gbdecompress to load a compressed tile set into VRAM.

-

+

irq

Illustrates how to install interrupt handlers.

-

+

large map

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.

-

+

metasprites

Demonstrates using the metasprite features to move and animate a large sprite.

-

+

lcd isr wobble

An example of how to use the LCD ISR for visual special effects.

-

+

paint

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
-

+

rand

The rand program, written by Luc Van den Borre, illustrates the use of the GBDK random generator.

-

+

ram_fn

The ram_fn example illustrates how to copy functions to RAM or HIRAM, and how to call them from C.

-

+

rpn

A basic RPN calculator. Try entering expressions like 12 134* and then 1789+.

-

+

samptest

Demonstration of playing a sound sample.

-

+

sgb (various)

A collection of examples showing how to use the Super Game Boy API features.

-

+

sound

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
-

+

space

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
-

+

templates

Two basic template examples are provided as a starting place for writing your GBDK programs.

diff --git a/docs/api/docs_faq.html b/docs/api/docs_faq.html index 0c1d7d04..f38ca8db 100644 --- a/docs/api/docs_faq.html +++ b/docs/api/docs_faq.html @@ -91,7 +91,7 @@ $(document).ready(function(){initNavTree('docs_faq.html',''); initResizable(); }

-

+

General

-

+

Licensing

-

+

Graphics and Resources

-

+

ROM Header Settings

-

+

Editors

-

+

Errors and Warnings

-

+

Debugging / Compiling / Toolchain

This section contains information that may be useful to know or important when upgrading to a newer GBDK release.

-

+

GBDK-2020 versions

-

+

Porting to GBDK-2020 4.3.0

    -
  • GBDK now requires ~SDCC 4.4 or higher with GBDK-2020 patches for the z80 and NES
  • +
  • GBDK now requires ~SDCC 4.4.0 or higher with GBDK-2020 patches for the z80 and NES
  • Changed to new calling convention for printf(), sprintf(), abs()
  • Changed to new SDCC calling convention for set_bkg_tile_xy(), set_win_tile_xy()
  • +
  • The SDCC object file format (.o, .rel files) changed from XL3 (24 bit addresses) to XL4 (32 bit addresses)
      +
    • Bankpack now supports both
    • +
    +
  • Recommend using:
  • +
  • set_sprite_palette() now indexes from 0..3 instead of 4..7
  • +
  • png2asset:
      +
    • If using either -bpp 1 or -pack_mode 1bpp then the other is auto-enabled
    • +
    • Significant bug fixes and changes, check to make sure output is as expected
    -

    +

  • +
+

Porting to GBDK-2020 4.2.0

  • GBDK now requires ~SDCC 4.3 or higher with GBDK-2020 patches for the z80 and NES
  • @@ -126,12 +136,12 @@ Porting to GBDK-2020 4.2.0
-

+

Porting to GBDK-2020 4.1.1

  • No significant changes required
-

+

Porting to GBDK-2020 4.1.0

  • GBDK now requires SDCC 4.2 or higher with GBDK-2020 patches for the z80 linker
  • @@ -161,7 +171,7 @@ Porting to GBDK-2020 4.1.0
-

+

Porting to GBDK-2020 4.0.6

  • Renamed bgb_emu.h to emu_debug.h and BGB_* functions to EMU_*
      @@ -169,7 +179,7 @@ Porting to GBDK-2020 4.0.6
-

+

Porting to GBDK-2020 4.0.5

  • GBDK now requires SDCC 12259 or higher with GBDK-2020 patches
  • @@ -186,18 +196,18 @@ Porting to GBDK-2020 4.0.5
-

+

Porting to GBDK-2020 4.0.4

  • GBDK now requires SDCC 12238 or higher
  • Made sample.h, cgb.h and sgb.h independent from gb.h
-

+

Porting to GBDK-2020 4.0.3

  • No significant changes required
-

+

Porting to GBDK-2020 4.0.2

  • The default font has been reduced from 256 to 96 characters.
      @@ -206,7 +216,7 @@ Porting to GBDK-2020 4.0.2
-

+

Porting to GBDK-2020 4.0.1

  • Important! : The WRAM memory region is no longer automatically initialized to zeros during startup.
      @@ -218,7 +228,7 @@ Porting to GBDK-2020 4.0.1
    • In .ihx files, multiple writes to the same ROM address are now warned about using ihxcheck.
    • set_*_tiles() now wrap maps around horizontal and vertical boundaries correctly. Code relying on it not wrapping correctly may be affected.
    -

    +

    Porting to GBDK-2020 4.0

    • GBDK now requires SDCC 4.0.3 or higher
    • @@ -230,22 +240,22 @@ Porting to GBDK-2020 4.0
    • Setting 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.
    • OAM symbol has been renamed to _shadow_OAM, that allows accessing shadow OAM directly from C code
    -

    +

    Porting to GBDK-2020 3.2

    • No significant changes required
    -

    +

    Porting to GBDK-2020 3.1.1

    • No significant changes required
    -

    +

    Porting to GBDK-2020 3.1

    -

    +

    Porting to GBDK-2020 3.0.1

    • LCC was upgraded to use SDCC v4.0. Makefile changes may be required
        @@ -262,9 +272,9 @@ Porting to GBDK-2020 3.0.1

      -

      +

      Historical GBDK versions

      -

      +

      GBDK 1.1 to GBDK 2.0

      • Change your int variables to long if they have to be bigger than 255. If they should only contain values between 0 and 255, use an unsigned int.
      • diff --git a/docs/api/docs_releases.html b/docs/api/docs_releases.html index e323a7e3..f5cca509 100644 --- a/docs/api/docs_releases.html +++ b/docs/api/docs_releases.html @@ -91,12 +91,12 @@ $(document).ready(function(){initNavTree('docs_releases.html',''); initResizable

The GBDK-2020 releases can be found on Github: https://github.com/gbdk-2020/gbdk-2020/releases

-

+

GBDK-2020 Release Notes

-

+

GBDK-2020 4.3.0

~2024/05

    -
  • Includes SDCC version ~4.4 (~14635) with GBDK-2020 patches for Z80 and NES
      +
    • Includes SDCC version ~4.4.0 (14650) with GBDK-2020 patches for Z80 and NES @@ -115,16 +115,19 @@ GBDK-2020 4.3.0
    • Changed EMU_printf() to remove dependency on stdio.h added similar EMU_fmtbuf()
    • Fixed emu_debug.h macros missing a trailing space
    • NES
        +
      • Many library improvements
      • Added PAL support
      • +
      • Added BCD support
      • +
      • Added deferred hblank system for fake LCD ISRs
      • Fixed _map_tile_offset not being applied for set_bkg_based_tiles()
      • Fixed VRAM transfer buffer bug (ensure stack page cleared on reset)
      • Fixed support for 4-player controllers using fourscore
      • +
      • Fixed set_sprite_palette() to index from 0..3 instead of 4..7
      • Updated libc to latest from sdcc 4.4.0
    • SMS/GG
    • -
    • Changed to allow nested locking of the shadow SAT copying on VBlank (also for MSX)
    • -
    • Changed VDP to reduce chances of dangerous ISR nesting (see SDCC issue https://sourceforge.net/p/sdcc/bugs/3721/) (also for MSX)
    • Optimized native tile data loading routines
    • +
    • Improved VDP_WRITE_DATA macro so it does not need di/ei protection
    • +
    • Improved palette initialization in crt0
    • Fixed tilemap wrapping over the low bound of the VDP name table
    • -
    • Fixed waitpad() (also for MSX)
    • Fixed scroll_sprite()
    • Fixed missing sms.h in sms/metasprites.h
    • -
    • Fixed return result of "`set_tile x, y`" family functions (also for MSX)
    • +
    • Fixed scroll glitch due to accessing VDP too fast
    • +
    +
  • +
  • Z80 shared SMS/GG/MSX
      +
    • Added DIV_REG emulation for the Z80 systems, may be useful for seeding RNG
    • +
    • Changed VDP to reduce chances of dangerous ISR nesting (see SDCC issue https://sourceforge.net/p/sdcc/bugs/3721/)
    • +
    • Changed to allow nested locking of the shadow SAT copying on VBlank
    • +
    • Optimized memcpy() for larger amounts of data
    • +
    • Fixed waitpad()
    • +
    • Fixed return result of "`set_tile x, y`" family functions
    • +
    • Fixed to not allow interrupts to fire durint crt0 initialization code
    • +
    +
  • +
  • MSXDOS
      +
    • Fixed .VDP_COLORDATA2 assembly definition
  • Game Boy
      @@ -185,6 +201,7 @@ GBDK-2020 4.3.0
  • Changed -use_structs to use designated initializers
  • +
  • Changed if using either -bpp 1 or -pack_mode 1bpp then the other is auto-enabled
  • Fixed garbage in unused colors of palettes (set unused colors to black)
  • Fixed -bin mode not honoring -tiles_only and -maps_only
  • Fixed segfault and wrong data size for -pack_mode sgb + -bin
  • @@ -200,6 +217,7 @@ GBDK-2020 4.3.0
  • bankpack
    • Added -banktype= to allow forcing a bank type to CODE or LIT before packing starts
    • +
    • Added support for XL4 (32 bit addresses) object file format (in addition to existing XL3)
    • Changed minimum bank for auto packing from 1 to 0 (required for the NES)
  • @@ -221,6 +239,7 @@ GBDK-2020 4.3.0
  • Fixes for SMS/GG: Fonts, Large Map, gbdecompress
  • +
  • Fixed NES version of Text Scroller to have splits as other platforms
  • Fixed Simple Physics: joypad input caching was wrong
  • Fixed Banks Non-Intrinsic: mismatched SRAM banks for final calculation, improved naming
  • Removed Analogue Pocket examples that were just duplicates of Game Boy ones
  • @@ -233,7 +252,7 @@ GBDK-2020 4.3.0 -

    +

    GBDK-2020 4.2.0

    2023/08

    • Includes SDCC version ~4.3 with GBDK-2020 patches for Z80 and NES
        @@ -331,7 +350,7 @@ GBDK-2020 4.2.0
    -

    +

    GBDK-2020 4.1.1

    2022/11

    • Includes SDCC version 13350 with GBDK-2020 patches for Z80
    • @@ -340,7 +359,7 @@ GBDK-2020 4.1.1
    -

    +

    GBDK-2020 4.1.0

    2022/10

    • Includes SDCC version 13350 with GBDK-2020 patches for Z80
    • @@ -459,7 +478,7 @@ GBDK-2020 4.1.0
    -

    +

    GBDK-2020 4.0.6

    2022/02

    • Includes SDCC version 12539 with GBDK-2020 patches for Z80
    • @@ -531,7 +550,7 @@ GBDK-2020 4.0.6
    -

    +

    GBDK-2020 4.0.5

    2021/09

    • Includes SDCC version 12539 with GBDK-2020 patches for Z80
    • @@ -616,7 +635,7 @@ GBDK-2020 4.0.5
    -

    +

    GBDK-2020 4.0.4

    2021/06

    • Library
        @@ -669,7 +688,7 @@ GBDK-2020 4.0.4
    -

    +

    GBDK-2020 4.0.3

    2021/03

    • Library
        @@ -705,7 +724,7 @@ GBDK-2020 4.0.3
    -

    +

    GBDK-2020 4.0.2

    2021/01/17

    • Includes SDCC snapshot build version 12016 (has a fix for duplicate debug symbols generated from inlined header functions which GBDK 4.0+ uses)
    • @@ -729,7 +748,7 @@ GBDK-2020 4.0.2
    • Examples: Added bgb debug example
    -

    +

    GBDK-2020 4.0.1

    2020/11/14

    • Updated API documentation
    • @@ -755,7 +774,7 @@ GBDK-2020 4.0.1
    -

    +

    GBDK-2020 4.0

    2020/10/01

    • GBDK now requires SDCC 4.0.3 or higher, that has fully working toolchain. Old link-gbz80 linker is not used anymore, sdldgb and makebin are used to link objects and produce binary roms; maccer tool is no longer needed either
        @@ -784,19 +803,19 @@ GBDK-2020 4.0
    -

    +

    GBDK-2020 3.2

    2020/06/05

    • Fixed OAM initialization that was causing a bad access to VRAM
    • Interrupt handlers now wait for lcd controller mode 0 or 1 by default to prevent access to inaccessible VRAM in several functions (like set_bkg_tiles)
    • Several optimizations here and there
    -

    +

    GBDK-2020 3.1.1

    2020/05/17

    • Fixed issues with libgcc_s_dw2-1.dll
    -

    +

    GBDK-2020 3.1

    2020/05/16

    • Banked functions are working! The patcher is fully integrated in link-gbz80, no extra tools are needed. It is based on Toxa's work
        @@ -814,20 +833,20 @@ GBDK-2020 3.1
    -

    +

    GBDK-2020 3.0.1

    2020/04/12

    • Updated SDCC to v.4.0
    • Updated LCC to work with the new compiler
    -

    +

    GBDK-2020 3.0

    2020/04/12

    • Initial GBDK-2020 release Updated SDCC to v4.0 The new linker is not working so the old version is still there There is an issue with sdagb compiling drawing.s (the JP in line 32 after ".org .MODE_TABLE+4*.G_MODE" it's writing more than 4 bytes invading some addresses required by input.s:41) Because of this, all .s files in libc have been assembled with the old as-gbz80 and that's why it is still included
    -

    +

    Historical GBDK Release Notes

    -

    +

    GBDK 2.96

    17 April, 2000 Many changes.

    • Code generated is now much more reliable and passes all of sdcc's regression suite.
    • @@ -835,7 +854,7 @@ GBDK 2.96
    • Added full 32 bit long support.
    • Still no floating pt support.
    -

    +

    GBDK 2.95-3

    19th August, 2000

      @@ -845,7 +864,7 @@ GBDK 2.95-3

    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.

    -

    +

    GBDK 2.95-2

    5th August, 2000 Just a small update. From the README:

      @@ -854,7 +873,7 @@ GBDK 2.95-2
    • Changed the ways globals are exported, reducing the amount of extra junk linked in.
    • Turned on the optimisations in flex. Large constant arrays like tile data should compile a bit faster.
    -

    +

    GBDK 2.95

    22nd July, 2000

    • Fixed 'a << c' for c = [9..15]
    • @@ -874,7 +893,7 @@ GBDK 2.95

      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

      -

      +

      GBDK 2.94

      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 :)

        @@ -890,7 +909,7 @@ GBDK 2.94
    -

    +

    GBDK 2.93

    6th April, 2000 From the README

      @@ -902,7 +921,7 @@ GBDK 2.93
    • The dscan demo now fully works (with a hack :)
    • There is a bug with cached computed values which are later used as pointers. When the value is first used as a BYTE arg, then later as a pointer the pointer fails as the high byte was never computed and is now missing. A temporary fix is to declare something appropriate as 'volatile' to stop the value being cached. See dscan.c/bombs() for an example.
    -

    +

    GBDK 2.92-2 for win32

    26th March, 2000 This is a maintenance release for win32 which fixes some of the niggly install problems, especially:

    • win32 only. Takes care of some of the install bugs, including:
        @@ -918,7 +937,7 @@ GBDK 2.92-2 for win32

        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.

        -

        +

        GBDK 2.92

        8th March, 2000 Better than 2.91 :). Can now be installed anywhere. All the demos work. See the README for more.

        • All the examples now work (with a little bit of patching :)
            @@ -931,7 +950,7 @@ GBDK 2.92
        -

        +

        GBDK 2.91

        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.

        @@ -940,27 +959,27 @@ GBDK 2.91

        8th 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.

        -

        +

        GBDK 2.1.5

        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.0b11 (DOS binary only) - 24 November 1997

        • Fixed another bug in code generation, that could happen when performing logical operations on 1-byte variables.
        -

        +

        GBDK 2.0b10 (DOS binary only) - 6 November 1997

        • Fixed a nasty bug in code generation, that could happen when performing arithmetic operations on 1-byte variables.
        • Changed the name of same files of the gb-dtmf example so that it compiles on DOS.
        -

        +

        GBDK 2.0b9 (DOS binary only)

        • Several bug fixes in the compiler and in the libraries.
        -

        +

        GBDK 2.0b8 (DOS binary only)

        • Limited all file names to 8 characters to solve problems on DOS.
        • @@ -969,14 +988,14 @@ GBDK 2.0b8 (DOS binary only)
        • It is possible to specify the name of the program (to be written in the image header) at link time using the -Wl-yn="XXX" flag (where X is the name of the program, which can contain up to 16 characters in quotes, including spaces; on Unix, depending on your shell, you must add backslashes before quotes and spaces like in -Wl-yn="My\ Game").
        • Several bug fixes in the compiler.
        -

        +

        GBDK 2.0b7 (DOS binary only)

        • GBDK now uses a pre-release of lcc 4.1 (DOS binary only), that fixes a couple of problems in code generation.
        • A couple of important points have been documented in the GBDK Programming Guidelines and Known Problems sections.
        • Several improvements and optimizations to the code generator.
        -

        +

        GBDK 2.0b6

        • Added a peephole optimizer (with few rules at the moment).
        • @@ -988,7 +1007,7 @@ GBDK 2.0b6
        • Added RAM banks support (switch_ram_bank() function). The switch_bank() function has been renamed to switch_rom_bank(). The banks.c example has been updated. The flags for generating multiple bank images have been modified.
        • It is possible to set the sprite ram location at link time using the -Wl-g.OAM=# flag (where # is the address of the sprite ram). The sprite ram address must begin at an address multiple of 0x100, and is 0xA0 bytes long.
        -

        +

        GBDK 2.0b5

        • New documentation (not finished yet).
        • @@ -998,26 +1017,26 @@ GBDK 2.0b5
        • Added a game (Deep Scan) written by a friend of Osamu.
        • Modified the delay() function so that it takes a long parameter. It can be used to wait between 1 and 65536 milliseconds (0 = 65536). The pause() function has been removed.
        -

        +

        GBDK 2.0b4

        • Fixed a bug that could generate wrong code when using hexadecimal constants.
        • A new example (galaxy.c) has been added. It is the C version of the space.s example. sprite.c has been removed.
        • Most of the libraries have been split into small modules for reducing final code size.
        -

        +

        GBDK 2.0b3

        • GBDK can generate multiple-banks images, i.e. images greater than 32kB (see the banks example).
        • It is possible to set the stack pointer at link time using the -Wl-g.STACK=# flag (where # is the address of the stack pointer). Several functions (e.g. show_bkg()) have been changed into macros (e.g. SHOW_BKG). The delay() function waits exactly 1 millisecond, and the pause() waits 256 milliseconds. Linking with the standard libraries is no more required. The lib/gb.lib (lib\gb.lib on DOS) text file contains a list of modules in which to look for undefined symbols. The linker will parse this file, and link your code with the required modules only. The stdio library has been split in several object files, and only necessary modules will be added to your code, thus reducing its size. The GBDK distribution can be located anywhere in your system if you use the -Wo-lccdir=GBDK-DIR flag when invoking lcc. Bug fixes.
        -

        +

        GBDK 2.0b2

        • Lots of bug fixes.
        • GBDK has to be in the \GBDK-2.0 directory on DOS machines.
        -

        +

        GBDK 2.0b1

        • The code generator has been completely rewritten with the new version of lcc. It produces much smaller and more efficient code. The size of the code is generally between 20 and 50% smaller. A number of small optimizations are still to be done.
        • @@ -1030,7 +1049,7 @@ GBDK 2.0b1
        • The linker generates the complement checksum correctly now.
        • The libraries and example programs have been modified for the new code generator.
        -

        +

        GBDK 1.1

        • Removed Xloadimage from the GBDK distribution. It is now available as a separate archive.
        • @@ -1039,7 +1058,7 @@ GBDK 1.1
        • The make script has been improved. Compiling on UNIX should be easier.
        • Many bugfixes.
        -

        +

        GBDK 1.0-1 1996

    diff --git a/docs/api/docs_supported_consoles.html b/docs/api/docs_supported_consoles.html index 4dff9aba..e80a4e55 100644 --- a/docs/api/docs_supported_consoles.html +++ b/docs/api/docs_supported_consoles.html @@ -588,9 +588,10 @@ Implementation of (fake) vbl / lcd handlers

    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.

    -

    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 scanline is the larger the CPU cycle loss. In practice this makes this faked-LCD-ISR functionality only suited for status bars at the top screen, or simple parallax cutscenes where the CPU has little else to do.

    +

    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.

    Note
    The support for VBL and LCD handlers is currently under consideration and subject to change in newer versions of gbdk-nes.

    Caveat: Make sure to call wait_vbl_done on every frame

    @@ -600,18 +601,28 @@ Caveat: Make sure to call wait_vbl_done on every frame
  • It allows future register writes to be synchronized to the screen
  • On gbdk-nes the second point is no longer true, because writes need to be made to the shadow registers before wait_vbl_done is called.

    -

    But the wait_vbl_done call serves two 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 calls flush_shadow_attributes so that updates to background attributes actually get written to PPU memory

    +

    But the wait_vbl_done 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 wait_vbl_done if you expect to see any graphical updates on the screen.

    +Caveat: Do all status bar scroll movement in LCD handlers to mitigate glitches

    +

    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 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.

    +

    maIf 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:

    +

    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.

    +

    Tile Data and Tile Map loading

    -

    +

    Tile and Map Data in 2bpp Game Boy Format

    -

    +

    Tile and Map Data in Native Format

    Use the following api calls when assets are avaialble in the native format for each platform.

    set_native_tile_data()

    -

    +

    From Game Boy to Mega Duck / Cougar Boy

    The Mega Duck is (for practical purposes) functionally identical to the Original Game Boy though it has a couple changes listed below.

    -

    +

    Summary of Hardware changes:

    -

    +

    Best Practices

    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).

    -

    +

    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.

    @@ -693,7 +704,7 @@ Sound Register Value Changes -

    +

    Graphics Register Bit Changes

    These changes are handled automatically when their GBDK definitions are used.

    Files

    file  bcd.h [code]
     
    file  hardware.h [code]
     
    file  metasprites.h [code]
    @@ -716,7 +727,7 @@ Graphics Register Bit Changes
    LCDCF_B_BGON .0 .6 Bit for Background Display Visible Hidden Select
    -

    +

    Detailed Register Address Changes

    These changes are handled automatically when their GBDK definitions are used.

    diff --git a/docs/api/docs_toolchain_settings.html b/docs/api/docs_toolchain_settings.html index 92c72c77..7570c3a5 100644 --- a/docs/api/docs_toolchain_settings.html +++ b/docs/api/docs_toolchain_settings.html @@ -91,7 +91,7 @@ $(document).ready(function(){initNavTree('docs_toolchain_settings.html',''); ini

    -

    +

    lcc settings

    ./lcc [ option | file ]...
    except for -l, options are processed left-to-right before files
    @@ -132,9 +132,9 @@ lcc settings
    -Woarg specify system-specific `arg'
    -W[pfablim]arg pass `arg' to the preprocessor, compiler, assembler, bankpack, linker, ihxcheck, or makebin

    -

    +

    sdcc settings

    -
    SDCC : z80/sm83/mos6502/mos65c02 TD- 4.4.0 #14620 (Linux)
    +
    SDCC : z80/sm83/mos6502/mos65c02 TD- 4.4.1 #14650 (Linux)
    published under GNU General Public License (GPL)
    Usage : sdcc [options] filename
    Options :-
    @@ -280,7 +280,7 @@ sdcc settings
    --no-zp-spill place register spills in 16-bit address space
    --no-std-crt0 Do not link default crt0.rel

    -

    +

    sdasgb settings

    sdas Assembler V02.00 + NoICE + SDCC mods (GameBoy)
    @@ -322,7 +322,7 @@ sdasgb settings
    -j Enable NoICE Debug Symbols
    -y Enable SDCC Debug Symbols

    -

    +

    sdasz80 settings

    sdas Assembler V02.00 + NoICE + SDCC mods (Zilog Z80 / Hitachi HD64180 / ZX-Next / eZ80 / R800)
    @@ -364,7 +364,7 @@ sdasz80 settings
    -j Enable NoICE Debug Symbols
    -y Enable SDCC Debug Symbols

    -

    +

    sdas6500 settings

    sdas Assembler V02.00 + NoICE + SDCC mods (Rockwell 6502/6510/65C02)
    @@ -406,7 +406,7 @@ sdas6500 settings
    -j Enable NoICE Debug Symbols
    -y Enable SDCC Debug Symbols

    -

    +

    bankpack settings

    bankalloc [options] objfile1 objfile2 etc
    Use: Read .o files and auto-assign areas with bank=255.
    @@ -448,7 +448,7 @@ bankpack settings
    S ___bank_<const name> Def0000FF
    (Above can be made by: const void __at(255) __bank_<const name>;

    -

    +

    sdldgb settings

    sdld Linker V03.00/V05.40 + sdld
    @@ -485,7 +485,7 @@ sdldgb settings
    End:
    -e or null line terminates input

    -

    +

    sdldz80 settings

    sdld Linker V03.00/V05.40 + sdld
    @@ -522,7 +522,7 @@ sdldz80 settings
    End:
    -e or null line terminates input

    -

    +

    sdld6808 settings

    sdld Linker V03.00/V05.40 + sdld
    @@ -559,7 +559,7 @@ sdld6808 settings
    End:
    -e or null line terminates input

    -

    +

    ihxcheck settings

    ihx_check input_file.ihx [options]
    @@ -570,7 +570,7 @@ ihxcheck settings
    Use: Read a .ihx and warn about overlapped areas.
    Example: "ihx_check build/MyProject.ihx"

    -

    +

    makebin settings

    Also see setting_mbc_and_rom_ram_banks

    makebin: convert a Intel IHX file to binary or GameBoy format binary.
    Usage: makebin [options] [<in_file> [<out_file>]]
    @@ -605,12 +605,12 @@ makebin settings
    <in_file> optional IHX input file, '-' means stdin. (default: stdin)
    <out_file> optional output file, '-' means stdout. (default: stdout)

    -

    +

    makecom settings

    makecom image.rom image.noi output.com
    Use: convert a binary .rom file to .msxdos com format.

    -

    +

    gbcompress settings

    gbcompress [options] infile outfile
    Use: compress a binary file and write it out.
    @@ -631,7 +631,7 @@ gbcompress settings
    The default compression (gb) is the type used by gbtd/gbmb
    The rle compression is Amiga IFF style

    -

    +

    png2asset settings

    usage: png2asset <file>.png [options]
    -o <filename> ouput file (if not used then default is <png file>.c)
    @@ -656,10 +656,10 @@ png2asset settings
    -use_nes_attributes Use NES BG Map attributes
    -use_nes_colors Convert RGB color values to NES PPU colors
    -use_structs Group the exported info into structs (default: false) (used by ZGB Game Engine)
    -
    -bpp bits per pixel: 1, 2, 4 (default: 2)
    +
    -bpp bits per pixel: 1, 2, 4 (default: 2. using 1 auto-enables "-pack_mode 1bpp")
    -max_palettes max number of palettes allowed (default: 8)
    (note: max colors = max_palettes x num colors per palette)
    -
    -pack_mode gb, nes, sgb, sms, 1bpp (default: gb)
    +
    -pack_mode gb, nes, sgb, sms, 1bpp (default: gb. using 1bpp auto-enables "-bpp 1")
    -tile_origin tile index offset for maps (default: 0)
    -tiles_only export tile data only
    -maps_only export map tilemap only
    @@ -673,7 +673,7 @@ png2asset settings
    -rel_paths paths to tilesets are relative to the input file path
    decoder error empty input buffer given to decoder. Maybe caused by non-existing file?

    -

    +

    png2hicolorgb settings

    png2hicolorgb input_image.png [options]
    version 1.4.1: bbbbbr. Based on Glen Cook's Windows GUI "hicolour.exe" 1.2
    @@ -709,7 +709,7 @@ png2hicolorgb settings
    Original Quantiser Code : Benny
    Quantiser Conversion : Glen Cook

    -

    +

    romusage settings

    romusage input_file.[map|noi|ihx|cdb|.gb[c]|.pocket|.duck|.gg|.sms] [options]
    version 1.2.8, by bbbbbr
    diff --git a/docs/api/files.html b/docs/api/files.html index 5574ce2e..0348f5f5 100644 --- a/docs/api/files.html +++ b/docs/api/files.html @@ -145,33 +145,34 @@ $(document).ready(function(){initNavTree('files.html',''); initResizable(); });
    - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     metasprites.h
     msx.h
      nes
     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
     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
    diff --git a/docs/api/gb_2metasprites_8h.html b/docs/api/gb_2metasprites_8h.html index 3b8b9efa..b682f38b 100644 --- a/docs/api/gb_2metasprites_8h.html +++ b/docs/api/gb_2metasprites_8h.html @@ -172,7 +172,7 @@ Metasprites composed of variable numbers of sprites
    // (where hiwater == last hardware sprite used + 1)
    hide_sprites_range(hiwater, MAX_HARDWARE_SPRITES);
    hide_sprites_range
    void hide_sprites_range(uint8_t from, uint8_t to)
    -
    MAX_HARDWARE_SPRITES
    #define MAX_HARDWARE_SPRITES
    Definition: gb.h:1830
    +
    MAX_HARDWARE_SPRITES
    #define MAX_HARDWARE_SPRITES
    Definition: gb.h:1842

    Metasprites and sprite properties (including cgb palette)

    diff --git a/docs/api/gb_8h.html b/docs/api/gb_8h.html index 21c9247a..838eb988 100644 --- a/docs/api/gb_8h.html +++ b/docs/api/gb_8h.html @@ -1877,7 +1877,11 @@ Variables
    -

    Turns on the background layer. Sets bit 0 of the LCDC register to 1.

    +

    Turns on the background layer. Sets bit 0 of the LCDC register to 1.

    +

    Doesn't work in CGB mode - the bit is reused to control sprite priority over background and window layers instead.

    @@ -1892,7 +1896,11 @@ Variables
    -

    Turns off the background layer. Sets bit 0 of the LCDC register to 0.

    +

    Turns off the background layer. Sets bit 0 of the LCDC register to 0.

    +

    Doesn't work in CGB mode - the bit is reused to control sprite priority over background and window layers instead.

    @@ -3308,7 +3316,7 @@ Variables

    Example:

    // Use DMG_BLACK as the Foreground color and DMG_LITE_GRAY
    // as the Background color when loading 1bpp tile data.
    set_1bpp_colors(DMG_BLACK, DMG_LITE_GRAY);
    -
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: gb.h:1014
    +
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: gb.h:1026
    See also
    DMG_BLACK, DMG_DARK_GRAY, DMG_LITE_GRAY, DMG_WHITE
    set_bkg_1bpp_data, set_win_1bpp_data, set_sprite_1bpp_data
    @@ -5312,7 +5320,7 @@ Variables
    // These flags tell the sprite to flip both vertically and horizontally.
    set_sprite_prop(0, S_FLIPY | S_FLIPX);
    S_FLIPY
    #define S_FLIPY
    Definition: gb.h:96
    -
    set_sprite_prop
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: gb.h:1921
    +
    set_sprite_prop
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: gb.h:1933
    S_FLIPX
    #define S_FLIPX
    Definition: gb.h:92
    set_sprite_palette
    #define set_sprite_palette(first_palette, nb_palettes, rgb_data)
    Definition: msx.h:550
    See also
    S_PALETTE, S_FLIPX, S_FLIPY, S_PRIORITY
    diff --git a/docs/api/gb_8h_source.html b/docs/api/gb_8h_source.html index 3dc92dc5..33d26599 100644 --- a/docs/api/gb_8h_source.html +++ b/docs/api/gb_8h_source.html @@ -376,306 +376,306 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    886 
    889 #define SET_BORDER_COLOR(C)
    890 
    -
    894 #define SHOW_BKG \
    -
    895  LCDC_REG|=LCDCF_BGON
    -
    896 
    -
    900 #define HIDE_BKG \
    -
    901  LCDC_REG&=~LCDCF_BGON
    +
    900 #define SHOW_BKG \
    +
    901  LCDC_REG|=LCDCF_BGON
    902 
    -
    912 #define SHOW_WIN \
    -
    913  LCDC_REG|=LCDCF_WINON
    +
    912 #define HIDE_BKG \
    +
    913  LCDC_REG&=~LCDCF_BGON
    914 
    -
    918 #define HIDE_WIN \
    -
    919  LCDC_REG&=~LCDCF_WINON
    -
    920 
    -
    924 #define SHOW_SPRITES \
    -
    925  LCDC_REG|=LCDCF_OBJON
    +
    924 #define SHOW_WIN \
    +
    925  LCDC_REG|=LCDCF_WINON
    926 
    -
    932 #define HIDE_SPRITES \
    -
    933  LCDC_REG&=~LCDCF_OBJON
    -
    934 
    -
    938 #define SPRITES_8x16 \
    -
    939  LCDC_REG|=LCDCF_OBJ16
    -
    940 
    -
    944 #define SPRITES_8x8 \
    -
    945  LCDC_REG&=~LCDCF_OBJ16
    +
    930 #define HIDE_WIN \
    +
    931  LCDC_REG&=~LCDCF_WINON
    +
    932 
    +
    936 #define SHOW_SPRITES \
    +
    937  LCDC_REG|=LCDCF_OBJON
    +
    938 
    +
    944 #define HIDE_SPRITES \
    +
    945  LCDC_REG&=~LCDCF_OBJON
    946 
    -
    947 
    -
    948 
    -
    955 void set_vram_byte(uint8_t * addr, uint8_t v) PRESERVES_REGS(b, c);
    -
    956 
    -
    968 uint8_t get_vram_byte(uint8_t * addr) PRESERVES_REGS(b, c, h, l);
    -
    969 
    -
    970 
    -
    974 uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    -
    975 
    -
    976 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
    -
    977 
    -
    980 inline void set_2bpp_palette(uint16_t palette) {
    -
    981  palette;
    -
    982 }
    -
    983 
    -
    984 extern uint16_t _current_1bpp_colors;
    -
    985 
    -
    993 void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL;
    -
    994 
    -
    1014 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
    -
    1015  set_1bpp_colors_ex(fgcolor, bgcolor, 0);
    -
    1016 }
    -
    1017 
    -
    1035 void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1036 #define set_bkg_2bpp_data set_bkg_data
    -
    1037 
    -
    1056 void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1057 
    -
    1078 void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1079 
    -
    1080 
    -
    1133 void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    -
    1134 #define set_tile_map set_bkg_tiles
    -
    1135 
    -
    1136 
    -
    1137 extern uint8_t _map_tile_offset;
    -
    1138 
    -
    1157 inline void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
    -
    1158  _map_tile_offset = base_tile;
    -
    1159  set_bkg_tiles(x, y, w, h, tiles);
    -
    1160  _map_tile_offset = 0;
    -
    1161 }
    -
    1162 
    -
    1163 
    -
    1212 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
    -
    1213 {
    -
    1214  VBK_REG = VBK_ATTRIBUTES;
    -
    1215  set_bkg_tiles(x, y, w, h, tiles);
    -
    1216  VBK_REG = VBK_TILES;
    -
    1217 }
    -
    1218 
    -
    1219 
    -
    1265 void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL;
    -
    1266 #define set_tile_submap set_bkg_submap
    -
    1267 
    -
    1268 
    -
    1269 extern uint8_t _submap_tile_offset;
    -
    1270 
    -
    1290 inline void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
    -
    1291  _submap_tile_offset = base_tile;
    -
    1292  set_bkg_submap(x, y, w, h, map, map_w);
    -
    1293  _submap_tile_offset = 0;
    -
    1294 }
    -
    1295 
    -
    1296 
    -
    1344 inline void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    -
    1345 {
    -
    1346  VBK_REG = VBK_ATTRIBUTES;
    -
    1347  set_bkg_submap(x, y, w, h, map, map_w);
    -
    1348  VBK_REG = VBK_TILES;
    -
    1349 }
    -
    1350 
    -
    1351 
    -
    1375 void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    -
    1376 
    -
    1377 
    -
    1385 uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t);
    -
    1386 #define set_tile_xy set_bkg_tile_xy
    -
    1387 
    -
    1396 inline uint8_t * set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
    -
    1397 {
    -
    1398  uint8_t* addr;
    -
    1399  VBK_REG = VBK_ATTRIBUTES;
    -
    1400  addr = set_bkg_tile_xy(x, y, a);
    -
    1401  VBK_REG = VBK_TILES;
    -
    1402  return addr;
    -
    1403 }
    -
    1404 #define set_attribute_xy set_bkg_attribute_xy
    -
    1405 
    -
    1420 uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    -
    1421 
    -
    1422 
    -
    1436 inline void move_bkg(uint8_t x, uint8_t y) {
    -
    1437  SCX_REG=x, SCY_REG=y;
    -
    1438 }
    -
    1439 
    -
    1440 
    -
    1450 inline void scroll_bkg(int8_t x, int8_t y) {
    -
    1451  SCX_REG+=x, SCY_REG+=y;
    -
    1452 }
    -
    1453 
    -
    1454 
    -
    1455 
    -
    1459 uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    -
    1460 
    -
    1474 void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1475 
    -
    1476 
    -
    1495 void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1496 
    -
    1497 
    -
    1515 void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1516 
    -
    1517 
    -
    1549 void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    -
    1550 
    -
    1551 
    -
    1570 inline void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
    -
    1571  _map_tile_offset = base_tile;
    -
    1572  set_win_tiles(x, y, w, h, tiles);
    -
    1573  _map_tile_offset = 0;
    -
    1574 }
    -
    1575 
    -
    1623 void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL;
    -
    1624 
    -
    1625 
    -
    1645 inline void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
    -
    1646  _submap_tile_offset = base_tile;
    -
    1647  set_win_submap(x, y, w, h, map, map_w);
    -
    1648  _submap_tile_offset = 0;
    -
    1649 }
    -
    1650 
    -
    1651 
    -
    1675 void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    -
    1676 
    -
    1677 
    -
    1685 uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t);
    -
    1686 
    -
    1687 
    -
    1700 uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    -
    1701 
    -
    1702 
    -
    1714 inline void move_win(uint8_t x, uint8_t y) {
    -
    1715  WX_REG=x, WY_REG=y;
    -
    1716 }
    -
    1717 
    -
    1718 
    -
    1728 inline void scroll_win(int8_t x, int8_t y) {
    -
    1729  WX_REG+=x, WY_REG+=y;
    -
    1730 }
    -
    1731 
    -
    1732 
    -
    1733 
    -
    1749 void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1750 #define set_sprite_2bpp_data set_sprite_data
    -
    1751 
    -
    1770 void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1771 
    -
    1790 void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    -
    1791 
    -
    1792 
    -
    1799 typedef struct OAM_item_t {
    -
    1800  uint8_t y, x; //< X, Y Coordinates of the sprite on screen
    -
    1801  uint8_t tile; //< Sprite tile number
    -
    1802  uint8_t prop; //< OAM Property Flags
    -
    1803 } OAM_item_t;
    +
    950 #define SPRITES_8x16 \
    +
    951  LCDC_REG|=LCDCF_OBJ16
    +
    952 
    +
    956 #define SPRITES_8x8 \
    +
    957  LCDC_REG&=~LCDCF_OBJ16
    +
    958 
    +
    959 
    +
    960 
    +
    967 void set_vram_byte(uint8_t * addr, uint8_t v) PRESERVES_REGS(b, c);
    +
    968 
    +
    980 uint8_t get_vram_byte(uint8_t * addr) PRESERVES_REGS(b, c, h, l);
    +
    981 
    +
    982 
    +
    986 uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    +
    987 
    +
    988 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
    +
    989 
    +
    992 inline void set_2bpp_palette(uint16_t palette) {
    +
    993  palette;
    +
    994 }
    +
    995 
    +
    996 extern uint16_t _current_1bpp_colors;
    +
    997 
    +
    1005 void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL;
    +
    1006 
    +
    1026 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
    +
    1027  set_1bpp_colors_ex(fgcolor, bgcolor, 0);
    +
    1028 }
    +
    1029 
    +
    1047 void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1048 #define set_bkg_2bpp_data set_bkg_data
    +
    1049 
    +
    1068 void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1069 
    +
    1090 void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1091 
    +
    1092 
    +
    1145 void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    +
    1146 #define set_tile_map set_bkg_tiles
    +
    1147 
    +
    1148 
    +
    1149 extern uint8_t _map_tile_offset;
    +
    1150 
    +
    1169 inline void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
    +
    1170  _map_tile_offset = base_tile;
    +
    1171  set_bkg_tiles(x, y, w, h, tiles);
    +
    1172  _map_tile_offset = 0;
    +
    1173 }
    +
    1174 
    +
    1175 
    +
    1224 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
    +
    1225 {
    +
    1226  VBK_REG = VBK_ATTRIBUTES;
    +
    1227  set_bkg_tiles(x, y, w, h, tiles);
    +
    1228  VBK_REG = VBK_TILES;
    +
    1229 }
    +
    1230 
    +
    1231 
    +
    1277 void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL;
    +
    1278 #define set_tile_submap set_bkg_submap
    +
    1279 
    +
    1280 
    +
    1281 extern uint8_t _submap_tile_offset;
    +
    1282 
    +
    1302 inline void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
    +
    1303  _submap_tile_offset = base_tile;
    +
    1304  set_bkg_submap(x, y, w, h, map, map_w);
    +
    1305  _submap_tile_offset = 0;
    +
    1306 }
    +
    1307 
    +
    1308 
    +
    1356 inline void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    +
    1357 {
    +
    1358  VBK_REG = VBK_ATTRIBUTES;
    +
    1359  set_bkg_submap(x, y, w, h, map, map_w);
    +
    1360  VBK_REG = VBK_TILES;
    +
    1361 }
    +
    1362 
    +
    1363 
    +
    1387 void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    +
    1388 
    +
    1389 
    +
    1397 uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t);
    +
    1398 #define set_tile_xy set_bkg_tile_xy
    +
    1399 
    +
    1408 inline uint8_t * set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
    +
    1409 {
    +
    1410  uint8_t* addr;
    +
    1411  VBK_REG = VBK_ATTRIBUTES;
    +
    1412  addr = set_bkg_tile_xy(x, y, a);
    +
    1413  VBK_REG = VBK_TILES;
    +
    1414  return addr;
    +
    1415 }
    +
    1416 #define set_attribute_xy set_bkg_attribute_xy
    +
    1417 
    +
    1432 uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    +
    1433 
    +
    1434 
    +
    1448 inline void move_bkg(uint8_t x, uint8_t y) {
    +
    1449  SCX_REG=x, SCY_REG=y;
    +
    1450 }
    +
    1451 
    +
    1452 
    +
    1462 inline void scroll_bkg(int8_t x, int8_t y) {
    +
    1463  SCX_REG+=x, SCY_REG+=y;
    +
    1464 }
    +
    1465 
    +
    1466 
    +
    1467 
    +
    1471 uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    +
    1472 
    +
    1486 void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1487 
    +
    1488 
    +
    1507 void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1508 
    +
    1509 
    +
    1527 void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1528 
    +
    1529 
    +
    1561 void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    +
    1562 
    +
    1563 
    +
    1582 inline void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
    +
    1583  _map_tile_offset = base_tile;
    +
    1584  set_win_tiles(x, y, w, h, tiles);
    +
    1585  _map_tile_offset = 0;
    +
    1586 }
    +
    1587 
    +
    1635 void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL;
    +
    1636 
    +
    1637 
    +
    1657 inline void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
    +
    1658  _submap_tile_offset = base_tile;
    +
    1659  set_win_submap(x, y, w, h, map, map_w);
    +
    1660  _submap_tile_offset = 0;
    +
    1661 }
    +
    1662 
    +
    1663 
    +
    1687 void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c);
    +
    1688 
    +
    1689 
    +
    1697 uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t);
    +
    1698 
    +
    1699 
    +
    1712 uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c);
    +
    1713 
    +
    1714 
    +
    1726 inline void move_win(uint8_t x, uint8_t y) {
    +
    1727  WX_REG=x, WY_REG=y;
    +
    1728 }
    +
    1729 
    +
    1730 
    +
    1740 inline void scroll_win(int8_t x, int8_t y) {
    +
    1741  WX_REG+=x, WY_REG+=y;
    +
    1742 }
    +
    1743 
    +
    1744 
    +
    1745 
    +
    1761 void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1762 #define set_sprite_2bpp_data set_sprite_data
    +
    1763 
    +
    1782 void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1783 
    +
    1802 void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
    +
    1803 
    1804 
    -
    1805 
    -
    1808 extern volatile struct OAM_item_t shadow_OAM[];
    -
    1809 
    -
    1812 __REG _shadow_OAM_base;
    -
    1813 
    -
    1814 #define DISABLE_OAM_DMA \
    -
    1815  _shadow_OAM_base = 0
    +
    1811 typedef struct OAM_item_t {
    +
    1812  uint8_t y, x; //< X, Y Coordinates of the sprite on screen
    +
    1813  uint8_t tile; //< Sprite tile number
    +
    1814  uint8_t prop; //< OAM Property Flags
    +
    1815 } OAM_item_t;
    1816 
    -
    1819 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
    -
    1820 
    -
    1821 #define ENABLE_OAM_DMA \
    -
    1822  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
    -
    1823 
    -
    1826 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
    -
    1827 
    -
    1830 #define MAX_HARDWARE_SPRITES 40
    -
    1831 
    -
    1834 #define HARDWARE_SPRITE_CAN_FLIP_X 1
    +
    1817 
    +
    1820 extern volatile struct OAM_item_t shadow_OAM[];
    +
    1821 
    +
    1824 __REG _shadow_OAM_base;
    +
    1825 
    +
    1826 #define DISABLE_OAM_DMA \
    +
    1827  _shadow_OAM_base = 0
    +
    1828 
    +
    1831 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
    +
    1832 
    +
    1833 #define ENABLE_OAM_DMA \
    +
    1834  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
    1835 
    -
    1838 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
    +
    1838 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
    1839 
    -
    1842 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
    -
    1843  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
    -
    1844 }
    -
    1845 
    -
    1862 inline void set_sprite_tile(uint8_t nb, uint8_t tile) {
    -
    1863  shadow_OAM[nb].tile=tile;
    -
    1864 }
    -
    1865 
    -
    1866 
    -
    1873 inline uint8_t get_sprite_tile(uint8_t nb) {
    -
    1874  return shadow_OAM[nb].tile;
    -
    1875 }
    -
    1876 
    +
    1842 #define MAX_HARDWARE_SPRITES 40
    +
    1843 
    +
    1846 #define HARDWARE_SPRITE_CAN_FLIP_X 1
    +
    1847 
    +
    1850 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
    +
    1851 
    +
    1854 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
    +
    1855  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
    +
    1856 }
    +
    1857 
    +
    1874 inline void set_sprite_tile(uint8_t nb, uint8_t tile) {
    +
    1875  shadow_OAM[nb].tile=tile;
    +
    1876 }
    1877 
    -
    1921 inline void set_sprite_prop(uint8_t nb, uint8_t prop) {
    -
    1922  shadow_OAM[nb].prop=prop;
    -
    1923 }
    -
    1924 
    -
    1925 
    -
    1931 inline uint8_t get_sprite_prop(uint8_t nb) {
    -
    1932  return shadow_OAM[nb].prop;
    -
    1933 }
    -
    1934 
    -
    1935 
    -
    1948 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
    -
    1949  OAM_item_t * itm = &shadow_OAM[nb];
    -
    1950  itm->y=y, itm->x=x;
    -
    1951 }
    -
    1952 
    -
    1953 
    -
    1964 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
    -
    1965  OAM_item_t * itm = &shadow_OAM[nb];
    -
    1966  itm->y+=y, itm->x+=x;
    -
    1967 }
    -
    1968 
    -
    1969 
    -
    1976 inline void hide_sprite(uint8_t nb) {
    -
    1977  shadow_OAM[nb].y = 0;
    -
    1978 }
    -
    1979 
    +
    1878 
    +
    1885 inline uint8_t get_sprite_tile(uint8_t nb) {
    +
    1886  return shadow_OAM[nb].tile;
    +
    1887 }
    +
    1888 
    +
    1889 
    +
    1933 inline void set_sprite_prop(uint8_t nb, uint8_t prop) {
    +
    1934  shadow_OAM[nb].prop=prop;
    +
    1935 }
    +
    1936 
    +
    1937 
    +
    1943 inline uint8_t get_sprite_prop(uint8_t nb) {
    +
    1944  return shadow_OAM[nb].prop;
    +
    1945 }
    +
    1946 
    +
    1947 
    +
    1960 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
    +
    1961  OAM_item_t * itm = &shadow_OAM[nb];
    +
    1962  itm->y=y, itm->x=x;
    +
    1963 }
    +
    1964 
    +
    1965 
    +
    1976 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
    +
    1977  OAM_item_t * itm = &shadow_OAM[nb];
    +
    1978  itm->y+=y, itm->x+=x;
    +
    1979 }
    1980 
    1981 
    -
    1997 void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len);
    -
    1998 
    -
    1999 
    -
    2021 void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len);
    -
    2022 
    -
    2035 void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len);
    -
    2036 
    -
    2037 
    -
    2038 
    -
    2062 void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL;
    -
    2063 
    -
    2074 void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b, c);
    +
    1988 inline void hide_sprite(uint8_t nb) {
    +
    1989  shadow_OAM[nb].y = 0;
    +
    1990 }
    +
    1991 
    +
    1992 
    +
    1993 
    +
    2009 void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len);
    +
    2010 
    +
    2011 
    +
    2033 void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len);
    +
    2034 
    +
    2047 void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len);
    +
    2048 
    +
    2049 
    +
    2050 
    +
    2074 void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL;
    2075 
    -
    2103 void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL;
    -
    2104 
    -
    2105 
    -
    2120 inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
    -
    2121  if (first_tile < 256) {
    -
    2122  set_bkg_data(first_tile, nb_tiles, data);
    -
    2123  } else {
    -
    2124  set_sprite_data(first_tile - 256, nb_tiles, data);
    -
    2125  }
    -
    2126 }
    -
    2127 
    -
    2143 inline void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
    -
    2144  set_bkg_data(first_tile, nb_tiles, data);
    -
    2145 }
    -
    2146 
    -
    2160 inline void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
    -
    2161  set_sprite_data(first_tile, nb_tiles, data);
    -
    2162 }
    -
    2163 
    -
    2169 void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b, c);
    -
    2170 
    -
    2176 void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b, c);
    -
    2177 
    -
    2185 void vmemset (void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b, c);
    -
    2186 
    -
    2187 
    -
    2188 
    -
    2197 void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b, c);
    -
    2198 #define fill_rect fill_bkg_rect
    +
    2086 void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b, c);
    +
    2087 
    +
    2115 void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL;
    +
    2116 
    +
    2117 
    +
    2132 inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
    +
    2133  if (first_tile < 256) {
    +
    2134  set_bkg_data(first_tile, nb_tiles, data);
    +
    2135  } else {
    +
    2136  set_sprite_data(first_tile - 256, nb_tiles, data);
    +
    2137  }
    +
    2138 }
    +
    2139 
    +
    2155 inline void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
    +
    2156  set_bkg_data(first_tile, nb_tiles, data);
    +
    2157 }
    +
    2158 
    +
    2172 inline void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
    +
    2173  set_sprite_data(first_tile, nb_tiles, data);
    +
    2174 }
    +
    2175 
    +
    2181 void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b, c);
    +
    2182 
    +
    2188 void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b, c);
    +
    2189 
    +
    2197 void vmemset (void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b, c);
    +
    2198 
    2199 
    -
    2208 void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b, c);
    -
    2209 
    -
    2210 #endif /* _GB_H */
    +
    2200 
    +
    2209 void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b, c);
    +
    2210 #define fill_rect fill_bkg_rect
    +
    2211 
    +
    2220 void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b, c);
    +
    2221 
    +
    2222 #endif /* _GB_H */
    OLDCALL
    #define OLDCALL
    Definition: types.h:21
    NONBANKED
    #define NONBANKED
    Definition: types.h:40
    PRESERVES_REGS
    #define PRESERVES_REGS(...)
    Definition: types.h:32
    @@ -690,18 +690,18 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    VBK_TILES
    #define VBK_TILES
    Definition: hardware.h:320
    SCX_REG
    __REG SCX_REG
    Definition: hardware.h:291
    _io_in
    volatile uint8_t _io_in
    -
    set_sprite_tile
    void set_sprite_tile(uint8_t nb, uint8_t tile)
    Definition: gb.h:1862
    +
    set_sprite_tile
    void set_sprite_tile(uint8_t nb, uint8_t tile)
    Definition: gb.h:1874
    d
    uint8_t d
    Definition: gb.h:414
    c
    uint8_t c
    Definition: gb.h:414
    -
    set_bkg_attributes
    void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
    Definition: gb.h:1212
    +
    set_bkg_attributes
    void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
    Definition: gb.h:1224
    send_byte
    void send_byte(void)
    -
    scroll_win
    void scroll_win(int8_t x, int8_t y)
    Definition: gb.h:1728
    +
    scroll_win
    void scroll_win(int8_t x, int8_t y)
    Definition: gb.h:1740
    refresh_OAM
    void refresh_OAM(void) PRESERVES_REGS(b
    -
    set_win_based_submap
    void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: gb.h:1645
    -
    set_bkg_submap_attributes
    void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    Definition: gb.h:1344
    +
    set_win_based_submap
    void set_win_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: gb.h:1657
    +
    set_bkg_submap_attributes
    void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
    Definition: gb.h:1356
    set_1bpp_colors_ex
    void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL
    set_bkg_data
    void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    -
    scroll_bkg
    void scroll_bkg(int8_t x, int8_t y)
    Definition: gb.h:1450
    +
    scroll_bkg
    void scroll_bkg(int8_t x, int8_t y)
    Definition: gb.h:1462
    _current_1bpp_colors
    uint16_t _current_1bpp_colors
    set_vram_byte
    void set_vram_byte(uint8_t *addr, uint8_t v) PRESERVES_REGS(b
    vmemcpy
    void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len)
    @@ -711,7 +711,7 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    receive_byte
    void receive_byte(void)
    shadow_OAM
    volatile struct OAM_item_t shadow_OAM[]
    reset
    void reset(void)
    -
    set_bkg_attribute_xy
    uint8_t * set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
    Definition: gb.h:1396
    +
    set_bkg_attribute_xy
    uint8_t * set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
    Definition: gb.h:1408
    get_system
    uint8_t get_system(void)
    Definition: gb.h:421
    joypad
    uint8_t joypad(void) PRESERVES_REGS(b
    init_bkg
    void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b
    @@ -726,23 +726,23 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    add_low_priority_TIM
    void add_low_priority_TIM(int_handler h)
    set_tiles
    void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL
    remove_TIM
    void remove_TIM(int_handler h)
    -
    move_bkg
    void move_bkg(uint8_t x, uint8_t y)
    Definition: gb.h:1436
    +
    move_bkg
    void move_bkg(uint8_t x, uint8_t y)
    Definition: gb.h:1448
    remove_JOY
    void remove_JOY(int_handler h)
    remove_LCD
    void remove_LCD(int_handler h)
    -
    set_native_tile_data
    void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:2120
    -
    get_sprite_prop
    uint8_t get_sprite_prop(uint8_t nb)
    Definition: gb.h:1931
    -
    scroll_sprite
    void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
    Definition: gb.h:1964
    +
    set_native_tile_data
    void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:2132
    +
    get_sprite_prop
    uint8_t get_sprite_prop(uint8_t nb)
    Definition: gb.h:1943
    +
    scroll_sprite
    void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
    Definition: gb.h:1976
    set_bkg_tiles
    void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    set_bkg_1bpp_data
    void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    -
    set_win_based_tiles
    void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: gb.h:1570
    +
    set_win_based_tiles
    void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: gb.h:1582
    fill_bkg_rect
    void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
    get_data
    void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len)
    sys_time
    volatile uint16_t sys_time
    delay
    void delay(uint16_t d) PRESERVES_REGS(h
    -
    _shadow_OAM_base
    __REG _shadow_OAM_base
    Definition: gb.h:1812
    -
    SET_SHADOW_OAM_ADDRESS
    void SET_SHADOW_OAM_ADDRESS(void *address)
    Definition: gb.h:1842
    +
    _shadow_OAM_base
    __REG _shadow_OAM_base
    Definition: gb.h:1824
    +
    SET_SHADOW_OAM_ADDRESS
    void SET_SHADOW_OAM_ADDRESS(void *address)
    Definition: gb.h:1854
    get_win_data
    void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
    -
    set_bkg_based_tiles
    void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: gb.h:1157
    +
    set_bkg_based_tiles
    void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
    Definition: gb.h:1169
    wait_vbl_done
    void wait_vbl_done(void) PRESERVES_REGS(b
    add_VBL
    void add_VBL(int_handler h)
    _cpu
    uint8_t _cpu
    @@ -754,37 +754,37 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    vmemset
    void vmemset(void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b
    _current_bank
    __REG _current_bank
    Definition: gb.h:522
    SYSTEM_60HZ
    #define SYSTEM_60HZ
    Definition: gb.h:27
    -
    set_sprite_prop
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: gb.h:1921
    +
    set_sprite_prop
    void set_sprite_prop(uint8_t nb, uint8_t prop)
    Definition: gb.h:1933
    add_TIM
    void add_TIM(int_handler h)
    get_mode
    uint8_t get_mode(void) PRESERVES_REGS(b
    -
    set_2bpp_palette
    void set_2bpp_palette(uint16_t palette)
    Definition: gb.h:980
    +
    set_2bpp_palette
    void set_2bpp_palette(uint16_t palette)
    Definition: gb.h:992
    get_bkg_tiles
    void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
    get_win_xy_addr
    uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
    _map_tile_offset
    uint8_t _map_tile_offset
    -
    set_sprite_native_data
    void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:2160
    +
    set_sprite_native_data
    void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:2172
    set_bkg_tile_xy
    uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t)
    enable_interrupts
    void enable_interrupts(void) PRESERVES_REGS(a
    display_off
    void display_off(void) PRESERVES_REGS(b
    set_sprite_1bpp_data
    void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    -
    move_sprite
    void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
    Definition: gb.h:1948
    +
    move_sprite
    void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
    Definition: gb.h:1960
    _submap_tile_offset
    uint8_t _submap_tile_offset
    joypad_ex
    void joypad_ex(joypads_t *joypads) PRESERVES_REGS(b
    joypad_init
    uint8_t joypad_init(uint8_t npads, joypads_t *joypads) OLDCALL
    h
    uint8_t h
    Definition: gb.h:414
    waitpad
    uint8_t waitpad(uint8_t mask) PRESERVES_REGS(b
    -
    set_bkg_based_submap
    void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: gb.h:1290
    +
    set_bkg_based_submap
    void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
    Definition: gb.h:1302
    set_tile_data
    void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b
    set_win_data
    void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    set_win_tile_xy
    uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t)
    remove_VBL
    void remove_VBL(int_handler h)
    _io_out
    volatile uint8_t _io_out
    -
    set_bkg_native_data
    void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:2143
    +
    set_bkg_native_data
    void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data)
    Definition: gb.h:2155
    set_win_1bpp_data
    void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
    -
    hide_sprite
    void hide_sprite(uint8_t nb)
    Definition: gb.h:1976
    +
    hide_sprite
    void hide_sprite(uint8_t nb)
    Definition: gb.h:1988
    fill_win_rect
    void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
    waitpadup
    void waitpadup(void) PRESERVES_REGS(a
    set_bkg_submap
    void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
    Definition: msx.h:619
    -
    set_1bpp_colors
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: gb.h:1014
    +
    set_1bpp_colors
    void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
    Definition: gb.h:1026
    get_sprite_data
    void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
    cancel_pending_interrupts
    uint8_t cancel_pending_interrupts(void)
    Definition: gb.h:398
    add_LCD
    void add_LCD(int_handler h)
    @@ -795,9 +795,9 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    add_SIO
    void add_SIO(int_handler h)
    set_interrupts
    void set_interrupts(uint8_t flags) PRESERVES_REGS(b
    e
    uint8_t e
    Definition: gb.h:414
    -
    move_win
    void move_win(uint8_t x, uint8_t y)
    Definition: gb.h:1714
    +
    move_win
    void move_win(uint8_t x, uint8_t y)
    Definition: gb.h:1726
    vsync
    void vsync(void) PRESERVES_REGS(b
    -
    get_sprite_tile
    uint8_t get_sprite_tile(uint8_t nb)
    Definition: gb.h:1873
    +
    get_sprite_tile
    uint8_t get_sprite_tile(uint8_t nb)
    Definition: gb.h:1885
    init_win
    void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b
    l
    uint8_t l
    Definition: gb.h:414
    set_win_submap
    void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
    Definition: msx.h:622
    @@ -807,11 +807,11 @@ $(document).ready(function(){initNavTree('gb_8h_source.html',''); initResizable(
    uint8_t
    unsigned char uint8_t
    Definition: stdint.h:51
    uint16_t
    unsigned short int uint16_t
    Definition: stdint.h:52
    int8_t
    signed char int8_t
    Definition: stdint.h:43
    -
    OAM_item_t
    Definition: gb.h:1799
    -
    OAM_item_t::x
    uint8_t x
    Definition: gb.h:1800
    -
    OAM_item_t::prop
    uint8_t prop
    Definition: gb.h:1802
    -
    OAM_item_t::tile
    uint8_t tile
    Definition: gb.h:1801
    -
    OAM_item_t::y
    uint8_t y
    Definition: gb.h:1800
    +
    OAM_item_t
    Definition: gb.h:1811
    +
    OAM_item_t::x
    uint8_t x
    Definition: gb.h:1812
    +
    OAM_item_t::prop
    uint8_t prop
    Definition: gb.h:1814
    +
    OAM_item_t::tile
    uint8_t tile
    Definition: gb.h:1813
    +
    OAM_item_t::y
    uint8_t y
    Definition: gb.h:1812
    joypads_t
    Definition: gb.h:743
    joypads_t::joy0
    uint8_t joy0
    Definition: gb.h:747
    joypads_t::npads
    uint8_t npads
    Definition: gb.h:744
    diff --git a/docs/api/gbdk_2bcd_8h_source.html b/docs/api/gbdk_2bcd_8h_source.html index 48ce8294..84f2d8d2 100644 --- a/docs/api/gbdk_2bcd_8h_source.html +++ b/docs/api/gbdk_2bcd_8h_source.html @@ -97,12 +97,15 @@ $(document).ready(function(){initNavTree('gbdk_2bcd_8h_source.html',''); initRes
    5  #include <gb/bcd.h>
    6 #elif defined(__TARGET_sms) || defined(__TARGET_gg) || defined(__TARGET_msxdos)
    7  #include <sms/bcd.h>
    -
    8 #else
    -
    9  #error Unrecognized port
    -
    10 #endif
    -
    11 
    +
    8 #elif defined(__TARGET_nes)
    +
    9  #include <nes/bcd.h>
    +
    10 #else
    +
    11  #error Unrecognized port
    12 #endif
    +
    13 
    +
    14 #endif
    bcd.h
    +
    bcd.h
    bcd.h
    diff --git a/docs/api/globals_b.html b/docs/api/globals_b.html index 1eaf88f5..2881214a 100644 --- a/docs/api/globals_b.html +++ b/docs/api/globals_b.html @@ -106,16 +106,16 @@ $(document).ready(function(){initNavTree('globals_b.html',''); initResizable(); : types.h
  • BANKREF -: gb.h -, msx.h -, nes.h +: msx.h , sms.h +, nes.h +, gb.h
  • BANKREF_EXTERN -: sms.h -, nes.h +: gb.h , msx.h -, gb.h +, nes.h +, sms.h
  • BCD : bcd.h diff --git a/docs/api/globals_defs_f.html b/docs/api/globals_defs_f.html index 26552553..fe7e7e09 100644 --- a/docs/api/globals_defs_f.html +++ b/docs/api/globals_defs_f.html @@ -89,12 +89,12 @@ $(document).ready(function(){initNavTree('globals_defs_f.html',''); initResizabl  

    - f -