What is the difference between flash and zflash since it works similarly (put a function to a register)?
Also how do you make programs be able to be recogised by the OS through index command?
So for the if statement, does , (<) and . (>) have functionality? (it did not work at all for me)
Also there's a weird bug with the while and for loop that causes any return statement (even though the return is inside or outside the loops) to become orphaned. (probably because I used goto to go outside the loops)
It's not too far off from a typical x86/x64 PC that's found in almost any home.
Difference is not that clear though, haven't thought of how to implement the computer exactly.
[I got the idea of segmenting the memory when watching/following an OS tutorial.
(Also the fact that larger blocks of memory seem to lag algodoo a lot when trying to use xsetarr on it)]
Heads up, I found out that eval instruction uses _xcra(9, 0) to initilize the registers instead of _xcra(_bios(2) - 1, 0).
This may cause any program that is cx-16 compatible to not work properly or not function at all if ran using eval instruction
Cool scene, though the controls are a bit w o n k y
Anyways after a bit of testing (ow my braincell ), here's what I've found:
1. The width rendering part starts at 0. It shouldn't, as it reads directly from the file which the image data starts at offset 4
2. The width renderer overrendered image width by 1 char.
3. Renderer is very f a s t
(less than 10 seconds on my portable waffle grill (thingy) with an image width of 5 and height of 3 than the expected 640 seconds).
4. Every time a line is rendered, the reading is offsetted by img_height * p. Typically it should be true_width * p.
So here's the fixes:
1. Yeet the `let g=x+1` out, it causes the width renderer to overrender.
(Dont forget to replace `let n=n+g` to `let n=n+x`)
2. offset j by 4 (The easiest part is in the width rendering loop).
3. Remove the `let x=img_height*p` and replace with `let x=n*p` (below the `let n=img_width-4` of course)
So when all is said and done, the (fixed) piece of code should look like:
`
...
640 | for i=4 img_height
650 | let printt=""
660 | let p=i-4
670 | let n=img_width-4
680 | let x=n*p
690 | let n=n+x
700 | for j=x n
710 | let z=j+4
720 | if file(z)="0" then let printt=printt+" "
730 | if file(z)="1" then let printt=printt+"_"
740 | if file(z)="2" then let printt=printt+"/ "
750 | if file(z)="3" then let printt=printt+"3"
760 | if file(z)="4" then let printt=printt+"#"
770 | if file(z)="5" then let printt=printt+"@"
780 | end
790 | print printt
800 | end
...
`
Happy coding!
(Btw use another code editor like notepad++ if you're still having trouble with ascii chars)
My face when someone comments whilst I was away for a few months
But yeah the optical disk version is for this scene by Little
http://www.algodoo.com/algobox/details.php?id=274845
And the max size of these optical disks is 1344 bytes or 1.34 KB, so the program size is definitely a constraint.
(If you're wondering how to make the drive work with AHOX Hydrogen, it's basically plugging in the spring that's connected from the drive to the CPU)
Hope this helps!
So I found out there was an issue with the until (& maybe while) command for chives.
Whenever conditions of the loop are fulfilled, when there is no data in the stack (no push/function call) it will throw a stack underflow.
If there is something in the stack, the command will behave erratically depending on what data was pushed before.
Using break when in an until loop/called function(& maybe while loop I still don't know ) will also throw an error.
If this helps -- It seems that the until & while command did not push anything into the stack before calling _break, but the _break function pops data from the stack (to check for type).
[Not sure for call, though]