From 7d4486e6a34a5163575400f21e806471be496e3d Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Sun, 24 Dec 2017 19:35:35 -0500 Subject: Remove all code from main.asm (some labeled INCBINs, like out-of-context graphics, are still present) engine/routines/ stores isolated out-of-context routines as individual files. It might be preferable later to append them to their related engine/ files in unique little SECTIONs, relying on the linkerscript to place them appropriately; or some other organization method. In the meantime, they're now easily findable apart from main.asm's other content. --- engine/check_nick_errors.asm | 74 -------------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 engine/check_nick_errors.asm (limited to 'engine/check_nick_errors.asm') diff --git a/engine/check_nick_errors.asm b/engine/check_nick_errors.asm deleted file mode 100644 index 1cedca420..000000000 --- a/engine/check_nick_errors.asm +++ /dev/null @@ -1,74 +0,0 @@ -CheckNickErrors:: ; 669f -; error-check monster nick before use -; must be a peace offering to gamesharkers - -; input: de = nick location - - push bc - push de - ld b, PKMN_NAME_LENGTH - -.checkchar -; end of nick? - ld a, [de] - cp "@" ; terminator - jr z, .end - -; check if this char is a text command - ld hl, .textcommands - dec hl -.loop -; next entry - inc hl -; reached end of commands table? - ld a, [hl] - cp -1 - jr z, .done - -; is the current char between this value (inclusive)... - ld a, [de] - cp [hl] - inc hl - jr c, .loop -; ...and this one? - cp [hl] - jr nc, .loop - -; replace it with a "?" - ld a, "?" - ld [de], a - jr .loop - -.done -; next char - inc de -; reached end of nick without finding a terminator? - dec b - jr nz, .checkchar - -; change nick to "?@" - pop de - push de - ld a, "?" - ld [de], a - inc de - ld a, "@" - ld [de], a -.end -; if the nick has any errors at this point it's out of our hands - pop de - pop bc - ret - -.textcommands ; 66cf -; table defining which characters are actually text commands -; format: - ; ≥ < - db "", TX_BOX + 1 - db "", $18 + 1 - db $1d, "%" + 1 - db $35, "" + 1 - db "", "" + 1 - db "", "" + 1 - db "", "┘" + 1 - db -1 ; end -- cgit v1.2.3