incl. debug configuration for vs code

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2023-11-20 22:52:29 +01:00
parent 7c440e4523
commit 5143e55753
6 changed files with 55 additions and 5 deletions

17
.vscode/launch.json vendored Normal file
View File

@@ -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"
}
]
}

View File

@@ -1,5 +1,7 @@
{
"files.associations": {
"stdint.h": "c"
"stdint.h": "c",
"splash_screen.h": "c",
"gb.h": "c"
}
}

24
.vscode/tasks.json vendored Normal file
View File

@@ -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
}
}
]
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

View File

@@ -1,13 +1,18 @@
#include <gb/gb.h>
#include <stdint.h>
#include <stdio.h>
#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!");
}