Skip to content

Commit

Permalink
Merge pull request #22 from afska/v7.0.0
Browse files Browse the repository at this point in the history
🟪 LinkCube, 📱 LinkMobile, ⚙️ lots of improvements
  • Loading branch information
afska authored Aug 27, 2024
2 parents 4ea8ec0 + 8cc6e90 commit 31136a8
Show file tree
Hide file tree
Showing 159 changed files with 11,241 additions and 2,627 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Directories
build
.vscode
build/
.vscode/
node_modules/

# Files
examples/multiboot
.DS_Store
*.elf
*.gba
*.sav
*.sa1
*.sa2
*.sa3
*.sa4
*.sa4
17 changes: 17 additions & 0 deletions .licenses/gba-hpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
gba-hpp is available under the [zlib license](https://www.zlib.net/zlib_license.html) :

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
276 changes: 226 additions & 50 deletions README.md

Large diffs are not rendered by default.

213 changes: 107 additions & 106 deletions docs/gbatek.md

Large diffs are not rendered by default.

Binary file added docs/img/link-cable-multiboot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-cable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-cube.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-gpio.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-mobile.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-raw-cable.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-raw-wireless.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-spi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/link-uart.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/pinout-raspberry-pi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/pinout-uart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
454 changes: 454 additions & 0 deletions docs/mobile_adapter.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/multiboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@
<li>MultiPlay mode: <a href="https://www.problemkaputt.de/gbatek.htm#siomultiplayermode" rel="nofollow noreferrer">https://www.problemkaputt.de/gbatek.htm#siomultiplayermode</a></li>
</ul>
</div>
</html>
</html>
499 changes: 241 additions & 258 deletions docs/wireless_adapter.md

Large diffs are not rendered by default.

37 changes: 19 additions & 18 deletions examples/LinkCableMultiboot_demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export TONCLIB := ${DEVKITPRO}/libtonc

# === TONC RULES ======================================================
#
# Yes, this is almost, but not quite, completely like to
# Yes, this is almost, but not quite, completely like to
# DKP's base_rules and gba_rules
#

Expand Down Expand Up @@ -53,7 +53,7 @@ export OBJCOPY := $(PREFIX)objcopy

%.elf :
@echo Linking cartridge
$(LD) -specs=gba.specs $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
$(LD) -specs=gba.specs $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
$(NM) -Sn $@ > $(basename $(notdir $@)).map

#----------------------------------------------------------------------
Expand All @@ -69,7 +69,7 @@ export OBJCOPY := $(PREFIX)objcopy
%.iwram.o : %.iwram.cpp
@echo $(notdir $<)
$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) $(IARCH) -c $< -o $@

#----------------------------------------------------------------------
%.iwram.o : %.iwram.c
@echo $(notdir $<)
Expand Down Expand Up @@ -134,22 +134,22 @@ TITLE := $(PROJ)
LIBS := -ltonc -lugba

BUILD := build
SRCDIRS := src ../_lib ../../lib
SRCDIRS := src ../_lib ../../lib ../_lib/libgbfs
DATADIRS := data
INCDIRS := src
LIBDIRS := $(TONCLIB) $(PWD)/../_lib/libugba

# --- switches ---

bMB := 1 # Multiboot build
bMB := 0 # Multiboot build
bTEMPS := 0 # Save gcc temporaries (.i and .s files)
bDEBUG2 := 0 # Generate debug info (bDEBUG2? Not a full DEBUG flag. Yet)


# === BUILD FLAGS =====================================================
# This is probably where you can stop editing
# NOTE: I've noticed that -fgcse and -ftree-loop-optimize sometimes muck
# up things (gcse seems fond of building masks inside a loop instead of
# NOTE: I've noticed that -fgcse and -ftree-loop-optimize sometimes muck
# up things (gcse seems fond of building masks inside a loop instead of
# outside them for example). Removing them sometimes helps

# --- Architecture ---
Expand All @@ -160,15 +160,16 @@ IARCH := -mthumb-interwork -marm -mlong-calls

# --- Main flags ---

CFLAGS := -mcpu=arm7tdmi -mtune=arm7tdmi -O2
CFLAGS := -mcpu=arm7tdmi -mtune=arm7tdmi -Ofast
CFLAGS += -Wall
CFLAGS += $(INCLUDE)
CFLAGS += -ffast-math -fno-strict-aliasing

CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
USERFLAGS ?=
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=c++17 -DLINK_DEVELOPMENT $(USERFLAGS)

ASFLAGS := $(ARCH) $(INCLUDE)
LDFLAGS := $(ARCH) -Wl,-Map,$(PROJ).map
LDFLAGS := $(ARCH) -Wl,--print-memory-usage,-Map,$(PROJ).map

# --- switched additions ----------------------------------------------

Expand Down Expand Up @@ -203,7 +204,7 @@ endif

ifneq ($(BUILD),$(notdir $(CURDIR)))

# Still in main dir:
# Still in main dir:
# * Define/export some extra variables
# * Invoke this file again from the build dir
# PONDER: what happens if BUILD == "" ?
Expand Down Expand Up @@ -238,7 +239,7 @@ export OFILES := $(addsuffix .o, $(BINFILES)) \
export INCLUDE := $(foreach dir,$(INCDIRS),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)

export LIBPATHS := -L$(CURDIR) $(foreach dir,$(LIBDIRS),-L$(dir)/lib)

# --- Create BUILD if necessary, and run this makefile from there ---
Expand All @@ -247,9 +248,6 @@ $(BUILD):
@[ -d $@ ] || mkdir -p $@
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
arm-none-eabi-nm -Sn $(OUTPUT).elf > $(BUILD)/$(TARGET).map
mv $(OUTPUT).gba tmp.gba
./pad16.sh tmp.gba
mv tmp.gba $(OUTPUT).gba

all : $(BUILD)

Expand Down Expand Up @@ -278,10 +276,13 @@ endif # End BUILD switch

.PHONY: clean rebuild start

rebuild: clean $(BUILD)
rebuild: clean $(BUILD) package

package: $(BUILD)
../gbfs.sh "$(TARGET).gba" content.gbfs "$(TARGET).out.gba"

start:
start "$(TARGET).gba"
start: package
start "$(TARGET).out.gba"

restart: rebuild start

Expand Down
Binary file added examples/LinkCableMultiboot_demo/content.gbfs
Binary file not shown.
Loading

0 comments on commit 31136a8

Please sign in to comment.