Browse Source

Make tools/emul *BSD-friendly

pull/10/head
Virgil Dupras 4 years ago
parent
commit
252d71f1b8
4 changed files with 10 additions and 9 deletions
  1. +2
    -2
      tools/cfspack/cfspack.c
  2. +2
    -2
      tools/emul/Makefile
  3. +2
    -2
      tools/emul/shell/shell.c
  4. +4
    -3
      tools/zasm.sh

+ 2
- 2
tools/cfspack/cfspack.c View File

@@ -1,8 +1,8 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include <fnmatch.h>
#include <libgen.h>
#include <sys/stat.h>

#define BLKSIZE 0x100
@@ -106,7 +106,7 @@ int spitdir(char *path, char *prefix, char *pattern)
}
} else {
if (pattern) {
if (fnmatch(pattern, ep->d_name, FNM_EXTMATCH) != 0) {
if (fnmatch(pattern, ep->d_name, 0) != 0) {
continue;
}
}


+ 2
- 2
tools/emul/Makefile View File

@@ -26,11 +26,11 @@ $(TARGETS):
$(CC) $< libz80/libz80.o -o $@

libz80/libz80.o: libz80/z80.c
make -C libz80/codegen opcodes
$(MAKE) -C libz80/codegen opcodes
$(CC) -Wall -ansi -g -c -o libz80/libz80.o libz80/z80.c

$(CFSPACK):
make -C ../cfspack
$(MAKE) -C ../cfspack

$(SHELLAPPS): $(ZASMBIN)
$(ZASMSH) $(KERNEL) $(APPS) shell/user.h < $(APPS)/$(notdir $@)/glue.asm > $@


+ 2
- 2
tools/emul/shell/shell.c View File

@@ -52,11 +52,11 @@ static uint8_t io_read(int unused, uint16_t addr)
{
addr &= 0xff;
if (addr == STDIO_PORT) {
uint8_t c = getchar();
int c = getchar();
if (c == EOF) {
running = 0;
}
return c;
return (uint8_t)c;
} else if (addr == FS_DATA_PORT) {
if (fsdev_addr_lvl != 0) {
fprintf(stderr, "Reading FSDEV in the middle of an addr op (%d)\n", fsdev_ptr);


+ 4
- 3
tools/zasm.sh View File

@@ -1,13 +1,14 @@
#!/bin/bash
#!/bin/sh

# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DIR=$(dirname $(readlink -f "$0"))
ZASMBIN="${DIR}/emul/zasm/zasm"
CFSPACK="${DIR}/cfspack/cfspack"
INCCFS=$(mktemp)

for p in "$@"; do
"${CFSPACK}" "${p}" "*.+(asm|h)" >> "${INCCFS}"
"${CFSPACK}" "${p}" "*.h" >> "${INCCFS}"
"${CFSPACK}" "${p}" "*.asm" >> "${INCCFS}"
done

"${ZASMBIN}" "${INCCFS}"


Loading…
Cancel
Save