From 64a6af405240dcef1fdf4b4d321d9cc2093d2fd0 Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 29 Aug 2013 20:02:40 -0400 Subject: [PATCH] condense some repetitive asm with rept macros --- main.asm | 95 +++++--------------------------------------------------- 1 file changed, 7 insertions(+), 88 deletions(-) diff --git a/main.asm b/main.asm index ab23266d3..17a7b7b8a 100644 --- a/main.asm +++ b/main.asm @@ -421,51 +421,13 @@ UpdateBGMap: ; 164c .row ; write a row of 20 tiles +rept 9 pop de ld [hl], e inc l ld [hl], d inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l +endr pop de ld [hl], e inc l @@ -528,6 +490,8 @@ GetTiles2: ; 1717 .loop ; put 1 tile (16 bytes) into hl from sp + +rept 3 pop de ld [hl], e inc l @@ -537,24 +501,7 @@ GetTiles2: ; 1717 inc l ld [hl], d inc l - pop de - ld [hl], e - inc l - ld [hl], e - inc l - ld [hl], d - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], e - inc l - ld [hl], d - inc l - ld [hl], d - inc l +endr pop de ld [hl], e inc l @@ -639,41 +586,13 @@ GetTiles: ; 177d .loop ; put 1 tile (16 bytes) into hl from sp +rept 7 pop de ld [hl], e inc l ld [hl], d inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l - pop de - ld [hl], e - inc l - ld [hl], d - inc l +endr pop de ld [hl], e inc l