Skip to content

Commit

Permalink
cracks/nzs: Fix for GCC14 and use m68k-elf- tool prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
keirf committed Jan 5, 2025
1 parent ea62d46 commit 0b189c6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TOOL_PREFIX = m68k-unknown-elf-
TOOL_PREFIX = m68k-elf-
CC = $(TOOL_PREFIX)gcc
OBJCOPY = $(TOOL_PREFIX)objcopy

Expand All @@ -10,7 +10,7 @@ FLAGS = -Os -nostdlib -std=gnu99 -iquote inc
FLAGS += -Wall -Werror -Wno-format -Wdeclaration-after-statement
FLAGS += -Wstrict-prototypes -Wredundant-decls -Wnested-externs
FLAGS += -fno-common -fno-exceptions -fno-strict-aliasing -fomit-frame-pointer
FLAGS += -m68000 -msoft-float
FLAGS += -fno-delete-null-pointer-checks -m68000 -msoft-float

FLAGS += -MMD -MF .$(@F).d
DEPS = .*.d
Expand Down
2 changes: 1 addition & 1 deletion cracking/cracks/nzs/gnu/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include Rules.mk
include ../Rules.mk
.PHONY: all
all: nzs_bootblock.bin nzs.bin
61 changes: 0 additions & 61 deletions cracking/cracks/nzs/gnu/Rules.mk

This file was deleted.

2 changes: 1 addition & 1 deletion cracking/cracks/nzs/gnu_c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ OBJS += nzs_crack.o
OBJS += trainer.o
OBJS += util.o

include Rules.mk
include ../Rules.mk

.PHONY: all
all: nzs_bootblock.bin nzs.bin
12 changes: 9 additions & 3 deletions cracking/cracks/nzs/gnu_c/amiga.ld
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ENTRY(start)

PHDRS
{
/* Define as RW^X to avoid a linker warning */
text PT_LOAD FLAGS(6);
}

SECTIONS
{
GRAPHICS = 0x20000;
Expand All @@ -15,7 +21,7 @@ SECTIONS
*(.rodata*)
. = ALIGN(4);
_etext = .;
}
} :text

.data : {
. = ALIGN(4);
Expand All @@ -24,7 +30,7 @@ SECTIONS
*(.data*)
. = ALIGN(4);
_edat = .;
}
} :text

.bss : {
. = ALIGN(4);
Expand All @@ -34,7 +40,7 @@ SECTIONS
. = ALIGN(4);
_ebss = .;
_end = .;
}
} :text

/DISCARD/ : {
*(.eh_frame)
Expand Down
1 change: 1 addition & 0 deletions cracking/cracks/nzs/gnu_c/inc/decls.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "types.h"
#include "util.h"
#include "amiga_hw.h"
#include "../../../../../base/inc/m68k.h"

/*
* Local variables:
Expand Down
8 changes: 5 additions & 3 deletions cracking/cracks/nzs/gnu_c/trainer.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* See the file COPYING for more details, or visit <http://unlicense.org>.
*/

static volatile struct m68k_vector_table * const m68k_vec =
(struct m68k_vector_table *)0x0;
static volatile struct amiga_custom * const cust =
(struct amiga_custom *)0xdff000;
static volatile struct amiga_cia * const ciaa =
Expand Down Expand Up @@ -269,8 +271,8 @@ static void update_option(uint8_t nr)
print_option(opt, nr);
}

IRQ(CIA_IRQ);
static void c_CIA_IRQ(void)
IRQ(CIAA_IRQ);
static void c_CIAA_IRQ(void)
{
uint16_t i;
uint8_t icr = ciaa->icr;
Expand Down Expand Up @@ -333,7 +335,7 @@ uint32_t trainer(void)

unpack_font();

*(volatile void **)0x68 = CIA_IRQ;
m68k_vec->level2_autovector.p = CIAA_IRQ;
cust->cop1lc.p = copper;

print_screen();
Expand Down

0 comments on commit 0b189c6

Please sign in to comment.