Author Topic: M4 directories access  (Read 891 times)

0 Members and 1 Guest are viewing this topic.

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
M4 directories access
« on: 12:05, 22 November 19 »

Hi,


I'm still working on iMPdraw v2 fixing.
All seems working well except cpc+ features and m4 directories.


Concerning cpc+ access, i will try with new fixed m4rom soon, but i need help about asm directories access on m4. (Duke if you read it!)
What works perfectly on xmass Doesn't work with m4.


here is the sample code i used


Code: [Select]
enterrepm4
;
 ld   de,filename
 ld   (&B07F),de
 ld   a,endf-filename
 ld   (&B07E),a
;
 ld   hl,rsxCD
 call &BCD4
 jr   nc,beep
;
 jp   &1B
;
beep ld a,7
 jp #bb5a
;
rsxCD byte "CD"+&80
filename
 byte "m4"
endf
;
« Last Edit: 12:22, 22 November 19 by Ast »
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline SOS

  • Supporter
  • 464 Plus
  • *
  • Posts: 361
  • Country: de
  • Identity lost
    • index.php?action=treasury
  • Liked: 232
  • Likes Given: 255
Re: M4 directories access
« Reply #1 on: 13:02, 22 November 19 »
You need to build an RSX-Buffer first and then call the CD-Command.
The following example code (similar) from YANCC works with M4DOS, ACMEDOS + CUBEMDOS:
Code: [Select]
ld   hl,rsxCD
call &BCD4
jr   nc,beep
;

ld a,l
ld (CHDIR_command_),a
ld a,h
ld (CHDIR_command_+1),a
ld a,c
ld (CHDIR_command_+2),a


ld ix,buffer_fn
push ix
pop hl
inc hl
inc hl
ld (ix+0),l
ld (ix+1),h
ld   a,endf-filename
ld (ix+2),a

ld hl,filename
ld (ix+3),l
ld (ix+4),h

ld a,1


defb &df    ;  RST 3   (=RST &18)   KL FAR CALL
defw CHDIR_command_
ret
;
rsxCD defm "C","D"+&80
CHDIR_command_: defs 3
buffer_fn: defs 5
org &a100
filename
 byte "TMP",0
endf

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
Re: M4 directories access
« Reply #2 on: 14:53, 22 November 19 »

It works ! Thank you very much @SOS !


Here is iMPdos m4 routine. I hope that will help you if you need about it.


Code: [Select]
;
; Enter in iMPdos m4 directory
; AsT/iMP4CT -> Thanks to SoS for help.
;
          ld   hl,rsxCD
          call &BCD4
          jp   nc,beep
;
          ld   ix,(&B07F)
          push ix
          pop  de
          inc  de
          inc  de
          ld   (ix+0),e
          ld   (ix+1),d
          ld   a,endf-filename
          ld   (ix+2),a
          ld   de,filename
          ld   (ix+3),e
          ld   (ix+4),d

          ld   a,1
          jp   &1B
;
rsxCD BYTE "CD"+&80
      ORG &A500
filename
      BYTE "impdos",0
endf


beep      ld   a,7
          jp   &BB5A

_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
Re: M4 directories access
« Reply #3 on: 19:53, 24 November 19 »

I found a Strange bug in the directories accesses.


To reproduce it easily :
|MKDIR,"123456789"


call &bc9b,&4000


then just look at #4000 you could see 12345679 -> 8 is missing strangely ???


It seems your Cat routine is buggy @Duke ! Any idea ?


Secondly, when you do


ùcd,"toto" then cat M4dos displays :


Drive a:/toto


Where can i find toto ? I think it's saved in the m4 card, but where ???


Thanks for your reply.
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.164
  • Country: dk
    • spinpoint.org
  • Liked: 1279
  • Likes Given: 983
Re: M4 directories access
« Reply #4 on: 08:18, 25 November 19 »
To reproduce it easily :
|MKDIR,"123456789"


call &bc9b,&4000


then just look at #4000 you could see 12345679 -> 8 is missing strangely ???
Thanks for reporting, will check it out and fix soon.

Quote
ùcd,"toto" then cat M4dos displays :


Drive a:/toto


Where can i find toto ? I think it's saved in the m4 card, but where ???
Not sure I follow, when I type |cd,"toto" it says unknown directory.
So if you have a directory named toto, it will cd into it and CAT will display the path as "Drive a:/toto"  the location would be a sub directory to the root ?

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
Re: M4 directories access
« Reply #5 on: 11:00, 25 November 19 »
My question was Where in memory can i found these data??? (If the sub directory exists of course!)
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline Duke

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.164
  • Country: dk
    • spinpoint.org
  • Liked: 1279
  • Likes Given: 983
Re: M4 directories access
« Reply #6 on: 11:41, 25 November 19 »
My question was Where in memory can i found these data??? (If the sub directory exists of course!)

Ah ok.
There is a special RSX called |GETPATH that @SOS added.
Check under "Special RSX Commands" -> http://www.spinpoint.org/cpc/m4info.txt   (almost at the end)

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 821
  • Country: fr
    • urban exploration
  • Liked: 1114
  • Likes Given: 676
Re: M4 directories access
« Reply #8 on: 19:47, 25 November 19 »
Who is Pedro?
use RASM, the best assembler ever made :p

I will survive

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
Re: M4 directories access
« Reply #9 on: 19:57, 25 November 19 »
No sabé!
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

Online Ast

  • 6128 Plus
  • ******
  • Posts: 1.072
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 954
  • Likes Given: 725
Re: M4 directories access
« Reply #10 on: 22:14, 25 November 19 »

@all : It's working now !!!

_____________________

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


Amstrad Plus French Forum

All friends are welcomed !