git.y1.nz

gbdk-2020

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

commit 5d62c592049beb7422ce3f45afc5721761c1d9bf
parent d8f3c6258c5fa69509973b7dfba750c871edab1e
Author: Toxa <untoxa@mail.ru>
Date:   Wed, 18 Aug 2021 16:35:29 +0300

png2mtspr: roll back -plat switch -- not needed; added include/gbdk/ folder for compatibility layer headers

Diffstat:
Mgbdk-lib/examples/ap/bcd/bcd.c2+-
Mgbdk-lib/examples/ap/metasprites/metasprites.c6+++---
Mgbdk-lib/examples/gb/bcd/bcd.c2+-
Mgbdk-lib/examples/gb/metasprites/metasprites.c6+++---
Mgbdk-lib/examples/gg/metasprites/Makefile2+-
Mgbdk-lib/examples/gg/metasprites/metasprites.c6+++---
Mgbdk-lib/examples/sms/metasprites/Makefile2+-
Mgbdk-lib/examples/sms/metasprites/metasprites.c6+++---
Rgbdk-lib/include/bcd.h -> gbdk-lib/include/gbdk/bcd.h0
Agbdk-lib/include/gbdk/metasprites.h21+++++++++++++++++++++
Agbdk-lib/include/gbdk/platform.h21+++++++++++++++++++++
Mgbdk-support/png2mtspr/png2mtspr.cpp10++--------
12 files changed, 60 insertions(+), 24 deletions(-)

diff --git a/gbdk-lib/examples/ap/bcd/bcd.c b/gbdk-lib/examples/ap/bcd/bcd.c @@ -4,7 +4,7 @@ #include <stdio.h> #include <gb/font.h> -#include "bcd.h" +#include <gbdk/bcd.h> BCD bcd = MAKE_BCD(10203040); BCD bcd2 = MAKE_BCD(05060708); diff --git a/gbdk-lib/examples/ap/metasprites/metasprites.c b/gbdk-lib/examples/ap/metasprites/metasprites.c @@ -1,7 +1,7 @@ -#include <gb/gb.h> #include <stdint.h> -#include <gb/sgb.h> -#include <gb/metasprites.h> + +#include <gbdk/platform.h> +#include <gbdk/metasprites.h> #include "sprite.h" diff --git a/gbdk-lib/examples/gb/bcd/bcd.c b/gbdk-lib/examples/gb/bcd/bcd.c @@ -4,7 +4,7 @@ #include <stdio.h> #include <gb/font.h> -#include "bcd.h" +#include <gbdk/bcd.h> BCD bcd = MAKE_BCD(10203040); BCD bcd2 = MAKE_BCD(05060708); diff --git a/gbdk-lib/examples/gb/metasprites/metasprites.c b/gbdk-lib/examples/gb/metasprites/metasprites.c @@ -1,7 +1,7 @@ -#include <gb/gb.h> #include <stdint.h> -#include <gb/sgb.h> -#include <gb/metasprites.h> + +#include <gbdk/platform.h> +#include <gbdk/metasprites.h> #include "sprite.h" diff --git a/gbdk-lib/examples/gg/metasprites/Makefile b/gbdk-lib/examples/gg/metasprites/Makefile @@ -25,7 +25,7 @@ compile.bat: Makefile # -spr8x16 : Use 8x16 hardware sprites # -c ... : Set C output file %.c: %.png - $(PNG2MTSPR) $< -sh 48 -spr8x16 -noflip -plat sms -c $@ + $(PNG2MTSPR) $< -sh 48 -spr8x16 -noflip -c $@ # Compile all C sources, including converted png metasprites $(BINS): $(CSOURCES) $(PNG_CSOURCES) diff --git a/gbdk-lib/examples/gg/metasprites/metasprites.c b/gbdk-lib/examples/gg/metasprites/metasprites.c @@ -1,5 +1,5 @@ -#include <sms/sms.h> -#include <sms/metasprites.h> +#include <gbdk/platform.h> +#include <gbdk/metasprites.h> #include <stdint.h> @@ -56,7 +56,7 @@ void main(void) { joypad_init(1, &joypads); // Set initial position, zero out speed - PosX = PosY = 64 << 4; + PosX = PosY = 128 << 4; SpdX = SpdY = 0; hide = 0; jitter = 0; idx = 0; rot = 0; diff --git a/gbdk-lib/examples/sms/metasprites/Makefile b/gbdk-lib/examples/sms/metasprites/Makefile @@ -25,7 +25,7 @@ compile.bat: Makefile # -spr8x16 : Use 8x16 hardware sprites # -c ... : Set C output file %.c: %.png - $(PNG2MTSPR) $< -sh 48 -spr8x16 -noflip -plat sms -c $@ + $(PNG2MTSPR) $< -sh 48 -spr8x16 -noflip -c $@ # Compile all C sources, including converted png metasprites $(BINS): $(CSOURCES) $(PNG_CSOURCES) diff --git a/gbdk-lib/examples/sms/metasprites/metasprites.c b/gbdk-lib/examples/sms/metasprites/metasprites.c @@ -1,5 +1,5 @@ -#include <sms/sms.h> -#include <sms/metasprites.h> +#include <gbdk/platform.h> +#include <gbdk/metasprites.h> #include <stdint.h> @@ -56,7 +56,7 @@ void main(void) { joypad_init(1, &joypads); // Set initial position, zero out speed - PosX = PosY = 64 << 4; + PosX = PosY = 128 << 4; SpdX = SpdY = 0; hide = 0; jitter = 0; idx = 0; rot = 0; diff --git a/gbdk-lib/include/bcd.h b/gbdk-lib/include/gbdk/bcd.h diff --git a/gbdk-lib/include/gbdk/metasprites.h b/gbdk-lib/include/gbdk/metasprites.h @@ -0,0 +1,20 @@ +#ifndef __PLAT_METASPRITES_H_INVCLUDE +#define __PLAT_METASPRITES_H_INVCLUDE + +#ifdef __TARGET_gb +#include <gb/metasprites.h> +#endif + +#ifdef __TARGET_ap +#include <gb/metasprites.h> +#endif + +#ifdef __TARGET_sms +#include <sms/metasprites.h> +#endif + +#ifdef __TARGET_gg +#include <sms/metasprites.h> +#endif + +#endif + diff --git a/gbdk-lib/include/gbdk/platform.h b/gbdk-lib/include/gbdk/platform.h @@ -0,0 +1,20 @@ +#ifndef __PLATFORM_H_INVCLUDE +#define __PLATFORM_H_INVCLUDE + +#ifdef __TARGET_gb +#include <gb/gb.h> +#endif + +#ifdef __TARGET_ap +#include <gb/gb.h> +#endif + +#ifdef __TARGET_sms +#include <sms/sms.h> +#endif + +#ifdef __TARGET_gg +#include <sms/sms.h> +#endif + +#endif + diff --git a/gbdk-support/png2mtspr/png2mtspr.cpp b/gbdk-support/png2mtspr/png2mtspr.cpp @@ -203,7 +203,6 @@ int main(int argc, char *argv[]) printf("-spr8x8 use SPRITES_8x8 (default: SPRITES_8x16)\n"); printf("-spr8x16 use SPRITES_8x16 (default: SPRITES_8x16)\n"); printf("-b <bank> bank (default 0)\n"); - printf("-plat <plat> platform (default gb)\n"); printf("-noflip disable flipping"); return 0; } @@ -215,7 +214,6 @@ int main(int argc, char *argv[]) int pivot_y = 0xFFFFFF; tile_h = 16; string output_filename = argv[1]; - string plat = "gb"; output_filename = output_filename.substr(0, output_filename.size() - 4) + ".c"; int bank = 0; bool tryflip = true; @@ -259,10 +257,6 @@ int main(int argc, char *argv[]) { bank = atoi(argv[++ i]); } - else if(!strcmp(argv[i], "-plat")) - { - plat = argv[++ i]; - } else if(!strcmp(argv[i], "-noflip")) { tryflip = false; @@ -318,7 +312,7 @@ int main(int argc, char *argv[]) fprintf(file, "#define __%s_H_INCLUDE\n", data_name.c_str()); fprintf(file, "\n"); fprintf(file, "#include <stdint.h>\n"); - fprintf(file, "#include <%s/metasprites.h>\n", plat.c_str()); + fprintf(file, "#include <gbdk/metasprites.h>\n"); fprintf(file, "\n"); fprintf(file, "#define %s_TILE_H %d\n", data_name.c_str(), tile_h); fprintf(file, "#define %s_WIDTH %d\n", data_name.c_str(), sprite_w); @@ -345,7 +339,7 @@ int main(int argc, char *argv[]) fprintf(file, "//AUTOGENERATED FILE FROM png2mtspr\n\n"); fprintf(file, "#include <stdint.h>\n"); - fprintf(file, "#include <%s/metasprites.h>\n", plat.c_str()); + fprintf(file, "#include <gbdk/metasprites.h>\n"); fprintf(file, "\n"); if(bank) {

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