git.y1.nz

gbdk-2020

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

gbdk-lib/include/duck/model.h

      1 #include <gbdk/platform.h>
      2 #include <stdint.h>
      3 
      4 #ifndef _MEGADUCK_MODEL_H
      5 #define _MEGADUCK_MODEL_H
      6 
      7 #define MEGADUCK_HANDHELD_STANDARD 0u
      8 #define MEGADUCK_LAPTOP_SPANISH    1u
      9 #define MEGADUCK_LAPTOP_GERMAN     2u
     10 
     11 
     12 /** Returns which MegaDuck Model the program is being run on
     13 
     14     Possible models are:
     15     - Handheld: @ref MEGADUCK_HANDHELD_STANDARD
     16     - Spanish Laptop "Super QuiQue": @ref MEGADUCK_LAPTOP_SPANISH
     17     - German Laptop "Super Junior Computer": @ref MEGADUCK_LAPTOP_GERMAN
     18 
     19     This detection should be called immediately at the start of the program
     20     for most reliable results, since it relies on inspecting uncleared VRAM
     21     contents.
     22 
     23     It works by checking for distinct font VRAM Tile Patterns (which aren't
     24     cleared before cart program launch) between the Spanish and German Laptop
     25     models which have slightly different character sets.
     26 
     27     So VRAM *must not* be cleared or modified at program startup until after
     28     this function is called (not by the crt0.s, not by the program itself).
     29 
     30     @note This detection may not work in emulators which don't simulate
     31           the preloaded Laptop System ROM font tiles in VRAM.
     32 */
     33 uint8_t duck_check_model(void);
     34 
     35 #endif // _MEGADUCK_MODEL_H

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