1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-01-10 16:29:48 +00:00

21 lines
279 B
C
Raw Normal View History

2020-02-02 12:17:31 -06:00
#include "common.h"
word bcd_add(word a, word b) {
2022-08-11 15:27:20 -05:00
asm("sed");
a += b;
asm("cld");
return a;
}
void draw_bcd_word(word address, word bcd) {
byte i;
address += 4;
for (i=0; i<4; i++) {
POKE(address, (bcd & 0b1111) + '0');
address--;
bcd >>= 4;
}
}