--- /dev/null
+* text=auto
--- /dev/null
+# Build directory
+bin/
+obj/
+tags
+
+ Prerequisites
+*.d
+
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+vgcore.*
+
+# Kernel Module Compile Results
+*.mod*
+*.cmd
+.tmp_versions/
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+
+compile_commands.json
+.cache/
+.clang_complete
+.clangd
+.session
+
+assets/
+*.pyc
--- /dev/null
+Copyright 2024 Lukas Krickl (lukas@krickl.dev)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction,
+including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS",
+WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null
+# tbgb
+
+An action rougelike platformer for the gameboy!
+
+## Table of content
+
+- [Installation](#Installation)
+- [Usage](#Usage)
+- [License](#License)
+- [Contributing](#Contributing)
+- [TODO](#TODO)
+
+## Installation
+
+## Usage
+
+### Building assets
+
+To build the assets simply check out the `assets repository` into the `assets` directory and run `make tiles`.
+This is only required if changes to the tileset were made. All 'compiled' tile directories are already included in this repository!
+
+## License
+
+This program is distributed under the terms of the MIT License.
+
+## Contributing
--- /dev/null
+AS=ulas
+BIN=rg.gb
+BDIR=bin/
+
+all:
+ mkdir -p $(BDIR)
+ ulas -v -o $(BDIR)/$(BIN) -l bin/rg.lst -s bin/rg.mlb -S mlb -i ./src -i ./tiles src/main.s
+
--- /dev/null
+; header
+ jp entry
+ nop
+logo:
+.db 0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B, 0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D
+.db 0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E, 0xDC, 0xCC, 0x6E, 0xE6, 0xDD, 0xDD, 0xD9, 0x99
+.db 0xBB, 0xBB, 0x67, 0x63, 0x6E, 0x0E, 0xEC, 0xCC, 0xDD, 0xDC, 0x99, 0x9F, 0xBB, 0xB9, 0x33, 0x3E
+logo_end:
+
+.str "tb"
+.fill 0, 0x147 - $
+
+; cartride type
+; MBC1+RAM+Battery
+.db 0x02
+.fill 0, 0x14D - $
+.chksm
+.fill 0, 0x150 - $
--- /dev/null
+; register defs
+
+#define SCRNW 159
+#define SCRNH 143
+
+; lcd registers
+
+; lcd y
+#define RLY 0xFF44
+#define RLYC 0xFF45
+#define RLCD 0xFF40
+
+#define LCDCF_BGON 0b00000001
+#define LCDCF_ON 0b10000000
+#define LCDCF_OBJON 0b00000010
+#define LCDF_WINDOWON 0b00100000
+
+#define RBGP 0xFF47
+#define ROBP0 0xFF48
+#define ROBP1 0xFF49
+
+; screen scroll y and x
+#define RSCY 0xFF42
+#define RSCX 0xFF43
+
+; window y and x
+#define RWY 0xFF4A
+#define RWX 0xFF4B
+
+; P1: joy pad register
+#define RP1 0xFF00
+#define P1F5 0b00100000 ; get buttons
+#define P1F4 0b00010000 ; get dpad
+
+; buttons
+#define BTNDOWN 0x80
+#define BTNUP 0x40
+#define BTNLEFT 0x20
+#define BTNRIGHT 0x10
+#define BTNSTART 0x08
+#define BTNSELECT 0x04
+#define BTNA 0x02
+#define BTNB 0x01
+
+; interrupts
+; interrupt flag
+#define IF 0xFF0F
+; interrupt enabled
+#define IE 0xFFFF
+#define IVBLANK 0b00000001
+
+; location where code for dma needs to be memcyp'd to
+.def int DMAFN = 0xFF80
+#define DMA 0xFF46
+
+#define OBJSMAX 40
+
+.def int P1FDPAD = P1F5
+.def int P1FBTN = P1F4
+.def int P1FNONE = P1F5 | P1F4
+
+; memory map
+.def int VRAM = 0x8000
+.def int VRAM9000 = VRAM+0x1000
+.def int SCRN0 = 0x9800
+.def int SCRN1 = 0x9C00
+.def int OAMRAM = 0xFE00
+.def int OBJSIZE = 4
+.def int OAMRAM_SIZE = OBJSMAX * OBJSIZE
+
+#define OAM_FYFLIP 0b01000000
+#define OAM_FXFLIP 0b00100000
+
+; MBC1 registers
+
+; write 0xA here to enable sram
+#define SRAM_ENABLE 0x0000
+#define ROM_BANKSEL 0x2000
+#define SRAM_BANKSEL 0x4000
--- /dev/null
+; RST $00
+; panic exception handler
+rst_panic:
+ di
+@forever:
+ jp @forever
+
+
+.fill 0, 0x40 - $
+
+; interrupt vectors
+
+;=============
+; vblank 0x40
+;=============
+vec_vblank:
+ push af
+ push bc
+ push de
+ push hl
+
+
+ pop hl
+ pop de
+ pop bc
+ pop af
+
+ reti
--- /dev/null
+#include "hw.inc"
+
+.org 0x0
+#include "jmp.inc"
+.fill 0, 0x100 - $
+#include "header.inc"
+
+entry:
+
+main:
+@forever:
+ jp @forever
+
+; fill bank
+.fill 0, 0x7FFF - $