Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/native/omega/allen/view.om # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / native / omega / allen / view.om` 98 lines ยท 1665 bytes Raw Blame History 1 note Exact legacy code row wrapping, at most4096 rows; full code retained. 2 global Rowst ulong 4096 3 global Rowlen ulong 4096 4 global Rowline ulong 4096 5 global View ulong 4 6 global Vwork ulong 6 7 note Vwork cols,maxrows,line,start,end. 8 fn onerow s ulong first bool to ulong 9 take = sub get Vwork 4 s 10 cols = get Vwork 0 11 if gt take cols 12 take = cols 13 j = cols 14 while gt j div cols 2 15 if eq get Code sub add s j 1 32 16 take = j 17 j = 0 18 else 19 j = sub j 1 20 end 21 end 22 end 23 slot = get View 0 24 put Rowst slot s 25 put Rowlen slot take 26 put Rowline slot 0 27 if first 28 put Rowline slot get Vwork 2 29 end 30 put View 0 add slot 1 31 ret add s take 32 end 33 fn rowroom pos ulong to bool 34 ret and lt pos get C 2 lt get View 0 get Vwork 1 35 end 36 fn moreline s ulong to bool 37 ret and lt s get Vwork 4 lt get View 0 get Vwork 1 38 end 39 fn rows cols ulong maxrows ulong to bool 40 if or eq cols 0 gt maxrows 4096 41 ret false 42 end 43 if ne codestat 2 44 ret false 45 end 46 put Vwork 0 cols 47 put Vwork 1 maxrows 48 put Vwork 2 1 49 put View 0 0 50 put View 1 0 51 pos = ulong 0 52 while rowroom pos 53 stop = pos 54 while lt stop get C 2 55 if eq get Code stop 10 56 put Vwork 4 stop 57 stop = get C 2 58 else 59 stop = add stop 1 60 put Vwork 4 stop 61 end 62 end 63 s = pos 64 if lt get View 0 maxrows 65 s = onerow s true 66 end 67 while moreline s 68 s = onerow s false 69 end 70 pos = add get Vwork 4 1 71 put Vwork 2 add get Vwork 2 1 72 end 73 ret true 74 end 75 fn scroll delta long page ulong to ulong 76 last = ulong 0 77 if gt get View 0 page 78 last = sub get View 0 page 79 end 80 if gt get View 1 last 81 put View 1 last 82 end 83 top = long get View 1 84 if lt delta 0 85 if lt delta neg top 86 put View 1 0 87 ret 0 88 end 89 else 90 if gt ulong delta sub last get View 1 91 put View 1 last 92 ret last 93 end 94 end 95 top = add top delta 96 put View 1 ulong top 97 ret ulong top 98 end