yuv422 / cosmo-engine Goto Github PK
View Code? Open in Web Editor NEWA new game engine to play the MS-DOS game "Cosmo's Cosmic Adventure" on modern systems
License: GNU General Public License v2.0
A new game engine to play the MS-DOS game "Cosmo's Cosmic Adventure" on modern systems
License: GNU General Public License v2.0
Hi, I would love if you include this feature!!
Hi Eric,
not sure if you want to, since it probably means some sort of adaptation/rewriting, but...
I tried to port your engine to AmigaOS4, but ran into some problems.
First there were compilation issues (since cmake doesn´t work on my platform, so i had to write my own makefile (attached). Luckily your cmake file is very clean and easy to adapt):
src/player.h:5:14: error: 'sint16' does not name a type; did you mean 'int'?
extern const sint16 player_x_offset_tbl[];
^~~~~~
int
src/player.h:6:14: error: 'sint16' does not name a type; did you mean 'int'?
extern const sint16 player_y_offset_tbl[];
^~~~~~
int
src/player.h:29:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 health;
^~~~~
int
src/player.h:30:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 num_health_bars;
^~~~~
int
src/player.h:32:8: error: 'uint16' does not name a type; did you mean 'int'?
extern uint16 num_bombs;
^~~~~~
int
src/player.h:33:8: error: 'uint16' does not name a type; did you mean 'int'?
extern uint16 has_had_bomb_flag;
^~~~~~
int
src/player.h:39:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 player_in_pneumatic_tube_flag;
^~~~~
int
src/player.h:46:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 show_monster_attack_hint;
^~~~~
int
src/player.h:48:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 word_28BEA;
^~~~~
int
src/player.h:73:28: error: variable or field 'display_player_sprite' declared void
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~~~
src/player.h:73:28: error: 'uint8' was not declared in this scope
src/player.h:73:28: note: suggested alternative: 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~~~
int
src/player.h:73:45: error: expected primary-expression before 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~
src/player.h:73:56: error: expected primary-expression before 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~
src/player.h:73:67: error: expected primary-expression before 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~
src/player.h:84:26: error: variable or field 'player_add_to_score' declared void
void player_add_to_score(uint32 amount_to_add_low);
^~~~~~
src/player.h:84:26: error: 'uint32' was not declared in this scope
src/player.h:84:26: note: suggested alternative: 'int'
void player_add_to_score(uint32 amount_to_add_low);
^~~~~~
int
src/player.h:88:110: error: 'uint8' has not been declared
void push_player_around(int push_direction, int push_anim_duration, int push_duration, int player_frame_num, uint8 dont_push_while_jumping_flag, int check_for_blocking_flag);
Those errors were was easily fixed by adding
#ifdef amigaos4
#include "files/defines.h"
#endif
to src/player.h, line 5
After the binary built i got more errors on start of the engine.
I cannot fix them by myself, too much of a noob i´m afraid, but i´d love to test anything you throw at me :-)
Here are the errors on start:
audio_init(): opened=1 times frequency=22050Hz format=S16MSB channel=1
ERROR: AUDIO_S16LSB or AUDIO_F32LSB required. found 0x9010
Failed opening: PROGDIR:/COSMO1.VOL
Error opening COSMO1.VOL
assertion "open_vol_file(vol_filename, &vol_file)" failed: file "src/files/vol.c", line 111
***Command 'cosmo_amigaos4' returned with unfreed signals 80000000!
I have to add that i´m using SDL2 on a Big Endian PPC-based machine
I independently decompiled all three episodes of Cosmo and released the work as a project called Cosmore. My goal was slightly different than yours -- I wanted to reconstruct the original code using the original compiler to get a DOS EXE. In the process I figured out a ton about what every variable and function does, and I tried to name things as descriptively as possible.
I realize that my project is of virtually no use to anyone who wants to run the game natively on modern systems, which is why I'd like to share my knowledge, experience, and even the code itself with your project. Anything you wish to incorporate, feel free. All I would ask for in return is attribution -- my name and a link back to Cosmore.
If nothing else, I'm always available for questions or discussions at the email address in my profile. I know this game pretty darn well now.
subj
?
subj
For whatever reason, the game crashes when loading. I am compiling with Visual Studio 2022, for x64.
I hunted down the culprit in the form of:
SDL_free(fullpath);
Commenting out that in a couple of places did the trick. As to why that fixes things is an excellent question to which I don't have an answer at the moment ;).
Tried changing it to just free(fullpath); and that worked fine, not sure why the code is using SDL_free when it's not allocated by SDL, but hey. It's something.
To reproduce, collect 55 stars.
Enter the bonus level where you can jump from trampoline to trampoline from left to right until the most right side of the screen.
Then drop down and do not go in any exit but keep walking around and collecting items that are on the bottom and touching the green creatures.
I ran into a segfault there twice now. Here is what I get in GDB:
$ gdb ./cosmo_engine
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cosmo_engine...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/julius/checkouts/cosmo-engine/build/cosmo_engine
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeac70700 (LWP 20755)]
[New Thread 0x7ffff7f93700 (LWP 20756)]
[New Thread 0x7fffea46f700 (LWP 20757)]
audio_init(): opened=1 times frequency=22050Hz format=S16LSB channels=1
Failed opening './COSMO1.CFG'
Loading 228 status tiles.
Loading 750 player tiles.
Loading 1, player tile info records.
Loaded 4797 actor tiles.
Loading 267, actor tile info records.
Loading 2000 map bg tiles.
Loading 1000 map fg tiles.
Loading 1607 cartoon tiles.
Loading 1, cartoon tile info records.
Loading 100 font tiles.
Total Sfx 72
SOUNDS.MNI, 24, 0
SOUNDS2.MNI, 24, 23
SOUNDS3.MNI, 24, 46
Level 0: rain=0, backdrop_index=11, bg_x_scroll=64, bg_y_scroll=0, pal_anim_type=0, music_index=8
Loading 720 background tiles.
map width (in tiles): 512
Level 1: rain=0, backdrop_index=11, bg_x_scroll=64, bg_y_scroll=0, pal_anim_type=0, music_index=8
map width (in tiles): 512
Failed opening './COSMO1.SV1'
Failed opening './COSMO1.SV2'
Failed opening './COSMO1.SV3'
Failed opening './COSMO1.SV4'
Failed opening './COSMO1.SV5'
Failed opening './COSMO1.SV6'
Failed opening './COSMO1.SV7'
Failed opening './COSMO1.SV8'
Failed opening './COSMO1.SV9'
Failed opening './COSMO1.SV2'
Failed opening './COSMO1.SV3'
Failed opening './COSMO1.SV4'
Failed opening './COSMO1.SV5'
Failed opening './COSMO1.SV6'
Failed opening './COSMO1.SV7'
Failed opening './COSMO1.SV8'
Failed opening './COSMO1.SV9'
Level 3: rain=0, backdrop_index=13, bg_x_scroll=64, bg_y_scroll=128, pal_anim_type=0, music_index=10
Loading 720 background tiles.
map width (in tiles): 512
Thread 1 "cosmo_engine" received signal SIGSEGV, Segmentation fault.
0x000055555555f367 in map_get_tile_cell ()
(gdb) bt
#0 0x000055555555f367 in map_get_tile_cell ()
#1 0x000055555555aba8 in sprite_blocking_check ()
#2 0x000055555556d66b in actor_wt_green_roamer_worm ()
#3 0x000055555555a996 in actor_update ()
#4 0x000055555555aaa6 in actor_update_all ()
#5 0x000055555555eb54 in executeTick ()
#6 0x000055555555ec53 in game_loop ()
#7 0x000055555555b061 in main ()
This happened when touching a green creature (after having touched many already and collecting points). The first time it happened when as far as I could see I just jumped over an exit without touching anything special.
Compiled with emscripten. I have tried putting the game files in the root, in the data folder, and in separate game folders. No matter what, the page does not seem to find them and returns the error:
Failed opening '//COSMO1.VOL'
Error: opening COSMO1.VOL
subj
would controller support be available. or a list of controls so i can try to use joy2key?
subj
i can't exit the game every time i hit escape or q and y it just goes back between the title screen and main menu
I have copied in the COSMO[23] .STN & .VOL however I am unable to switch episodes.
Has this not been implemented or is there something i'm missing?
I recall the DOS version has a different executable for each episode, i'm running on JelOS via portmaster.
HI! tested on linux! niceee! how to set it on fullscreen?.. I wont to do trashing "AKA tinkering" with your code to achieve it. video about it soon
do you plan to make it so you can add, new enemies? I would also love it if you could make the boss have more hp and be harder to pin down too. :)
Let me know if you want me to try it out, I will test when its beta if you want
I mostly repasted this from my comment earlier here, but I figured, I should ask anyways.
This is the place I mentioned:
i was able to build it correctly, i think. but when i try to run it i get 2 errors
NFO: Game controllers found: 0 Mappings: '/opt/retropie/ports/cosmoengine//gamecontrollerdb.txt' Count: -1
i have the gamecontrollerdb.txt in the wrong place, easy fix
cosmo_engine: /home/pi/RetroPie-Setup/tmp/build/cosmoengine/src/files/vol.c:127: vol_file_open: Assertion `open_vol_file(vol_filename, &vol_file)' failed.
this one i dont know hot to fix. the dir it is looking for the files is where the game was compiled in. once its done there it gets moved.
any thoughts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.