Got build working on newer OSX, included missing ADFs

This commit is contained in:
alpine9000 2019-06-11 13:58:03 +10:00
parent abe4b9e850
commit ffc5f1f93d
40 changed files with 4937 additions and 341 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -16,11 +16,10 @@ out/copper-new.s: $(GIF_FILE) out/copper_fun_generate convert.sh
./convert.sh > out/copper-new.s
out/copper_fun_generate: copper_fun_generate.c Makefile
gcc $(HOST_CFLAGS) `GraphicsMagick-config --cppflags` copper_fun_generate.c -o out/copper_fun_generate $(LIBS)
gcc -Wno-ignored-attributes $(HOST_CFLAGS) `GraphicsMagick-config --cppflags` copper_fun_generate.c -o out/copper_fun_generate $(LIBS)
video: GIF_FILE:=assets/video.gif
video: all
vgo: RUN_SCRIPT:=$(A600_RUN_SCRIPT)
vgo: video go

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11,7 +11,7 @@ typedef struct {
unsigned short lo;
unsigned short pad2;
unsigned short hi;
} copper_layout_t
} copper_layout_t;
void

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,8 @@ SUBDIRS=tools/makeadf \
tools/croppa\
tools/external/shrinkler\
tools/external/doynamite68k\
tools/mapgen\
tools/fade\
000.trackdisk\
001.simple_image\
002.sprite_display\
@ -25,14 +27,14 @@ SUBDIRS=tools/makeadf \
018.vert_scroll\
019.hori_scroll\
020.shrinkler\
021.calling_c\
022.photons_bootloader\
023.slideshow\
024.simple_text\
025.scroll_text\
026.tile_hscroll\
027.parallax\
028.bs
#028.bs
#021.calling_c\
.PHONY: subdirs $(SUBDIRS)

View File

@ -1,6 +1,6 @@
HOST_WARNINGS=-pedantic-errors -Wfatal-errors -Wall -Werror -Wextra -Wno-unused-parameter -Wshadow
HOST_CFLAGS=$(HOST_WARNINGS)
SDK_INCLUDE=-I/usr/local/amiga/vgcc/ndk/include/
MAKEADFDIR=../tools/makeadf/
MAKEADF=$(MAKEADFDIR)/out/makeadf
IMAGECONDIR=../tools/imagecon
@ -110,18 +110,18 @@ out/bootblock.bin: out/bootblock.o
vlink -brawbin1 $< -o $@
out/bootblock.o: $(BOOTBLOCK_ASM) $(PROGRAM_BIN)
vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_BOOTBLOCK_ARGS) -DUSERSTACK_ADDRESS="\$$$(USERSTACK_ADDRESS)" -DBASE_ADDRESS="\$$$(BASE_ADDRESS)" $< -o $@ -I/usr/local/amiga/os-include
vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_BOOTBLOCK_ARGS) -DUSERSTACK_ADDRESS="\$$$(USERSTACK_ADDRESS)" -DBASE_ADDRESS="\$$$(BASE_ADDRESS)" $< -o $@ $(SDK_INCLUDE) -I../include
out/main.o: $(MODULE) $(EXTRA)
vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ -I/usr/local/amiga/os-include
@vasmm68k_mot -depend=make $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ -I/usr/local/amiga/os-include > $*.d
vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ $(SDK_INCLUDE)
@vasmm68k_mot -depend=make $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ $(SDK_INCLUDE) > $*.d
out/%.o: %.s
vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ -I/usr/local/amiga/os-include
@vasmm68k_mot -depend=make $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ -I/usr/local/amiga/os-include > out/$*.d
vasmm68k_mot $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ $(SDK_INCLUDE)
@vasmm68k_mot -depend=make $(VASM_ARGS) $(VASM_EXTRA_ARGS) $< -o $@ $(SDK_INCLUDE) > out/$*.d
out/%.o: %.c
vc -O3 -c $< -o $@
m68k-amigaosvasm-gcc -O3 -c $< -o $@
-@vc -O3 -S $< -o out/$*.s > /dev/null 2> /dev/null
-@vc -O0 -S $< -o out/$*-noopt.s > /dev/null 2> /dev/null

View File

@ -1,6 +1,7 @@
include exec/io.i
include lvo/exec_lib.i
include devices/trackdisk.i
;; include funcdef.i
;; include exec/io.i
;; include exec/exec_lib.i
;; include devices/trackdisk.i
bootblock:
dc.b "DOS",0
dc.l 0
@ -15,15 +16,15 @@ bootEntry:
;; Load the progam from the floppy using trackdisk.device
move.l #mainEnd-mainStart,IO_LENGTH(a1)
move.l a5,IO_DATA(a1)
move.l #mainStart-bootblock,IO_OFFSET(a1)
jsr _LVODoIO(a6)
move.l #mainEnd-mainStart,36(a1) ;IO_LENGTH(a1)
move.l a5,40(a1) ;IO_DATA(a1)
move.l #mainStart-bootblock,44(a1) ;IO_OFFSET(a1)
jsr -456(a6) ;DoIO
;; Turn off drive motor
move.l #0,IO_LENGTH(a1)
move.w #TD_MOTOR,IO_COMMAND(a1)
jsr _LVODoIO(a6)
move.l #0,36(a1) ;IO_LENGTH(a1)
move.w #9,28(a1) ;#TD_MOTOR,28(a1) ;IO_COMMAND(a1)
jsr -456(a6) ;DoIO
jmp (a5) ; -> main.s entry point

View File

@ -1,6 +1,7 @@
include "funcdef.i"
include "../include/registers.i"
include "exec/io.i"
include "lvo/exec_lib.i"
include "exec/exec_lib.i"
include "devices/trackdisk.i"

View File

@ -1,5 +1,5 @@
WARN_ERROR=-Werror
HOST_WARNINGS=$(WARN_ERROR) -pedantic-errors -Wfatal-errors -Wall -Wextra -Wno-unused-parameter -Wshadow -limagequant
HOST_WARNINGS=$(WARN_ERROR) -pedantic-errors -Wfatal-errors -Wall -Wextra -Wno-unused-parameter -Wshadow -limagequant -Wno-unused-command-line-argument -Wno-ignored-attributes
HOST_CFLAGS=$(HOST_WARNINGS) -O3 $(EXTRA_CFLAGS)
$(PROGRAM): out bin $(OBJS)

View File

@ -203,9 +203,9 @@ nearest_color(int *v, node_heap *h) {
int diff, max = 100000000;
oct_node o = 0;
for (i = 1; i < h->n; i++) {
diff = 3 * abs(h->buf[i]->r - v[0])
+ 5 * abs(h->buf[i]->g - v[1])
+ 2 * abs(h->buf[i]->b - v[2]);
diff = 3 * abs((int)(h->buf[i]->r - v[0]))
+ 5 * abs((int)(h->buf[i]->g - v[1]))
+ 2 * abs((int)(h->buf[i]->b - v[2]));
if (diff < max) {
max = diff;
o = h->buf[i];

View File

@ -20,10 +20,10 @@ get_tile_address(tmx_map *m, unsigned int gid)
}
int ts_count = 0;
tmx_tileset** ta;
tmx_tileset_list** ta;
{
tmx_tileset* t = m->ts_head;
tmx_tileset_list* t = m->ts_head;
while (t != 0) {
t = t->next;
ts_count++;
@ -41,18 +41,18 @@ get_tile_address(tmx_map *m, unsigned int gid)
unsigned baseAddress = 0;
for (int y = 0; y < ts_count; y++) {
tmx_tileset* ts = ta[y];
for (unsigned int i = 0; i < ts->tilecount; i++) {
tmx_tile* t = ts->tiles;
tmx_tileset_list* ts = ta[y];
for (unsigned int i = 0; i < ts->tileset->tilecount; i++) {
tmx_tile* t = ts->tileset->tiles;
if (t[i].id+ts->firstgid == gid) {
unsigned address = baseAddress + (t[i].ul_y * ((ts->image->width/8) * config.bitDepth)) + (t[i].ul_x/8);
unsigned address = baseAddress + (t[i].ul_y * ((ts->tileset->image->width/8) * config.bitDepth)) + (t[i].ul_x/8);
if (config.verbose) {
printf("%s - baseAddress = %d address = %d\n", ts->name, baseAddress, address);
printf("%s - baseAddress = %d address = %d\n", ts->tileset->name, baseAddress, address);
}
return address;
}
}
baseAddress += ((ts->image->width/8) * config.bitDepth * ts->image->height);
baseAddress += ((ts->tileset->image->width/8) * config.bitDepth * ts->tileset->image->height);
}
return 0;
@ -67,10 +67,10 @@ get_tile_index(tmx_map *m, unsigned int gid)
}
int ts_count = 0;
tmx_tileset** ta;
tmx_tileset_list** ta;
{
tmx_tileset* t = m->ts_head;
tmx_tileset_list* t = m->ts_head;
while (t != 0) {
t = t->next;
ts_count++;
@ -87,12 +87,12 @@ get_tile_index(tmx_map *m, unsigned int gid)
for (int y = 0; y < ts_count; y++) {
tmx_tileset* ts = ta[y];
for (unsigned int i = 0; i < ts->tilecount; i++) {
tmx_tile* t = ts->tiles;
tmx_tileset_list* ts = ta[y];
for (unsigned int i = 0; i < ts->tileset->tilecount; i++) {
tmx_tile* t = ts->tileset->tiles;
if (t[i].id+ts->firstgid == gid) {
if (config.verbose) {
printf("%s - index = %d\n", ts->name, t[i].id);
printf("%s - index = %d\n", ts->tileset->name, t[i].id);
}
return t[i].id;
}

View File

@ -91,210 +91,3 @@ mk_padding(char pad[11], int depth) {
if (depth>0) memset(pad, '\t', depth);
pad[depth] = '\0';
}
void
dump_prop(tmx_property *p, int depth)
{
char padding[11]; mk_padding(padding, depth);
printf("\n%s" "properties={", padding);
if (!p) {
printf(" (NULL) }");
} else {
while (p) {
printf("\n%s\t" "'%s'='%s'", padding, p->name, p->value);
p = p->next;
}
printf("\n" "%s}", padding);
}
}
void
print_shape(enum tmx_shape shape) {
switch(shape) {
case S_NONE: printf("none"); break;
case S_SQUARE: printf("square"); break;
case S_ELLIPSE: printf("ellipse"); break;
case S_POLYGON: printf("polygon"); break;
case S_POLYLINE: printf("polyline"); break;
default: printf("unknown");
}
}
void
dump_image(tmx_image *i, int depth)
{
char padding[11]; mk_padding(padding, depth);
printf("\n%s" "image={", padding);
if (i) {
printf("\n%s\t" "source='%s'", padding, i->source);
printf("\n%s\t" "height=%lu", padding, i->height);
printf("\n%s\t" "width=%lu", padding, i->width);
printf("\n%s\t" "uses_trans=%s", padding, str_bool(i->uses_trans));
printf("\n%s\t" "trans=#%.6X", padding, i->trans);
printf("\n%s}", padding);
} else {
printf(" (NULL) }");
}
}
void
dump_points(double **p, int pl) {
int i;
for (i=0; i<pl; i++) {
printf(" (%f, %f)", p[i][0], p[i][1]);
}
}
void
dump_objects(tmx_object *o, int depth) {
char padding[11]; mk_padding(padding, depth);
printf("\n%s" "object={", padding);
if (!o) {
printf(" (NULL) }");
} else {
printf("\n%s\t" "id=%u", padding, o->id);
printf("\n%s\t" "name='%s'", padding, o->name);
printf("\n%s\t" "type='%s'", padding, o->type);
printf("\n%s\t" "shape=", padding); print_shape(o->shape);
printf("\n%s\t" "x=%f", padding, o->x);
printf("\n%s\t" "y=%f", padding, o->y);
printf("\n%s\t" "number of points='%d'", padding, o->points_len);
printf("\n%s\t" "rotation=%f", padding, o->rotation);
printf("\n%s\t" "visible=%s", padding, str_bool(o->visible));
if (o->points_len) {
printf("\n%s\t" "points=", padding);
dump_points(o->points, o->points_len);
}
dump_prop(o->properties, depth+1);
printf("\n%s}", padding);
}
if (o && o->next) {
dump_objects(o->next, depth);
}
}
void
dump_tile(tmx_tile *t, unsigned int tilecount) {
unsigned int i, j;
for (i=0; i<tilecount; i++) {
printf("\n\t" "tile={");
printf("\n\t\t" "id=%u", t[i].id);
printf("\n\t\t" "upper-left=(%u,%u)", t[i].ul_x, t[i].ul_y);
dump_image(t[i].image, 2);
dump_prop(t[i].properties, 2);
dump_objects(t[i].collision, 2);
if (t[i].animation) {
printf("\n\t\t" "animation={");
for (j=0; j<t[i].animation_len; j++) {
printf("\n\t\t\t" "tile=%3u (%6ums)", t[i].animation[j].tile_id, t[i].animation[j].duration);
}
printf("\n\t\t}");
}
printf("\n\t}");
}
}
void
dump_tileset(tmx_tileset *t) {
printf("\ntileset={");
if (t) {
printf("\n\t" "name=%s", t->name);
printf("\n\t" "tilecount=%u", t->tilecount);
printf("\n\t" "firstgid=%u", t->firstgid);
printf("\n\t" "tile_height=%u", t->tile_height);
printf("\n\t" "tile_width=%u", t->tile_width);
printf("\n\t" "firstgid=%u", t->firstgid);
printf("\n\t" "margin=%u", t->margin);
printf("\n\t" "spacing=%u", t->spacing);
printf("\n\t" "x_offset=%d", t->x_offset);
printf("\n\t" "y_offset=%d", t->y_offset);
dump_image(t->image, 1);
dump_tile(t->tiles, t->tilecount);
dump_prop(t->properties, 1);
printf("\n}");
} else {
printf(" (NULL) }");
}
if (t && t->next) {
dump_tileset(t->next);
}
}
void
dump_layer(tmx_layer *l, unsigned int tc)
{
unsigned int i;
printf("\nlayer={");
if (!l) {
printf(" (NULL) }");
} else {
printf("\n\t" "name='%s'", l->name);
printf("\n\t" "visible=%s", str_bool(l->visible));
printf("\n\t" "opacity='%f'", l->opacity);
printf("\n\t" "offsetx=%d", l->offsetx);
printf("\n\t" "offsety=%d", l->offsety);
if (l->type == L_LAYER && l->content.gids) {
printf("\n\t" "type=Layer" "\n\t" "tiles=");
for (i=0; i<tc; i++) {
printf("%d,", l->content.gids[i] & TMX_FLIP_BITS_REMOVAL);
}
} else if (l->type == L_OBJGR) {
printf("\n\t" "color=#%.6X", l->content.objgr->color);
printf("\n\t" "draworder="); print_draworder(l->content.objgr->draworder);
printf("\n\t" "type=ObjectGroup");
dump_objects(l->content.objgr->head, 1);
} else if (l->type == L_IMAGE) {
printf("\n\t" "type=ImageLayer");
dump_image(l->content.image, 1);
}
dump_prop(l->properties, 1);
printf("\n}");
}
if (l) {
if (l->next) dump_layer(l->next, tc);
}
}
void dump_map(tmx_map *m) {
fputs("map={", stdout);
if (m) {
printf("\n\t" "orient="); print_orient(m->orient);
printf("\n\t" "renderorder=%d", m->renderorder);
printf("\n\t" "height=%u", m->height);
printf("\n\t" "width=%u", m->width);
printf("\n\t" "theight=%u", m->tile_height);
printf("\n\t" "twidth=%u", m->tile_width);
printf("\n\t" "bgcol=#%.6X", m->backgroundcolor);
printf("\n\t" "staggerindex="); print_stagger_index(m->stagger_index);
printf("\n\t" "staggeraxis="); print_stagger_axis(m->stagger_axis);
printf("\n\t" "hexsidelength=%d", m->hexsidelength);
} else {
fputs("\n(NULL)", stdout);
}
puts("\n}");
if (m) {
dump_tileset(m->ts_head);
dump_layer(m->ly_head, m->height * m->width);
dump_prop(m->properties, 0);
}
}