Skip to content

Instantly share code, notes, and snippets.

👓
Looking for an internship

Eldred Habert ISSOtm

👓
Looking for an internship
Block or report user

Report or block ISSOtm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ISSOtm
ISSOtm / set_data.s
Created Apr 15, 2020
Optimized GBDK lib funcs
View set_data.s
.include "global.s"
.globl .copy_vram
;; BANKED: checked
.area _BASE
_set_bkg_data::
_set_win_data::
ld d, #0x90
@ISSOtm
ISSOtm / hardest_part_in_lexer.c
Created Apr 11, 2020
"@ISSOtm what's the hardest part about the lexer [of RGBDS]?"
View hardest_part_in_lexer.c
#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? */
/*
@ISSOtm
ISSOtm / popslide.asm
Created Apr 10, 2020
Sample from a VBlank handler to transfer tiles using "popslide"
View popslide.asm
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]
@ISSOtm
ISSOtm / make_compare.log
Last active Apr 2, 2020
As of commit c87f8512a4d736a847dbc69e09c781a29eeaa638. Forget that it didn't build `tools/gfx`, that's intended :p
View make_compare.log
make: Entering directory '/home/issotm/rgbds/test/pokecrystal/tools' gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o lzcomp lzcomp.c gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o png_dimensions png_dimensions.c gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o scan_includes scan_includes.c gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o palette palette.c gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o pokemon_animation pokemon_animation.c gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o pokemon_animation_graphics pokemon_animation_graphics.c gcc -O3 -std=c99 -Wall -Wextra -Wno-missing-field-initializers -o md5 md5.c make: Leaving directory '/home/issotm/rgbds/test/pokecrystal/tools'
rgbasm -L -o audio.o audio.asm
rgbasm -L -o home.o home.asm
rgbgfx -o gfx/sgb/sgb_border.2bpp gfx/sgb/sgb_border.png
tools/gfx --trim-whitespace -o gfx/sgb/sgb_border.2bpp gfx/sgb/sgb_border.2bpp
==2645597== Memcheck, a me
@ISSOtm
ISSOtm / change.log
Created Mar 31, 2020
WIP changelog for RGBDS 0.4.0
View change.log
All:
added long options
removed undefined behavior in a couple places, improves reliability across systems
nightlies builds now available on GitHub
RGBASM:
**deprecated colon-less non-local labels**
deprecated `GLOBAL` and `XDEF` keywords
deprecated `OPT z` in favor of new `OPT p`
removed deprecated `IMPORT` keyword
@ISSOtm
ISSOtm / vblank_copy.asm
Created Mar 31, 2020
Help me code golf this pls
View vblank_copy.asm
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
@ISSOtm
ISSOtm / language_menu.asm
Last active Mar 30, 2020
Menu system, designed for Motherboard GB, and ported elsewhere...
View language_menu.asm
SECTION "Language menu header", ROMX
LanguageMenuHeader::
db BANK("Language menu")
dw LanguageMenuInit
db PADF_START | PADF_DOWN | PADF_UP
db 0 ; Prevent repeat press
dw 0, 0, 0, ForceMenuValidation, 0, 0, 0, 0
db 0 ; Previous item
@ISSOtm
ISSOtm / core.asm.diff
Last active Mar 15, 2020
Partial add of Hail to Pokémon Crystal
View core.asm.diff
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index f8d99b24e..f56744186 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1690,8 +1690,11 @@ HandleWeather:
call .PrintWeatherMessage
ld a, [wBattleWeather]
+ cp WEATHER_HAIL
+ jr z, .hailOrSandstorm
@ISSOtm
ISSOtm / getname.asm
Created Mar 14, 2020
pokered's `GetName` but with fallback
View getname.asm
NamePointers::
dbbw BANK(TrainerNames), ?, MonsterNames ; Bank doesn't matter
dbbw BANK(MoveNames), ?, MoveNames
dbbw BANK(UnusedNames), 0, UnusedNames
dbbw BANK(ItemNames), ?, ItemNames
dbbw BANK(wPartyMonOT), 6, wPartyMonOT
dbbw BANK(wEnemyMonOT), 6, wEnemyMonOT
dbbw BANK(TrainerNames), ?, TrainerNames
FallbackName:
@ISSOtm
ISSOtm / gbdiff.bash
Created Jan 26, 2020
Bash script for diffing Game Boy ROMs. Requires `diff` and `xxd`! Outputs GB addresses instead of ROM offsets, and tries to use SYM files to provide label locations as well.
View gbdiff.bash
#!/bin/bash
STATE=0
diff <(xxd $1) <(xxd $2) | while read -r LINE; do
if [ $STATE -eq 0 ]; then
# Discard first line (line info)
STATE=1
elif [ "$LINE" = '---' ]; then
# Separator between files switches states
echo $LINE
You can’t perform that action at this time.