mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 10:02:32 +03:00
Another jet state adjustment.
This commit is contained in:
parent
031856b0ef
commit
43eeb64fc7
40
i/n/a.h
40
i/n/a.h
@ -251,46 +251,6 @@
|
||||
? u3a_north_is_senior(r, som) \
|
||||
: u3a_south_is_senior(r, som) )
|
||||
|
||||
/* Word axis macros. For 31-bit axes only.
|
||||
*/
|
||||
/* u3x_dep(): number of axis bits.
|
||||
*/
|
||||
# define u3x_dep(a_w) (c3_bits_word(a_w) - 1)
|
||||
|
||||
/* u3x_cap(): root axis, 2 or 3.
|
||||
*/
|
||||
# define u3x_cap(a_w) (0x2 | (a_w >> (u3x_dep(a_w) - 1)))
|
||||
|
||||
/* u3x_mas(): remainder after cap.
|
||||
*/
|
||||
# define u3x_mas(a_w) \
|
||||
( (a_w & ~(1 << u3x_dep(a_w))) | (1 << (u3x_dep(a_w) - 1)) )
|
||||
|
||||
/* u3x_peg(): connect two axes.
|
||||
*/
|
||||
# define u3x_peg(a_w, b_w) \
|
||||
( (a_w << u3x_dep(b_w)) | (b_w &~ (1 << u3x_dep(b_w))) )
|
||||
|
||||
/* Conventional axes for gate call.
|
||||
*/
|
||||
# define u3x_pay 3 // payload
|
||||
# define u3x_sam 6 // sample
|
||||
# define u3x_sam_1 6
|
||||
# define u3x_sam_2 12
|
||||
# define u3x_sam_3 13
|
||||
# define u3x_sam_4 24
|
||||
# define u3x_sam_5 25
|
||||
# define u3x_sam_6 26
|
||||
# define u3x_sam_12 52
|
||||
# define u3x_sam_13 53
|
||||
# define u3x_sam_7 27
|
||||
# define u3x_con 7 // context
|
||||
# define u3x_con_2 14 // context
|
||||
# define u3x_con_3 15 // context
|
||||
# define u3x_con_sam 30 // sample in gate context
|
||||
# define u3v_noc 2 // deprecated
|
||||
# define u3v_bat 2 // battery
|
||||
|
||||
|
||||
/** Globals.
|
||||
**/
|
||||
|
4
i/n/j.h
4
i/n/j.h
@ -15,7 +15,9 @@
|
||||
hap=(map ,@ud ,@ud) :: axis/jet
|
||||
== ::
|
||||
++ calx (trel calf ,* (map term nock)) :: cached by battery
|
||||
++ clog (pair cope (map batt (map term nock))) :: identity record
|
||||
++ clog (pair cope (map batt club)) :: identity record
|
||||
++ corp (each batt core) :: parent or static
|
||||
++ club (pair corp (map term nock)) :: battery pattern
|
||||
++ cope (trel bane axis (each bash noun)) :: core pattern
|
||||
++ dash :: jet system
|
||||
$: sys=(map batt bash) :: battery/identity
|
||||
|
46
i/n/x.h
46
i/n/x.h
@ -2,6 +2,52 @@
|
||||
**
|
||||
** This file is in the public domain.
|
||||
*/
|
||||
/** Constants.
|
||||
**/
|
||||
/* Conventional axes for gate call.
|
||||
*/
|
||||
# define u3x_pay 3 // payload
|
||||
# define u3x_sam 6 // sample
|
||||
# define u3x_sam_1 6
|
||||
# define u3x_sam_2 12
|
||||
# define u3x_sam_3 13
|
||||
# define u3x_sam_4 24
|
||||
# define u3x_sam_5 25
|
||||
# define u3x_sam_6 26
|
||||
# define u3x_sam_12 52
|
||||
# define u3x_sam_13 53
|
||||
# define u3x_sam_7 27
|
||||
# define u3x_con 7 // context
|
||||
# define u3x_con_2 14 // context
|
||||
# define u3x_con_3 15 // context
|
||||
# define u3x_con_sam 30 // sample in gate context
|
||||
# define u3x_bat 2 // battery
|
||||
|
||||
|
||||
/** Macros.
|
||||
**/
|
||||
/* Word axis macros. For 31-bit axes only.
|
||||
*/
|
||||
/* u3x_dep(): number of axis bits.
|
||||
*/
|
||||
# define u3x_dep(a_w) (c3_bits_word(a_w) - 1)
|
||||
|
||||
/* u3x_cap(): root axis, 2 or 3.
|
||||
*/
|
||||
# define u3x_cap(a_w) (0x2 | (a_w >> (u3x_dep(a_w) - 1)))
|
||||
|
||||
/* u3x_mas(): remainder after cap.
|
||||
*/
|
||||
# define u3x_mas(a_w) \
|
||||
( (a_w & ~(1 << u3x_dep(a_w))) | (1 << (u3x_dep(a_w) - 1)) )
|
||||
|
||||
/* u3x_peg(): connect two axes.
|
||||
*/
|
||||
# define u3x_peg(a_w, b_w) \
|
||||
( (a_w << u3x_dep(b_w)) | (b_w &~ (1 << u3x_dep(b_w))) )
|
||||
|
||||
/** Functions.
|
||||
**/
|
||||
/** u3x_*: read, but bail with c3__exit on a crash.
|
||||
**/
|
||||
#if 1
|
||||
|
12
n/j.c
12
n/j.c
@ -259,21 +259,21 @@ _cj_cold_mine(u3_noun cey, u3_noun cor)
|
||||
{
|
||||
u3_noun soh = _cj_sham(u3k(mop));
|
||||
u3_noun hoe = u3kdb_get(u3k(u3t(u3R->jed.das)), u3k(soh));
|
||||
u3_noun cub = u3nc(u3_nul, u3k(r_cey));
|
||||
u3_noun sab;
|
||||
|
||||
if ( u3_none == hoe ) {
|
||||
sab = u3nt(u3nc(u3k(bat), u3k(r_cey)), u3_nul, u3_nul);
|
||||
sab = u3nt(u3nc(u3k(bat), cub), u3_nul, u3_nul);
|
||||
}
|
||||
else {
|
||||
sab = u3kdb_put(u3k(u3t(hoe)), u3k(bat), u3k(r_cey));
|
||||
sab = u3kdb_put(u3k(u3t(hoe)), u3k(bat), cub);
|
||||
u3z(hoe);
|
||||
}
|
||||
{
|
||||
u3_noun sad, h_sad, t_sad;
|
||||
|
||||
h_sad = u3kdb_put(u3k(u3h(u3R->jed.das)), u3k(bat), u3k(soh));
|
||||
t_sad = u3kdb_put(u3k(u3t(u3R->jed.das)), soh,
|
||||
u3nc(u3k(mop), sab));
|
||||
t_sad = u3kdb_put(u3k(u3t(u3R->jed.das)), soh, u3nc(u3k(mop), sab));
|
||||
sad = u3nc(h_sad, t_sad);
|
||||
|
||||
u3z(u3R->jed.das);
|
||||
@ -451,7 +451,7 @@ _cj_warm_ream_is(c3_l jax_l,
|
||||
u3x_trel(sab, &n_sab, &l_sab, &r_sab);
|
||||
u3x_cell(n_sab, &pn_sab, &qn_sab);
|
||||
|
||||
_cj_warm_ream_be(jax_l, pax, pn_sab, qn_sab);
|
||||
_cj_warm_ream_be(jax_l, pax, pn_sab, u3t(qn_sab));
|
||||
_cj_warm_ream_is(jax_l, pax, l_sab);
|
||||
_cj_warm_ream_is(jax_l, pax, r_sab);
|
||||
}
|
||||
@ -989,4 +989,4 @@ u3j_reap(u3_noun das, u3p(u3h_root) har_p)
|
||||
{
|
||||
_cj_cold_reap_in(u3t(das));
|
||||
u3h_walk(har_p, _cj_warm_reap);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user