From 5143e55753bf5b93190e6c7a7b30074c1fbdc070 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Mon, 20 Nov 2023 22:52:29 +0100 Subject: [PATCH] incl. debug configuration for vs code Signed-off-by: Peter Siegmund --- .vscode/launch.json | 17 +++++++++++++++++ .vscode/settings.json | 4 +++- .vscode/tasks.json | 24 ++++++++++++++++++++++++ Makefile | 4 +++- res/splash_screen_tileset.png | Bin 0 -> 232 bytes src/main.c | 11 ++++++++--- 6 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 res/splash_screen_tileset.png diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..429e3a7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Verwendet IntelliSense zum Ermitteln möglicher Attribute. + // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. + // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "emulicious-debugger", + "request": "launch", + "name": "Launch in Emulicious", + "program": "${workspaceFolder}/obj/snake.gb", + "port": 58870, + "stopOnEntry": true, + "preLaunchTask": "build" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index b399b4d..f97eb5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,7 @@ { "files.associations": { - "stdint.h": "c" + "stdint.h": "c", + "splash_screen.h": "c", + "gb.h": "c" } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..439a2de --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,24 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "make", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + } + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index cb84bd2..1044a2c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ PNG2ASSET = $(GBDK_HOME)bin/png2asset # For example, you can uncomment the line below to turn on debug output # LCCFLAGS += -debug # Uncomment to enable debug output # LCCFLAGS += -v # Uncomment for lcc verbose output +LCCFLAGS +=-Wa-l -Wl-m -Wl-j -Wf--debug # You can set the name of the .gb ROM file here @@ -57,7 +58,8 @@ $(BINS): $(OBJS) $(LCC) $(LCCFLAGS) -o $(BINS) $(OBJS) png2asset: - ${PNG2ASSET} ${RESDIR}/splash_screen.png -c ${GENDIR}/splash_screen.c -map -noflip + ${PNG2ASSET} ${RESDIR}/splash_screen.png -c ${GENDIR}/splash_screen.c -map -source_tileset $(RESDIR)/splash_screen_tileset.png -noflip + ${PNG2ASSET} ${RESDIR}/splash_screen_tileset.png -c ${GENDIR}/splash_screen_tileset.c -tiles_only -map -noflip prepare: mkdir -p $(DSTDIR) diff --git a/res/splash_screen_tileset.png b/res/splash_screen_tileset.png new file mode 100644 index 0000000000000000000000000000000000000000..974cb6978a296be765f8eb8cc1b79fc1183b35de GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^9ze{&!3-pGvppq&6k~CayA#8@b22Z19G(E55Z66d zd)n68JBKL%1(f#M8UiVnk|4iehX4QnZ`O6_0P?FmT^vI+Ce}`96lzf5aF+b@-=2NS zi4(Uf7a7g#@;DhGFsW0X!En~@rQd~?oJbLjJ9nk5_sfF=D>@uC0`9sioSmY_{{L*( zh4_%~r4zc0P15@}f7p2I)r4hCEfFVdQ&MBb@0Ps9lH~;_u literal 0 HcmV?d00001 diff --git a/src/main.c b/src/main.c index ea9b781..012610d 100644 --- a/src/main.c +++ b/src/main.c @@ -1,13 +1,18 @@ #include -#include +#include #include "splash_screen.h" +#include "splash_screen_tileset.h" #define TILEMAP_WIDTH_IN_TILES (splash_screen_WIDTH >> 3) #define TILEMAP_HEIGHT_IN_TILES (splash_screen_HEIGHT >> 3) -void main() +void main(void) { SHOW_BKG; - set_bkg_data(0, splash_screen_TILE_COUNT, splash_screen_tiles); + set_bkg_data(0, splash_screen_tileset_TILE_COUNT, splash_screen_tileset_tiles); set_bkg_tiles(0, 0, TILEMAP_WIDTH_IN_TILES, TILEMAP_HEIGHT_IN_TILES, splash_screen_map); + + waitpad(J_START); + + printf("Hello World!"); }