Skip to content

Commit

Permalink
Some code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
MockbaTheBorg committed Jul 5, 2024
1 parent 96558fb commit b3a4c8c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions RunCPM/abstraction_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,15 @@ static void _parse_options(int argc, char *argv[]) {
}
#endif

void _host_init(int argc, char* argv[]) {
#ifdef STREAMIO
void _host_init(int argc, char* argv[]) {
_parse_options(argc, argv);
#endif
if (chdir(dirname(argv[0]))) {
_file_failure_exit(argv, "error performing chdir(%s)",
dirname(argv[0]));
}
}
#endif

/* Console abstraction functions */
/*===============================================================================*/
Expand Down
4 changes: 2 additions & 2 deletions RunCPM/abstraction_vstudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,11 @@ static void _parse_options(int argc, char *argv[]) {
}
#endif

void _host_init(int argc, char* argv[]) {
#ifdef STREAMIO
void _host_init(int argc, char* argv[]) {
_parse_options(argc, argv);
#endif
}
#endif

/* Console abstraction functions */
/*===============================================================================*/
Expand Down
15 changes: 8 additions & 7 deletions RunCPM/ccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ uint8 _ccp_cnum(void) {
return (result);
} // _ccp_cnum

// Returns true if character is a separator
// Returns true if character is a delimiter
uint8 _ccp_delim(uint8 ch) {
return (ch == 0 || ch == ' ' || ch == '=' || ch == '.' || ch == ':' || ch == ';' || ch == '<' || ch == '>');
}
Expand All @@ -100,8 +100,8 @@ void _ccp_printfcb(uint16 fcb, uint8 compact) {

ch = _RamRead(fcb);
if (ch && compact) {
_ccp_bdos( C_WRITE, ch + '@');
_ccp_bdos( C_WRITE, ':');
_ccp_bdos(C_WRITE, ch + '@');
_ccp_bdos(C_WRITE, ':');
}

for (i = 1; i < 12; ++i) {
Expand Down Expand Up @@ -250,12 +250,12 @@ void _ccp_era(void) {
} // _ccp_era

// TYPE command
uint8 _ccp_type(void) {
void _ccp_type(void) {
uint8 i, c, l = 0, error = TRUE;
uint16 a, p = 0;

_puts("\r\n");
if (!_ccp_bdos(F_OPEN, ParFCB)) {
_puts("\r\n");

while (!_ccp_bdos(F_READ, ParFCB)) {
i = 128;
Expand All @@ -282,8 +282,9 @@ uint8 _ccp_type(void) {
break;
}
error = FALSE;
} else {
_puts("No file");
}
return (error);
} // _ccp_type

// SAVE command
Expand Down Expand Up @@ -835,7 +836,7 @@ void _ccp(void) {
}

case 2: { // TYPE
i = _ccp_type();
_ccp_type();
break;
}

Expand Down
6 changes: 0 additions & 6 deletions RunCPM/cpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,6 @@ void _Bdos(void) {
last[j] = _RamRead((chrsCntIdx + j) & 0xFFFF);
}
}
#if 0
printf("\n\r chrsMaxIdx: %0X, chrsMax: %u, chrsCnt: %u", chrsMaxIdx, chrsMax, chrsCnt);
for (j = 0; j < chrsCnt + 2; j++) {
printf("\n\r chrsMaxIdx[%u]: %0.2x", j, last[j]);
}
#endif
_putcon('\r'); // Gives a visual feedback that read ended
break;
}
Expand Down
2 changes: 1 addition & 1 deletion RunCPM/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ int main(int argc, char* argv[]) {
_sys_deletefile((uint8*)LogName);
#endif

_host_init(argc, &argv[0]);
#ifdef STREAMIO
_host_init(argc, &argv[0]);
_streamioInit();
#endif
_console_init();
Expand Down

0 comments on commit b3a4c8c

Please sign in to comment.