News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Colday

Changing the user on files

Started by Colday, 18:24, 18 February 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Colday

Hi all.


I acquired a disk (ostensibly blank) from a seller on eBay, however when I've changed the user to 229 via poke &a701,229 I can see quite a lot of deleted files.


Some of these are .bas and can therefore be loaded and then saved back to another disc once the user number has been returned to 0.


However, some have other suffixes. Is there a way to just change the user number (from 229 back to 0) on the same disc?


The files appear to be just type ins with a few what appear to be utilities. Nothing that is 'personal' or 'sensitive' in nature. One of the .bas files plays an assortment of tunes etc.


Would be interested to hear from you all.



the graveborn

#1
Whilst the current user number is 229:

|ren,"0:name of destination file","name of source file"

I hope that that helps..! :)
Current project: SDL2 joystick interrogator

Colday

I thank you sir.


Shall have a go at the as soon as the kids finish eating their dinner!

Colday

#3
Ok, had a go at that.


States that 'sourcefile' cannot be found.


So, I'm in user 229, can see the file. Type in the above ¦ren command replacing with exact names.


Any other thoughts?


For me I find it odd it cannot see the source file...

the graveborn

#4
Could you post exactly what you typed..?
Current project: SDL2 joystick interrogator

Colday

Sure...


poke &a701,229


¦ren,"0:autocat.bas","autocat.bas"


And I get the file not found error.


Ast

#6
Unfortunately, this couldn't work on cpc with xmem (or other rom card) using roms
Why ? The answer is simple because amsdos start adress will change when rom will be installed.


The best way to do it is



Ld hl,(#be7d) ; start amsdos adress
Inc hl
Ld a,user (0-255)
Ld (hl),a



_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Colday

Sorry, I'm a little confused.


It's just a basic bog standard 6128 and a basic bog standard Amsoft CF-2 disc.


I've no idea what code you've used Ast, or how to use it.

Ast

Sorry.. in basic


?hex$(Peek(&be7e))+hex$(peek(&be7d))


Take the adress and add 1


Then poke adress,user


Is it easier like that ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Colday

Sorry Ast.


Not hugely more useful.


Let's pretend for a moment that I know nothing about anything about Amstrads or Basic or anything else.


How about you do a step by step method of changing the user number of a file from 229(deleted) to 0(usable).


Or basically, undeleting files.

the graveborn

#10
I'm sorry, I don't know why what I suggested didn't work – and I did test it!(Albeit in an emulator.)

I'm sorry, but you'll likely have to wait for a more knowledgeable member of this forum to suggest something – my knowledge of the Amstrad CPC is very incomplete (I've never owned an Amstrad anything, but as there's an intersection between my interests and retroprogramming I've learnt a little of how to operate an Amstrad CPC by trial-and-(mostly...)error – evidently I need to learn more...)

Ps. I assume that you've tried what I suggested with other files on that disc..? And with other discs..?
Current project: SDL2 joystick interrogator

Ast

&A701 was the user adress on a nude cpc. When you connect any romcard with actives rom running, this adress changes, but you could also find the correct one at be7d-be7e.


For example, on a nude cpc
Peek(&be7d)=0
Peek(&be7e)=&a7


So amsdos entry will start in &a700.


But when you simply connect a rom, this adress changes. Just try it !


&a701 is not universal.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Ast

To complete and finish, if you found &f4 at &be7d and &a6 at &be7e then amsdos entry will start at &a6f4 and not in &a700.


So your user adress will have to be poked at &a6f5.





Do you understand what i mean ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

GeoffB17

Sorry to stick my nose in here, as I'm a PCW person and while I know a bit about CF2 disks, CP/M, disk directories etc, I know zilch about the CPC things you're discussing.

No problem doing what you're talking about using a disk editor.

BUT, I hope that OP is aware that you're seeing the directory entries, which may seem valid, but this is not to say that the actual data (sectors) that were once attached to the dir entries are still there, or contain the right data, or don't have chunks missing.   You could try what you're trying, and see what happens, but this could generate errors, i.e. two files linking to the same Allocation block.

If there were x files on the disk, and all were deleted, and then nothing new was written to the disk, then you could get 100% recovery.  But if anything new was written to the disk AFTER the files were deleted, then problems.   And if the NEW files were in turn deleted, then even more of a mess.   If I had the disk, I could follow thru the Allocation Block numbers and know for sure.

Fun!

Geoff

GUNHED

Quote from: Colday on 18:24, 18 February 19
Hi all.
I acquired a disk (ostensibly blank) from a seller on eBay, however when I've changed the user to 229 via poke &a701,229 I can see quite a lot of deleted files.
...
Would be interested to hear from you all.


There is a very easy way to change user numbers of files. You can use FutureOS for that. Use the REName function.

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Ast

#15

Here is a basic example

10 mode 2
20 a$=hex$(peek(&be7e))+hex$(peek(&be7d))
30 print "AmsDos entry : &";a$
40 poke val("&"+a$),0 ' 0 : drive A - 1 : drive B
50 poke val("&"+a$)+1,229 ' User
60 cat

A better way to learn new things.
Bye.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Powered by SMFPacks Menu Editor Mod