You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
Spectre VR Dev Thread
Posted on: 4/22 3:24
VB Gamer
Joined 2/16
33 Posts
This is a crazy dream of mine. At least one other member of Planet VB is helping me make this dream a reality. I will ned to learn to code, obviously, but I have some experience with BASIC and html. I really need some skill with JAVA and C. Anyway, I figure it might be useful to share what I have on a thread.

Step 1 will be to disassemble the code for the MAC release of Spectre VR, Spectre Supreme and Spectre 1.0

Step 2 will be to reverse engineer source code for these games

Step 3 will be to create a port that offers multiplayer capibility on the VB. At this point I'm hoping to base it mostly on Spectre VR. If it becomes somehow possble to do multiplayer with more than two players, then that would be awesome.

Attached are the dumped resource forks

Attach file:



png  Screen Shot 2019-04-21 at 7.38.20 PM.png (1,246.92 KB)
14957_5cbd14cb3196b.png 928X681 px
zip Spectre VR.zip Size: 2,998.12 KB; Hits: 12
zip Spectre 1.0 dumps.zip Size: 1,124.60 KB; Hits: 3
zip Spectre Supreme Dumps.zip Size: 2,619.37 KB; Hits: 3
zip Spectre VR dumps.zip Size: 5,101.42 KB; Hits: 2
Edited by SpectreVR on 2019/4/22 3:39
Edited by SpectreVR on 2019/5/16 19:30
Top

#2
Re: Spectre VR Dev Thread
Posted on: 4/22 3:58
VB Gamer
Joined 2/16
33 Posts
This is a screenshot of the mac version of the game set to black and white then tinted red with the filled polygons turned off

The second is what it might looklike with filled polys turned on.

I have then reduced the resolution to 324x224

I am no where near getting this working on a real VB. I have no idea if it can handle rendering filled polygons in 3d at 50 fps.

Attach file:



jpg  gameplayConcept.jpg (54.27 KB)
14957_5cbd30396e5ed.jpg 324X224 px

jpg  GameplayConcept2.jpg (53.09 KB)
14957_5cbd3043c40ab.jpg 324X224 px
Edited by SpectreVR on 2019/4/22 5:07
Edited by SpectreVR on 2019/4/22 5:08
Edited by SpectreVR on 2019/4/22 5:09
Top

#3
Re: Spectre VR Dev Thread
Posted on: 4/22 20:40
Nintendoid!
Joined 2016/5/12
USA
129 Posts
Long Time User (3 Years)
very excited to see how this turns out, good luck to you!
Top

#4
Re: Spectre VR Dev Thread
Posted on: 4/22 22:35
Virtual Freak
Joined 2017/6/24
USA
62 Posts
Long Time User (1 Year)
The resolution of the Virtual Boy is 384x224, not 324x224.
Top

#5
Re: Spectre VR Dev Thread
Posted on: 4/22 23:05
Nintendoid!
Joined 2007/12/14
169 Posts
CoderLong Time User (11 Years) App Coder
Skip steps 1 and 2. Please. You will burn yourself out in frustration after a month.

Disassembling and making sense out of optimized, unsymbolicated assembly is not for the faint of heart and definitely not a task for a beginner. Moreover, analyzing classic Mac OS assembly in 2019 is particularly difficult because Apple has done a fine job of eliminating the requisite API documentation from the Internet. By my estimation there are maybe 30 people left in the world who can decompile classic Mac OS applications, and those folks by necessity maintain a rich working knowledge of that API and its quirks.

If your goal is to make a version of Spectre on the Virtual Boy, very little of the Mac code will help you anyway. Here are a few major points about the Mac version that will not transfer over:

- No QuickTime on the VB. Nothing even close.

- Spectre's multiplayer is communicated using the AppleTalk protocol. Needless to say, this doesn't exist on the VB either.

- Graphics on the Mac are predominantly done entirely in software, typically via Apple's QuickDraw API which, as you can probably guess, also isn't on the VB. Spectre is designed to do all of its rendering in software, for instance (QuickDraw accelerators might help, but those are rare). Mac graphics coders have the advantage of better control over the back buffers-- games, if not rendering to the framebuffer directly, render to an offscreen buffer (which consumes RAM) and make a final blit to the screen. You don't have this on the Virtual Boy-- an offscreen framebuffer would consume 24K, or over 1/3 of the VB's total working RAM. In addition, video memory on the Mac is organized in horizontal scanlines-- contrast this with the Virtual Boy which uses vertical scanlines. In short, you will have to fully rewrite the renderer. The Virtual Boy sports a powerful sprite engine in the VIP that can be leveraged essentially as a GPU. Taking advantage of the greater amount of ROM over RAM to prerender the 3D graphics as sprites will provide major gains in performance.

- All Macs come equipped with some kind of DAC for playing back sampled sound. No such thing on the Virtual Boy-- sampled sound can be coaxed out of the VSU, but again, you'd have to do all of that in software, spoon-feeding individual samples to the VSU at a regular rate. This costs you CPU time that could be otherwise spent rendering Spectre's 3D world and tracking gameplay. Keep in mind that the V810 processor inside the VB is clocked at just 20 Mhz-- just slightly faster than a Mac SE/30. Rewriting the sound code to take advantage of the VSU's native capabilities will win that CPU time back. Most of Spectre's audio is not terribly complex anyway.

As far as I know, the original source code to Spectre for Mac is lost. If you have your heart set on using "original" code, your best bet is probably the iOS port, which was done using a technique that I suggest you use: a fan meticulously studied the game's operation and created their own clone using their own engine from scratch. I'm pretty sure its source code isn't public though, but even if it was, I still wouldn't use it for this project.

Seriously, I want to see this project succeed, as I too am a huge fan of this game and have many fond recollections of facing off against my sister in the late 90s. But you should approach it from the perspective of what the Virtual Boy is capable of and build from there. The Mac code will just get in your way.
Top

#6
Re: Spectre VR Dev Thread
Posted on: 4/23 2:10
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Quote:

blitter wrote:
Disassembling and making sense out of optimized, unsymbolicated assembly is not for the faint of heart and definitely not a task for a beginner.

While it's true that someone who is just getting into programming may not be well-equipped for the task, the process in general is not as hard as you might think. With the right resources, I'm faithful that SpectreVR (the user) can pull off this Spectre VR (the game) project.

Quote:

blitter wrote:
If your goal is to make a version of Spectre on the Virtual Boy, very little of the Mac code will help you anyway. Here are a few major points about the Mac version that will not transfer over:

Only a cross-section of the game's code is necessary for a faithful port: the fundamental game engine and general rendering logic. The nitty-gritties about how the game communicates I/O with the OS or interacts with the windowing system aren't all that important when porting the game to any target, let alone Virtual Boy. As long as one knows what the game wants to do, the rest can be handled by a purpose-built implementation.

Also, between those Inside Macintosh books and Macintosh Programmer's Workshop--both of which are available online--we still have access to information regarding the old system API.
Top

#7
Re: Spectre VR Dev Thread
Posted on: 4/23 23:50
Nintendoid!
Joined 2007/12/14
169 Posts
CoderLong Time User (11 Years) App Coder
OK. Good luck.
Top

#8
Re: Spectre VR Dev Thread
Posted on: 4/29 2:53
VB Gamer
Joined 2/16
33 Posts
Ok, so I'm at the momment working on a java program that will parse throughthe MacBinaryII executable and let me copy thiungs out of it or run it through a disassembler. I've already used ResEdit for some of this, but unfortunately ResEdit wont let me copy some things very easily. I also need a betterway of dumping the shap resource than copying the data from resedit by hand.

Anyway, Ithought I'd share some developments. First of all the header of a macbinary is well known and is documented here

https://files.stairways.com/other/macbinaryii-standard-info.txt

It is also known that all macintosh applications have both a data fork and a resource fork. It was important to know which comes first in the binary. This sint something that is easy to find in documentation. So, time for some exparimentation. I found I can use BinHex 5.0 in baselisk to export binaries out of baselisk. Next I created a copy of Spectre 1.0 and exported it as a binary. Then I took the same copy and opened teh readme file for Spectre Supreme. Text files are purely data and show up in resedit as having a data fork. Its impoirtant to note that you cannot add data to the fork in an ID other than 128. Believe me, I tried. Anyway, open up the data resource in the readme with resEdit's hex editor and copy the whole thing. Now back to the Spectre 1.0 copy. Open the data fork, then open data resource 128 in the hex editor, and past it in, then save. Run BinHex 5.0 on it and save this as Spectre 1.0 copy2

Now we have two binaries that we can compare in a hex editor. I used Hex Fiend. Anyway, The data stream size is listed as being located at offset 83 and its a long word, which means it will be offset 83, 84, 85, 86 and further down it says it must be in the range of 0000 0000-$007F FFFF. As we would expect, this value changes from 0000 0000 to 0000 0463 which in decimal is 1123 and corresponds exactly to the length of the data I copied into the data fork. The data I copied begins at offset 128

This same test method can be applied to locate any resource in the binary to confirm the documentation. I also tried deleting the ALRT resource and compared the one without an ALRT to the one that had it.

So in short, there is a header which is described in the link I include here, then comes a data fork, then a resource fork. The data fork may have a map, but I cant say for sure yet. What I do know is that the resource fork does have a map. Presumably this is at the start of the resource fork.

Attach file:



png  Screen Shot 2019-04-28 at 7.48.23 PM.png (153.95 KB)
14957_5cc64a729781d.png 554X879 px

png  Screen Shot 2019-04-28 at 7.50.12 PM.png (177.29 KB)
14957_5cc64a8209e01.png 816X856 px
Top

#9
Re: Spectre VR Dev Thread
Posted on: 5/2 17:48
VB Gamer
Joined 2/16
33 Posts
Work continues on the Java tool, but in the meantime I managed to copy all the PICT resources out of the first game. There is no easy way I know of to just copy and paste the resources into new PICT files that are readable by OSX, but I can copy the file from within baselisk, and go to photoshop CS5 and create a new document which at least gets the new image to be sized correctly. Then I take a screenshot of the resource in ResEdit in baselisk, open the screenshot, then copy and past THAT into the photoshop document I just created. Alignment is of course critical. I'm confident I'm absolutely spot on with most files, but large screen filling images may be off by a pixel. The prites can be done as a series of small screen shots and then resized with an automated batch process in photoshop, so that made it all go quicker.

Attach file:


zip PICT.zip Size: 1,504.34 KB; Hits: 7
Top

#10
Re: Spectre VR Dev Thread
Posted on: 5/14 4:58
VB Gamer
Joined 2/16
33 Posts
Java tool to parse the data is finished. Attached is all the resource fork data separated out into individual binary files. Resedit uses templates to be able to edit and interpret the data within a resource. The TMPL resource contains templates. OS7 doubtless has several built in. Anyway, the TMPL structure is not documented but is easy enough to understand. Just by playing around in resedit I was able to confirm that a TMPL resource consists of a byte tat defines the length of the feild name, a feild name, then 4 bytes for a data type, then the next feild name size byte follows etc. It should be very simple to exploit this to dump the shap resource in the later releases to get to the original 3d models and even reformat them into a .obj file or whatever we want.

Attach file:


zip Archive 2.zip Size: 3,362.20 KB; Hits: 1
Top

 Top   Previous Topic   Next Topic


Register To Post