This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define keepOnGetc(var, handle) \ | |
do { \ | |
(var) = fgetc(handle); \ | |
} while ((var) == EOF && ferror(handle) && errno == EINTR) | |
/* Pointer to chars to inject in lexer input */ | |
static char const *insertPtr = NULL; | |
/* TODO: this doesn't handle interactive buffers; should it try to? */ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.include "global.s" | |
.globl .copy_vram | |
;; BANKED: checked | |
.area _BASE | |
_set_bkg_data:: | |
_set_win_data:: | |
ld d, #0x90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE "defines.asm" | |
SECTION "Palette buffer fading", ROM0 | |
; Applies fade to both palette buffers | |
; | |
FadePaletteBuffers:: | |
ld hl, wFadeSteps | |
dec [hl] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reset:: | |
di ; Disable interrupts while we set up | |
; Kill sound | |
xor a | |
ldh [rNR52], a | |
; Wait for VBlank and turn LCD off | |
.waitVBlank | |
ldh a, [rLY] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; File generated by rgblink | |
00:0008 WaitVBlank | |
00:0010 MemsetSmall | |
00:0018 MemcpySmall | |
00:0074 MemcpySmall.noVBlank | |
00:0076 LCDMemcpy | |
00:0079 LCDMemcpy.loop | |
00:008c LCDMemsetSmall | |
00:008d LCDMemsetSmallFromB | |
00:0099 CharsetPtrs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FadeDMGToWhite: | |
ld c, LOW(hBGP) | |
ld hl, wBGP | |
.fadeDMGPalToWhite | |
ld a, [hli] | |
ld b, 4 | |
.fadeDMGColorToWhite | |
ld e, a | |
and $C0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import itertools | |
import sys | |
if len(sys.argv) < 2: | |
print(f"Usage: {argv[0]} <subnet mask>\n\tSubnet mask must be in dotted decimal form.", file=sys.stderr) | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(BINDIR)/game.gb: $(SRCDIR)/tools/crcify.py $(OBJS) | |
@$(MKDIR) -p $(@D) | |
$(RGBLINK) $(LDFLAGS) -o $@ $(OBJS) | |
$(RGBFIX) $(FIXFLAGS) $@ | |
$(RGBASM) $(ASFLAGS) -D'BANK_BYTE=$$'$$(xxd -s 0x148 -l 1 -p $@) -o $(OBJDIR)/crc.o $(SRCDIR)/crc.asm | |
$(RGBLINK) $(LDFLAGS) -o $@ $(OBJS) \ | |
&& $(RGBFIX) $(FIXFLAGS) $@ \ | |
&& $(PY) $< $@ \ | |
&& $(RGBFIX) $(FIXFLAGS) $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NEWCHARMAP "Low byte" | |
charmap "A", $12 | |
NEWCHARMAP "High byte" | |
charmap "A", $34 | |
; ... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLEASE NOTE THAT THIS WAS MADE FOR C-INTERCAL | |
PLEASE DO .10 <- #18 | |
PLEASE DO ,10 <- .10 | |
PLEASE DO ,11 <- .10 | |
DO NOT BE AFRAID, THESE ARE ASCII NUMBERS, NOT "TURING TAPE" | |
DO ,10SUB#1 <- #65 | |
DO ,10SUB#2 <- #114 | |
DO ,10SUB#3 <- #99 | |
DO ,10SUB#4 <- #104 |