Skip to content

Commit

Permalink
Fix AmigaOS 3 build
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Dec 5, 2023
1 parent 3fe838f commit 5895d54
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ jobs:
strategy:
matrix:
amiga:
# - { name: "AmigaOS 3", host: "m68k-amigaos", system: "amigaos3" }
- { name: "AmigaOS 4", host: "ppc-amigaos", system: "amiga" }
- { name: "AmigaOS 3", host: "m68k-amigaos" }
- { name: "AmigaOS 4", host: "ppc-amigaos" }

steps:
- uses: actions/checkout@v3
- name: Build
run: make SYSTEM=${{ matrix.amiga.system }} CROSS=${{ matrix.amiga.host }}-
run: make SYSTEM=amiga CROSS=${{ matrix.amiga.host }}-
16 changes: 4 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ SOUND_SUPPORT=yes
SOUND_PTHREAD=no
SRCS += amiga/wb.c amiga/arexx.c
OBJS += amiga/wb.o amiga/arexx.o
ifneq (,$(findstring m68k,$(CROSS)))
CFLAGS += -noixemul
LDFLAGS += -noixemul
else
CFLAGS += -mcrt=newlib -D__LARGE64_FILES -D__USE_INLINE__
LDFLAGS += -mcrt=newlib
# The following two lines are for Altivec support via libfreevec
Expand All @@ -120,18 +124,6 @@ LDFLAGS += -mcrt=newlib
# the emulator up but slows it down, so it is disabled by default
#CFLAGS += -DONCHIPMEM_SUPPORT
endif

ifeq (${SYSTEM},amigaos3)
CROSS=m68k-amigaos-
HOST_BIGENDIAN=yes
HOSTFS_SUPPORT=yes
EXTNROM_SUPPORT=yes
SOUND_SUPPORT=yes
SOUND_PTHREAD=no
SRCS += amiga/wb.c
OBJS += amiga/wb.o
CFLAGS += -D__amigaos3__ -noixemul
LDFLAGS += -noixemul
endif

ifeq (${SYSTEM},riscos-single)
Expand Down
6 changes: 3 additions & 3 deletions amiga/DispKbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ struct OCMIFace *IOCM = NULL;
#endif // ONCHIPMEM_SUPPORT
#endif // _amigaos4__

#ifdef __amigaos4__
struct Library *AslBase;
struct Library *GfxBase;
struct Library *IntuitionBase;
#ifdef __amigaos4__
struct AslIFace *IAsl;
struct GraphicsIFace *IGraphics;
struct IntuitionIFace *IIntuition;
Expand Down Expand Up @@ -99,7 +99,7 @@ void *state_alloc(int s)
#endif

if(p == NULL) {
p = AllocVec(s, MEMF_PRIVATE);
p = malloc(s);
}

return p;
Expand All @@ -113,7 +113,7 @@ void state_free(void *p)
DropInterface((struct Interface *)IOCM);
#endif
} else {
FreeVec(p);
free(p);
}

cleanup();
Expand Down
4 changes: 4 additions & 0 deletions amiga/arexx.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "../arch/fdc1772.h"
#include <string.h>

#ifdef __amigaos4__

struct Library *ARexxBase;
struct ARexxIFace *IARexx;

Expand Down Expand Up @@ -105,3 +107,5 @@ STATIC VOID rx_led(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unus
*/
}

#endif

2 changes: 0 additions & 2 deletions amiga/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/asl.h>
#ifdef __amigaos4__ // weird _NewObject error
#include <proto/intuition.h>
#endif
#include <proto/graphics.h>
#include <proto/utility.h>
//#include <proto/input.h>
Expand Down
2 changes: 1 addition & 1 deletion amiga/wb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ int swapmousebuttons;
BOOL anymonitor;
BOOL use_ocm;

struct Library *IconBase;
#ifdef __amigaos4__
struct Library *IconBase;
struct IconIFace *IIcon;
#endif

Expand Down
2 changes: 0 additions & 2 deletions hostfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,15 +1088,13 @@ hostfs_args_3_write_file_extent(ARMul_State *state)
return;
}

#ifndef __amigaos3__ // no ftruncate in libnix - not sure if this is a critical function
/* Set file to required extent */
/* FIXME Not defined if file is increased in size */
if (ftruncate(fd, (off_t) state->Reg[2])) {
fprintf(stderr, "hostfs_args_3_write_file_extent() bad ftruncate(): %s %d\n",
strerror(errno), errno);
return;
}
#endif
}

static void
Expand Down

0 comments on commit 5895d54

Please sign in to comment.