Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main(void) {
}
}
else {
printf("%cEscape\n\r", MOS_prompt);
printf("%s%cEscape\n\r", cwd, MOS_prompt);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/mos.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ extern BYTE rtc; // In globals.asm
static FATFS fs; // Handle for the file system
static char * mos_strtok_ptr; // Pointer for current position in string tokeniser

TCHAR cwd[256]; // Hold current working directory.

extern volatile BYTE history_no;

t_mosFileObject mosFileObjects[MOS_maxOpenFiles];
Expand Down Expand Up @@ -159,7 +161,7 @@ BYTE mos_getkey() {
//
UINT24 mos_input(char * buffer, int bufferLength) {
INT24 retval;
putch(MOS_prompt);
printf("%s%c", cwd, MOS_prompt);
retval = mos_EDITLINE(buffer, bufferLength, 1);
printf("\n\r");
return retval;
Expand Down Expand Up @@ -536,6 +538,7 @@ int mos_cmdCD(char * ptr) {
return 19; // Bad Parameter
}
fr = f_chdir(path);
f_getcwd(cwd, sizeof(cwd)); //Update full path.
return fr;
}

Expand Down Expand Up @@ -746,6 +749,7 @@ int mos_cmdMOUNT(char *ptr) {
fr = mos_mount();
if (fr != FR_OK)
mos_error(fr);
f_getcwd(cwd, sizeof(cwd)); //Update full path.
return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions src/mos.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void mos_SETRTC(UINT24 address);
UINT24 mos_SETINTVECTOR(UINT8 vector, UINT24 address);
UINT24 mos_GETFIL(UINT8 fh);

extern TCHAR cwd[256];

UINT8 fat_EOF(FIL * fp);

#define HELP_CAT "Directory listing of the current directory\r\n"
Expand Down