mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-22 14:33:51 +00:00
21 lines
279 B
C
21 lines
279 B
C
|
|
#include "common.h"
|
|
|
|
word bcd_add(word a, word b) {
|
|
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;
|
|
}
|
|
}
|
|
|