A dungeon delver roguelike using Pathfinder 2nd edition rules
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Trying to add a rand_range function, errors for some reason:

+41 -4
+41 -4
gb/src/utils.asm
··· 42 42 Mul8:: 43 43 ld hl, 0 44 44 ld b, 8 45 - Mul8Loop: 45 + .Loop: 46 46 rrca 47 - jp nc, Mul8Skip 47 + jp nc, Mul8.Skip 48 48 add hl, de 49 - Mul8Skip: 49 + .Skip: 50 50 sla e 51 51 rl d 52 - STOP 52 + jp nz, Mul8.Loop 53 + ret 54 + 55 + ; A = HL % C 56 + Mod8:: 57 + ld b, 16 58 + .Loop 59 + xor a 60 + add hl, hl 61 + rla 62 + cp c 63 + jp c, Mod8.Exit 64 + inc l 65 + sub c 66 + jr nz, Mod8.Loop 67 + .Exit 68 + ret 69 + 70 + ; from = b 71 + ; to = c 72 + ; ret = b 73 + rand_range:: 74 + push de 75 + 76 + call rand 77 + push hl 78 + push af 79 + ld l, b 80 + ld h, 0 81 + add c, 1 82 + add c, b 83 + call Mod8 84 + ld e, a 85 + pop af 86 + pop hl 87 + add e, b 88 + ld b, e 89 + pop de 53 90 ret