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
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
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
.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
#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
push de | |
ld [wSP], sp | |
ldh a, [hVRAMCopySrc] | |
ld l, a | |
ldh a, [hVRAMCopySrc+1] | |
ld h, a | |
ld sp, hl | |
ldh a, [hVRAMCopyDest] | |
ld l, a | |
ldh a, [hVRAMCopyDest+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
jr z, .noVRAMTransfer ; This JR is out of range | |
ld c, a | |
ldh a, [hConsoleType] | |
and a | |
jr z, .GDMA | |
ld [wSP], sp | |
ldh a, [hVRAMCopySrc] | |
ld l, a | |
ldh a, [hVRAMCopySrc+1] | |
ld h, a |
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
template<typename Ts...> | |
char * reassembleString(Ts... ts) { | |
char * fragments[]{ts...}; | |
size_t size = 0; | |
for(size_t i = 0; i < sizeof...(Ts); i++) { | |
size += strlen(fragments[i]); | |
} | |
char * output = new char[size + 1]; | |
char * ptr = output; |
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 <stdlib.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include "link/main.h" | |
#include "link/script.h" | |
#include "link/section.h" |