Tokugawa Corporate Forums

Retro Japanese Computing
It is currently March 29th, 2024, 9:23 am

All times are UTC




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: April 11th, 2011, 4:44 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
I took a look at both Screamer and Hadou no Hyouteki with M88 and can definitely say they don't have a file name table. I'm still thinking they have a file allocation table, the question is just how to find it. Even without a filename table though there should still be a file allocations table I think... I'm still not certain on this though. I have a feeling you can indeed control read/writes of the sectors.

If anyones curious, the way I can verify no filename table is by checking out the fdc.dmp log. (Look here for the debug version of the emu : http://fullmotionvideo.free.fr/forum/vi ... .php?t=609)

Inside you'll see a bunch of commands sent to the floppy but all we're interested in is :

Code:
[46] ReadData FD 0 On
(00 00 00 01 01 10 0e ff)
   Read 00 00 01 01

 <TC>   TC at 0x100 byte
   { 00 00 00 00 00 02 01 }
FD 0 Off


The piece where it says Read corresponds to the sector itself, so if you search using a hex editor for 00000101 you'll find the corresponding sector in the disk. Using Xarth if you follow them you'll see how when it reads a file it'll hit the filename table and file allocation table.

Hopefully with this info we can figure out more about how these games work.

Does anyone by chance have any technical documents for coding on the PC88?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: April 15th, 2011, 8:57 am 
Offline
User avatar

Joined: April 27th, 2009, 11:42 am
Posts: 725
Location: Twilight of Neo Kobe City
I've done some tests with the aid of the pcc88mk2 system disk.
The FILES command gives varied results.
Some games display correctly the files in the disk. Others, like Yaksa, give a "bad allocation table" error (but the game works correctly when booted). Other games give a "I/O error", but work when booted (Screamer).
I wonder if using DOS we could see the files inside the disk. Zork I has a primitive built-in version of DOS in it, i'll try doing some tests.

_________________
Call me Snake...


Top
 Profile  
 
 Post subject:
PostPosted: April 15th, 2011, 10:49 am 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
The bad allocation table is due to it not being in sector 12 head 01 cylinder 01 id 09 and the filename table not being in sector 12 head 01 cylinder 01 id 01.

I'd be curious to see your results about booting in dos as I know BASIC it's hardcoded to look there.

Hopefully I'll have some results soon on whether or not those games that don't have a filename table still have an allocation table. I've been pouring through M88, X88000, and Quasi88's source code and damn is it still hard to figure out how it seeks :D I know the 4 ports the PC88 uses but it's still a bit confusing as they are used for multiple things regarding the floppy drive. I've figured out how it does it using the sub cpu but I want to see how the main cpu sends it in (besides the fact it sends it through the PiO device). I have an idea though on how to find out that I'll be testing later on today.

Also, if you ever want to see one of the finest coded programs ever, definitely M88 hands down.

Also, Quasi88 is an awesome emulator for debugging. I never really used it till this week and just wow :D Now if it just had the ability to trace out to a file that'd be awesome (something I may look later at adding but for now M88 fills that role).


Top
 Profile  
 
 Post subject:
PostPosted: April 15th, 2011, 5:09 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
Huzzah! Finally I figured out how to load track/sectors. It's not quite what I was looking for but it's the breakthrough we need. It's a BIOS function call that does this for us. If you enable the main cpu logging in M88 or if you want to set a breakpoint in Quasi88, look for/set on 0x369a. I'd recommend using logging though as I don't believe Quasi88 has the ability to look at the stack (maybe it does... not sure) so you won't see what calls it.

The setup of this function is :

Bios Function 0x369a :
Register A : # of sectors to pull (?)
Register B : Track #
Register C : Sector # (to start from)
Register H : First half of location to write to
Register L : Second half of location to write to

I need to confirm register A's use but that's what it appears to be for.

Note, a game does not have to use this as I saw other tracks loading without using this so there's another function to be tracked down. But it's a start :D

For the other function I have a sneaking suspicion it just specifies the track # and sector to start from and it just slurps it all in rather then being told how many sectors to pull. Just a theory though.


Last edited by EsperKnight on April 16th, 2011, 7:23 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: April 15th, 2011, 6:24 pm 
Offline
User avatar

Joined: April 27th, 2009, 11:42 am
Posts: 725
Location: Twilight of Neo Kobe City
These are very good news!
I've tried using the very primitive version of DOS that is embedded with the Zork games, but like you correctly guessed, it doesn't work.
It gives me this "bad sector" error:

Image

I'll try to look in my backups for PC88 technical documents. Stay tuned ;)

_________________
Call me Snake...


Top
 Profile  
 
 Post subject:
PostPosted: April 15th, 2011, 7:22 pm 
Offline
User avatar

Joined: April 27th, 2009, 11:42 am
Posts: 725
Location: Twilight of Neo Kobe City
I've found only a couple of docs that the good Danjuro gave to me more than a year ago.
They are called PC-8001 Load Star and PC-8001 Technical Manual, but i don't think they can be of any help with your issue.
If anyone is interested in them i'd be more than happy to upload them, tough :)

_________________
Call me Snake...


Top
 Profile  
 
 Post subject:
PostPosted: April 15th, 2011, 8:35 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
I say go ahead, never know they might be useful for something else.


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2011, 7:24 am 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
Updated my post about the bios function as I forgot to write down that HL is used for where to write it in RAM. What I get for writing it in a hurry at the time :)


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2011, 4:00 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
Yay, I found the other piece of the puzzle. There is indeed another function you can use although it's not a function per say. To access it you load HL with the place in memory you have the needed variables for it and call RST 10h.

The format of the variables is as follows (subject to change if I get them wrong :) ) :

00h : # of sectors to pull
01h : Disk # (0 or 1 for the first and second respectively)
02h : Track #
03h : Sector #
04h : Unknown (Seems to vary between 38h and 40h. I'll take a look later at M88s or Qausi88s code to see what it does maybe).
05h - 06h : Location to write to (lower half + upper half)
07h : If 0, return, if FFh then pull in a next track, same format

So if you look at the first disk of Screamer, the boot disk, look at 0xC99C for the first load ingame using this function, track 4f.

What's intriguing is it cuts of track 4f short 0x200 bytes. Seems this function doesn't care if you hit the max ram threshold, it just quits nicely.

Also note, even if the sectors are out of order, it doesn't matter as it still reads them inorder (ignore what Quasi88 says about the order they're loaded as it's wrong).

So next up is to add this functionality to my extractor :)


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2011, 7:21 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
Think I found another revelation... need to confirm it on my games but I noticed that anything that uses BASIC to boot with (Hadou no Hyouteki, Death Trap and I'm sure Zarth and Lolita Syndrome) use CALL 369AH exclusively (as far as I can tell so far, not 100% sure yet).

Those games that use ? aka Screamer use both CALL 369AH and RST 10H. I'm suspecting they either use Dos or I was reading somewhere that the PC8801 also runs off CP/M. Not sure though. Easiest way to tell :

Search for RST 10H and if you see JP 100H then it's the routine to load sectors off the disk. Else wise, if you see INC HL then it should be using BASIC to boot it up.

Mind you I only confirmed the BASIC routine with two games and the RST 10H with one game so take this with a grain of salt.

If you wish to look yourself, boot up the M88 debug version, load up the disk you want to run, click on Debug -> Dump CPU1 Log and reboot. Wait till graphics load up or so then stop it. Load it up then in anything that accepts large files (notepad++ or EditPad) and then search on RST 10H (include double spaces between RST and 10H). Based on what you see it should conform to one of those two hopefully. If not lemme know :)

If you want to see how a bank is loaded, the easiest way I've found is wait till the text is loaded on screen then do a RAM dump of it in M88 (Debug -> Show Memory -> Image -> Save). Then search for where that text is in the RAM dump. Start up logging and reboot back to that point (I don't do both at once just in case plus logging will slow down the emu) and when you get to it, go ahead and stop it. Open it up and search on that location. You'll either see INI or LD (HL), A or something akin to the latter. INI stores what's in A at the location pointed to by HL. The other does the same as well. From here you'll be either in the 0XXXs or the 3XXX most likely. So generally you want to search up to where you jumped to it. If it's in the 0XXX search for RST. If it's not then search for CALL (over and over...) till you get out if it. Remember, patience is key when doing this stuff :)

Hope that helps. I'll keep checking various games so feel free to mention any and all you'd like me to look at. Next up I'll look at Zarth so more as well as verify Hadou no Hyouteki some more too. Yaksa I'll check too.


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2011, 8:06 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
Well scratch what I said about BASIC vs the other as Screamer uses what I thought was a BASIC call. I'm now wondering if Screamer uses something custom... to find the calls in Screamer search instead on 0100: (include the colon). To double check I couldn't find it in Zarth or Hadou no Hyouteki so that doesn't disprove my theory that BASIC games wouldn't use this. We'll see though.

(Note, my assumptions were based off this was a BIOS call but now I'm not so sure...)


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2011, 10:10 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
I hope no one minds me posting as I am but I find it a bit easier to keep these all separate to show progress and also my thinking as well which may help someone.

I looked at Yaksa. It uses a custom routine located at C103h.
Registers are as follows :

HL : Position to write to
BL : Amount to copy to.

There is some prep before hand I'm sure to setup what disk to access and track and sector. I haven't looked for that just yet though.

So this confirms at least that there will be no universal way of grabbing files out but hey, at least we know now what to look for.


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2011, 10:15 pm 
Offline
User avatar

Joined: May 15th, 2010, 1:35 am
Posts: 701
Awesome work, EsperKnight. :)


Top
 Profile  
 
 Post subject:
PostPosted: April 17th, 2011, 4:13 pm 
Offline
User avatar

Joined: April 27th, 2009, 11:42 am
Posts: 725
Location: Twilight of Neo Kobe City
EsperKnight wrote:
I was reading somewhere that the PC8801 also runs off CP/M. Not sure though.


The bdos version which is embedded with Zork actually uses CP/M, it's shown in the screen i posted.
I'll upload the docs soon, i tried to open sharebee but it seems that it is under manteinance now. :(

_________________
Call me Snake...


Top
 Profile  
 
 Post subject:
PostPosted: April 17th, 2011, 7:32 pm 
Offline

Joined: August 17th, 2009, 10:22 pm
Posts: 46
Ack good thing I paid attention. Reminds me as I meant to ask, are the files its showing the dos files and the zork disks themselves?

Edit: Duh, you can list the files on the zork disks but swapping to another doesn't work :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group