From fb28d24bd78c7a322c4bd3129b57808c8f7cbbad Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 29 Aug 2013 21:42:28 -0400 Subject: [PATCH] condense repeated asm with rept macros --- main.asm | 81 +++++--------------------------------------------------- 1 file changed, 7 insertions(+), 74 deletions(-) diff --git a/main.asm b/main.asm index 0cd3625b4..0ff75f115 100644 --- a/main.asm +++ b/main.asm @@ -6367,87 +6367,19 @@ Function327b: ; 327b ld c, $41 .asm_328c pop de -.asm_328d + +rept 9 +.loop\@ ld a, [$ff00+c] and b - jr nz, .asm_328d - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_3296 - ld a, [$ff00+c] - and b - jr nz, .asm_3296 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_329f - ld a, [$ff00+c] - and b - jr nz, .asm_329f - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_32a8 - ld a, [$ff00+c] - and b - jr nz, .asm_32a8 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_32b1 - ld a, [$ff00+c] - and b - jr nz, .asm_32b1 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_32ba - ld a, [$ff00+c] - and b - jr nz, .asm_32ba - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_32c3 - ld a, [$ff00+c] - and b - jr nz, .asm_32c3 - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_32cc - ld a, [$ff00+c] - and b - jr nz, .asm_32cc - ld [hl], e - inc l - ld [hl], d - inc l - pop de -.asm_32d5 - ld a, [$ff00+c] - and b - jr nz, .asm_32d5 + jr nz, .loop\@ ld [hl], e inc l ld [hl], d inc l pop de +endr + .asm_32de ld a, [$ff00+c] and b @@ -6456,6 +6388,7 @@ Function327b: ; 327b inc l ld [hl], d inc l + ld de, $000c add hl, de ld a, [$ffd3]