Jump to content
IGNORED

Supernotes


GDMike

Recommended Posts

I was able to make 3 different size files, but each file was remembering data from the last filename and I'd get a mix of filenames on each file I created.

Then after the 4th file I wasn't able to create files any longer. Rebooted, shutdown Peb, console, running the same program. Nothing seemed to get it writing filenames again.

So, this has happened a few times already, and my fix is always to modify the code to to write only 5 character filenames then change the code again to add >0A to Byte 9.

And it seems to work.

Link to comment
Share on other sites

1 hour ago, GDMike said:

My second attempt I entered a file called MIKE, but what got created was

MIKE DUCED,

Apparently something needs clearing. 

But it looks like I got it ☺️ taken care of..geeees...

It's the art of learning DSR

This would tell me that the length byte did not match the string 'MIKE' ie: 5

You might want to go back a few steps and make a bullet proof sub-routine to copy a counted string into VDP RAM.

If your input routine created a counted string in CPU RAM it becomes pretty easy then to transfer from CPU RAM to VDP RAM.

  • Like 1
Link to comment
Share on other sites

10 hours ago, GDMike said:

Right. It's all on my weeding through certain keys and spending extra processing time for those.

Haha..at first I was blaming you for all my trouble, even that time in elementary school in the lunchroom, but then I realized, your not old like me, and that couldn't of been you in the lunchroom that day! BwhahahBwhahah

That depends on how old you are... ;)

 

  • Haha 1
Link to comment
Share on other sites

10 hours ago, GDMike said:

It's hard to explain to you what's going on by simply texting.

Here I've included a file, called FILEM

And I run to this program after I've already typed on the screen the file name that I want to save the file as for example, "DSK3.FILENAME"

but when I key in the file name, it creates a file on my disk 3 fine if it's a 4-5 character filename.

but the file name is short for longer names I created. it's like five characters long it's not the complete six characters or eight characters or ten characters if a filename I create. even after I put in byte 9 of my pab an >0A.

 

Your problem seems to be the word “filename”. The length byte in PAB+9 is NOT the length of the actual file’s name. It is the length of the entire string that represents the full pathname of the file, which must include the device name and, if that device name is “DSK” (with no device number, like the ‘3’ as in “DSK3”), it must also include the name of the disk so the DSR can search for it among the attached drives. For your DSK3.FILENAME, that length is 13 (>0D). For my earlier example of DSK.MYTI99DISK.MYTI99FILE, it is 25 (>19). Each of these files has a name length ≤ 10, but, again, that is not what determines what you put in PAB+9.

 

...lee

  • Like 1
Link to comment
Share on other sites

Yes, that's right. Because my change I'm making is always to PAB+13

And with that said, my PAB 9th byte has been>0A, but I only seem to create a 5 digit filename, so I bumped byte 9 of my PAB to >0F,

And I was writing (creating) a filename of my choice as an example, "INTRODUCED" was created on my tipi drive 3.

Then when I pressed enter to exit back into SNP, and I chose to SAVE file again, this time typing in "DSK3.MIKE", I now see a newly created file called,

"MIKE DUCED" with a space between MIKE and DUCED, which is apparently left over filename INTRODUCED from the previous run.

I'll continue working with it and get it ironed out, my question is, should I leave my 9th PAB byte at a >0A with the TEXT following my PAB represented as byte 10, a 10 byte empty string? As in TEXT "DSK3.     "

 

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

Yay. I've got that resolved, meaning, I can now create a 1-10 digit filename, geeees what an ordeal. Lol

I can create a 1 Digit filename following creating a 10 digit named file.

But only on a tipi drive 1-4 root.

When I tried creating a file on a sub folder, my filename was reduced in filename length by the amount of characters in the name of the sub folder.

So I'll have to figure that out now...

But it's progress..

 

Edited by GDMike
Link to comment
Share on other sites

Here is some pictures of my code and the change I made.

I also changed my 9th PAB byte from>0A to >0F. While keeping my TEXT portion (byte 10) at a length of 25 blanks.

And injecting my new filename, held in FNPT, to my PAB Address+13 and NOT injecting my new filename length to 

My PAB Address byte 09.

I guess that was my mistake, thinking I needed to update that byte 9 with new filename length? But Leaving it >F  and only adjusting the PAB address+13 with new information seems to work.

Overthinking it I assume.?? Thx everyone.

Next, to adjust for folder name lengths..

Note in the code on the bottom picture, pos is my new filename length. So after removing it, wholla

 

IMG_20210125_093617123.jpg

IMG_20210125_093649695.jpg

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

43 minutes ago, GDMike said:

I guess that was my mistake, thinking I needed to update that byte 9 with new filename length? But Leaving it >F  and only adjusting the PAB address+13 with new information seems to work.

 

It really is a mystery to me why you are not getting the concept of “name length”. The byte at PAB+9 ALWAYS needs to be changed to hold the length of the FULL pathname string (which starts with the device name)...ALWAYS!! As @TheBF said, you should think of the pathname that goes into the PAB as a counted string. This means that the string (pathname) is immediately preceded by a byte containing the length of that string. Please, re-read my last post, where I tried to explain this.

 

...lee

  • Like 1
Link to comment
Share on other sites

27 minutes ago, Lee Stewart said:

 

It really is a mystery to me why you are not getting the concept of “name length”. The byte at PAB+9 ALWAYS needs to be changed to hold the length of the FULL pathname string (which starts with the device name)...ALWAYS!! As @TheBF said, you should think of the pathname that goes into the PAB as a counted string. This means that the string (pathname) is immediately preceded by a byte containing the length of that string. Please, re-read my last post, where I tried to explain this.

 

...lee

Yes, I am getting that, it was where to implement the change in my code, I didn't know if I should change it early or rt before my call to DSR.

But I found that changing it earlier, meaning, as soon as I had that information from my calculations of new filename or wait and figure it out rt before my first DSR call.

I was trying to make the changes later rather than earlier..

Again, hard to explain on text.

I could upload my new FILEM file and someone could compare the old file to the new, but I eventually figured it out.

It wasn't a Matter of understanding the PAB, but rather when to make my adjustment earlier or later it seems.

I'll now just count the"." Period in my seperator to go give me my count that I'm missing when I go to save to a subfolder, that should fix my subfolder writing of the complete file name.

 

 

Edited by GDMike
Link to comment
Share on other sites

I'll now just count the"." Period in my seperator to go give me my count that I'm missing when I go to save to a subfolder, that should fix my subfolder writing of the complete file name.

ooops, I meant, I need to add the length of the subfolder NAME and add that to my byte 9 in the PAB..gees

Link to comment
Share on other sites

I'm seeing something in my new code that should not be there, I'm trying to read, for some weird reason, a pab I have setup for my tipi clock, apparently I'm reading out of the, learning assy book, and wrote down the wrong code in my new file... yikes...good grief!

Let me straighten things out a bit...gees

Link to comment
Share on other sites

45 minutes ago, GDMike said:

 

It is difficult to follow your relatively uncommented code, but the following snippet has some problems (see my comments after “+++”):

FPRC   BL   @CLS40            * start file save here
       LI   R0,374            * "SAVING"
       LI   R1,T0
       LI   R2,10
       BLWP @VMBW
 
       MOV  @POS,@FPBADR+9    * ADDED! +++??????? This tries to write to console ROM!!!
       LI   R0,FPBADR         +++VRAM destination
       LI   R1,FPAB           +++??????? This loads R1, but gets clobbered below!!!
       MOVB @OPEN,R1          +++RAM source
       BLWP @VSBW             +++write one byte to VRAM from R1 MSB
       BL   @DSR
 
WRITEF CLR  R5                +++???????
       LI   R0,>3000          +++VRAM source???????
       LI   R1,BUFR           * change from >F80   +++RAM destination???????
WF     LI   R2,120            +++bytes to copy from VRAM to RAM
       BLWP @VMBR             +++read 120 bytes from VRAM (>3000) to RAM (>0F80)???????

Note that for VDP read/write routines that R0 always contains the VRAM address and R1 always contains the RAM reference (address for multi-byte or is the location for single-byte), regardless of the direction of transfer.

 

...lee

  • Like 1
Link to comment
Share on other sites

The label and instructions for writef is a dummy instruction, not being used at the moment...TBD later...

 

The instructions with the comment,*ADDED can be deleted. I was experimenting..

And this, MOVB @POS  @FPBADR+9 is probably an issue.

I want to move R2, which contains my new filename length, to my PAB address R9. Hmm

Edited by GDMike
Link to comment
Share on other sites

Ok. I've finally figured how to write my new file to a sub folder, but I've got to figure out how to manipulate byte 9 of the pab. In the case where I need to create a file in the folder"basic" I made byte 9 a >15 manually in the PAB and ran it. This wrote the entire filename, not just part.

 

I can get the math that I need between"." Seperators, and make the difference to byte 9.

But how do you change that byte 9 in the PAB if you can't do a LI R0,PABADR+9

LI R4,>0014

MOV R4,*R0

 

Edited by GDMike
Link to comment
Share on other sites

Aha. I just treat like any other VSBW.

I did it. I think.

My code for manipulating byte 9 of the PAB.

LI R0, My pab address

LI R1,>15 or what value I need it to be

BLWP @VSBW

 

Well I'm used to writing character values in VDP not moving other values. So I kept thinking I was placing a character value.

Anyway, that did write my sub folder new filename.

 

  • Like 1
Link to comment
Share on other sites

8 hours ago, GDMike said:

Aha. I just treat like any other VSBW.

I did it. I think.

My code for manipulating byte 9 of the PAB.

LI R0, My pab address

LI R1,>15 or what value I need it to be

BLWP @VSBW

 

Well I'm used to writing character values in VDP not moving other values. So I kept thinking I was placing a character value.

Anyway, that did write my sub folder new filename.

 

The file length should be in the most significant byte of R1 before the call to VSBW. If you use LI R1,>15 it will be in the least significant byte, so you have to swap the bytes first:

 

LI R0,PABADR+9

LI R1,>15

SWPB R1

BLWP @VSBW

 

In the real program you won't use LI because the length will not be known until runtime, so you will need a MOV to get the length into R1.

 

 

  • Thanks 1
Link to comment
Share on other sites

Yes sir. I figured that, what you said above.

I've counted my string that a user inputs for filename, I start my search just to the right of the first decimal point, then start counting until either eol, or another decimal is reached and I added that count to >0F and I got good results, even though I stopped working on this last night and haven't finished, I was getting some close results of what I was looking for.

Yes, I had to end up swapping my R5(counter). But thanks for the advice.

I'll be on a break away for a day, or almost all day. Darn... but will pickup by tomorrow. Like I said, it's very difficult to explain what I've done, what I know, what I've tried, the reason for this and that all in the confines of a text box. It's aggravating for most while trying to get something achieved. That's why I really like pictures with explanation, and showing the code helps too.

Video does wonders.

 

Edited by GDMike
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...