Skip to content

Commit 4aa6f4a

Browse files
committed
Initial import.
0 parents  commit 4aa6f4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3086
-0
lines changed

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SlitherlinkNX
2+
3+
## Introduction
4+
5+
Slitherlink is a logic puzzle game created in 1989 by Japanese publisher Nikoli,
6+
famous for creating Sudoku, among many other puzzle games.
7+
See https://en.wikipedia.org/wiki/Slitherlink for more info.
8+
9+
I discovered the game a few years ago on the Nintendo DS with 'Puzzle Series
10+
Vol. 5: Slitherlink', which was never released outside of Japan. It's such a
11+
good game I became addicted to it, just like with Picross and Nurikabe.
12+
13+
This is my version of the game for the Nintendo Switch. It's a rewrite of one
14+
of my previous projects for the Dingoo A320. It features 456 levels in four
15+
sizes: 5x5 (easy), 7x7, 10x10, 20x20 (hard). There's also a save state function,
16+
undo button, and more.
17+
18+
## Rules
19+
20+
In SlitherlinkNX, you draw lines on a grid to create a meandering path, following
21+
the rules:
22+
23+
* The path must form a __single loop__, without crossing itself or branching.
24+
* The numbers indicate how many lines surround each cell. Empty cells may be
25+
surrounded by any number of lines.
26+
27+
There is one unique solution for each level.
28+
You can draw small x's on segments that cannot be connected.
29+
You should be able to find the solution by logical deduction only, without guessing.
30+
31+
For Slitherlink beginners, I strongly recommend to consult the Wikipedia page,
32+
especially chapter 'Solution methods', which is a big help at the start:
33+
https://en.wikipedia.org/wiki/Slitherlink#Solution_methods
34+
35+
## Controls
36+
37+
* d-pad / analog stick: move cursor
38+
* X/A/B/Y: draw a line, then a cross, then nothing, in the corresponding direction
39+
* L + X/A/B/Y: draw a cross, then a line, then nothing, in the corresponding direction
40+
* R: undo previous action
41+
* +: open menu, allowing to: retry, save state, or quit
42+
43+
## Installation
44+
45+
Download the latest release, unpack, and copy directory 'SlitherlinkNX' to the
46+
SD card, in /switch/. Then, launch with the homebrew menu.
47+
48+
## Compilation
49+
50+
You'll need devkitpro, and the packages switch-sdl2, switch-sdl2_image,
51+
switch-sdl2_mixer. Then: 'make -f makefile.switch'.
52+
It's based on SDL2, so it can be built for PC too.
53+
54+
## History
55+
56+
v1.0: First release
57+
58+
## Credits
59+
60+
* Development: Tardigrade (http://beyondds.free.fr/)
61+
* Original game: Nikoli (http://www.nikoli.com/)
62+
* Puzzles: Krazydad (http://www.krazydad.com/slitherlink/)
63+
* Font: Chopin Script
64+
* Sounds: Junggle
65+
* Background: aopsan

icon.jpg

33.2 KB
Loading

makefile.linux

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OBJS = $(wildcard src/*.cpp)
2+
CC = g++
3+
COMPILER_FLAGS = -Wall
4+
LINKER_FLAGS = -lSDL2 -lSDL2_image -lSDL2_mixer
5+
OBJ_NAME = SlitherlinkNX
6+
7+
all : $(OBJS)
8+
$(CC) $(OBJS) -o $(OBJ_NAME) $(COMPILER_FLAGS) $(LINKER_FLAGS)
9+
10+
clean :
11+
rm -f $(OBJ_NAME)

makefile.switch

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
#---------------------------------------------------------------------------------
2+
.SUFFIXES:
3+
#---------------------------------------------------------------------------------
4+
5+
ifeq ($(strip $(DEVKITPRO)),)
6+
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
7+
endif
8+
9+
TOPDIR ?= $(CURDIR)
10+
include $(DEVKITPRO)/libnx/switch_rules
11+
12+
#---------------------------------------------------------------------------------
13+
# TARGET is the name of the output
14+
# BUILD is the directory where object files & intermediate files will be placed
15+
# SOURCES is a list of directories containing source code
16+
# DATA is a list of directories containing data files
17+
# INCLUDES is a list of directories containing header files
18+
# EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm".
19+
# ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional)
20+
#
21+
# NO_ICON: if set to anything, do not use icon.
22+
# NO_NACP: if set to anything, no .nacp file is generated.
23+
# APP_TITLE is the name of the app stored in the .nacp file (Optional)
24+
# APP_AUTHOR is the author of the app stored in the .nacp file (Optional)
25+
# APP_VERSION is the version of the app stored in the .nacp file (Optional)
26+
# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional)
27+
# ICON is the filename of the icon (.jpg), relative to the project folder.
28+
# If not set, it attempts to use one of the following (in this order):
29+
# - <Project name>.jpg
30+
# - icon.jpg
31+
# - <libnx folder>/default_icon.jpg
32+
#---------------------------------------------------------------------------------
33+
TARGET := $(notdir $(CURDIR))
34+
BUILD := build
35+
SOURCES := src
36+
# DATA := data
37+
INCLUDES := src
38+
EXEFS_SRC := exefs_src
39+
ROMFS := res
40+
41+
APP_TITLE := SlitherlinkNX
42+
APP_AUTHOR := Tardigrade
43+
APP_VERSION := 1.0
44+
45+
#---------------------------------------------------------------------------------
46+
# options for code generation
47+
#---------------------------------------------------------------------------------
48+
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
49+
50+
CFLAGS := -g -Wall -O2 -ffunction-sections \
51+
$(ARCH) $(DEFINES)
52+
53+
CFLAGS += $(INCLUDE) -D__SWITCH__
54+
55+
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
56+
57+
ASFLAGS := -g $(ARCH)
58+
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
59+
60+
LIBS := -lSDL2_image -lSDL2_mixer -lSDL2 -lpng -lz -ljpeg -lEGL -lglapi -ldrm_nouveau -lnx -lmodplug -lmpg123 -lvorbisidec -logg
61+
#---------------------------------------------------------------------------------
62+
# list of directories containing libraries, this must be the top level containing
63+
# include and lib
64+
#---------------------------------------------------------------------------------
65+
LIBDIRS := $(PORTLIBS) $(LIBNX)
66+
67+
68+
#---------------------------------------------------------------------------------
69+
# no real need to edit anything past this point unless you need to add additional
70+
# rules for different file extensions
71+
#---------------------------------------------------------------------------------
72+
ifneq ($(BUILD),$(notdir $(CURDIR)))
73+
#---------------------------------------------------------------------------------
74+
75+
export OUTPUT := $(CURDIR)/$(TARGET)
76+
export TOPDIR := $(CURDIR)
77+
78+
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
79+
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
80+
81+
export DEPSDIR := $(CURDIR)/$(BUILD)
82+
83+
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
84+
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
85+
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
86+
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
87+
88+
#---------------------------------------------------------------------------------
89+
# use CXX for linking C++ projects, CC for standard C
90+
#---------------------------------------------------------------------------------
91+
ifeq ($(strip $(CPPFILES)),)
92+
#---------------------------------------------------------------------------------
93+
export LD := $(CC)
94+
#---------------------------------------------------------------------------------
95+
else
96+
#---------------------------------------------------------------------------------
97+
export LD := $(CXX)
98+
#---------------------------------------------------------------------------------
99+
endif
100+
#---------------------------------------------------------------------------------
101+
102+
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
103+
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
104+
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
105+
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
106+
107+
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
108+
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
109+
-I$(CURDIR)/$(BUILD)
110+
111+
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
112+
113+
export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC)
114+
115+
ifeq ($(strip $(ICON)),)
116+
icons := $(wildcard *.jpg)
117+
ifneq (,$(findstring $(TARGET).jpg,$(icons)))
118+
export APP_ICON := $(TOPDIR)/$(TARGET).jpg
119+
else
120+
ifneq (,$(findstring icon.jpg,$(icons)))
121+
export APP_ICON := $(TOPDIR)/icon.jpg
122+
endif
123+
endif
124+
else
125+
export APP_ICON := $(TOPDIR)/$(ICON)
126+
endif
127+
128+
ifeq ($(strip $(NO_ICON)),)
129+
export NROFLAGS += --icon=$(APP_ICON)
130+
endif
131+
132+
ifeq ($(strip $(NO_NACP)),)
133+
export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp
134+
endif
135+
136+
ifneq ($(APP_TITLEID),)
137+
export NACPFLAGS += --titleid=$(APP_TITLEID)
138+
endif
139+
140+
ifneq ($(ROMFS),)
141+
export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS)
142+
endif
143+
144+
.PHONY: $(BUILD) clean all
145+
146+
#---------------------------------------------------------------------------------
147+
all: $(BUILD)
148+
149+
$(BUILD):
150+
@[ -d $@ ] || mkdir -p $@
151+
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/makefile.switch
152+
153+
#---------------------------------------------------------------------------------
154+
clean:
155+
@echo clean ...
156+
@rm -fr $(BUILD) $(TARGET).pfs0 $(TARGET).nso $(TARGET).nro $(TARGET).nacp $(TARGET).elf
157+
158+
159+
#---------------------------------------------------------------------------------
160+
else
161+
.PHONY: all
162+
163+
DEPENDS := $(OFILES:.o=.d)
164+
165+
#---------------------------------------------------------------------------------
166+
# main targets
167+
#---------------------------------------------------------------------------------
168+
all : $(OUTPUT).pfs0 $(OUTPUT).nro
169+
170+
$(OUTPUT).pfs0 : $(OUTPUT).nso
171+
172+
$(OUTPUT).nso : $(OUTPUT).elf
173+
174+
ifeq ($(strip $(NO_NACP)),)
175+
$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp
176+
else
177+
$(OUTPUT).nro : $(OUTPUT).elf
178+
endif
179+
180+
$(OUTPUT).elf : $(OFILES)
181+
182+
$(OFILES_SRC) : $(HFILES_BIN)
183+
184+
#---------------------------------------------------------------------------------
185+
# you need a rule like this for each extension you use as binary data
186+
#---------------------------------------------------------------------------------
187+
%.bin.o %_bin.h : %.bin
188+
#---------------------------------------------------------------------------------
189+
@echo $(notdir $<)
190+
@$(bin2o)
191+
192+
-include $(DEPENDS)
193+
194+
#---------------------------------------------------------------------------------------
195+
endif
196+
#---------------------------------------------------------------------------------------

makefile.win

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
OBJS = $(wildcard src/*.cpp)
2+
CC = g++
3+
INCLUDE_PATHS = -IC:\mingw_dev_lib\SDL2-2.0.8\i686-w64-mingw32\include \
4+
-IC:\mingw_dev_lib\SDL2-2.0.8\i686-w64-mingw32\include\SDL2 \
5+
-IC:\mingw_dev_lib\SDL2_image-2.0.3\i686-w64-mingw32\include \
6+
-IC:\mingw_dev_lib\SDL2_mixer-2.0.2\i686-w64-mingw32\include
7+
LIBRARY_PATHS = -LC:\mingw_dev_lib\SDL2-2.0.8\i686-w64-mingw32\lib \
8+
-LC:\mingw_dev_lib\SDL2_image-2.0.3\i686-w64-mingw32\lib \
9+
-LC:\mingw_dev_lib\SDL2_mixer-2.0.2\i686-w64-mingw32\lib
10+
# Add '-Wl,-subsystem,windows' to COMPILER_FLAGS to get rid of the console window
11+
COMPILER_FLAGS = -Wall
12+
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer
13+
OBJ_NAME = SlitherlinkNX
14+
15+
all : $(OBJS)
16+
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)
17+
cp c:/MinGW/bin/libstdc++-6.dll .
18+
cp c:/mingw_dev_lib/SDL2-2.0.8/i686-w64-mingw32/bin/SDL2.dll .
19+
cp c:/mingw_dev_lib/SDL2_image-2.0.3/i686-w64-mingw32/bin/*.dll .
20+
cp c:/mingw_dev_lib/SDL2_mixer-2.0.2/i686-w64-mingw32/bin/*.dll .
21+
22+
clean :
23+
rm -f $(OBJ_NAME).exe *.dll

res/arrowDown.png

257 Bytes
Loading

res/arrowLeft.png

265 Bytes
Loading

res/arrowRight.png

305 Bytes
Loading

res/arrowUp.png

218 Bytes
Loading

res/background.png

1.56 MB
Loading

0 commit comments

Comments
 (0)