thanks for the information. made the tool seem a little less odd.
Hey everybody!
I think it is quite hard to understand the CD and CD Ray, so I'm gonna show you how it works.
BP told me all of that, so credits for the content goes to BP, the text is written by Me.
------------------------------------------------------------------------
The CD actually works like a real CD, so it is quite hard to use it. If you think you can do it, do it. If you think you can't, try it.
As it's like a real CD, you need a general understanding of how a CD works.
This little picture shows that: (Got it from BP) http://xandaros.bplaced.net/cdd.png
I start in the Middle: The "inner circle". The inner circle is not readable/writable. This is where the hole is placed, too.
The CD-Drive has to grab the CD somewhere. To be exactly: at the inner circle. That's why you can't use it.
The readable places of the CD are devided into tracks and sections.
It's like X and Y coordinates on a circle. the Stacks are the Z. While X, Y and Z are Tracks, Sections and Stacks, the Point it refers to, is a Block. Every single Block can hold Data.
Now we need some numbers!
The CD Ray has got some Outputs, like Section, Track, LocalSection, Address, Data,...
The Tracks go from 0 to whatever is your maximum. Data is the Data written in the Block the Ray is currently pointing on.
Well the Sections have 2 ways to be numbered. The first is "LocalSection", where you have a different numbering per Track. The second is "Section", where each Section has a unique number. I would have called this output "Block" ;D
What Address is for, I don't know either and I didn't have to use it up to now.
------------------------------------------------------------------
Well, you actually have to spin the CD, if you want to read from it, don't you?
But if you place a motor or something on it, you cant get it out. Well, that's no problem, because there is a thingy that's called CD Lock. You can spawn it with the CD Ray Tool's right click.
The CD actually snaps on it, like a plug in the socket.
--------------------------------------------------------------------
Some useful hints:
The CD spawner has a right click, to select the model. BP himself suggests to use a round phx plate ;D (I, too, have some good experience with it.
DO NOT EVER TRY TO USE A PROP WITH CORNERS! IT DOESN'T WORK!
And Example, made by BP: http://xandaros.bplaced.net/gm_wireconstruct_rc0287.jpg
-------------------------------------------------------------------
If you have any Questions, feel free to ask.
Many thanks to BP, who told me how to use it ;D
Xan
Edit: Well, I just saw it has Memory addresses^^
Play around with them like you want^^ (From the lua files)
0 [W] Write ray on
1 [W] Read ray on
2 [R] Current sector (global)
3 [R] Current sector (on track)
4 [R] Current track
5 [R] Current stack
6 [R] Current address (global)
7 [R] Current address (in current stack)
8 [W] Buffer ready (read or write - pick the ray)
9 [W] Continuous mode
10 [W] Wait for address mode
11 [W] Target address (in current stack)
12 [W] Wait for track§or mode
13 [W] Target sector
14 [W] Target track
21 [R] Raw disk spin velocity
22 [R] Raw disk spin angle
23 [R] Raw distance from disk center
24 [R] Raw stack index
25 [R] Disk precision (Inches Per Block)
26 [R] Disk sectors (total)
27 [R] Disk tracks (total)
28 [R] First track number
29 [R] Bytes per block
30 [R] Disk size (per stack)
31 [R] Disk volume (bytes total)
OMG MOAR INFORMATION!
(By -=Fox=-)
Hey there, it's -=Fox=-! I got some more information for you guys! So I figured I'd share it here, apologies for intruding
The Read/Write Buffer is located at Cells 512-1023 in the Highspeed Memory of the CD Ray entity!
And a Basic Procedure list for reading/writing CD-Roms!
Let us know if anything is missing!
Notes:
The CD Ray usually Reads and Writes to the disk in BLOCKS or sections of areas on the CD. Reading a Sector will fill the Ray's Buffer with the data in that sector. It is possible to write address by address, but I would think that it would be more efficient to write and read by blocks instead.
[I adjusted the notes... I didn't think the info here reflected above. Replace this with any other notes you want to add/correct Xan. -=Fox=-]
Basic Read/Write Method
1. Turn Ray on (read or Write) with cell 0 (write) or 1 (read)
---Reading the CD is "AutoMagical"
---Writing the Data requires use of the "Buffer Ready" (Cell 8!)
2a. If reading the buffer will automatically be filled with the data on the CD, HS cells after 512 on the CD Ray will be filled with the data!
2b. If Writing data you must fill the HS Buffer with the data you want to save, HS Cells after 512 on the CD Ray. Then tell the CD Ray that the buffer is ready to Write the Data (Send 1 to Cell 8) and then CD Ray will then Write the Data to the Sector!
(You might have to send a 0 to Cell 8 when your done writing to the sector to prevent it from writing other sectors with information you don't want to write)
Works!
Modes:
(BP says modes can be combined!)
-Continuous Mode (Cell 9)
Usually used for Formatting the Disk, this will continuously write data that is in the buffer to the CD. Maybe even a "Live mode" I'll have to experiment.
-Wait for Address (Cells 10 & 11)
Will wait for Address (Cell 10) of the sector to write to before Writing/Reading. Very useful! Parameters are put in Cell 11 for the address to wait for.
-Wait for Track and Sector (Cells 12-14)
Same as Wait for Address, will wait for Track and Sector information. Use Cell 12 to turn this mode on Cell 13 for Sector and Cell 14 for Track.
Collecting Data from the CD
You can collect data from the cells listed above that are labeled with a R above in the list. To collect this data simply read the cells!
Yep!
Edit by Xan: just marked tested statements
A little Tutorial
(From Xan)
Well, I never got it to work with normal wire, so get a CPU and wire membus to the ray. Clk to a button and, if you want, IOBus to a Data Port.
Now for the CPU. To write, you first enable the write ray(switch to writing mode). Then, you move your Data to 512 and higher (Depending on the Address you are going to Write to) and then you move 1 to buffer ready (cell 8). (Confirm the write). Now you deactivate the Buffer ready and you can do whatever you want with data and write ray now^^
To read:
To read, it's basically the same. You enable the read ray and everything is in the Buffer. (512+)
That's it ;D
Now for an example code.
(Needs more notes)
Reading:
Writing:Code:mov #65536,0; mov #65537,1; //Read out 0,#66048; jmp codestart;
Have fun!Code:mov #65536,1; //Write mov #65537,0; mov #66048,20; mov #65544,1; jmp codestart;
thanks for the information. made the tool seem a little less odd.
A-Z Materials - Released!!!!!!!
The tool is still in developement, and you CAN use shapeless props, except it's gonna make reading/writing very hard.
Address is address of current block (if each block has 512 bytes in it, then it's gonna be 512 * Sectors).
WHy is the CD round? Because reading from a "shapeless" item is nearly impossible. Seriously, if you don't call yourself Black Phoenix, I wouldn't recommend trying it^^
So the address points at how much you could have written to the cd right now?
Interesting...
Xan


If the cd is square, aint it the same but with square tracks, blocks and sectors?


Hehe, I am so going to create a square CD reader
Edit:
Like this? Where the colors are tracks and squares are blocks.
Can you confirm this, BP?
Last edited by -HP-; 04-02-2009 at 09:57 AM.


Okay, honestly I can't get this to work. Can you (or anyone) create a tutorial with how to use it, instead of explaining how it works?
I tried, and all of the outputs of the ray, except the data output, was zero. I wired write and read to two toggle buttons, and value to and advanced input.
The data output of the ray always showed the same as the adv. input, even if I was reading.
Last edited by -HP-; 04-02-2009 at 10:53 AM.


And one more thing... How do you know where to put the laser? There are no markings showing where the blocks are![]()
Last edited by -HP-; 04-02-2009 at 10:56 PM.
Bookmarks