All the changes needed for the AmigaOS 4 port and release
|
@ -0,0 +1,5 @@
|
||||||
|
*.o
|
||||||
|
*.d
|
||||||
|
*.lha
|
||||||
|
blues
|
||||||
|
Crashlog*
|
|
@ -0,0 +1,62 @@
|
||||||
|
|
||||||
|
SDL_CFLAGS := -D__USE_INLINE__ -I/sdk/local/newlib/include/SDL2
|
||||||
|
SDL_LIBS := -lSDL2_mixer -lmikmod -lmodplug -lFLAC -logg -lSDL2 -lpthread -athread=native -lstdc++
|
||||||
|
|
||||||
|
MODPLUG_LIBS ?=
|
||||||
|
|
||||||
|
BB := decode.c game.c level.c objects.c resource.c screen.c sound.c staticres.c tiles.c unpack.c
|
||||||
|
JA := game.c level.c resource.c screen.c sound.c staticres.c unpack.c
|
||||||
|
P2 := bosses.c game.c level.c monsters.c resource.c screen.c sound.c staticres.c unpack.c
|
||||||
|
|
||||||
|
BB_SRCS := $(foreach f,$(BB),bb/$f)
|
||||||
|
JA_SRCS := $(foreach f,$(JA),ja/$f)
|
||||||
|
P2_SRCS := $(foreach f,$(P2),p2/$f)
|
||||||
|
SRCS := $(BB_SRCS) $(JA_SRCS) $(P2_SRCS)
|
||||||
|
OBJS := $(SRCS:.c=.o)
|
||||||
|
DEPS := $(SRCS:.c=.d)
|
||||||
|
|
||||||
|
CPPFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wpedantic -MMD $(SDL_CFLAGS) -I. -g
|
||||||
|
|
||||||
|
all: blues
|
||||||
|
|
||||||
|
game_bb.o: CPPFLAGS += -fvisibility=hidden
|
||||||
|
|
||||||
|
game_bb.o: $(BB_SRCS:.c=.o)
|
||||||
|
ld -r -o $@ $^
|
||||||
|
objcopy --localize-hidden $@
|
||||||
|
|
||||||
|
game_ja.o: CPPFLAGS += -fvisibility=hidden
|
||||||
|
|
||||||
|
game_ja.o: $(JA_SRCS:.c=.o)
|
||||||
|
ld -r -o $@ $^
|
||||||
|
objcopy --localize-hidden $@
|
||||||
|
|
||||||
|
game_p2.o: CPPFLAGS += -fvisibility=hidden
|
||||||
|
|
||||||
|
game_p2.o: $(P2_SRCS:.c=.o)
|
||||||
|
ld -r -o $@ $^
|
||||||
|
objcopy --localize-hidden $@
|
||||||
|
|
||||||
|
blues: main.o mixer.o sys_sdl2.o util.o game_bb.o game_ja.o game_p2.o
|
||||||
|
$(CC) $(LDFLAGS) -o $@ $^ $(SDL_LIBS) $(MODPLUG_LIBS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJS) $(DEPS) *.o *.d
|
||||||
|
|
||||||
|
-include $(DEPS)
|
||||||
|
|
||||||
|
|
||||||
|
# prepare an archive for the program
|
||||||
|
release:
|
||||||
|
@echo "Creating release files..."
|
||||||
|
@strip blues
|
||||||
|
@mkdir -p release/blues
|
||||||
|
@copy ALL release_files/ release/blues/ QUIET
|
||||||
|
@copy blues "release/blues/Blues Brothers/"
|
||||||
|
@copy blues "release/blues/Jukebox Adventure/"
|
||||||
|
@copy blues "release/blues/Prehistorik 2/"
|
||||||
|
@copy README.md release/blues/
|
||||||
|
@echo "Creating release archive..."
|
||||||
|
@lha -aeqr3 a blues.lha release/
|
||||||
|
@echo "Clean release files..."
|
||||||
|
@delete release ALL QUIET FORCE
|
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
#if defined(__amigaos4__)
|
||||||
|
#include <sys/unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "unpack.h"
|
#include "unpack.h"
|
||||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
@ -113,7 +113,7 @@ static uint8_t level_lookup_tile(uint8_t num) {
|
||||||
|
|
||||||
static uint8_t level_get_tile(int offset) {
|
static uint8_t level_get_tile(int offset) {
|
||||||
if (offset < 0 || offset >= g_vars.tilemap_w * g_vars.tilemap_h) {
|
if (offset < 0 || offset >= g_vars.tilemap_w * g_vars.tilemap_h) {
|
||||||
print_warning("Invalid tilemap offset %d", offset);
|
// print_warning("Invalid tilemap offset %d", offset);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int num = g_vars.tilemap_data[offset];
|
int num = g_vars.tilemap_data[offset];
|
||||||
|
@ -2434,7 +2434,7 @@ static void level_tile_func_5f16(struct object_t *obj, int bp) {
|
||||||
level_tile_func_5e83(obj, bp);
|
level_tile_func_5e83(obj, bp);
|
||||||
} else {
|
} else {
|
||||||
if (obj != &g_vars.players_table[0].obj) {
|
if (obj != &g_vars.players_table[0].obj) {
|
||||||
print_warning("Unexpected object #%d spr %d on tile 5f16", obj - g_vars.objects_table, obj->spr_num);
|
// print_warning("Unexpected object #%d spr %d on tile 5f16", obj - g_vars.objects_table, obj->spr_num);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player_flags2(obj) &= ~2;
|
player_flags2(obj) &= ~2;
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
#if defined(__amigaos4__)
|
||||||
|
#include <sys/unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "unpack.h"
|
#include "unpack.h"
|
||||||
|
|
10
main.c
|
@ -7,7 +7,17 @@
|
||||||
|
|
||||||
struct options_t g_options;
|
struct options_t g_options;
|
||||||
|
|
||||||
|
#if defined(__amigaos4__)
|
||||||
|
#define USED __attribute__((used))
|
||||||
|
#define VSTRING "Blues 1.0.0r1 (04.08.2023)"
|
||||||
|
#define VERSTAG "\0$VER: " VSTRING
|
||||||
|
static const char *stack USED = "$STACK:102400";
|
||||||
|
static const char *version USED = VERSTAG;
|
||||||
|
|
||||||
|
static const char *DEFAULT_DATA_PATH = "PROGDIR:data";
|
||||||
|
#else
|
||||||
static const char *DEFAULT_DATA_PATH = ".";
|
static const char *DEFAULT_DATA_PATH = ".";
|
||||||
|
#endif
|
||||||
|
|
||||||
static const int DEFAULT_SCALE_FACTOR = 2;
|
static const int DEFAULT_SCALE_FACTOR = 2;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Run >NIL: blues --scale=3
|
|
@ -0,0 +1 @@
|
||||||
|
Run >NIL: blues --scale=3
|
|
@ -0,0 +1 @@
|
||||||
|
Run >NIL: blues --scale=3
|
|
@ -0,0 +1,94 @@
|
||||||
|
# blues for AmigaOS 4.1 FE
|
||||||
|
|
||||||
|
blues is a game engine developed by Gregory Montoir and found at his
|
||||||
|
GitHub repository (https://github.com/cyxx/blues)
|
||||||
|
|
||||||
|
This engine supports three games developed by Titus Interactive,
|
||||||
|
which are the "Blues Brothers", the "Blues Brothers: Jukebox Adventure"
|
||||||
|
and the "Prehistorik 2"
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Extract the archive wherever you want. There are three folders, one
|
||||||
|
for each game. In these folders there is the executable and a *data*
|
||||||
|
folder where you need to copy the data files for each game.
|
||||||
|
Please read below for more info about these files.
|
||||||
|
|
||||||
|
### Blues Brothers
|
||||||
|
|
||||||
|
The data files of the Amiga or DOS version, full game or
|
||||||
|
demo (https://archive.org/details/TheBluesBrothers_1020), are
|
||||||
|
required.
|
||||||
|
|
||||||
|
```
|
||||||
|
*.BIN, *.CK1, *.CK2, *.SQL, *.SQV, *.SQZ
|
||||||
|
```
|
||||||
|
|
||||||
|
For sounds and music, the Amiga version files or the
|
||||||
|
ExoticA (https://www.exotica.org.uk/wiki/The_Blues_Brothers) set
|
||||||
|
need to be copied.
|
||||||
|
|
||||||
|
### Jukebox Adventure
|
||||||
|
|
||||||
|
The data files of the DOS version are required.
|
||||||
|
|
||||||
|
```
|
||||||
|
*.EAT, *.MOD
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prehistorik 2
|
||||||
|
|
||||||
|
The data files of the DOS version, full game or
|
||||||
|
demo (http://cd.textfiles.com/ccbcurrsh1/demos/pre2.zip), are
|
||||||
|
required.
|
||||||
|
|
||||||
|
```
|
||||||
|
*.SQZ, *.TRK
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
Usage: blues [OPTIONS]...
|
||||||
|
--datapath=PATH Path to data files (default '.')
|
||||||
|
--level=NUM Start at level NUM
|
||||||
|
--cheats=MASK Cheats bitmask
|
||||||
|
--startpos=XxY Start at position (X,Y)
|
||||||
|
--fullscreen Enable fullscreen
|
||||||
|
--scale=N Graphics scaling factor (default 2)
|
||||||
|
--filter=NAME Graphics scaling filter (default 'nearest')
|
||||||
|
--screensize=WxH Graphics screen size (default 320x200)
|
||||||
|
--cga Enable CGA colors
|
||||||
|
--dosscroll Enable DOS style screen scrolling
|
||||||
|
--hybrid Enable fuchsia color as in Hybrid crack
|
||||||
|
```
|
||||||
|
|
||||||
|
## I would like to thank
|
||||||
|
|
||||||
|
- Gregory Montoir for creating this awesome engine and open sourcing it
|
||||||
|
- Capehill for his tireless work on SDL port for AmigaOS 4.1 FE
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
If you enjoy what I am doing and would like to keep me up during the night,
|
||||||
|
please consider to buy me a coffee at:
|
||||||
|
https://ko-fi.com/walkero
|
||||||
|
|
||||||
|
## Known issues
|
||||||
|
|
||||||
|
- Please avoid using the fullscreen because some times it breaks
|
||||||
|
the game in some situations. Prefer to use --scale
|
||||||
|
- By default the game loads the data files from the data folder.
|
||||||
|
It is not tested if those are in a different place and it might fail
|
||||||
|
- If you have problems in graphics (black screen, missing sprites)
|
||||||
|
try different SDL renderer in prefs
|
||||||
|
|
||||||
|
You can find the known issues at
|
||||||
|
https://git.walkero.gr/walkero/blues
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.0.0r1] - 2023-08-04
|
||||||
|
### Added
|
||||||
|
- First release for AmigaOS 4
|
||||||
|
|
|
@ -119,7 +119,7 @@ static void sdl2_set_screen_size(int w, int h, const char *caption, int scale, c
|
||||||
}
|
}
|
||||||
const int window_w = w * scale;
|
const int window_w = w * scale;
|
||||||
const int window_h = h * scale;
|
const int window_h = h * scale;
|
||||||
const int flags = fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE;
|
const int flags = fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_SHOWN;
|
||||||
_window = SDL_CreateWindow(caption, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window_w, window_h, flags);
|
_window = SDL_CreateWindow(caption, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window_w, window_h, flags);
|
||||||
_renderer = SDL_CreateRenderer(_window, -1, 0);
|
_renderer = SDL_CreateRenderer(_window, -1, 0);
|
||||||
SDL_RenderSetLogicalSize(_renderer, w, h);
|
SDL_RenderSetLogicalSize(_renderer, w, h);
|
||||||
|
@ -647,7 +647,11 @@ static void sdl2_start_audio(sys_audio_cb callback, void *param) {
|
||||||
SDL_AudioSpec desired;
|
SDL_AudioSpec desired;
|
||||||
memset(&desired, 0, sizeof(desired));
|
memset(&desired, 0, sizeof(desired));
|
||||||
desired.freq = SYS_AUDIO_FREQ;
|
desired.freq = SYS_AUDIO_FREQ;
|
||||||
|
#if defined(__amigaos4__)
|
||||||
|
desired.format = AUDIO_S16SYS;
|
||||||
|
#else
|
||||||
desired.format = AUDIO_S16;
|
desired.format = AUDIO_S16;
|
||||||
|
#endif
|
||||||
desired.channels = 1;
|
desired.channels = 1;
|
||||||
desired.samples = 2048;
|
desired.samples = 2048;
|
||||||
desired.callback = callback;
|
desired.callback = callback;
|
||||||
|
|