+Random Terrain Posted August 31, 2013 Share Posted August 31, 2013 In case you don't know, I look for useful free scripts on the Internet when I need an interactive chart or tool. Well, the Programming Equivalents tool on the bB Tools and Toys page has always bothered me because the Binary box never padded out the numbers to 8 digits. I didn't know how to edit the javascript myself and I couldn't find a fix using Google. While using the tool today, the lack of leading zeroes was irritating me once more, so I went Googling again and finally found a solution: stackoverflow.com/questions/1267283/how-can-i-create-a-zerofilled-value-using-javascript/1268377#1268377 I merged that script with the script that was already on the page and now the Binary box always shows at least 8 digits when you put a number in one of the other boxes: randomterrain.com/atari-2600-memories-batari-basic-tools-toys.html Update: I'm now using code by bogax on the page instead. 1 Quote Link to comment Share on other sites More sharing options...
bogax Posted August 31, 2013 Share Posted August 31, 2013 heh no wonder you get a mega byte of javascript anytime you download a page Quote Link to comment Share on other sites More sharing options...
bogax Posted September 1, 2013 Share Posted September 1, 2013 For my own amusement I rewrote your radix converter. radix_converter.html Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 2, 2013 Author Share Posted September 2, 2013 For my own amusement I rewrote your radix converter. radix_converter.html Thanks, but the code I added from that page makes sure there are at least 8 digits while being able to handle larger numbers. For example, if you put 7777 in the decimal box of the current page, you'll get 1111001100001 in the binary box, but with your version, you'll get 01100001 in the binary box. Quote Link to comment Share on other sites More sharing options...
bogax Posted September 2, 2013 Share Posted September 2, 2013 (edited) Thanks, but the code I added from that page makes sure there are at least 8 digits while being able to handle larger numbers. For example, if you put 7777 in the decimal box of the current page, you'll get 1111001100001 in the binary box, but with your version, you'll get 01100001 in the binary box. oh, well if you insist radix_converter_mk2.html really I was just playin' one thing I was considering is grouping the hex digits into bytes Edited September 2, 2013 by bogax Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 2, 2013 Author Share Posted September 2, 2013 oh, well if you insist radix_converter_mk2.html really I was just playin' one thing I was considering is grouping the hex digits into bytes Thanks. While you're playing, can you make the Hexadecimal box show a leading zero when the number is 0 through F? So instead of 1, it will show 01 and instead of F, it will show 0F? Quote Link to comment Share on other sites More sharing options...
bogax Posted September 2, 2013 Share Posted September 2, 2013 Thanks. While you're playing, can you make the Hexadecimal box show a leading zero when the number is 0 through F? So instead of 1, it will show 01 and instead of F, it will show 0F? radix_converter_mk2_2.html Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 2, 2013 Author Share Posted September 2, 2013 radix_converter_mk2_2.html Thanks. It seems to be working great so far: randomterrain.com/atari-2600-memories-batari-basic-tools-toys.html Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 3, 2013 Share Posted September 3, 2013 I wish I had this when I was programming Dead of Knight. I was running out of room for, er, rooms. One technique I used was instead of using playfield commands I directly manipulated the screen vars to produce scenery. I'd rather use your tool than the Windows calc program. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 3, 2013 Share Posted September 3, 2013 (edited) If you have a Windows PC, you might already know that the calculator in your Accessories folder can convert decimal, hex, and binary numbers when switched to Scientific under the View menu. If you have a Mac, the Calculator program in the Applications folder can do so as well when switched to Programmer under the View menu. While you cannot type in binary values, you can click the 0s and 1s in the binary view (between display and keypad) to toggle the value of each bit. The display will change to match the new binary value. Just checked my work computer and they changed the calculator in Windows 7 - there's now Programmer option under the View menu. They've also added the bit display, complete with click-to-toggle each bit. You can also type in the binary values, which is nice. Edited September 3, 2013 by SpiceWare Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 3, 2013 Author Share Posted September 3, 2013 They've also added the bit display, complete with click-to-toggle each bit. I just tried that with the calculator on my computer and it thinks that 10000000 is -128. Speaking of toggling bits . . . bogax, if you are reading this, do you feel like making a tool that has 8 boxes that can toggle off and on similar to the Playfield Toy? I'm looking for something that will instantly display the correct hex number every time the boxes are toggled. The tool might look something like this: If it could display hex and decimal numbers, that would be even better. Now that I think about it, this thing could be a separate tool, or if you know how, you could add the 8 interactive boxes at the top of the Programming Equivalents tool and just have the values displayed in the Decimal, Hexadecimal, Binary, Ternary, Quintal, and Octal boxes below it. It might look something like this: 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 3, 2013 Share Posted September 3, 2013 Maybe a pseudo drawing tool that displayed the decimal value for each row. That's what I typically wish for when drawing playfield pixels [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 3, 2013 Author Share Posted September 3, 2013 Maybe a pseudo drawing tool that displayed the decimal value for each row. That's what I typically wish for when drawing playfield pixels [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 [X][X][X][X][X][X][X][X] = 255 [X][X][X][X][X][X][X][X] = 0 VisualbB can already convert a playfield into data that will work directly with the playfield variables. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 3, 2013 Share Posted September 3, 2013 I see covert to data file but that doesn't output to decimal. I also cannot see anything like the format I suggested above. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 3, 2013 Author Share Posted September 3, 2013 I see covert to data file but that doesn't output to decimal. I also cannot see anything like the format I suggested above. Do you plan on using it as data to use directly with playfield variables? If so, why does it need to be in decimal? Here's an example playfield: __ playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX XX............................XX XX..XXXXXXXXXXX..XXXXXXXXXXX..XX XX..XX....................XX..XX XX..XX....................XX..XX XX..XX....................XX..XX XX..XXXXX..XXXX..XXXX..XXXXX..XX XX............................XX XX............................XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end __ __ And here is the converted data: __ data _Data_PF_01 $FF,$FF,$FF,$FF $C0,$00,$00,$C0 $C0,$00,$00,$C0 $CF,$7F,$7F,$CF $CC,$00,$00,$CC $CC,$00,$00,$CC $CC,$00,$00,$CC $CF,$79,$79,$CF $C0,$00,$00,$C0 $C0,$00,$00,$C0 $FF,$FF,$FF,$FF end __ Once you have the data, you can place parts of it anywhere on the screen like I did here and it's lightning-fast: http://atariage.com/forums/topic/205563-whats-so-great-about-vbbs-convert-to-data-file-example-program/ Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 3, 2013 Share Posted September 3, 2013 Nah. Not as fast as my post. If I want to create landmarks instead of whole playfields the method I describe is alot more helpful. Say, if you wanted to create a gravestone you could record the decimal values after drawing them like in my checkbox area I described in my post. After that you could easily reuse the results in different columns of playfield variables. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 3, 2013 Author Share Posted September 3, 2013 Nah. Not as fast as my post. If I want to create landmarks instead of whole playfields the method I describe is alot more helpful. Say, if you wanted to create a gravestone you could record the decimal values after drawing them like in my checkbox area I described in my post. After that you could easily reuse the results in different columns of playfield variables. If you are putting data directly into playfield variables, you need to know which variables will be reversed. As I have said in another thread, you don't have to do whole playfields. You don't even need to do horizontal strips of playfields. You can draw what you want in the editor, then use VbB to spit out the values with reversed data and just copy and paste the specific part of the data that you want to use. As long as you remember that the second and fourth playfield variables of each row have a reversed bit order, you can place that data exactly where you want it. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 3, 2013 Share Posted September 3, 2013 I guess the only way to explain the value is to write the utility myself. I'll probably end up using the Windows calc and some mental gymnastics like usual, though Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 3, 2013 Share Posted September 3, 2013 I just tried that with the calculator on my computer and it thinks that 10000000 is -128. That's because it is. LDA #%10000000 BMI NEGATIVE_VALUE ... LDA #%01111111 BPL POSITIVE_VALUE Both of those branches will be taken. If you want the Windows calculator to treat %10000000 as positive use Word, Dword or Qword instead of Byte. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 3, 2013 Author Share Posted September 3, 2013 If you want the Windows calculator to treat %10000000 as positive use Word, Dword or Qword instead of Byte. Thanks. Looks like Dword has fewer digits, so that's the one I'd use (less likely that I'd click on the wrong thing). Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 3, 2013 Share Posted September 3, 2013 Hmm, the link to the Two's Complement entry at Wiki broke. Looks like the forum doesn't like the ' in the link. Copy the following and paste in your address bar to get there. en.wikipedia.org/wiki/Two's_complement Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 3, 2013 Author Share Posted September 3, 2013 Hmm, the link to the Two's Complement entry at Wiki broke. Looks like the forum doesn't like the ' in the link. Copy the following and paste in your address bar to get there. en.wikipedia.org/wiki/Two's_complement en.wikipedia.org/wiki/Two%27s_complement Test When I pasted, the forum software converted that character to something it could use. Quote Link to comment Share on other sites More sharing options...
bogax Posted September 4, 2013 Share Posted September 4, 2013 (edited) Here's a preliminary whack at itAt least it seems to workedit: nested the tablesradix_converter_03_2.html Edited September 4, 2013 by bogax 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 4, 2013 Author Share Posted September 4, 2013 Here's a preliminary whack at it At least it seems to work edit: nested the tables radix_converter_03_2.html Wow, that seems to be working great so far. Thanks. The only thing I could see people complaining about is that the new byte section only remembers what has been clicked inside of it. For example, if somebody types 80 in the decimal box, then goes to toggle one of the boxes in the byte area, the byte area remembers what has or hasn't been toggled inside of it previously. Do you think you could make the memory for the byte area reset when something is typed in one of the Decimal, Hexadecimal, Binary, Ternary, Quintal, and Octal boxes below it, then remember the new number? Quote Link to comment Share on other sites More sharing options...
bogax Posted September 5, 2013 Share Posted September 5, 2013 Wow, that seems to be working great so far. Thanks. The only thing I could see people complaining about is that the new byte section only remembers what has been clicked inside of it. For example, if somebody types 80 in the decimal box, then goes to toggle one of the boxes in the byte area, the byte area remembers what has or hasn't been toggled inside of it previously. Do you think you could make the memory for the byte area reset when something is typed in one of the Decimal, Hexadecimal, Binary, Ternary, Quintal, and Octal boxes below it, then remember the new number? The bit boxes are just a new way to input If you change any of the boxes they all (including the bit boxes) get updated to the new value except the bit boxes only get the lo byte. If you change the bit boxes then you only get eight bits (they'll all be <=255) At least that's how it's supposed to work. It maybe differences in browsers I suppose 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.