Skip to content

Commit

Permalink
add recent file changes
Browse files Browse the repository at this point in the history
commit a bunch of pending changes
TODO: remove obsolete files
  • Loading branch information
djulien committed Jan 27, 2022
1 parent 4dab273 commit aefd55c
Show file tree
Hide file tree
Showing 83 changed files with 43,047 additions and 7,318 deletions.
133 changes: 133 additions & 0 deletions Firmware/MJB+tree-GOOD-STATIC.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
;Mary + Joseph + manger + tree, needs anim
messg Mary + Joseph + manger + tree, needs anim @__LINE__

;RGB colors:
constant OFF = LITERAL(0);
constant X = LITERAL(0); //don't care/ignored
#if 1; dim
constant RED = LITERAL(0x030000);
constant GREEN = LITERAL(0x000300);
constant BLUE = LITERAL(0x000003);
constant YELLOW = LITERAL(0x020200);
constant CYAN = LITERAL(0x000202);
constant MAGENTA = LITERAL(0x020002);
constant WHITE = LITERAL(0x010101);
#else; full
constant RED = LITERAL(0xFF0000);
constant GREEN = LITERAL(0x00FF00);
constant BLUE = LITERAL(0x0000FF);
constant YELLOW = LITERAL(0x7F7F00);
constant CYAN = LITERAL(0x007F7F);
constant MAGENTA = LITERAL(0x7F007F);
constant WHITE = LITERAL(0x555555);
#endif;

;//palent[0]: 0x7f0000, #occ 266
;//palent[1]: 0x3f3f36, #occ 176
;//palent[2]: 0x0, #occ 52
;//palent[3]: 0x7f7f00, #occ 46
;//angel colors:
; constant PAL0 = LITERAL(0x5f7f00);
; constant PAL1 = LITERAL(0x3f3f36);
; constant PAL2 = LITERAL(0);
; constant PAL3 = LITERAL(0x7f7f00);
; constant ANGEL_WINGS = #v(LITERAL(0x4F6F00)); //GRB gold 40%
; constant ANGEL_BODY = #v(LITERAL(0x2F2F20)); //GRB warm white 20%
; constant ANGEL_HAIR = #v(LITERAL(0x6F6F00)); //GRB yellow 45%
; constant ANGEL_HALO = #v(LITERAL(0x4F6F00)); //GRB gold 40%
; constant ANGEL_TRUMPET = #v(LITERAL(0x5F7F00)); //GRB gold 50%
; constant TRIM = #v(LITERAL(0))
;//heartbeat:
constant HB_EVEN = LITERAL(0x010000);
constant HB_ODD = LITERAL(0x000100);
;//prop colors:
constant MARY_BODY = #v(LITERAL(0x6F0000)); //RGB red 45%
constant MARY_HOOD = #v(LITERAL(0x2F2F20)); //RGB warm white 20%
constant JOSEPH_BODY = #v(LITERAL(0x00006F)); //RGB blue 45%
constant JOSEPH_HOOD = #v(LITERAL(0x2F2F20)); //RGB warm white 20%
constant MANGER_BASKET = #v(LITERAL(0x6F6F00)); //RGB yellow 45%
constant MANGER_LEGS = #v(LITERAL(0x4F2F00)); //RGB brown 30%
constant TREE_BRANCHES = #v(LITERAL(0x00bf00)); //RGB forest green 75%
constant TREE_DRIP = #v(LITERAL(0xbfffff)); RGB ice white 100%
;#define DEVPANEL_CH BIT(RA0); //RA0, RA1, RA2, RA5
#define ALLPROPS_CH #v(LITERAL(BIT(RA0) | BIT(RA1) | BIT(RA2) | BIT(RA5)));
#define PROP_CH0 #v(LITERAL(BIT(RA0)));
#define PROP_CH1 #v(LITERAL(BIT(RA1)));
#define PROP_CH2 #v(LITERAL(BIT(RA2)));
#define PROP_CH5 #v(LITERAL(BIT(RA5)));
#define STATUS_CH #v(LITERAL(BIT(RA4)));
#define ALL_CH #v(LITERAL(0XFF));
#define NONE_CH #v(LITERAL(0));

#define MARY_CH PROP_CH0
#define JOSEPH_CH PROP_CH1
#define MANGER_CH PROP_CH2
#define TREE_CH PROP_CH5

b0DCL pxbuf, :24; //8 parallel 24-bit values (1 for each IO pin)
display_engine pxbuf;
; doing_init TRUE
; PBLI pxbuf; set initial colors
; DW 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0;


ws_player: DROP_CONTEXT;
CURRENT_FPS_usec = -1; force timer0 init
WAIT 5 sec; give power time to settle
player_loop: DROP_CONTEXT;
ws8_firstpx pxbuf, LITERAL(0), HB_EVEN, STATUS_CH; heartbeat
CALL anim;
ws8_firstpx pxbuf, LITERAL(0), HB_ODD, STATUS_CH; heartbeat
CALL anim;
GOTO player_loop

b0DCL16 drip;
anim: DROP_CONTEXT;
#if 0; TODO
mov16 drip, LITERAL(9 * 33 + 4 - 300);
CALL drip_down;
mov16 drip, LITERAL(15 * 33 + 4 - 300);
CALL drip_down;
mov16 drip, LITERAL(11 * 33 + 4 - 300);
CALL drip_down;
mov16 drip, LITERAL(12 * 33 + 4 - 300);
CALL drip_up;
mov16 drip, LITERAL(16 * 33 + 4 - 300);
CALL drip_down;
mov16 drip, LITERAL(13 * 33 + 4 - 300);
CALL drip_up;
mov16 drip, LITERAL(14 * 33 + 4 - 300);
CALL drip_up;
GOTO anim;

b0DCL8 count;
drip_down: CONTEXT_DROP;
mov8 count, LITERAL(33);
#endif

draw: DROP_CONTEXT;
BANKCHK LATA;
ws8_firstpx pxbuf, LITERAL(0), MARY_BODY, MARY_CH
ws8_firstpx pxbuf, LITERAL(0), JOSEPH_BODY, JOSEPH_CH
ws8_firstpx pxbuf, LITERAL(0), MANGER_BASKET, MANGER_CH
ws8_firstpx pxbuf, LITERAL(0), TREE_BRANCHES, TREE_CH; set color for new frame
;//8 RLE blocks:
;// RLE 100*[2], 48*[5], 68*[3], 12*[6], 68*[4], 4*[7], 492*[1], 808*[0]; //0..1599
ws8_sendpx pxbuf, LITERAL(100), MANGER_LEGS, MANGER_CH;
ws8_sendpx pxbuf, LITERAL(48), OFF, MANGER_CH;
ws8_sendpx pxbuf, LITERAL(68), MARY_HOOD, MARY_CH;
ws8_sendpx pxbuf, LITERAL(12), JOSEPH_HOOD, JOSEPH_CH;
ws8_sendpx pxbuf, LITERAL(68), OFF, MARY_CH;
ws8_sendpx pxbuf, LITERAL(4), OFF, JOSEPH_CH;
#if 1; no anim
ws8_sendpx pxbuf, LITERAL(492), OFF, TREE_CH;
#else; tree drip anim
ws8_sendpx pxbuf, drip, TREE_SNOW, TREE_CH; drip >= 300 to not interfere with MJB
ws8_sendpx pxbuf, LITERAL(2), TREE_BRANCHES, TREE_CH;
ws8_sendpx pxbuf, LITERAL(492), OFF, TREE_CH; overshoot ignored
#endif
CURRENT_FPS_usec = -1; force timer0 init
WAIT 1 sec
return;

48 changes: 48 additions & 0 deletions Firmware/angel-shaped-wings-static.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
; angel NEEDS_REPAIR with shaped wings
;//palent[0]: 0x7f0000, #occ 266
;//palent[1]: 0x3f3f36, #occ 176
;//palent[2]: 0x0, #occ 52
;//palent[3]: 0x7f7f00, #occ 46
constant PAL0 = LITERAL(0x5f7f00);
constant PAL1 = LITERAL(0x3f3f36);
constant PAL2 = LITERAL(0);
constant PAL3 = LITERAL(0x7f7f00);
angel_loop: DROP_CONTEXT;
ws8_firstpx pxbuf, LITERAL(0), PAL1, CHALL;
;//30 RLE blocks:
; RLE 154*[1], 4*[2], 16*[0], 7*[2], 20*[0], 1*[2], 23*[0], 1*[2], 23*[0], 3*[2], 20*[0],
ws8_sendpx pxbuf, LITERAL(154), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(4), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(16), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(7), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(20), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(1), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(23), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(1), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(23), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(3), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(20), PAL2, CHALL;
; 6*[2], 16*[0], 4*[2], 23*[3], 54*[0], 23*[3], 4*[2], 16*[0], 7*[2], 20*[0], 1*[2],
ws8_sendpx pxbuf, LITERAL(6), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(16), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(4), PAL3, CHALL;
ws8_sendpx pxbuf, LITERAL(23), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(54), PAL3, CHALL;
ws8_sendpx pxbuf, LITERAL(23), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(4), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(16), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(7), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(20), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(1), PAL0, CHALL;
; 23*[0], 1*[2], 23*[0], 3*[2], 20*[0], 6*[2], 16*[0], 4*[2]; //375..541
ws8_sendpx pxbuf, LITERAL(23), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(1), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(23), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(3), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(20), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(6), PAL0, CHALL;
ws8_sendpx pxbuf, LITERAL(16), PAL2, CHALL;
ws8_sendpx pxbuf, LITERAL(4), OFF, CHALL;
WAIT 1 sec
GOTO angel_loop;

114 changes: 114 additions & 0 deletions Firmware/devpanel-multi-chase-dot.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
;RGB colors:
constant OFF = LITERAL(0);
constant X = LITERAL(0); //don't care/ignored
#if 1; dim
constant RED = LITERAL(0x030000);
constant GREEN = LITERAL(0x000300);
constant BLUE = LITERAL(0x000003);
constant YELLOW = LITERAL(0x020200);
constant CYAN = LITERAL(0x000202);
constant MAGENTA = LITERAL(0x020002);
constant WHITE = LITERAL(0x010101);
#else; full
constant RED = LITERAL(0xFF0000);
constant GREEN = LITERAL(0x00FF00);
constant BLUE = LITERAL(0x0000FF);
constant YELLOW = LITERAL(0x7F7F00);
constant CYAN = LITERAL(0x007F7F);
constant MAGENTA = LITERAL(0x7F007F);
constant WHITE = LITERAL(0x555555);
#endif;


#define UNIV_LEN (256-2)
;#define DEVPANEL_CH BIT(RA0); //RA0, RA1, RA2, RA5
#define ALLPROPS_CH LITERAL(BIT(RA0) | BIT(RA1) | BIT(RA2) | BIT(RA5));
#define PROP_CH0 LITERAL(BIT(RA0));
#define PROP_CH1 LITERAL(BIT(RA1));
#define PROP_CH2 LITERAL(BIT(RA2));
#define PROP_CH5 LITERAL(BIT(RA5));
#define STATUS_CH LITERAL(BIT(RA4));
#define ALL_CH LITERAL(0XFF);
#define NONE_CH LITERAL(0);

b0DCL onbuf, :24; //8 parallel 24-bit values (1 for each IO pin)
display_engine onbuf;
b0DCL offbuf, :24; //used for variable space at start (~scrolling)
display_engine offbuf;
; b0DCL altbuf, :24; //alternate pxbuf
; display_engine altbuf;
; doing_init TRUE
; PBLI pxbuf0; set initial colors
; DW 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0;
; doing_init FALSE

ws_player: DROP_CONTEXT;
messg devpanel dot chase (different color each port) @__LINE__
;//reset colors for new frame
ws8_firstpx offbuf, LITERAL(0), OFF, ALLPROPS_CH;
ws8_firstpx onbuf, LITERAL(0), RED_DIM, PROP_CH0;
ws8_firstpx onbuf, LITERAL(0), GREEN_DIM, PROP_CH1;
ws8_firstpx onbuf, LITERAL(0), BLUE_DIM, PROP_CH2;
ws8_firstpx onbuf, LITERAL(0), YELLOW_DIM, PROP_CH5;
//status/heartbeat:
b0DCL24 heartbeat_color; //use var so it can be copied to devpanel
heartbeat_loop: DROP_CONTEXT;
mov24 heartbeat_color, CYAN_DIM;
; ws8_firstpx onbuf, LITERAL(0), CYAN_DIM, STATUS_CH;
; ws8_firstpx offbuf, LITERAL(0), CYAN_DIM, STATUS_CH;
CALL anim;
; ws8_firstpx onbuf, LITERAL(0), MAGENTA_DIM, STATUS_CH;
; ws8_firstpx offbuf, LITERAL(0), CYAN_DIM, STATUS_CH;
mov24 heartbeat_color, MAGENTA_DIM;
CALL anim;
GOTO heartbeat_loop;

sub16 macro dest, total, amt
ERRIF(ISLIT(amt) || !ISLIT(total), TODO: lits/vars @__LINE__)
mov8 BYTEOF(dest, 1), BYTEOF(total, 1); kludge: no SUBLWB so use SUBWFB with reg :(
MOVF REGLO(amt), W
SUBLW (total) & 0xFF;
MOVWF REGLO(dest);
MOVF REGHI(amt), W
SUBWFB REGHI(dest), F;
endm

ifcmp16 macro reg, bitreg, bitnum, bitval, stmt
MOVF REGLO(reg), W
IORWF REGHI(reg), W
ifbit bitreg, bitnum, bitval, stmt; //EQUALS0 TRUE, GOTO nopad
endif
messg [TODO] allow set > 1 color- swap pxbuf !retain inline pxbuf changes @__LINE__
messg [TODO] allow disable port while another drawn @__LINE__
b0DCL16 dotpad;
anim: DROP_CONTEXT;
mov16 dotpad, LITERAL(0);
b0DCL16 univpad;
draw_loop: DROP_CONTEXT;
sub16 univpad, LITERAL(UNIV_LEN), dotpad;
ifcmp16 univpad, EQUALS0 TRUE, GOTO nopad
;//RLE blocks: var off, 1 color, univ_len - var off, 1 sentinel
BANKCHK LATA;
ws8_firstpx offbuf, dotpad, X, NONE_CH;
ws8_sendpx onbuf, LITERAL(1), X, NONE_CH;
ws8_sendpx onbuf, univpad, sentinel, ALLPROPS_CH;
ws8_sendpx onbuf, LITERAL(1), OFF, ALLPROPS_CH;
GOTO anim_wait;

nopad: DROP_CONTEXT;
BANKCHK LATA;
ws8_firstpx offbuf, dotpad, X, NONE_CH;
ws8_sendpx onbuf, LITERAL(1), heartbeat_color, ALL_CH;
ws8_sendpx onbuf, LITERAL(1), OFF, ALLPROPS_CH;

anim_wait: DROP_CONTEXT;
CURRENT_FPS_usec = -1; force timer0 init
WAIT 1 sec/16
INCF REGHI(dotpad), F; kludge: allow DECFSZ to catch 0 (not -1)
DECFSZ REGLO(dotpad), F
INCF REGHI(dotpad), F ;lower !wrap
DECFSZ REGHI(dotpad), F
GOTO draw_loop
return;

90 changes: 90 additions & 0 deletions Firmware/fence+pole-marque.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
;12V BRG order
constant RED_FENCE = #v(LITERAL(0x0000A0));
constant GREEN_FENCE = #v(LITERAL(0x00A000));
constant WHITE_FENCE = #v(LITERAL(0x505050));
nbDCL16 marque;
; mov16 marque, LITERAL(0);
other_loop: DROP_CONTEXT;
mov16 marque, LITERAL(7);
CALL pole_loop;
mov16 marque, LITERAL(8);
CALL pole_loop;
mov16 marque, LITERAL(9);
CALL pole_loop;
mov16 marque, LITERAL(10);
CALL pole_loop;
GOTO other_loop;

pole_loop: DROP_CONTEXT;
;fence macro pole_ofs
; RCandle: 5,
; RBell: 7,
; XAndel: 7,
; RK_camel: 7,
; K_camel_star: 6,
; LCandle: 4,
; RAngel: 6,
BANKCHK LATA;
ws8_firstpx pxbuf, LITERAL(0), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(5), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(6), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(4), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(6), GREEN_FENCE, CHALL;
; K_camel_kneel: 7,
; MJB_star: 7,
; Shep2_kneel: 7,
; LAngel: 6,
; City: 7,
; Sheps2_star: 7,
; LShep: 6,
; LBell: 5,
; Joy: 7,
ws8_sendpx pxbuf, LITERAL(7), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(6), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(7), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(6), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(5), GREEN_FENCE, CHALL;
; ws8_sendpx pxbuf, LITERAL(7), RED_FENCE, CHALL;
ws8_sendpx pxbuf, marque, RED_FENCE, CHALL;
; pole: 25,
; if (pole_ofs % 4) < 1
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
; endif
; if (pole_ofs % 4) < 2
ws8_sendpx pxbuf, LITERAL(1), WHITE_FENCE, CHALL;
; endif
; if (pole_ofs % 4) < 3
ws8_sendpx pxbuf, LITERAL(1), OFF, CHALL;
; endif
ws8_sendpx pxbuf, LITERAL(1), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), WHITE_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), OFF, CHALL;
ws8_sendpx pxbuf, LITERAL(1), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), WHITE_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), OFF, CHALL;
ws8_sendpx pxbuf, LITERAL(1), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), WHITE_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), OFF, CHALL;
ws8_sendpx pxbuf, LITERAL(1), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), WHITE_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), OFF, CHALL;
ws8_sendpx pxbuf, LITERAL(1), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), WHITE_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), OFF, CHALL;
ws8_sendpx pxbuf, LITERAL(1), RED_FENCE, CHALL;
ws8_sendpx pxbuf, LITERAL(1), GREEN_FENCE, CHALL;
WAIT 1 sec/3;
return;
;
Loading

0 comments on commit aefd55c

Please sign in to comment.