Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Monster Rancher Battle Card GB/ROM map

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a ROM map for Monster Rancher Battle Card GB.

Bank 3A

Reduce Monsters' Life Points

RO3A:6177 06 00            ld   b,00
RO3A:6179 16 00            ld   d,00
RO3A:617B 3E 03            ld   a,03
RO3A:617D F5               push af
RO3A:617E 21 F0 C1         ld   hl,C1F0
RO3A:6181 79               ld   a,c         ;hl + c to point to the current Monster's LPs
RO3A:6182 85               add  l
RO3A:6183 6F               ld   l,a
RO3A:6184 7C               ld   a,h
RO3A:6185 CE 00            adc  a,00
RO3A:6187 67               ld   h,a
RO3A:6188 7E               ld   a,(hl)
RO3A:6189 CB 27            sla  a
RO3A:618B CB 27            sla  a
RO3A:618D 21 00 4C         ld   hl,4C00
RO3A:6190 85               add  l
RO3A:6191 6F               ld   l,a
RO3A:6192 7C               ld   a,h
RO3A:6193 CE 00            adc  a,00
RO3A:6195 67               ld   h,a
RO3A:6196 56               ld   d,(hl)
RO3A:6197 21 F6 C1         ld   hl,C1F6     ;Monsters LPs
RO3A:619A 79               ld   a,c         ;hl + c to point to the current Monster's LPs
RO3A:619B 85               add  l
RO3A:619C 6F               ld   l,a
RO3A:619D 7C               ld   a,h
RO3A:619E CE 00            adc  a,00
RO3A:61A0 67               ld   h,a
RO3A:61A1 46               ld   b,(hl)      ;Load the current Monster's LPs to b
RO3A:61A2 21 68 C3         ld   hl,C368
RO3A:61A5 7B               ld   a,e         ;hl + e to point to the current card used on the monster
RO3A:61A6 85               add  l
RO3A:61A7 6F               ld   l,a
RO3A:61A8 7C               ld   a,h
RO3A:61A9 CE 00            adc  a,00
RO3A:61AB 67               ld   h,a
RO3A:61AC CB 7E            bit  7,(hl)
RO3A:61AE 28 04            jr   z,61B4      ;if bit 7 of the current card is set, jump to 3A:61B4
RO3A:61B0 78               ld   a,b
RO3A:61B1 BA               cp   d
RO3A:61B2 30 34            jr   nc,61E8
RO3A:61B4 78               ld   a,b
RO3A:61B5 96               sub  (hl)
RO3A:61B6 47               ld   b,a
RO3A:61B7 CB 78            bit  7,b
RO3A:61B9 28 02            jr   z,61BD
RO3A:61BB 06 00            ld   b,00
RO3A:61BD 21 68 C3         ld   hl,C368
RO3A:61C0 7B               ld   a,e
RO3A:61C1 85               add  l
RO3A:61C2 6F               ld   l,a
RO3A:61C3 7C               ld   a,h
RO3A:61C4 CE 00            adc  a,00
RO3A:61C6 67               ld   h,a
RO3A:61C7 7E               ld   a,(hl)
RO3A:61C8 CB 7F            bit  7,a
RO3A:61CA 28 05            jr   z,61D1
RO3A:61CC 78               ld   a,b
RO3A:61CD BA               cp   d
RO3A:61CE 38 01            jr   c,61D1
RO3A:61D0 42               ld   b,d
RO3A:61D1 78               ld   a,b
RO3A:61D2 B7               or   a
RO3A:61D3 20 13            jr   nz,61E8
RO3A:61D5 CD FA 61         call 61FA
RO3A:61D8 78               ld   a,b
RO3A:61D9 B7               or   a
RO3A:61DA 20 0C            jr   nz,61E8
RO3A:61DC 21 FC C1         ld   hl,C1FC
RO3A:61DF 79               ld   a,c
RO3A:61E0 85               add  l
RO3A:61E1 6F               ld   l,a
RO3A:61E2 7C               ld   a,h
RO3A:61E3 CE 00            adc  a,00
RO3A:61E5 67               ld   h,a
RO3A:61E6 CB 9E            res  3,(hl)
RO3A:61E8 21 F6 C1         ld   hl,C1F6     ;Monsters' LPs
RO3A:61EB 79               ld   a,c         ;hl + c to point to the current Monster's LPs
RO3A:61EC 85               add  l
RO3A:61ED 6F               ld   l,a
RO3A:61EE 7C               ld   a,h
RO3A:61EF CE 00            adc  a,00
RO3A:61F1 67               ld   h,a
RO3A:61F2 70               ld   (hl),b      ;Update the current Monster's LP after calculation
RO3A:61F3 0C               inc  c           ;Next monster
RO3A:61F4 1C               inc  e
RO3A:61F5 F1               pop  af
RO3A:61F6 3D               dec  a
RO3A:61F7 20 84            jr   nz,617D
RO3A:61F9 C9               ret