Day 1

1 minute read

Day Summary

  • 8h30: first meeting :blush:

  • 9h-11h30: install party.
    • Everyone has now WLA DX install with a linux distro (Arch, Ubuntu or Ubuntu subsystem for Window).
    • Everyone has now vbam-wx or BGB installed. (vbam-wx for linux, BGB for windows).
  • 13h30-15h15: Z80 asm crash course.
    • registers
    • heap
    • instructions
    • jump
  • 15h15-16h15: TP, programing in asm using a template with the gb initialized and the ploting of a sprite already handled.

TP Setup

  • 16h15-17h: Z80 asm crash course 2, functions
    • PC
    • Stack
    • function
    • calling conventions
    • interruptions
  • 17h: debrief

Other:

#################
# Configuration #
#################

# Assembleur options
ASSEMBLER=wla-gb
LINKER=wlalink
AFLAGS=
LFLAGS=-d -v -s

# Folders
SRC=src
BIN=bin
INCLUDE=src ##TODO : separate include from SRC (read wla doc)
INSTALL="/media/B009-9376/1 Game Boy/5 Team Rocket"

# Files
TARGET=rocket
SOURCE_FILES =\
	pong.s 

##############
# Directives #
##############
OBJECT_FILES = $(SOURCE_FILES:%.s=$(BIN)/%.o)
TARGET_FILE = $(BIN)/$(TARGET).gb
LINK_FILE = $(BIN)/linkfile

all: directories $(TARGET_FILE)

run: all
	vbam -f 17 $(TARGET_FILE)

install: all
	cp $(TARGET_FILE) $(INSTALL)


clean:
	rm -rf $(BIN)

directories:
	@mkdir -p $(BIN)

.PHONY: build clean directories

$(TARGET_FILE): $(OBJECT_FILES) $(LINK_FILE) 
	echo "Building $(OBJECT_FILES)"
	$(LINKER) $(LFLAGS) -r $(LINK_FILE) $(TARGET_FILE)
	
$(BIN)/%.o: $(SRC)/%.s
	$(ASSEMBLER) $(AFLAGS) -I $(INCLUDE) -o $@ $<  

$(LINK_FILE): 
	echo "[objects]" > $(LINK_FILE)
	printf "%s\n" $(OBJECT_FILES) >> $(LINK_FILE)

TODO:

  • Find a way to install vbam-wx on windows and to hook it to gdb

  • Define coding convention
    • Calling convention
    • Documention
  • Introduction to advence git

  • Introduction to the stecifics of the gb architecture