6 ms·
BOX-256: a tiny game about writing assembly code to pass the graphics tests
- azeirah 11y agoCopying and pasting is not working for me :(
- tromp 11y agoVisiting that webpage causes my SUSE Firefox 45.0 browser to say "You need a browser which supports WebGL to run this content. Try installing Firefox."
- fpgaminer 11y agoProbably a driver issue. Firefox 45.0 supports WebGL, but it may be disabled on your machine if it can't find a suitable OpenGL driver. For reference, the site worked fine on my Ubuntu 15.10 machine, Firefox 45.0, Intel GPU.
- achikin 11y agoWill there be a standalone version for Mac?
- keely 11y agoYes, in a few days hopefully
- zokier 11y agoLove it, very Zachtronicesque. If the author is reading, here are couple of improvement ideas: * Show the level number somewhere so its easier to discuss with others * Add some way to know how well I did on the level, either by having some leaderboards or rating system/target cycle count * Allow pausing the execution when running * Not sure if it would make sense to have full 8-bit color palette instead of 4 bits. Probably does not matter to game design too much I think it might be neat idea to implement this on real hardware with these sort of rgb led modules http://i.imgur.com/4YnDwWu.jpg http://i.imgur.com/4YnDwWu.jpg and some way to input code, maybe row of toggle switches Altair/PDP style or small keypad like in KIM-1
- tehbeard 11y ago8 bit palette means trying to match the colour against 256 possibilities instead of 16.
- zokier 11y agoThat reminds me of one additional improvement suggestion: allow viewing the color values of the target pixels somehow.
- zokier 11y agoI just had to make a quick mockup of hardware version of BOX256: http://i.imgur.com/Vw1i459.jpg http://i.imgur.com/Vw1i459.jpg
- amstocker 11y agoVery cool, reminds me a lot of TIS-100
- SilasX 11y agoNeat! Would like my own editor though. This doesn't have a lot of text editing capabilities and is fixed size. How well does this map to real x86 assembly programming?
- zokier 11y agoReal x86 is very different; you have limited registers (especially 32bit x86), very weird variable length instruction encoding, gazillion different instructions, memory access takes significant amount of time. Of course having near infinite amount of memory compared to the 256 bytes of BOX256 changes the way you program your code too.
- doomrobo 11y agoFYI this gives a javascript error in Safari 9.1 private browsing mode. Disabling private browsing fixes the problem.
- danjayh 11y agoWish it had a 'mod' instruction :(
- azeirah 11y agoThe `thr` statement is not very useful at the moment. It's impossible to pass parameters to a piece of code using threads :( I have to duplicate my code in order to use the threads
- zokier 11y agoNot sure how you would integrate that sort of thing to the ISA though. Maybe something like: 00 THR 004 001 @A0 04 JEQ 001 @A0 010 08 --- parent thread ... 10 --- child thread where THR instruction would store a value that is visible only to child in some memory location, in this example value 001 would be stored at @A0, which is then used to distinguish the threads in a conditional jump.
- chipsy 11y agoIt's really ungainly to work with -- but it does drop the cycle counts to solve the problems by running more threads.
- ekimekim 11y agoWhat's really funny is when the program's trivially paralellizable (any of them where the entire thing to draw fits in memory) and the main thing your threads are doing is to start more threads, then finally all the threads do 2 draw instructions each.
- OMGWTF 11y agoMy current scores: Square: 0x07 cycles Checkerboard: 0x4C cycles 4 Squares: 0x09 cycles I will post my solutions in 24-48 hours.
- ekimekim 11y agoCheckerboard: 0x24 cycles. http://imgur.com/C1UeEdn http://imgur.com/C1UeEdn (EDIT: 0x16, see below) My key insight was twofold: 1. If you start every thread at 0x00 and make the first N commands "THR @00", you get 2^(n+1)-1 threads running by the time your first thread exits the chain of THR commands. 2. You can use a single array MOV instruction to set a range of program counters, effectively causing every thread to jump to a set position. So in the first 5 cycles I start 31 threads, then my main thread drops into a loop where all it does is set every thread's position (including its own) to a start point every 2 cycles. Every single thread is now a 2-cycle loop with no JMP cycle spent to return to the start each time. Then I simply make 16 loops of: PIX counter color ADD counter 1 counter with color being one of two memory positions, which the main thread swaps out each loop. I initialize counter such that each thread is doing its own row of the output (0, 10, 20, etc). The leftover threads I don't actually want (but it's hard to fine tune the thread count, so I left them in), so they share the first thread's loop. The repeated actions are effectively a noop. Note that, due to space constraints, I use the unused 4th byte of each PIX instruction as the counter for that loop. Doing this got me to 0x24 cycles. I shaved a further 4 cycles by using the leftover space to add 4 more loops. These ones run vertically and operate on the last two columns (two threads doing one column together). By the time the row-moving threads have reached the 2nd last column, the column-moving threads have finished the last two columns, and so the program is finished 4 cycles earlier. I think I could get another 2-cycle saving if I fine-tuned the number of threads started, compressed everything down again and got another two column-moving threads. The bigger improvement is converting the whole thing to 1-cycle loops instead of 2-cycle, and having half the loops incrementing the counters and the other half doing PIX instructions. This might just be possible in the available space if I've run the numbers correctly, and would result in a total time of 0x14. EDIT: Did the latter: http://imgur.com/zD1Gw5H http://imgur.com/zD1Gw5H It came out to 0x16, as I failed to account for the extra time to spin up more threads.
- johnlinvc 11y agoIt's HNed, I got 509 Bandwidth Limit Exceeded. Looking forward to play it.
- kencausey 11y agoI looked at this a couple of times today before finally digging in and as I completed each level I looked forward more and more to the next level. And then there were no more levels, far sooner than I expected. I hope the author adds more in time. Edit: Oh and earlier today after having looked at it many times I bought http://www.lexaloffle.com http://www.lexaloffle.com 's combination of Voxatron and Pico-8. I've spent sometime today learning about Pico-8 (to which I'm going to limit my attention for now) and I think anyone interested in the linked game might be interested in these as well.
- keely 11y agoHi, I'm the author. Looks like the game went a bit viral and my personal website bandwidth limits were exceeded. You can now play here instead: http://bit.ly/1V1PiHt http://bit.ly/1V1PiHt
- azeirah 11y agoMade a subreddit for this game: https://www.reddit.com/r/box256 https://www.reddit.com/r/box256
- impomatic 11y agoFour squares solved in 7 cycles, 16 threads and overlapping code :-) https://twitter.com/john_metcalf/status/716901521036861440/ https://twitter.com/john_metcalf/status/716901521036861440/
- kencausey 11y agoThis has moved to http://box-256.com/ http://box-256.com/