mirror of
https://github.com/mars3142/gb-snake.git
synced 2026-03-12 19:49:05 +00:00
incl. debug configuration for vs code
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -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
24
.vscode/tasks.json
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
4
Makefile
4
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)
|
||||
|
||||
BIN
res/splash_screen_tileset.png
Normal file
BIN
res/splash_screen_tileset.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 232 B |
11
src/main.c
11
src/main.c
@@ -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!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user