0 Members and 1 Guest are viewing this topic.
I have an old model calc, though. =/
Code: (Original routine: 18 bytes, ~72 cycles) [Select]p_Nib1: .db __Nib1End-$-1 scf rr h rr l ld a,(hl) jr c,__Nib1Skip rrca rrca rrca rrca__Nib1Skip: and %00001111 ld l,a ld h,0 ret__Nib1End: Code: (Optimized routine: 17 bytes, ~105 cycles) [Select]p_Nib1: .db __Nib1End-$-1 xor a scf rr h rr l ld b,(hl)__Nib1Loop: rrd ccf jr c,__Nib1Loop ld (hl),b ld l,a ld h,0 ret__Nib1End:Code: (Original routine: 18 bytes, ~68 cycles) [Select]p_Nib2: .db __Nib2End-$-1 srl h rr l ld a,(hl) jr c,__Nib2Skip rrca rrca rrca rrca__Nib2Skip: and %00001111 ld l,a ld h,0 ret__Nib2End: Code: (Optimized routine: 15 bytes, ~77 cycles) [Select]p_Nib2: .db __Nib2End-$-1 xor a srl h rr l rrd jr c,__Nib2Skip rld__Nib2Skip: ld l,a ld h,0 ret__Nib2End:
p_Nib1: .db __Nib1End-$-1 scf rr h rr l ld a,(hl) jr c,__Nib1Skip rrca rrca rrca rrca__Nib1Skip: and %00001111 ld l,a ld h,0 ret__Nib1End:
p_Nib1: .db __Nib1End-$-1 xor a scf rr h rr l ld b,(hl)__Nib1Loop: rrd ccf jr c,__Nib1Loop ld (hl),b ld l,a ld h,0 ret__Nib1End:
p_Nib2: .db __Nib2End-$-1 srl h rr l ld a,(hl) jr c,__Nib2Skip rrca rrca rrca rrca__Nib2Skip: and %00001111 ld l,a ld h,0 ret__Nib2End:
p_Nib2: .db __Nib2End-$-1 xor a srl h rr l rrd jr c,__Nib2Skip rld__Nib2Skip: ld l,a ld h,0 ret__Nib2End:
Haha! Interesting bug, unintentional self-modifying code... And Runer, isn't that 2nd piece of code only 17 bytes? That's only a 2 byte total increase in size.
I've got a fake mem clear program compiled in 0.4.7 and it's now complete, but for some reason, it doesn't work when compiled in 0.5.1 and when I do a fake ram clear, the screen goes a little random. NEED HELP (plus i need a few optimizations)
In other news, Frey continues kicking unprecedented levels of ass.
I JUST DISCOVERED A HORRIFIC BUG!!!1Spoiler For Horrific bug: You misspelled "routines" in Commands.inc.