vidak Posted July 15, 2018 Share Posted July 15, 2018 (edited) I have to be brief because my partner is calling me haha: - there is an esoteric langauge with 8 operations - they are represented by the symbols .,<>[]+- - the compiler can be as small as 1KB - it is called 'brainfuck' programming ON the 2600?? Edited July 15, 2018 by vidak Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted July 18, 2018 Share Posted July 18, 2018 Pretty much just assembler and two BASIC compilers. Quote Link to comment Share on other sites More sharing options...
vidak Posted July 18, 2018 Author Share Posted July 18, 2018 Well what I mean is I could make a cart not unlike Warren Robinett's BASIC cartridge except you would have a much lower and more powerful control of the hardware while programming on the 2600. You would only need at least 8 buttons, as well, not counting text formatting keys.The premise of brainfuck is that you have a one-dimensional array of memory cells, that can each hold an 8-bit number. You may move left and right along the memory cell list, and you may decrement and increment the value in a memory cell. You may also write out the value of the memory cell to the console, and you may read in a value from the console. You may also set up loops, and nested loops, to iterate over sections of code. I believe this esoteric language is sufficiently simple enough to allow some limited programming natively on the Atari 2600 console, so you may write and execute programs in real time on your own 2600. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted July 18, 2018 Share Posted July 18, 2018 Probably want to hold off until a C compiler becomes available called SpiceC. It uses some assistance from an ARM chip. Not impossible using tight assembler code coupled with a very tight text mode-like graphics kernel. That's more than some can handle. Quote Link to comment Share on other sites More sharing options...
vidak Posted July 18, 2018 Author Share Posted July 18, 2018 I think it's possible - the idea just dawned on me, though. People have already written compilers for brainfuck, and have done it in around 1KB. I suppose I would just have to reimplement their sourcecode. I think I would perhaps implement the 7-bit ASCII character set, but that would take up room. Perhaps I could go with a 5-bit character set, and forego lower case characters. The code for "Hello World" looks like this: 1 +++++ +++ Set Cell #0 to 8 2 [ 3 >++++ Add 4 to Cell #1; this will always set Cell #1 to 4 4 [ as the cell will be cleared by the loop 5 >++ Add 4*2 to Cell #2 6 >+++ Add 4*3 to Cell #3 7 >+++ Add 4*3 to Cell #4 8 >+ Add 4 to Cell #5 9 <<<<- Decrement the loop counter in Cell #1 10 ] Loop till Cell #1 is zero 11 >+ Add 1 to Cell #2 12 >+ Add 1 to Cell #3 13 >- Subtract 1 from Cell #4 14 >>+ Add 1 to Cell #6 15 [<] Move back to the first zero cell you find; this will 16 be Cell #1 which was cleared by the previous loop 17 <- Decrement the loop Counter in Cell #0 18 ] Loop till Cell #0 is zero 19 20 The result of this is: 21 Cell No : 0 1 2 3 4 5 6 22 Contents: 0 0 72 104 88 32 8 23 Pointer : ^ 24 25 >>. Cell #2 has value 72 which is 'H' 26 >---. Subtract 3 from Cell #3 to get 101 which is 'e' 27 +++++ ++..+++. Likewise for 'llo' from Cell #3 28 >>. Cell #5 is 32 for the space 29 <-. Subtract 1 from Cell #4 for 87 to give a 'W' 30 <. Cell #3 was set to 'o' from the end of 'Hello' 31 +++.----- -.----- ---. Cell #3 for 'rl' and 'd' 32 >>+. Add 1 to Cell #5 gives us an exclamation point 33 >++. And finally a newline from Cell #6 The same program in minimised form: ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++. The main problem is having enough RAM. Writing brainfuck as an interpreter would take up RAM, and writing a compiler would require the 2600 to /write/ the program somewhere on the cart, and that may be possible with some extra bankswitched SRAM or some sort of non-volatile RAM?Anyway I just wanted to bring this idea I had up to see if anyone found it interesting. 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted July 18, 2018 Share Posted July 18, 2018 On the Atari 2600 everything is already hard and convoluted (even in BASIC). So, I'm good Quote Link to comment Share on other sites More sharing options...
vidak Posted July 18, 2018 Author Share Posted July 18, 2018 Fair enough, dude!! 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted July 18, 2018 Share Posted July 18, 2018 I just saw a Scratch newbie get interested in making real 2600 games. Now, if you could fit something like THAT into a cartridge.. Quote Link to comment Share on other sites More sharing options...
vidak Posted July 18, 2018 Author Share Posted July 18, 2018 (edited) I'm actually thinking of doing some YouTube videos on how to learn 6502 assembly for making 2600 games. In my experience, I don't think 6502 assembly is that difficult. Most of the time you're just storing, loading, and branching. It's not that hard. Anyway some lectures/tutorials would easily help more people grasp the concepts. Edited July 18, 2018 by vidak 4 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted July 18, 2018 Share Posted July 18, 2018 They've got an assembly framework for the Intellivision called "P-Machinery". I bet with a similar game engine template and some cleverly coded macros you could make it almost as intuitive as BASIC. Quote Link to comment Share on other sites More sharing options...
vidak Posted July 18, 2018 Author Share Posted July 18, 2018 True - I'd like people to understand what they're doing, though. Batari BASIC really is a great way to get going really quickly, though. Most programming now is all about doing the most you can in the minimum amount of lines. Assembly is NOTHING like that. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.