Jump to content
Sign in to follow this  
Kchula-Rrit

How accurate is TI994w NanoPEB Emulation?

Recommended Posts

Anyone know how "faithful" the NanoPEB emulation in TI994w is?  Or, would a better question be, how close is the CF7+ emulation to the NanoPEB?

 

I've been working on a new version of my batch loader, using TI994w to debug it while my TI has been in pieces.  After getting the TI back together, the loader hung when I tried running it.  The loader ran under TI994w without problems.

 

My TI994w configuration uses FIADs, where the files are in DSK1-3 directories in TI-FILES format.  Then I switched the configuration to use a CF7 image, and used TI99-Dir to make an image of the Compact Flash board in my NanoPEB.

 

The batch loader appeared to hang, but when i showed the CPU window I could see that the program appeared to be stuck in a loop in the >4XXX range, presumably in the emulated disk DSR.

 

K-R.

Share this post


Link to post
Share on other sites

Forgot to say, I'm using v5.4b in a Win98 system.  I already have 5.4c downloaded, but have not loaded it yet.

 

K-R.

 

Share this post


Link to post
Share on other sites
On 4/14/2021 at 4:32 AM, Kchula-Rrit said:

Anyone know how "faithful" the NanoPEB emulation in TI994w is?  Or, would a better question be, how close is the CF7+ emulation to the NanoPEB?

 

I've been working on a new version of my batch loader, using TI994w to debug it while my TI has been in pieces.  After getting the TI back together, the loader hung when I tried running it.  The loader ran under TI994w without problems.

 

My TI994w configuration uses FIADs, where the files are in DSK1-3 directories in TI-FILES format.  Then I switched the configuration to use a CF7 image, and used TI99-Dir to make an image of the Compact Flash board in my NanoPEB.

 

The batch loader appeared to hang, but when i showed the CPU window I could see that the program appeared to be stuck in a loop in the >4XXX range, presumably in the emulated disk DSR.

 

K-R.

Depends on what you are doing. Ti994w is using the CF7a+ DSR. There are differences in the addresses of the CF-card between the Cf7a+ and the nanoPeb.

 

CFPRT1    DATA    >5E00,>5F00    CF7+    read/write ports
CFPRT2    DATA    >5F80,>5FC0    nanoPEB read/write ports

 

  • Like 1

Share this post


Link to post
Share on other sites

I'm doing disk-reads through Level-3 DSR calls, plus calling TI's LOADER program in low RAM.  All my screen messages and user prompts are stored in VDP RAM, to save space in CPU RAM.  I set the VDP free-space pointer at 0x8370 appropriately when loading, then restore it upon exit.  I don't think that should matter.

 

I tried v5.4c this morning and my loader did not hang, and the test file ran without problem, using FIADs.  After switching to a CF7 image of my NanoPEB compact flash, my loader and the test file ran successfully.

 

It occurred to me that I had not turned off FIAD (top entry on the DSR menu) to use the CF7.  When I did so, the debug window halted with the line

Cf7a+Features       : Value = 0x81 Status=0x00 : Ok
Cf7a+ReadSector     : Sector=0x00000000 Status=0x00 : Ok
Cf7a+WriteSector    : Sector=0x00000000 Status=0x00 : Ok
Cf7a+ReadSector     : Sector=0x063FF9C1 Status=0x04 : Sectornumber to big

I turned off the TI disk controller (CRU addr 0x1100) and go the same message.  When I turned on FIAD, everything worked, with or without the TI disk controller.  Looks like the CF7 needs the FIAD to work.

 

K-R.

  • Like 1

Share this post


Link to post
Share on other sites

Update:  My loader runs in TI994w, with FIAD or CF7 emulation.  It still fails (hangs) in my real TI, so now I get to figure out what I am doing wrong.

 

K-R.

  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, Kchula-Rrit said:

Update:  My loader runs in TI994w, with FIAD or CF7 emulation.  It still fails (hangs) in my real TI, so now I get to figure out what I am doing wrong.

 

K-R.

You can try it in Classic99 just to see if you get different behaviour with a different emulation. You'll need the CF7+ BIOS and you'll have to make a memory image for the CF card.

Share this post


Link to post
Share on other sites

It assembles and runs in Classic99 using TI (FIAD) disk emulation.  Haven't tried CF7+ yet, but I bet it will work.

 

I'm trying some creative things to minimize Low RAM usage, which may be stepping on some addresses the NanoPEB uses.  The screen prompts are at the start of the program.  They get copied to the upper end of VDP RAM, then the Low RAM that the prompts use gets freed (LSTLOW gets set to just below the first instruction).  I'm also working with the PABs directly in VDP RAM to read the batch file and call LOADER.  Of course, I update >8370 when I grab VDP RAM and restore the original value when I exit.

 

I haven't done these kinds of things before, so I might be trying to get too "fancy" all at once.

 

K-R.

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
On 4/16/2021 at 8:33 PM, Kchula-Rrit said:

I'm doing disk-reads through Level-3 DSR calls, plus calling TI's LOADER program in low RAM.  All my screen messages and user prompts are stored in VDP RAM, to save space in CPU RAM.  I set the VDP free-space pointer at 0x8370 appropriately when loading, then restore it upon exit.  I don't think that should matter.

 

I tried v5.4c this morning and my loader did not hang, and the test file ran without problem, using FIADs.  After switching to a CF7 image of my NanoPEB compact flash, my loader and the test file ran successfully.

 

It occurred to me that I had not turned off FIAD (top entry on the DSR menu) to use the CF7.  When I did so, the debug window halted with the line

Cf7a+Features       : Value = 0x81 Status=0x00 : Ok
Cf7a+ReadSector     : Sector=0x00000000 Status=0x00 : Ok
Cf7a+WriteSector    : Sector=0x00000000 Status=0x00 : Ok
Cf7a+ReadSector     : Sector=0x063FF9C1 Status=0x04 : Sectornumber to big

I turned off the TI disk controller (CRU addr 0x1100) and go the same message.  When I turned on FIAD, everything worked, with or without the TI disk controller.  Looks like the CF7 needs the FIAD to work.

 

K-R.

What is cousing the second Cf7a+Readsector? After a reset I only see the first three Cf7a+ messages?

Is the CF cards (image) you are using at least 26.843.136.256 bytes in size (0x063ff9c1 * 256) ?

If not then there is maybe something wrong with the volume on the CF card (image) you are using.

 

The TI DC and CF7A+ DSR doesn't like each other. Menu option File -> Device Service Routines

[x] >1000 FIAD: Simulated DSK, DSK1..3    (if you need this for i.e. loading your program from a directory)

[ ] >1100 DSK: Ti Diskcontroller

[x] >1600 CF7A+: DSK, DSK1, DSK2, DSK3

 

DSR.jpg.982454474904c09dbd3a87820e1c3887.jpg

 

Although the CRU address is >1600 for the CF7A+ as stated here, the CRU is still found at >1100. I can't remember why, maybe I did some forbidden under aged trickery here.

 

(maybe switch off what you don't need, like IDE, HDX etc).

 

Then in menu option File -> Fiad and Doad

Tab CF7A+: Select your CF7A+ CF card image

Tab DSK: Could be switched of. Only matters if you do something with this feature.

Tab DSK1: Select your FIAD directory if you need this else select CF7A+ DSK1

Tab DSK2: Select CF7A+ DSK2

Tab DSK3: Select CF7A+ DSK3

 

But ... if it is more convenient to have DSK1 and DSK2 as a CF7A+ and you need a FIAD for test purposes then set DSK3 as such. That is what I always do.

 

afbeelding.png.53ffa3b1b13c91b550902ad38040e8f0.png

 

And if you only do level3 file IO then it should work.

 

 

 

Edited by F.G. Kaal
  • Like 3

Share this post


Link to post
Share on other sites
23 hours ago, Kchula-Rrit said:

It assembles and runs in Classic99 using TI (FIAD) disk emulation.  Haven't tried CF7+ yet, but I bet it will work.

I don't think there's any reason to assume that. Classic99 does not simulate the CF7+, it's a low level emulation including emulation of a fake CF card and its registers. FIAD emulation is a complete simulation.

 

Share this post


Link to post
Share on other sites
On 4/19/2021 at 9:24 AM, Tursi said:

I don't think there's any reason to assume that. Classic99 does not simulate the CF7+, it's a low level emulation including emulation of a fake CF card and its registers. FIAD emulation is a complete simulation.

 

I was just going on my experience with TI994w, where both FIAD and CF7 worked.  Silly assumption on my part.

 

K-R.

Share this post


Link to post
Share on other sites
Posted (edited)
On 4/18/2021 at 11:39 AM, F.G. Kaal said:

What is cousing the second Cf7a+Readsector? After a reset I only see the first three Cf7a+ messages?

Is the CF cards (image) you are using at least 26.843.136.256 bytes in size (0x063ff9c1 * 256) ?

If not then there is maybe something wrong with the volume on the CF card (image) you are using.

   ...

And if you only do level3 file IO then it should work.

 

 

 

The image I am using is of a 128MB CF, it is 63MB in size.  Sector 63FF9C1 is 104,856,001 decimal.  Dividing by 1600 sectors per disk-image gives a disk-image number of 65,535.  Looks like I'm trying to access something that is not there, or my CF board is bad, or maybe the board exceeds the NanoPEB's capacity.  Oops.

 

More info:  When I back-up the CF board using, TI99Dir v8.2a-20210101, the sector-count is 250368, which gives 156 images of 1600 sectors each.  This is what I remember when using CF2K to mount and format images.

 

Have to look through my code a bit more closely to see where it may be going awry.

 

Forgot to mention that, so far as I know, I'm only Level 3 file I/O.  I open a text file and read it, then call TI's LOADER routine.

 

K-R.

Edited by Kchula-Rrit
Added some more info
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
On 4/23/2021 at 3:03 AM, Kchula-Rrit said:

The image I am using is of a 128MB CF, it is 63MB in size.  Sector 63FF9C1 is 104,856,001 decimal.  Dividing by 1600 sectors per disk-image gives a disk-image number of 65,535.  Looks like I'm trying to access something that is not there, or my CF board is bad, or maybe the board exceeds the NanoPEB's capacity.  Oops.

 

More info:  When I back-up the CF board using, TI99Dir v8.2a-20210101, the sector-count is 250368, which gives 156 images of 1600 sectors each.  This is what I remember when using CF2K to mount and format images.

 

Have to look through my code a bit more closely to see where it may be going awry.

 

Forgot to mention that, so far as I know, I'm only Level 3 file I/O.  I open a text file and read it, then call TI's LOADER routine.

 

K-R.

If you are only doing level 3 file I/O then the DSR is calculating the coresponding sector number.

 

63MB / 256 bytes / 1600 sectors per volume is about 153 volumes. So what you remember about Ti99Dir seems to be correct.

 

If you use DM2k on my emulator, do you see what you expect ?

If you use CF2K on my emulator, do you see what you expect ?

Also try display (B or T command) the file with DM2K/CF2K you are trying to access with your program. Do you see what you expect?

Create a simple TI-basic program to access your file (that is level-3 IO for sure). Do you see what you expect?

Edited by F.G. Kaal

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...