I'll edit the bB page later today with the new code. Thanks bogax.

Here's essentially the same tarted up a bit

hi_scor
rem puts temp1 in the upper three score digits
scr0 = 0 : scr1 = scr1 & 15
if temp1 >= 100 then scr0 = scr0 + 16 : temp1 = temp1 - 100
if temp1 >= 100 then scr0 = scr0 + 16 : temp1 = temp1 - 100
if temp1 >= 50 then scr0 = scr0 + 5 : temp1 = temp1 - 50
if temp1 >= 30 then scr0 = scr0 + 3 : temp1 = temp1 - 30
if temp1 >= 20 then scr0 = scr0 + 2 : temp1 = temp1 - 20
if temp1 >= 10 then scr0 = scr0 + 1 : temp1 = temp1 - 10
scr1 = (temp1 * 4 * 4) | scr1
return
lo_scor
rem puts temp1 in the lower three digits of score
scr1 = scr1 & 240 : scr2 = 0
if temp1 >= 100 then scr1 = scr1 + 1 : temp1 = temp1 - 100
if temp1 >= 100 then scr1 = scr1 + 1 : temp1 = temp1 - 100
if temp1 >= 50 then scr2 = scr2 + 80 : temp1 = temp1 - 50
if temp1 >= 30 then scr2 = scr2 + 48 : temp1 = temp1 - 30
if temp1 >= 20 then scr2 = scr2 + 32 : temp1 = temp1 - 20
if temp1 >= 10 then scr2 = scr2 + 16 : temp1 = temp1 - 10
scr2 = scr2 | temp1
return

here's something similar but shorter and probably slower.

also uses two more temp variables

hi_scor
rem puts temp1 in the upper three score digits
scor0 = 0 : scor1 = scor1 & 15
hi_100s
if temp1 >= 100 then scor0 = scor0 + 16 : temp1 = temp1 - 100 : goto hi_100s
temp2 = 80 : temp3 = 8
hi_scor_loop
if temp1 >= temp2 then scor0 = scor0 + temp3 : temp1 = temp1 - temp2
temp2 = temp2 / 2 : temp3 = temp3 / 2
if temp3 then hi_scor_loop
scor1 = (temp1 * 4 * 4) | scor1
return
lo_scor
rem puts temp1 in the lower three digits of score
scor1 = scor1 & 240 : scor2 = 0
lo_100s
if temp1 >= 100 then scor1 = scor1 + 1 : temp1 = temp1 - 100 : goto lo_100s
temp2 = 80 : temp3 = 128
lo_scor_loop
if temp1 >= temp2 then scor2 = scor2 + temp3 : temp1 = temp1 - temp2
temp2 = temp2 / 2 : temp3 = temp3 / 2
if temp2 >= 10 then lo_scor_loop
scor2 = scor2 | temp1
return

edit:

Here's another shorter bB version that is

even shorter and doesn't use more temp variables

and I think is not substantially slower than

the previous shorter bB version.

hi_scor
rem puts temp1 in the upper three score digits
scor0 = 0
hi_scor_100s_loop
if temp1 >= 100 then scor0 = scor0 + 16 : temp1 = temp1 - 100 : goto hi_scor_100s_loop
goto enter_hi_scor_10s_loop
hi_scor_10s_loop
scor0 = scor0 + 1 : temp1 = temp1 - 10
enter_hi_scor_10s_loop
if temp1 >= 10 then hi_scor_10s_loop
scor1 = (((temp1 * 4 * 4) ^ scor1) & $F0) ^ scor1
return
lo_scor
rem puts temp1 in the lower three digits of score
scor1 = scor1 & 240 : scor2 = 0
lo_scor_100s_loop
if temp1 >= 100 then scor1 = scor1 + 1 : temp1 = temp1 - 100 : goto lo_scor_100s_loop
goto enter_lo_scor_10s_loop
lo_scor_10s_loop
scor2 = scor2 + 1 : temp1 = temp1 - 10
enter_lo_scor_10s_loop
if temp1 >= 10 then lo_scor_10s_loop
scor2 = (scor2 * 4 * 4) | temp1
return

here's some asm

hi_scor
rem puts temp1 in the upper three score digits
asm
ldx #$FF
lda temp1
sec
hi_100s_loop
inx
sbc #$64
bcs hi_100s_loop
adc #$64
sta temp1
txa
asl
asl
asl
asl
tax
lda temp1
sec
hi_10s_loop
inx
sbc #$0A
bcs hi_10s_loop
adc #$0A
dex
asl
asl
asl
asl
eor scor1
and #$F0
eor scor1
sta scor1
stx scor0
rts
end
lo_scor
rem puts temp1 in the lower three digits of score
asm
ldx #$FF
lda temp1
sec
lo_100s_loop
inx
sbc #$64
bcs lo_100s_loop
adc #$64
sta temp1
txa
eor scor1
and #$0F
eor scor1
sta scor1
lda temp1
ldx #$FF
sec
lo_10s_loop
inx
sbc #$0A
bcs lo_10s_loop
adc #$0A
sta temp1
txa
asl
asl
asl
asl
ora temp1
sta scor2
rts
end

edit:

yet another (asm) version

a little shorter a little faster

rem puts temp1 into the upper 3 score digits
rem uses the table defined in lo_score
hi_scor
asm
lda temp1
ldx #$00
hi_100s_loop
cmp #$64
bcc skip_hi_100s
sbc #$64
inx
bne hi_100s_loop
skip_hi_100s
ldy scor_x10_tbl,x
sec
hi_10s_loop
iny
sbc #$0A
bcs hi_10s_loop
adc #$0A
dey
sty scor0
tax
lda scor_x10_tbl,x
eor scor1
and #$F0
eor scor1
sta scor1
rts
end
rem puts temp1 into the lower 3 score digits
lo_scor
asm
lda scor1
and #$F0
sta scor1
lda temp1
lo_100s_loop
cmp #$64
bcc skip_lo_100s
sbc #$64
inc scor1
bne lo_100s_loop
skip_lo_100s
ldx #$FF
SEC
lo_10s_loop
inx
sbc #$0A
bcs lo_10s_loop
adc #$0A
ora scor_x10_tbl,x
sta scor2
rts
scor_x10_tbl
.byte $00, $10, $20, $30, $40, $50, $60, $70, $80, $90
end

edit I hate uncommented code does this need

commenting?

**Edited by bogax, Mon Mar 18, 2013 11:04 PM.**