├── Code ├── SDI_headers │ ├── SDI_compiler.h │ ├── SDI_hook.h │ ├── SDI_interrupt.h │ ├── SDI_lib.h │ ├── SDI_misc.h │ ├── SDI_stdarg.h │ └── readme.md ├── anims.c ├── anims.h ├── assets.h ├── audio.c ├── audio.h ├── collisions.c ├── collisions.h ├── color.c ├── color.h ├── cop_inst_macros.h ├── diskio.c ├── diskio.h ├── display.c ├── display.h ├── display_level.c ├── display_level.h ├── display_loading.c ├── display_loading.h ├── display_menu.c ├── display_menu.h ├── display_splash.c ├── display_splash.h ├── fonts.c ├── fonts.h ├── functions.h ├── gameobject.c ├── gameobject.h ├── input.c ├── input.h ├── keyboard.c ├── keyboard.h ├── level.c ├── level.h ├── level_display_gradients.c ├── level_display_gradients.h ├── level_display_loop.c ├── main.c ├── makefile ├── missing_hardware_defines.h ├── palettes.h ├── physics.c ├── physics.h ├── ptplayer.asm ├── ptplayer.h ├── rainbow.c ├── rainbow.h ├── settings.h ├── sevgi.h ├── system.c ├── system.h ├── tilemap.c ├── tilemap.h ├── tiles.c ├── tiles.h └── version.h ├── Docs.info ├── Docs ├── Sevgi_Editor.guide ├── Sevgi_Editor.guide.info ├── Sevgi_Engine.guide ├── Sevgi_Engine.guide.info ├── ptplayer_licence └── ptplayer_licence.info ├── Extras ├── Sevgi_Engine_Gameobject_Properties.json ├── display_example.c ├── makefile_sas_c └── ptplayer_sas_c.o ├── ILBM_image.c ├── ILBM_image.h ├── Icons ├── GlowIcons.info ├── GlowIcons │ ├── Sevgi_Editor.info │ └── Sevgi_Editor_New.info ├── MagicWB.info ├── MagicWB │ └── Sevgi_Editor_MWB.info ├── Mason.info ├── Mason │ └── Sevgi_Editor.info ├── Mason_2010.info └── Mason_2010 │ └── Sevgi_Editor.info ├── Images ├── MWB_20x20 │ ├── anim.iff │ ├── boing.iff │ ├── break_point.iff │ ├── compile.iff │ ├── copy.iff │ ├── cut.iff │ ├── debug.iff │ ├── display.iff │ ├── dpaint.iff │ ├── editor.iff │ ├── font.iff │ ├── gear.iff │ ├── gradient.iff │ ├── image.iff │ ├── joystick.iff │ ├── linker.iff │ ├── load.iff │ ├── map.iff │ ├── new.iff │ ├── new_display.iff │ ├── object.iff │ ├── objects.iff │ ├── palette.iff │ ├── paste.iff │ ├── redo.iff │ ├── run.iff │ ├── save.iff │ ├── saveas.iff │ ├── sprite.iff │ ├── tileset.iff │ ├── tool.iff │ └── undo.iff └── no_image.ilbm ├── README.md ├── Sevgi_Editor.info ├── Templates ├── Platformer.ilbm ├── Platformer.text ├── Platformer │ ├── anims.c │ ├── anims.h │ ├── assets.h │ ├── assets │ │ ├── Background.ilbm │ │ ├── FreeCuteTilemap.js │ │ ├── FreeCuteTileset.ilbm │ │ ├── FreeCuteTileset.png │ │ ├── FreeCuteTileset.tsx │ │ ├── MouseSheet2.iff │ │ ├── Palette.ilbm │ │ ├── sprite_sheet_all_L.iff │ │ └── sprite_sheet_all_R.iff │ ├── collisions.c │ ├── collisions.h │ ├── data │ │ ├── Background.ilbm │ │ ├── Background.mod │ │ ├── FreeCuteTilemap │ │ │ ├── Gameobjects.obj │ │ │ └── Tilemap.map │ │ ├── FreeCuteTileset.tls │ │ ├── Jump.iff │ │ ├── Left_Stomp.iff │ │ ├── MousePointers2.spr │ │ ├── RedRidingHood.spr │ │ ├── RedRidingHood_fm2.spr │ │ ├── Right_Stomp.iff │ │ ├── orbitron_15.fnt │ │ ├── orbitron_15.iff │ │ ├── select-granted-05.iff │ │ └── select-granted-06.iff │ ├── level_display_gradients.c │ ├── level_display_gradients.h │ ├── level_display_loop.c │ ├── palettes.h │ └── settings.h ├── Top-Down_Adventure.ilbm ├── Top-Down_Adventure.text └── Top-Down_Adventure │ ├── anims.c │ ├── anims.h │ ├── assets.h │ ├── assets │ ├── Character_Sheet.iff │ ├── Character_Sheet.png │ ├── MouseSheet1.iff │ ├── Pixel16.js │ ├── Pixel16.tsx │ ├── Pixel16_Sheet.iff │ ├── Pixel16_Sheet.png │ └── Waterfall.iff │ ├── collisions.c │ ├── collisions.h │ ├── data │ ├── Character.spr │ ├── MousePointers1.spr │ ├── Pixel16.tls │ ├── Pixel16 │ │ ├── Gameobjects.obj │ │ └── Tilemap.map │ ├── orbitron_15.fnt │ ├── orbitron_15.iff │ ├── select-granted-05.iff │ ├── select-granted-06.iff │ ├── walls-beautiful_world.mod │ ├── waterfall.iff │ └── waterfall.sht │ ├── level_display_loop.c │ ├── palettes.h │ └── settings.h ├── Tools ├── BOBSheeter ├── ConvertMap ├── ConvertTiles ├── SpriteBankMerger ├── SpriteBanker └── src │ ├── BOBSheeter │ ├── main.c │ └── makefile │ ├── ConvertMap │ ├── main.c │ ├── makefile │ ├── utility.c │ └── utility.h │ ├── ConvertTiles │ ├── main.c │ └── makefile │ ├── SpriteBankMerger │ ├── main.c │ └── makefile │ └── SpriteBanker │ ├── main.c │ └── makefile ├── ackstring.c ├── ackstring.h ├── assets_editor.c ├── assets_editor.h ├── bitmap_selector.c ├── bitmap_selector.h ├── bobsheet_creator.c ├── bobsheet_creator.h ├── chunky_image.c ├── chunky_image.h ├── color_gadget.c ├── color_gadget.h ├── color_palette.c ├── color_palette.h ├── display_creator.c ├── display_creator.h ├── dosupernew.c ├── dosupernew.h ├── dtpicdisplay.c ├── dtpicdisplay.h ├── editor_settings.c ├── editor_settings.h ├── game_settings.c ├── game_settings.h ├── gamefont_creator.c ├── gamefont_creator.h ├── image_display.c ├── image_display.h ├── image_editor.c ├── image_editor.h ├── image_spec.c ├── image_spec.h ├── includes ├── SDI_compiler.h ├── SDI_hook.h ├── SDI_interrupt.h ├── SDI_lib.h ├── SDI_misc.h ├── SDI_stdarg.h └── readme.md ├── integer_gadget.c ├── integer_gadget.h ├── main.c ├── makefile ├── new_project.c ├── new_project.h ├── palette_editor.c ├── palette_editor.h ├── palette_selector.c ├── palette_selector.h ├── popasl_string.c ├── popasl_string.h ├── spritebank_creator.c ├── spritebank_creator.h ├── tilemap_creator.c ├── tilemap_creator.h ├── tileset_creator.c ├── tileset_creator.h ├── toolbar.c ├── toolbar.h ├── tooltypes.c ├── tooltypes.h ├── utility.c └── utility.h /Code/SDI_headers/SDI_compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Code/SDI_headers/SDI_compiler.h -------------------------------------------------------------------------------- /Code/SDI_headers/SDI_interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef SDI_INTERRUPT_H 2 | #define SDI_INTERRUPT_H 3 | 4 | /* Includeheader 5 | 6 | Name: SDI_interrupt.h 7 | Versionstring: $VER: SDI_interrupt.h 1.1 (25.04.2006) 8 | Author: Guido Mersmann 9 | Distribution: PD 10 | Project page: https://github.com/adtools/SDI 11 | Description: defines to hide compiler specific interrupt and 12 | handler stuff 13 | 14 | 1.0 17.05.05 : inspired by the SDI_#?.h files made by Jens Langner 15 | and Dirk St�cker I created files to handle interrupt 16 | and handler functions in an API compatible way. 17 | 1.1 25.04.06 : fixed MakeInterrupt() and MakeHandler() macro. (geit) 18 | 19 | */ 20 | 21 | /* 22 | ** This is PD (Public Domain). This means you can do with it whatever you want 23 | ** without any restrictions. I only ask you to tell me improvements, so I may 24 | ** fix the main line of this files as well. 25 | ** 26 | ** To keep confusion level low: When changing this file, please note it in 27 | ** above history list and indicate that the change was not made by myself 28 | ** (e.g. add your name or nick name). 29 | ** 30 | ** Find the latest version of this file at: 31 | ** https://github.com/adtools/SDI 32 | ** 33 | ** Guido Mersmann 34 | ** 35 | */ 36 | 37 | #include "SDI_compiler.h" 38 | 39 | /* 40 | ** The INTERRUPTPROTO macro is for creating interrupts functions and the 41 | ** HANDLERPROTO macro is for handler type setup like used by the 42 | ** input.device. 43 | ** 44 | ** The usage is simular to the DISPATCHERPROTO macro provided by SDI_hook.h. 45 | ** 46 | ** It gets the function name as argument. To supply this function for use by 47 | ** an interrupt structure or handler argument, use the ENTRY macro, which also 48 | ** gets the function name as argument. There is also a MakeInterrupt and a 49 | ** MakeHandler macro for easy structure setup. 50 | ** 51 | ** Example: 52 | ** 53 | ** We create a handler function for the input.device. 54 | ** 55 | ** HANDLERPROTO( handlerfunc, ULONG, struct InputEvent *inputevent, APTR userdata) 56 | ** { 57 | ** ... Modify/parse input stream here 58 | ** ... 59 | ** return( (ULONG) inputevent ); 60 | ** } 61 | ** MakeHandler( handlerstruct, handlerfunc, "TestHandler", &our_user_data); 62 | ** 63 | ** As you can see usage is as simple as using SDI hooks. To create interrupt 64 | ** use INTERRUPTPROTO and MakeInterrupt. Internally both macros are identically. 65 | ** 66 | ** There are also functions to create more specific interrupt and handler 67 | ** structures. By default type is NT_INTERRUPT and priority is 0. 68 | ** 69 | ** MakeHandlerType - additional argument for type 70 | ** MakeHandlerPri - additional argument for pri 71 | ** MakeHandlerTypePri - additional arguments for type and pri 72 | ** 73 | ** 74 | ** Notes: Since the interrupt structure is used for handlers and also foreign 75 | ** handlers are using this structure I kept the arguments definition 76 | ** on the user side. 77 | ** 78 | */ 79 | 80 | #ifdef __MORPHOS__ 81 | 82 | #ifndef SDI_TRAP_LIB /* avoid defining this twice */ 83 | 84 | #include 85 | #include 86 | 87 | #define SDI_TRAP_LIB 0xFF00 /* SDI prefix to reduce conflicts */ 88 | 89 | struct SDI_EmulLibEntry 90 | { 91 | UWORD Trap; 92 | UWORD pad; 93 | APTR Func; 94 | }; 95 | #endif 96 | 97 | #define INTERRUPTPROTO(name, ret, obj, data) \ 98 | SAVEDS ASM ret name( obj, data); \ 99 | static ret Trampoline_##name(void) {return name(( obj) REG_A0, \ 100 | (data) REG_A1);} \ 101 | static const struct SDI_EmulLibEntry Gate_##name = {SDI_TRAP_LIB, 0, \ 102 | (APTR) Trampoline_##name}; \ 103 | SAVEDS ASM ret name( obj, data) 104 | 105 | #define HANDLERPROTO(name, ret, obj, data) \ 106 | SAVEDS ASM ret name( obj, data); \ 107 | static ret Trampoline_##name(void) {return name(( obj) REG_A0, \ 108 | (data) REG_A1);} \ 109 | static const struct SDI_EmulLibEntry Gate_##name = {SDI_TRAP_LIB, 0, \ 110 | (APTR) Trampoline_##name}; \ 111 | SAVEDS ASM ret name( obj, data) 112 | 113 | #define ENTRY(func) (APTR)&Gate_##func 114 | 115 | #else 116 | 117 | #define INTERRUPTPROTO(name, ret, obj, data) \ 118 | SAVEDS ASM ret name(REG(a0, obj), REG(a1, data)) 119 | #define HANDLERPROTO(name, ret, obj, data) \ 120 | SAVEDS ASM ret name(REG(a0, obj), REG(a1, data)) 121 | 122 | #define ENTRY(func) (APTR)func 123 | 124 | #endif /* __MORPHOS__ */ 125 | 126 | /* some structure creating macros for easy and more specific usage */ 127 | 128 | #define MakeInterrupt( name, func, title, isdata ) \ 129 | static struct Interrupt name = {{ NULL, NULL, NT_INTERRUPT, 0, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 130 | 131 | #define MakeInterruptPri( name, func, title, isdata, pri ) \ 132 | static struct Interrupt name = {{ NULL, NULL, NT_INTERRUPT, pri, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 133 | 134 | #define MakeInterruptType( name, func, title, isdata, type ) \ 135 | static struct Interrupt name = {{ NULL, NULL, type, 0, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 136 | 137 | #define MakeInterruptTypePri( name, func, title, isdata, type, pri ) \ 138 | static struct Interrupt name = {{ NULL, NULL, type, pri, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 139 | 140 | #define MakeHandler( name, func, title, isdata ) \ 141 | static struct Interrupt name = {{ NULL, NULL, NT_INTERRUPT, 0, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 142 | 143 | #define MakeHandlerPri( name, func, title, isdata, pri ) \ 144 | static struct Interrupt name = {{ NULL, NULL, NT_INTERRUPT, pri, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 145 | 146 | #define MakeHandlerType( name, func, title, isdata, type ) \ 147 | static struct Interrupt name = {{ NULL, NULL, type, 0, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 148 | 149 | #define MakeHandlerTypePri( name, func, title, isdata, type, pri ) \ 150 | static struct Interrupt name = {{ NULL, NULL, type, pri, (STRPTR) title}, (APTR) isdata, (void (*)()) ENTRY(func) } 151 | 152 | 153 | #endif /* SDI_INTERRUPT_H */ 154 | -------------------------------------------------------------------------------- /Code/SDI_headers/SDI_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Code/SDI_headers/SDI_lib.h -------------------------------------------------------------------------------- /Code/SDI_headers/SDI_misc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Code/SDI_headers/SDI_misc.h -------------------------------------------------------------------------------- /Code/SDI_headers/SDI_stdarg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Code/SDI_headers/SDI_stdarg.h -------------------------------------------------------------------------------- /Code/SDI_headers/readme.md: -------------------------------------------------------------------------------- 1 | For more information on SDI-headers refer to: 2 | http://aminet.net/package/dev/c/SDI_headers -------------------------------------------------------------------------------- /Code/anims.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "anims.h" 8 | /// 9 | ///defines 10 | /// 11 | ///globals 12 | extern volatile struct Custom custom; 13 | extern struct Level current_level; 14 | extern volatile ULONG g_frame_counter; 15 | /// 16 | //prototypes 17 | VOID testAnim1(struct GameObject*); 18 | VOID testAnim2(struct GameObject*); 19 | // 20 | //exports 21 | VOID (*animFunction[NUM_ANIMS])(struct GameObject*) = {NULL, 22 | testAnim1, 23 | testAnim2}; 24 | // 25 | 26 | ///testAnim1(gameobject) //TEMP: 27 | VOID testAnim1(struct GameObject* go) 28 | { 29 | if (go->anim.frame > 64) { 30 | go->anim.frame = 0; 31 | go->anim.state++; 32 | if (go->anim.state > 3) { 33 | go->anim.state = 0; 34 | } 35 | } 36 | 37 | if (!(go->anim.frame % 3)) { 38 | go->anim.storage_1++; 39 | if (go->anim.storage_1 > 7) go->anim.storage_1 = 0; 40 | go->image = (struct ImageCommon*)¤t_level.bob_sheet[0]->image[go->anim.state * 16 + go->anim.storage_1]; 41 | } 42 | 43 | switch (go->anim.state) { 44 | case 0: 45 | go->anim.frame++; 46 | go->y--; 47 | break; 48 | case 1: 49 | go->anim.frame++; 50 | go->x++; 51 | break; 52 | case 2: 53 | go->anim.frame++; 54 | go->y++; 55 | break; 56 | case 3: 57 | go->anim.frame++; 58 | go->x--; 59 | break; 60 | } 61 | 62 | go->x1 = go->x + ((struct BOBImage*)go->image)->h_offs; 63 | go->x2 = go->x1 + ((struct BOBImage*)go->image)->width; 64 | go->y1 = go->y + ((struct BOBImage*)go->image)->v_offs; 65 | go->y2 = go->y1 + ((struct BOBImage*)go->image)->height; 66 | } 67 | /// 68 | ///testAnim2(gameobject) 69 | VOID testAnim2(struct GameObject* go) 70 | { 71 | #define IMAGE_NUM 1 72 | 73 | static UWORD eighth_frame = 7; 74 | static UWORD image_num = IMAGE_NUM; 75 | 76 | if (go->anim.frame > 16) { 77 | go->anim.frame = 0; 78 | go->anim.state++; 79 | if (go->anim.state > 3) { 80 | go->anim.state = 0; 81 | } 82 | } 83 | 84 | switch (go->anim.state) { 85 | case 0: 86 | go->anim.frame++; 87 | go->y1--; 88 | go->y2--; 89 | break; 90 | case 1: 91 | go->anim.frame++; 92 | go->x1--; 93 | go->x2--; 94 | break; 95 | case 2: 96 | go->anim.frame++; 97 | go->y1++; 98 | go->y2++; 99 | break; 100 | case 3: 101 | go->anim.frame++; 102 | go->x1++; 103 | go->x2++; 104 | break; 105 | } 106 | 107 | if (eighth_frame >= 7) { 108 | struct SpriteBank* sb = ((struct SpriteImage*)go->image)->sprite_bank; 109 | 110 | image_num++; 111 | if (image_num >= 47) { 112 | image_num = 0; 113 | } 114 | 115 | go->image = (struct ImageCommon*) &sb->image[image_num]; 116 | go->x2 = go->x1 + go->image->width; 117 | go->y2 = go->y1 + go->image->height; 118 | 119 | eighth_frame = 0; 120 | } 121 | else { 122 | eighth_frame++; 123 | } 124 | } 125 | /// 126 | -------------------------------------------------------------------------------- /Code/anims.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIMS_H 2 | #define ANIMS_H 3 | 4 | #include "level.h" 5 | #include "tiles.h" 6 | #include "tilemap.h" 7 | #include "collisions.h" 8 | #include "gameobject.h" 9 | #include "audio.h" 10 | 11 | /********************************************* 12 | * NUMBER OF ANIMATION FUNCTIONS * 13 | * NOTE: One extra for the NULL initializer! * 14 | *********************************************/ 15 | #define NUM_ANIMS 3 16 | 17 | //TO ACCESS ANIMS ADD THIS LINE INTO YOUR .c fILE: 18 | //extern VOID (*animFunction[NUM_ANIMS])(struct GameObject*); 19 | 20 | #endif /* ANIMS_H */ 21 | -------------------------------------------------------------------------------- /Code/assets.h: -------------------------------------------------------------------------------- 1 | #ifndef ASSETS_H 2 | #define ASSETS_H 3 | 4 | #ifdef FONTS_H 5 | STATIC struct TextAttr textAttrs[NUM_TEXTFONTS] = {{"Helvetica.font", 9, FS_NORMAL, FPF_DESIGNED}}; 6 | STATIC STRPTR gameFontFiles[NUM_GAMEFONTS] = {"orbitron_15.fnt"}; 7 | #endif 8 | 9 | #ifdef LEVEL_H 10 | // LEVEL 0 (Main Menu) 11 | STATIC STRPTR sprite_banks_0[] = {"MousePointers1.spr", NULL}; 12 | STATIC STRPTR music_modules_0[] = {NULL}; 13 | STATIC STRPTR sound_samples_0[] = {"select-granted-05.iff", "select-granted-06.iff", NULL}; 14 | STATIC UBYTE* palettes_0[] = {palette_0_0, NULL}; 15 | STATIC STRPTR gameobj_banks_0[] = {(STRPTR)4, NULL}; 16 | 17 | STATIC struct LevelData levelData[NUM_LEVELS] = {{"Main Menu", 18 | NULL, 19 | NULL, 20 | NULL, 21 | sprite_banks_0, 22 | music_modules_0, 23 | sound_samples_0, 24 | palettes_0, 25 | gameobj_banks_0, 26 | MD_blitBOB, 27 | MD_unBlitBOB, 28 | MENU_SCREEN_WIDTH, 29 | MENU_SCREEN_HEIGHT, 30 | 0, 31 | 0 32 | } 33 | }; 34 | #endif 35 | 36 | #endif /* ASSETS_H */ 37 | -------------------------------------------------------------------------------- /Code/audio.h: -------------------------------------------------------------------------------- 1 | #ifndef AUDIO_H 2 | #define AUDIO_H 3 | 4 | #include "settings.h" 5 | 6 | #define PTVT_IDLE 0 7 | #define PTVT_FADE_IN 1 8 | #define PTVT_FADE_OUT 2 9 | 10 | #include "ptplayer.h" 11 | 12 | struct PT_ModuleHeader { 13 | UBYTE title[20]; 14 | struct { 15 | UBYTE name[22]; 16 | UWORD length_w; 17 | UBYTE finetune; 18 | UBYTE volume; 19 | UWORD loop_start_w; 20 | UWORD loop_length_w; 21 | } sample_info[31]; 22 | UBYTE pat_tbl_size; 23 | UBYTE unused; 24 | UBYTE pat_tbl[128]; 25 | ULONG tracker_id; 26 | }; 27 | 28 | struct PT_Pattern { 29 | struct { 30 | ULONG sample_hi:4; 31 | ULONG parameter:12; 32 | ULONG sample_lo:4; 33 | ULONG effect:12; 34 | }command[64][4]; 35 | }; 36 | 37 | struct PT_Tracker { 38 | struct PT_ModuleHeader header; 39 | struct PT_Pattern pattern; 40 | }; 41 | 42 | struct PT_Module { 43 | struct PT_Tracker* tracker; 44 | UWORD num_patterns; 45 | APTR samples; 46 | ULONG samples_size; 47 | }; 48 | 49 | struct PT_VolumeTable { 50 | union { 51 | ULONG value; 52 | struct { 53 | UBYTE value; 54 | UBYTE p1,p2,p3; 55 | }byte; 56 | }volume_state; 57 | ULONG increment; 58 | UBYTE volume; 59 | UBYTE state; 60 | UWORD steps; 61 | UWORD step; 62 | }; 63 | 64 | VOID PT_InitPTPlayer(VOID); 65 | struct PT_Module* PT_LoadModule(STRPTR fileName); 66 | VOID PT_FreeModule(struct PT_Module* mod); 67 | 68 | #define PT_InitModule(mod, pos) mt_init((void*)&custom, (void*)mod->tracker, (void*)mod->samples, pos) 69 | #define PT_PlayModule() mt_Enable = 1 70 | #define PT_PauseModule() mt_Enable = 0 71 | #define PT_StopAudio() mt_end((void*)&custom) 72 | #define PT_SetModuleVolume(vol) mt_mastervol((void*)&custom, (UBYTE)vol) 73 | #define PT_SetSampleVolume(sample, vol) mt_samplevol((UWORD)sample, (UBYTE)vol) 74 | #define PT_SetModuleChannels(chns) mt_MusicChannels = chns 75 | #define PT_SetChannelMask(mask) mt_channelmask((void*)&custom, (UBYTE)mask) 76 | #define PT_PlaySFX(sfx) mt_playfx((void*)&custom, sfx) 77 | #define PT_LoopSFX(sfx) mt_loopfx((void*)&custom, sfx) 78 | #define PT_StopSFX(cha) mt_stopfx((void*)&custom, cha) 79 | #define PT_TerminatePTPlayer() mt_remove_cia(&custom) 80 | 81 | VOID updateVolume(VOID); 82 | VOID setVolume(UBYTE vol); 83 | 84 | #endif /* AUDIO_H */ 85 | -------------------------------------------------------------------------------- /Code/collisions.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "collisions.h" 8 | /// 9 | ///defines 10 | /// 11 | ///globals 12 | extern volatile struct Custom custom; 13 | extern struct Level current_level; 14 | /// 15 | //prototypes 16 | // Collisions functions between gameobjects 17 | VOID testGobjColl1(struct GameObject*, struct GameObject*); 18 | 19 | // Collisions between tiles and gameobjects 20 | VOID testTileColl1(struct GameObject*); 21 | 22 | //exports 23 | VOID (*gobjCollisionFunction[NUM_GOBJ_COLL_FUNCS])(struct GameObject*, struct GameObject*) = {NULL, 24 | testGobjColl1}; 25 | 26 | VOID (*tileCollisionFunction[NUM_TILE_COLL_FUNCS])(struct GameObject*) = {NULL, 27 | testTileColl1}; 28 | // 29 | 30 | /******************************************** 31 | * Collisions functions between gameobjects * 32 | ********************************************/ 33 | ///testGobjColl1(gameobject) //TEMP: 34 | VOID testGobjColl1(struct GameObject* go1, struct GameObject* go2) 35 | { 36 | // A hitbox collision can be implemented here if required 37 | 38 | } 39 | /// 40 | 41 | /******************************************** 42 | * Collisions between tiles and gameobjects * 43 | ********************************************/ 44 | ///testTileColl1(gameobject) 45 | VOID testTileColl1(struct GameObject* go) 46 | { 47 | // TILEID tileID; 48 | 49 | /************************************ 50 | * Tile collide per image rectangle * 51 | ************************************/ 52 | // x1, y1 collision 53 | // tileID = TILEID_AT_COORD(map, go->x1, go->y1); 54 | 55 | // x2, y1 collision 56 | // tileID = TILEID_AT_COORD(map, go->x2, go->y1); 57 | 58 | // x2, y2 collision 59 | // tileID = TILEID_AT_COORD(map, go->x2, go->y2); 60 | 61 | // x1, y2 collision 62 | // tileID = TILEID_AT_COORD(map, go->x1, go->y2); 63 | 64 | /********************************** 65 | * Tile collide per image hotspot * 66 | **********************************/ 67 | // tileID = TILEID_AT_COORD(map, go->x, go->y); 68 | } 69 | /// 70 | -------------------------------------------------------------------------------- /Code/collisions.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLISIONS_H 2 | #define COLLISIONS_H 3 | 4 | #include "level.h" 5 | #include "tiles.h" 6 | #include "tilemap.h" 7 | #include "gameobject.h" 8 | #include "audio.h" 9 | 10 | /********************************************* 11 | * NUMBER OF COLLISION FUNCTIONS * 12 | * NOTE: One extra for the NULL initializer! * 13 | *********************************************/ 14 | #define NUM_GOBJ_COLL_FUNCS 2 15 | #define NUM_TILE_COLL_FUNCS 2 16 | 17 | //TO ACCESS COLLISION FUNCTIONS ADD THESE LINES INTO YOUR .c fILE: 18 | //extern VOID (*gobjCollisionFunction[NUM_GOBJ_COLL_FUNCS])(struct GameObject*, struct GameObject*); 19 | //extern VOID (*tileCollisionFunction[NUM_TILE_COLL_FUNCS])(struct GameObject*); 20 | 21 | #endif /* COLLISIONS_H */ 22 | -------------------------------------------------------------------------------- /Code/color.h: -------------------------------------------------------------------------------- 1 | #ifndef COLOR_H 2 | #define COLOR_H 3 | 4 | #include "settings.h" 5 | 6 | #define BPLCON3_V BPLCON3_BRDNBLNK | 0xC00 7 | 8 | //Precision bits for fixed point arithmetic used in ColorTables (8 or 20) 9 | // 20 bits is highly precise and fast. 10 | // 8 bits is precise enough (no noticable visual difference with 20) yet it cuts 11 | // the size of ColorTables in half at the cost of one additional operation per 12 | // color (it is two additional operations in AGA). 13 | #define CT_PRECISION 8 14 | 15 | //Data structure of a palette in pseudo code 16 | // struct Palette { 17 | // UBYTE num_colors; // actually the number of colors in the palette -1 18 | // struct { 19 | // UBYTE R, G, B; 20 | // }hues[num_colors + 1]; 21 | // }; 22 | // 23 | // NOTE: num_colors is actually the the number of colors in the palette minus 1. 24 | // When it is 0 there is 1 color in the palette. 25 | // When it is 255 there are 256 colors in the palette. 26 | // This way we can store the size of a 256 color (full AGA palette) in a 27 | // single UBYTE. 28 | // So that the data type for a palette can just be an UBYTE array of size: 29 | // num_colors * 3 + 1 30 | 31 | //Gradient types 32 | #define GRD_TYPE_OCS 1 // WARNING: Do not change these values. They not only... 33 | #define GRD_TYPE_AGA 2 // ...define type, but also are used in calculations! 34 | 35 | //Color table states 36 | #define CT_IDLE 0 37 | #define CT_FADE_IN 1 38 | #define CT_FADE_OUT 2 39 | 40 | #if CT_PRECISION == 8 41 | struct ColorState { 42 | union { 43 | struct { 44 | UWORD R,G,B; 45 | }value; 46 | struct { 47 | UBYTE R,RP, G,GP, B,BP; 48 | }bytes; 49 | }color; 50 | struct { 51 | UWORD R,G,B; 52 | }increment; 53 | }; 54 | #elif CT_PRECISION == 20 55 | struct ColorState { 56 | union { 57 | struct { 58 | ULONG R,G,B; 59 | }value; 60 | struct { 61 | UBYTE RH,RL; 62 | UWORD RP; 63 | UBYTE GH,GL; 64 | UWORD GP; 65 | UBYTE BH,BL; 66 | UWORD BP; 67 | }bytes; 68 | }color; 69 | struct { 70 | ULONG R,G,B; //NOTE: we can make this LONG to cover negative increments! 71 | }increment; 72 | }; 73 | #endif 74 | 75 | struct ColorTable { 76 | UBYTE* table; // palette, copperlist or the gradient this ColorTable is for 77 | struct ColorState* states; // holds the current states and increment values for all the colors 78 | UWORD fade_steps; // how many steps a complete fade in/out takes 79 | UWORD fade_step; // on which step are we on the fade/in out 80 | UWORD state; // CT_IDLE, CT_FADE_IN or CT_FADE_OUT 81 | UWORD colors; // number of colors this ColorTable fades 82 | }; 83 | 84 | struct Gradient { 85 | UWORD num_colors; // number of "all" colors on the gradient 86 | UBYTE type; // AGA or OCS gradient 87 | UBYTE col_reg; // On which color register this gradient will apply 88 | UBYTE scrollable: 1; 89 | UBYTE movable : 1; 90 | UBYTE blitable : 1; 91 | UBYTE modulus; // blitter modulus for the color instructions on the rainbow | 92 | UBYTE index; // the position of the color instruction on the CopOp -> These three are to be set by createRainbow() 93 | UBYTE loct_offs; // the byte offset between the color instruction and it's AGA counterpart | 94 | UWORD pos; // the position of the visible part on "all" (num_colors) for scrollable gradients 95 | UWORD pos_max; // precalculated maximum scroll position for pos 96 | UWORD vis; // the visible size of the gradient on screen (in rasterlines) for scrollable gradients 97 | UBYTE scr_pos; // the rasterline this gradient will start (screen coordinate) 98 | UBYTE scr_pos_max;// precalculated maximum position for scr_pos 99 | UWORD* colors; // In word aligned chipram 100 | struct ColorTable* color_table; 101 | }; 102 | struct ColorTable* newColorTable(UBYTE* table, UWORD fade_steps, ULONG step); 103 | struct ColorTable* newColorTable_CL(UWORD* copperlist, UWORD fade_steps, ULONG step); 104 | struct ColorTable* newColorTable_GRD(struct Gradient* grd, UWORD fade_steps, ULONG step); 105 | VOID freeColorTable(struct ColorTable* ct); 106 | #define updateColorTable(ct) updateColorTable_Partial(ct, 0, ct->colors) 107 | VOID updateColorTable_Partial(struct ColorTable* ct, ULONG start, ULONG end); 108 | #define setColorTable(ct) setColorTable_REG(ct, 0, ct->colors) 109 | #define setColorTable_Partial setColorTable_REG 110 | VOID setColorTable_REG(struct ColorTable* ct, ULONG start, ULONG num_colors); 111 | VOID setColorTable_CL(struct ColorTable* ct); 112 | VOID setColorTable_GRD(struct ColorTable* ct); 113 | VOID setColors(UBYTE* table); 114 | VOID blackOut(VOID); 115 | 116 | #endif /* COLOR_H, */ 117 | -------------------------------------------------------------------------------- /Code/diskio.h: -------------------------------------------------------------------------------- 1 | #ifndef DISKIO_H 2 | #define DISKIO_H 3 | 4 | #define BM_TYPE_BITMAP 0x0 5 | #define BM_TYPE_DISPLAYABLE BMF_DISPLAYABLE 6 | #define BM_TYPE_INTERLEAVED BMF_INTERLEAVED 7 | #define BM_TYPE_GAMEFONT BMF_DISPLAYABLE 8 | #define BM_TYPE_BOBSHEET 0x26 9 | 10 | #ifndef Unity 11 | #define Unity 0x10000UL 12 | #endif 13 | 14 | struct TileSet *loadTileSet(STRPTR file, struct BitMap *friend); 15 | struct TileMap *loadTileMap(STRPTR file, UWORD scr_width, UWORD scr_height); 16 | struct BitMap* loadILBMBitMap(STRPTR fileName, ULONG type); 17 | struct SfxStructure* PT_Load8SVX(STRPTR fileName); 18 | VOID PT_FreeSFX(struct SfxStructure* sfx); 19 | struct SpriteBank* loadSpriteBank(STRPTR fileName); 20 | VOID freeSpriteBank(struct SpriteBank* bank); 21 | struct BOBSheet* loadBOBSheet(STRPTR fileName); 22 | VOID freeBOBSheet(struct BOBSheet* bs); 23 | 24 | #endif /* DISKIO_H */ 25 | -------------------------------------------------------------------------------- /Code/display.h: -------------------------------------------------------------------------------- 1 | #ifndef DISPLAY_H 2 | #define DISPLAY_H 3 | 4 | #include "SDI_headers/SDI_compiler.h" 5 | 6 | BOOL openNullDisplay(VOID); 7 | VOID closeNullDisplay(VOID); 8 | VOID activateNullCopperList(VOID); 9 | VOID deactivateNullCopperList(VOID); 10 | VOID switchToNullCopperList(VOID); 11 | 12 | /******************************* 13 | * NULL SPRITE * 14 | *******************************/ 15 | /* Import as below whereever an empty sprite is required 16 | extern UWORD NULL_SPRITE_ADDRESS_H; 17 | extern UWORD NULL_SPRITE_ADDRESS_L; 18 | */ 19 | 20 | /******************************* 21 | * SOME HELPFUL DEFAULT VALUES * 22 | *******************************/ 23 | #define DEFAULT_DDFSTRT_LORES 0x0038 24 | #define DEFAULT_DDFSTRT_HIRES 0x003C 25 | #define DEFAULT_DDFSTOP_LORES 0x00D0 26 | #define DEFAULT_DIWSTRT 0x2C81 27 | #define DEFAULT_DIWSTOP 0x2CC1 28 | 29 | /****************************** 30 | * EXPORTED UTILITY FUNCTIONS * 31 | ******************************/ 32 | #define RPF_LAYER 0x01 33 | #define RPF_BITMAP 0x02 34 | #define RPF_TMPRAS 0x04 35 | #define RPF_AREA 0x08 36 | #define RPF_ALL 0x0F 37 | 38 | struct RastPort* allocRastPort(ULONG sizex, ULONG sizey, ULONG depth, ULONG bm_flags, struct BitMap *friend, ULONG rp_flags, LONG max_vectors); 39 | VOID freeRastPort(struct RastPort* rp, ULONG free_flags); 40 | 41 | #define CL_SINGLE FALSE 42 | #define CL_DOUBLE TRUE 43 | #define CL_SIZE(a) (sizeof(a)) 44 | #define CL_NUM_INSTS(a) (sizeof(a) / 4) 45 | 46 | #define allocCopperList(list, access, doubleBuf) copperAllocator(list, CL_NUM_INSTS(list), &access, doubleBuf, 0) 47 | #define freeCopperList(cl) FreeVec(cl); 48 | BOOL copperAllocator(ULONG* cl_insts, ULONG num_insts, UWORD** access_ptr, BOOL double_buffer, ULONG extra_insts); 49 | 50 | /*************************************************** 51 | * Ensure BitMap allocations meet AGA requirements * 52 | ***************************************************/ 53 | #define ROUND_TO_64(a) ((a + 63) & 0xFFFFFFC0) 54 | #define allocBitMap(sizex, sizey, depth, flags, friend) AllocBitMap(ROUND_TO_64(sizex), sizey, depth, flags, friend) 55 | 56 | #endif /* DISPLAY_H */ 57 | -------------------------------------------------------------------------------- /Code/display_level.h: -------------------------------------------------------------------------------- 1 | #ifndef LEVEL_DISPLAY_H 2 | #define LEVEL_DISPLAY_H 3 | 4 | #include "missing_hardware_defines.h" 5 | #include "gameobject.h" 6 | #include "anims.h" 7 | #include "settings.h" 8 | 9 | // Number of pixels to scroll the map in the corresponding direction. 10 | // After a call to scroll(), will hold the remaining pixels to scroll... 11 | // ...after updateCopperList() 12 | struct ScrollInfo { 13 | UWORD up; 14 | UWORD down; 15 | UWORD left; 16 | UWORD right; 17 | }; 18 | 19 | #define SCREEN_COLORS (1 << SCREEN_DEPTH) 20 | #define BITMAP_WIDTH (SCREEN_WIDTH + SCR_WIDTH_EXTRA) 21 | #define BITMAP_HEIGHT (((SCREEN_HEIGHT % TILESIZE) ? SCREEN_HEIGHT - (SCREEN_HEIGHT % TILESIZE) + TILESIZE : SCREEN_HEIGHT) + SCR_HEIGHT_EXTRA) 22 | 23 | #define DIWSTART_V 0x2981 24 | #define DIWSTOP_V 0x29C1 25 | 26 | //Smart sprites only work with dynamic copperlist 27 | #ifndef DYNAMIC_COPPERLIST 28 | #undef SMART_SPRITES 29 | #endif 30 | 31 | //Un-commenting the below define unrolls the bitplane loops in update copperlist functions 32 | #define UNROLL_LOOPS 33 | 34 | #if BPL_FMODE == 1 35 | 36 | #define DDFSTART_V 0x0030 37 | #define DDFSTOP_V 0x00D0 38 | #define BPLXMOD_V ((BITMAP_WIDTH / 8) * SCREEN_DEPTH - (SCREEN_WIDTH / 8) - 2) 39 | #define VSPLTMOD_V ((-((BITMAP_HEIGHT - 1) * (BITMAP_WIDTH / 8) * SCREEN_DEPTH + (SCREEN_WIDTH / 8) + 2)) & 0xFFFF) 40 | #define DISPLAY_BUFFER_OFFSET 0 41 | #define DISPLAY_BUFFER_OFFSET_BYTES 0 42 | #define SCROLL_PIXELS 16 43 | #define SCROLL_MASK 15 44 | #define SCROLL_BYTES 2 45 | #define BPL_FMODE_V 0x0 46 | 47 | #elif BPL_FMODE == 2 48 | 49 | #define DDFSTART_V 0x0028 50 | #define DDFSTOP_V 0x00C8 51 | #define BPLXMOD_V ((BITMAP_WIDTH / 8) * SCREEN_DEPTH - (SCREEN_WIDTH / 8) - 4) 52 | #define VSPLTMOD_V ((-((BITMAP_HEIGHT - 1) * (BITMAP_WIDTH / 8) * SCREEN_DEPTH + (SCREEN_WIDTH / 8) + 4)) & 0xFFFF) 53 | #define DISPLAY_BUFFER_OFFSET 16 54 | #define DISPLAY_BUFFER_OFFSET_BYTES 2 55 | #define SCROLL_PIXELS 32 56 | #define SCROLL_MASK 31 57 | #define SCROLL_BYTES 4 58 | #define BPL_FMODE_V FMODE_BLP32 59 | 60 | #elif BPL_FMODE == 4 61 | 62 | #define DDFSTART_V 0x0018 63 | #define DDFSTOP_V 0x00B8 64 | #define BPLXMOD_V ((BITMAP_WIDTH * (SCREEN_DEPTH - 1)) / 8) 65 | #define VSPLTMOD_V ((-((BITMAP_WIDTH * (BITMAP_HEIGHT - 1) * SCREEN_DEPTH) + BITMAP_WIDTH) / 8) & 0xFFFF) 66 | #define DISPLAY_BUFFER_OFFSET 48 // 48 for (FMODE_BLP32 | FMODE_BPAGEM) 67 | #define DISPLAY_BUFFER_OFFSET_BYTES 6 // (DISPLAY_BUFFER_OFFSET / 8) 68 | #define SCROLL_PIXELS 64 69 | #define SCROLL_MASK 63 70 | #define SCROLL_BYTES 8 71 | #define BPL_FMODE_V FMODE_BLP32 | FMODE_BPAGEM 72 | 73 | #endif 74 | 75 | #if SPR_FMODE == 1 76 | #define FMODE_V (BPL_FMODE_V) 77 | #elif SPR_FMODE == 2 78 | #define FMODE_V (BPL_FMODE_V | FMODE_SPR32) 79 | #elif SPR_FMODE == 4 80 | #define FMODE_V (BPL_FMODE_V | FMODE_SPR32 | FMODE_SPAGEM) 81 | #endif 82 | 83 | VOID LD_blitBOB(struct GameObject* go); 84 | VOID LD_unBlitBOB(struct GameObject* go); 85 | 86 | VOID startLevelDisplay(ULONG level_num); 87 | 88 | #endif /* LEVEL_DISPLAY_H */ 89 | -------------------------------------------------------------------------------- /Code/display_loading.h: -------------------------------------------------------------------------------- 1 | #ifndef LOADING_DISPLAY_H 2 | #define LOADING_DISPLAY_H 3 | 4 | BOOL openLoadingDisplay(VOID); 5 | VOID closeLoadingDisplay(VOID); 6 | VOID startLoadingDisplay(VOID); 7 | VOID endLoadingDisplay(VOID); 8 | 9 | #endif /* LOADING_DISPLAY_H */ 10 | -------------------------------------------------------------------------------- /Code/display_menu.h: -------------------------------------------------------------------------------- 1 | #ifndef MENU_DISPLAY_H 2 | #define MENU_DISPLAY_H 3 | 4 | #define MENU_RV_ERROR 0 5 | #define MENU_RV_START 1 6 | #define MENU_RV_OPTIONS 2 7 | #define MENU_RV_QUIT 3 8 | 9 | #include "missing_hardware_defines.h" 10 | 11 | /****************************************************************************** 12 | * OPTIONS * 13 | ******************************************************************************/ 14 | #define MENU_SCREEN_WIDTH 320 15 | #define MENU_SCREEN_HEIGHT 256 16 | #define MENU_SCREEN_DEPTH 2 17 | 18 | #define MENU_SPR_FMODE 1 // Sprite fetch mode (1, 2 or 4) 19 | /****************************************************************************** 20 | * END OF OPTIONS * 21 | ******************************************************************************/ 22 | 23 | #define MENU_SCREEN_COLORS (1 << MENU_SCREEN_DEPTH) 24 | 25 | #if MENU_SPR_FMODE == 1 26 | #define MENU_FMODE_V 0x0 27 | #elif MENU_SPR_FMODE == 2 28 | #define MENU_FMODE_V (FMODE_SPR32) 29 | #elif MENU_SPR_FMODE == 4 30 | #define MENU_FMODE_V (FMODE_SPR32 | FMODE_SPAGEM) 31 | #endif 32 | 33 | VOID MD_blitBOB(struct GameObject* go); 34 | VOID MD_unBlitBOB(struct GameObject* go); 35 | ULONG startMenuDisplay(VOID); 36 | 37 | #endif /* MENU_DISPLAY_H */ 38 | -------------------------------------------------------------------------------- /Code/display_splash.h: -------------------------------------------------------------------------------- 1 | #ifndef SPLASH_DISPLAY_H 2 | #define SPLASH_DISPLAY_H 3 | 4 | VOID showSplashDisplay(VOID); 5 | 6 | #endif /* SPLASH_DISPLAY_H */ 7 | -------------------------------------------------------------------------------- /Code/fonts.h: -------------------------------------------------------------------------------- 1 | #ifndef FONTS_H 2 | #define FONTS_H 3 | 4 | //TO ACCESS LOADED FONTS ADD THESE LINE INTO YOUR .c FILE: 5 | // extern struct TextFont* textFonts[NUM_TEXTFONTS]; 6 | // extern struct GameFont* gameFonts[NUM_GAMEFONTS]; 7 | 8 | #include "settings.h" 9 | 10 | #define GF_TYPE_FIXED 0 11 | #define GF_TYPE_PROPORTIONAL 1 12 | 13 | struct GameFont { 14 | struct BitMap* bitmap; 15 | struct BitMap* mask; 16 | UBYTE type; 17 | UBYTE width; 18 | UBYTE height; 19 | UBYTE spacing; 20 | UBYTE start; 21 | UBYTE end; 22 | struct { 23 | UWORD offset; 24 | }letter[0]; 25 | }; 26 | 27 | BOOL openFonts(VOID); 28 | VOID closeFonts(VOID); 29 | ULONG GF_TextLength(struct GameFont* gf, STRPTR str, ULONG count); 30 | VOID GF_Text(struct RastPort* rp, struct GameFont* gf, STRPTR str, ULONG count); 31 | struct BitMap* createBltMasks(struct BitMap* bm); 32 | 33 | #endif /* FONTS_H */ 34 | 35 | /* 36 | STRIP FONT FILE FORMAT DESIGN: 37 | "GAMEFONT" // eight char identifier 38 | "Stripname.iff" // filename string to strip image (NULL terminated) 39 | UBYTE type // fixed or proportional (0/1) 40 | UBYTE width // width for fixed (width of space char for proportional) 41 | UBYTE height // height of the gamefont 42 | UBYTE spacing // space between every letter 43 | UBYTE start // how many letters this strip contains beginning from... 44 | UBYTE end // ..ascii start to ascii end! 45 | // file ends here for type fixed 46 | // for proportional: 47 | struct { 48 | UWORD offset; 49 | }letter[end - start + 2]; 50 | */ 51 | -------------------------------------------------------------------------------- /Code/functions.h: -------------------------------------------------------------------------------- 1 | #ifndef FUNCTIONS_H 2 | #define FUNCTIONS_H 3 | 4 | #include "anims.h" 5 | #include "collisions.h" 6 | 7 | #endif /* FUNCTIONS_H */ 8 | -------------------------------------------------------------------------------- /Code/input.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * NOTE: We need to write a better implementation that gathers all the data * 3 | * from both joystick ports in one go. * 4 | * NOTE: Also imagine a game genre like Street Fighter in which you have to * 5 | * read joystick events multiple times each frame and also buffer them. This * 6 | * would require a completely different implementation. * 7 | ******************************************************************************/ 8 | #include 9 | #include 10 | #include 11 | 12 | #include "input.h" 13 | 14 | extern struct Custom custom; 15 | extern struct CIA ciaa, ciab; 16 | 17 | ///readMouse(port) 18 | /****************************************************************************** 19 | * Reads the hardware registers of the given joystick port for mouse state. * 20 | * Returns the state packed in an ULONG value. Individual state values can be * 21 | * accessed by casting the returned ULONG to a struct MouseState. * 22 | * NOTE: Reported to not work on some emulators. * 23 | ******************************************************************************/ 24 | ULONG readMouse(ULONG port) 25 | { 26 | static BYTE old_x = 0; 27 | static BYTE old_y = 0; 28 | BYTE x; 29 | BYTE y; 30 | UWORD joydat; 31 | UWORD pot; 32 | ULONG retval = 0; 33 | struct MouseState* mouseState = (struct MouseState*)&retval; 34 | 35 | custom.potgo = 0xFF00; 36 | pot = custom.potinp; 37 | 38 | if (port) { 39 | //Read the second port (the joystick port) of the Amiga 40 | joydat = custom.joy1dat; 41 | mouseState->buttons |= (ciaa.ciapra & 0x0080) ? 0 : LEFT_MOUSE_BUTTON; 42 | mouseState->buttons |= (pot & 0x1000) ? 0 : MIDDLE_MOUSE_BUTTON; 43 | mouseState->buttons |= (pot & 0x4000) ? 0 : RIGHT_MOUSE_BUTTON; 44 | } 45 | else { 46 | joydat = custom.joy0dat; 47 | mouseState->buttons |= (ciaa.ciapra & 0x0040) ? 0 : LEFT_MOUSE_BUTTON; 48 | mouseState->buttons |= (pot & 0x0100) ? 0 : MIDDLE_MOUSE_BUTTON; 49 | mouseState->buttons |= (pot & 0x0400) ? 0 : RIGHT_MOUSE_BUTTON; 50 | } 51 | 52 | x = joydat & 0x00FF; 53 | mouseState->deltaX = x - old_x; 54 | old_x = x; 55 | 56 | y = joydat >> 8; 57 | mouseState->deltaY = y - old_y; 58 | old_y = y; 59 | 60 | return retval; 61 | } 62 | /// 63 | -------------------------------------------------------------------------------- /Code/input.h: -------------------------------------------------------------------------------- 1 | #ifndef INPUT_H 2 | #define INPUT_H 3 | 4 | //for joystick on port 0 (mouse port) a = 0 5 | //for joystick on port 1 (joystick port) a = 1 6 | #define JOY_LEFT(a) (custom.joy##a##dat & 512) 7 | #define JOY_RIGHT(a) (custom.joy##a##dat & 2) 8 | #define JOY_UP(a) (((custom.joy##a##dat << 1) ^ custom.joy##a##dat) & 512) 9 | #define JOY_DOWN(a) (((custom.joy##a##dat << 1) ^ custom.joy##a##dat) & 2) 10 | #define JOY_BUTTON1(a) !(ciaa.ciapra & (a ? 0x0080 : 0x0040)) 11 | #define JOY_BUTTON2(a) !(custom.potinp & (a ? 0x4000 : 0x0400)) 12 | 13 | #define LEFT_MOUSE_BUTTON 1 14 | #define MIDDLE_MOUSE_BUTTON 2 15 | #define RIGHT_MOUSE_BUTTON 4 16 | 17 | #define UL_VALUE(a) (*(ULONG*)&a) 18 | 19 | struct MouseState { 20 | UBYTE buttons; 21 | UBYTE pad; 22 | BYTE deltaX; 23 | BYTE deltaY; 24 | }; 25 | 26 | ULONG readMouse(ULONG); 27 | 28 | #endif /* INPUT_H */ 29 | -------------------------------------------------------------------------------- /Code/keyboard.c: -------------------------------------------------------------------------------- 1 | ///defines 2 | #define MATRIX_SIZE 16UL 3 | /// 4 | ///includes 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include "keyboard.h" 16 | /// 17 | ///globals 18 | static struct MsgPort *keyMP = NULL; 19 | static struct IORequest* keyIO = NULL; 20 | static UBYTE keyMatrix[MATRIX_SIZE] = {0}; 21 | static BOOL device_ok = FALSE; 22 | /// 23 | 24 | /// setKeyboardAccess() 25 | /**************************************************** 26 | * Creates an IORequest to query the keyboard state * 27 | ****************************************************/ 28 | BOOL setKeyboardAccess(VOID) 29 | { 30 | struct IOStdReq* ioStdReq = NULL; 31 | 32 | if ((keyMP = CreatePort(NULL, NULL))) { 33 | if ((ioStdReq = (struct IOStdReq*)CreateExtIO(keyMP, sizeof(struct IOStdReq)))) { 34 | keyIO = (struct IORequest*)ioStdReq; 35 | if (!OpenDevice("keyboard.device", NULL, keyIO, NULL)) { 36 | device_ok = TRUE; 37 | ioStdReq->io_Command = KBD_READMATRIX; 38 | ioStdReq->io_Data = (APTR)keyMatrix; 39 | ioStdReq->io_Length = MATRIX_SIZE; 40 | return TRUE; 41 | } 42 | else 43 | puts("Error: Could not open keyboard.device!"); 44 | } 45 | else 46 | puts("Error: Could not create I/O request!"); 47 | } 48 | else 49 | puts("Error: Could not create message port!"); 50 | 51 | endKeyboardAccess(); 52 | return FALSE; 53 | } 54 | /// 55 | /// endKeyboardAccess() 56 | VOID endKeyboardAccess() 57 | { 58 | if (device_ok) CloseDevice(keyIO); 59 | if (keyIO) DeleteExtIO(keyIO); 60 | if (keyMP) DeletePort(keyMP); 61 | } 62 | /// 63 | /// doKeyboardIO() 64 | VOID doKeyboardIO() 65 | { 66 | DoIO(keyIO); 67 | } 68 | /// 69 | /// keyState(rawkey) 70 | BOOL keyState(UBYTE rawkey) 71 | { 72 | UBYTE bit = 0x01; 73 | // rawkey / 8 rawkey % 8 74 | return (BOOL)(keyMatrix[rawkey >> 3] & (bit << (rawkey & 0x7))); 75 | } 76 | /// 77 | -------------------------------------------------------------------------------- /Code/keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef KEYBOARD_H 2 | #define KEYBOARD_H 3 | 4 | //Amiga Raw Key Codes 5 | #define RAW_GRAVE 0x00 6 | #define RAW_1 0x01 7 | #define RAW_2 0x02 8 | #define RAW_3 0x03 9 | #define RAW_4 0x04 10 | #define RAW_5 0x05 11 | #define RAW_6 0x06 12 | #define RAW_7 0x07 13 | #define RAW_8 0x08 14 | #define RAW_9 0x09 15 | #define RAW_0 0x0A 16 | #define RAW_HYPHEN 0x0B 17 | #define RAW_EQUALS 0x0C 18 | #define RAW_OR 0x0D 19 | #define RAW_NUM_0 0x0F 20 | #define RAW_Q 0x10 21 | #define RAW_W 0x11 22 | #define RAW_E 0x12 23 | #define RAW_R 0x13 24 | #define RAW_T 0x14 25 | #define RAW_Y 0x15 26 | #define RAW_U 0x16 27 | #define RAW_I 0x17 28 | #define RAW_O 0x18 29 | #define RAW_P 0x19 30 | #define RAW_BRACKET_L 0x1A 31 | #define RAW_BRACKET_R 0x1B 32 | #define RAW_NUM_1 0x1D 33 | #define RAW_NUM_2 0x1E 34 | #define RAW_NUM_3 0x1F 35 | #define RAW_A 0x20 36 | #define RAW_S 0x21 37 | #define RAW_D 0x22 38 | #define RAW_F 0x23 39 | #define RAW_G 0x24 40 | #define RAW_H 0x25 41 | #define RAW_J 0x26 42 | #define RAW_K 0x27 43 | #define RAW_L 0x28 44 | #define RAW_SEMICOLON 0x29 45 | #define RAW_QUOTE 0x2A 46 | #define RAW_NUM_4 0x2D 47 | #define RAW_NUM_5 0x2E 48 | #define RAW_NUM_6 0x2F 49 | #define RAW_Z 0x31 50 | #define RAW_X 0x32 51 | #define RAW_C 0x33 52 | #define RAW_V 0x34 53 | #define RAW_B 0x35 54 | #define RAW_N 0x36 55 | #define RAW_M 0x37 56 | #define RAW_COMMA 0x38 57 | #define RAW_PERIOD 0x39 58 | #define RAW_SLASH 0x3A 59 | #define RAW_NUM_DOT 0x3C 60 | #define RAW_NUM_7 0x3D 61 | #define RAW_NUM_8 0x3E 62 | #define RAW_NUM_9 0x3F 63 | #define RAW_SPACE 0x40 64 | #define RAW_BACKSPACE 0x41 65 | #define RAW_TAB 0x42 66 | #define RAW_NUM_ENTER 0x43 67 | #define RAW_RETURN 0x44 68 | #define RAW_ESC 0x45 69 | #define RAW_DEL 0x46 70 | #define RAW_NUM_MINUS 0x4A 71 | #define RAW_UP 0x4C 72 | #define RAW_DOWN 0x4D 73 | #define RAW_RIGHT 0x4E 74 | #define RAW_LEFT 0x4F 75 | #define RAW_F1 0x50 76 | #define RAW_F2 0x51 77 | #define RAW_F3 0x52 78 | #define RAW_F4 0x53 79 | #define RAW_F5 0x54 80 | #define RAW_F6 0x55 81 | #define RAW_F7 0x56 82 | #define RAW_F8 0x57 83 | #define RAW_F9 0x58 84 | #define RAW_F10 0x59 85 | #define RAW_NUM_PAR_L 0x5A 86 | #define RAW_NUM_PAR_R 0x5B 87 | #define RAW_NUM_DIV 0x5C 88 | #define RAW_NUM_MUL 0x5D 89 | #define RAW_NUM_PLUS 0x5E 90 | #define RAW_HELP 0x5F 91 | #define RAW_SHIFT_L 0x60 92 | #define RAW_SHIFT_R 0x61 93 | #define RAW_CAPSLOCK 0x62 94 | #define RAW_CTRL 0x63 95 | #define RAW_ALT_L 0x64 96 | #define RAW_ALT_R 0x65 97 | #define RAW_AMIGA_L 0x66 98 | #define RAW_AMIGA_R 0x67 99 | 100 | BOOL setKeyboardAccess(VOID); 101 | VOID endKeyboardAccess(VOID); 102 | VOID doKeyboardIO(VOID); 103 | BOOL keyState(UBYTE); 104 | 105 | #endif /* KEYBOARD_H */ 106 | -------------------------------------------------------------------------------- /Code/level.h: -------------------------------------------------------------------------------- 1 | #ifndef LEVEL_H 2 | #define LEVEL_H 3 | 4 | #define NUM_LEVELS 2 5 | 6 | //TO ACCESS CURRENT LEVEL ADD THIS LINE INTO YOUR .c FILE: 7 | //extern struct Level current_level; 8 | 9 | #include "system.h" 10 | #include "diskio.h" 11 | #include "tilemap.h" 12 | #include "tiles.h" 13 | #include "audio.h" 14 | #include "color.h" 15 | #include "gameobject.h" 16 | 17 | struct LevelData { 18 | STRPTR name; 19 | STRPTR* tilesets; 20 | STRPTR* tilemaps; 21 | STRPTR* bob_sheets; 22 | STRPTR* sprite_banks; 23 | STRPTR* music_modules; 24 | STRPTR* sound_samples; 25 | UBYTE** palettes; 26 | STRPTR* gameobject_banks; 27 | STRPTR* bitmaps; 28 | VOID (*blitBOBFunc)(struct GameObject*); 29 | VOID (*unBlitBOBFunc)(struct GameObject*); 30 | UWORD screen_width; 31 | UWORD screen_height; 32 | LONG initial_mapPosX; 33 | LONG initial_mapPosY; 34 | }; 35 | 36 | struct Level { 37 | struct TileSet** tileset; 38 | struct TileMap** tilemap; 39 | struct BOBSheet** bob_sheet; 40 | struct SpriteBank** sprite_bank; 41 | struct PT_Module** music_module; 42 | struct SfxStructure** sound_sample; 43 | struct ColorTable** color_table; 44 | struct BOBImage** bobImage; 45 | struct SpriteImage** spriteImage; 46 | struct GameObjectBank** gameobject_bank; 47 | struct BitMap** bitmap; 48 | LONG initial_mapPosX; 49 | LONG initial_mapPosY; 50 | struct { 51 | UBYTE tilesets; 52 | UBYTE tilemaps; 53 | UBYTE bob_sheets; 54 | UBYTE sprite_banks; 55 | UBYTE music_modules; 56 | UBYTE sound_samples; 57 | UBYTE color_tables; 58 | UBYTE gameobject_banks; 59 | UBYTE bitmaps; 60 | UWORD bobImages; 61 | UWORD spriteImages; 62 | }num; 63 | struct { 64 | UBYTE tileset; 65 | UBYTE tilemap; 66 | UBYTE music_module; 67 | UBYTE color_table; 68 | UWORD gameobject_bank; 69 | }current; 70 | }; 71 | 72 | struct Level* loadLevel(ULONG num); 73 | VOID unloadLevel(VOID); 74 | 75 | #endif /* LEVEL_H */ 76 | -------------------------------------------------------------------------------- /Code/level_display_gradients.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * WARNING: This file is not to be compiled to its own module. It is just * 3 | * inculed by display_level.c. * 4 | * Only use globals from display_level.c and do NOT declare new globals here! * 5 | ******************************************************************************/ 6 | #define GRADIENT_HEIGHT SCREEN_HEIGHT 7 | #define GRADIENT_COLOR_REG 0 // Between 0 and 31 8 | #define NUM_GRADIENTS 2 // One extra for the NULL termination! 9 | 10 | STATIC BOOL prepGradients(ULONG level_num) 11 | { 12 | BOOL retval = TRUE; 13 | #include "level_display_gradients.h" 14 | 15 | /* 16 | switch (level_num) { 17 | case 1: 18 | { 19 | static struct Gradient* grad_list[NUM_GRADIENTS] = {0}; 20 | #ifdef CT_AGA 21 | grad_list[0] = createGradient(GRD_TYPE_AGA, GRADIENT_COLOR_REG, GRADIENT_HEIGHT, 0, GRADIENT_HEIGHT, 0, GRD_BLITABLE, example_huelist); 22 | #else 23 | grad_list[0] = createGradient(GRD_TYPE_OCS, GRADIENT_COLOR_REG, GRADIENT_HEIGHT, 0, GRADIENT_HEIGHT, 0, GRD_BLITABLE, example_huelist); 24 | #endif 25 | 26 | //Init the color_table of the gradient 27 | grad_list[0]->color_table = newColorTable_GRD(grad_list[0], CT_DEFAULT_STEPS, 0); 28 | grad_list[0]->color_table->state = CT_FADE_IN; 29 | 30 | #if BOTTOM_PANEL_HEIGHT > 0 31 | rainbow = createRainbow(grad_list, end_Instructions); 32 | #else 33 | rainbow = createRainbow(grad_list, NULL); 34 | #endif 35 | 36 | if (!rainbow) { 37 | retval = FALSE; 38 | } 39 | } 40 | break; 41 | } 42 | */ 43 | 44 | return retval; 45 | } 46 | 47 | STATIC VOID freeGradients() 48 | { 49 | if (rainbow) { 50 | if (rainbow->gradList) { 51 | struct Gradient** g = rainbow->gradList; 52 | 53 | while (*g) { 54 | freeGradient(*g); 55 | *g = NULL; 56 | g++; 57 | } 58 | } 59 | 60 | freeRainbow(rainbow); rainbow = NULL; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Code/level_display_gradients.h: -------------------------------------------------------------------------------- 1 | STATIC UBYTE example_huelist[] = {1, 2 | 0, 0, 0, 3 | 255, 255, 255}; 4 | -------------------------------------------------------------------------------- /Code/level_display_loop.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * WARNING: This file is not to be compiled to its own module. It is just * 3 | * inculed by display_level.c. * 4 | * Only use globals from display_level.c and do NOT declare new globals here * 5 | ******************************************************************************/ 6 | STATIC VOID levelDisplayLoop() 7 | { 8 | UWORD quitting = FALSE; 9 | struct ScrollInfo si = {0}; 10 | struct MouseState ms = {0}; 11 | 12 | while (TRUE) { 13 | UWORD pixels; 14 | 15 | #ifdef DYNAMIC_COPPERLIST 16 | if (new_frame_flag % 2) { 17 | //Unsync detected. Re-scync with the copperlist set by the copper 18 | if (CopperList == CopperList1) 19 | CopperList = CopperList2; 20 | else 21 | CopperList = CopperList1; 22 | } 23 | #endif //DYNAMIC_COPPERLIST 24 | new_frame_flag = 1; 25 | 26 | doKeyboardIO(); 27 | UL_VALUE(ms) = readMouse(0); 28 | 29 | if (keyState(RAW_ESC) && !quitting) { 30 | quitting = TRUE; 31 | color_table->state = CT_FADE_OUT; 32 | volume_table.state = PTVT_FADE_OUT; 33 | } 34 | if (quitting == TRUE && color_table->state == CT_IDLE && volume_table.state == PTVT_IDLE) { 35 | break; 36 | } 37 | 38 | if (UL_VALUE(ms)) { 39 | if (ms.deltaX > 0) si.right = ms.deltaX; 40 | if (ms.deltaX < 0) si.left = -ms.deltaX; 41 | if (ms.deltaY > 0) si.down = ms.deltaY; 42 | if (ms.deltaY < 0) si.up = -ms.deltaY; 43 | } 44 | else { 45 | if (JOY_BUTTON1(1) || keyState(RAW_CTRL)) pixels = MAX_SCROLL_SPEED; else pixels = 1; 46 | 47 | if (JOY_UP(1) || keyState(RAW_UP)) si.up = pixels; 48 | if (JOY_DOWN(1) || keyState(RAW_DOWN)) si.down = pixels; 49 | if (JOY_LEFT(1) || keyState(RAW_LEFT)) si.left = pixels; 50 | if (JOY_RIGHT(1) || keyState(RAW_RIGHT)) si.right = pixels; 51 | } 52 | 53 | scroll(&si); 54 | 55 | updateVolume(); 56 | updateColorTable_Partial(color_table, 1, color_table->colors); 57 | updateGameObjects(); 58 | #ifdef DYNAMIC_COPPERLIST 59 | updateDynamicCopperList(); 60 | #endif 61 | // *(WORD*)0xDFF180 = 0; //DEBUG (displays performance of the above algorithms) 62 | updateBOBs(); 63 | 64 | //Wait until current frame completes 65 | waitTOF(); 66 | 67 | //blit the remaining secondPart tiles first thing on the next frame 68 | scrollRemaining(&si); 69 | 70 | // *(WORD*)0xDFF180 = 0x0F00; //DEBUG (displays performance of the above algorithms) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Code/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sevgi_Engine projects (gcc) 2 | 3 | EXE = sevgi_engine 4 | ################################################################################ 5 | CPU = -m68020 6 | AS = vasm 7 | CC = m68k-amigaos-gcc -c 8 | LD = m68k-amigaos-gcc -o 9 | OPTIONS = -DNO_INLINE_STDARG 10 | LFLAGS = -s -noixemul -lamiga 11 | ################################################################################ 12 | # Common options 13 | WARNINGS = -Wall 14 | OPTIMIZE = -Os 15 | DEBUG = 16 | IDIRS = 17 | 18 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 19 | AFLAGS = -Faout $(CPU) 20 | 21 | DEPS = assets.h palettes.h settings.h version.h 22 | 23 | OBJS = main.o system.o keyboard.o input.o display.o diskio.o fonts.o \ 24 | display_level.o display_loading.o display_menu.o display_splash.o \ 25 | color.o rainbow.o tiles.o tilemap.o \ 26 | audio.o ptplayer.o \ 27 | gameobject.o physics.o level.o anims.o collisions.o 28 | ################################################################################ 29 | 30 | # target 'all' (default target) 31 | all : $(EXE) 32 | 33 | # $@ matches the target; $< matches the first dependent 34 | main.o : main.c version.h 35 | $(CC) $< $(CFLAGS) 36 | 37 | audio.o : audio.c audio.h settings.h 38 | $(CC) $< $(CFLAGS) 39 | 40 | color.o : color.c color.h settings.h 41 | $(CC) $< $(CFLAGS) 42 | 43 | diskio.o : diskio.c diskio.h settings.h 44 | $(CC) $< $(CFLAGS) 45 | 46 | display_level.o : display_level.c level_display_loop.c level_display_gradients.c level_display_gradients.h display_level.h anims.h collisions.h settings.h 47 | $(CC) $< $(CFLAGS) 48 | 49 | display_loading.o : display_loading.c display_loading.h settings.h 50 | $(CC) $< $(CFLAGS) 51 | 52 | display_menu.o : display_menu.c display_menu.h settings.h 53 | $(CC) $< $(CFLAGS) 54 | 55 | display_splash.o : display_splash.c display_splash.h version.h 56 | $(CC) $< $(CFLAGS) 57 | 58 | fonts.o : fonts.c fonts.h assets.h settings.h 59 | $(CC) $< $(CFLAGS) 60 | 61 | gameobject.o : gameobject.c gameobject.h anims.h collisions.h settings.h 62 | $(CC) $< $(CFLAGS) 63 | 64 | level.o : level.c level.h assets.h settings.h palettes.h 65 | $(CC) $< $(CFLAGS) 66 | 67 | ptplayer.o : ptplayer.asm 68 | $(AS) $(AFLAGS) -o $@ $< 69 | 70 | rainbow.o : rainbow.c rainbow.h settings.h 71 | $(CC) $< $(CFLAGS) 72 | 73 | tiles.o : tiles.c tiles.h settings.h 74 | $(CC) $< $(CFLAGS) 75 | 76 | $(EXE) : $(OBJS) 77 | $(LD) $(EXE) $(OBJS) $(LFLAGS) 78 | 79 | # target 'clean' 80 | clean: 81 | rm -f $(EXE) 82 | rm -f $(OBJS) 83 | rm -f ./fonts/fontcache 84 | find . -name '*.uaem' -delete 85 | -------------------------------------------------------------------------------- /Code/missing_hardware_defines.h: -------------------------------------------------------------------------------- 1 | #ifndef MISSING_HARDWARE_DEFINES_H 2 | #define MISSING_HARDWARE_DEFINES_H 3 | 4 | #define CLR_ALL 0x7FFF 5 | 6 | #define BPLCON0_HIRES 0x8000 7 | #define BPLCON0_BPU0 0x1000 8 | #define BPLCON0_DBLPF 0x0400 9 | #define BPLCON0_COLOR 0x0200 10 | #define BPLCON0_BPU3 0x0010 11 | #define BPLCON0_LACE 0x0004 12 | #define BPLCON0_ECSENA 0x0001 13 | #define BPLCON3_LOCT 0x0200 14 | 15 | #define VPOS_LOF 0x8000 16 | 17 | #define FMODE_BLP32 0x0001 18 | #define FMODE_BPAGEM 0x0002 19 | #define FMODE_SPR32 0x0004 20 | #define FMODE_SPAGEM 0x0008 21 | #define FMODE_BSCAN2 0x4000 22 | #define FMODE_SSCAN2 0x8000 23 | 24 | #endif /* MISSING_HARDWARE_DEFINES_H */ 25 | -------------------------------------------------------------------------------- /Code/palettes.h: -------------------------------------------------------------------------------- 1 | STATIC UBYTE palette_0_0[] = {3, 2 | 0, 0, 0, 3 | 121, 121, 121, 4 | 180, 180, 180, 5 | 255, 255, 255}; 6 | -------------------------------------------------------------------------------- /Code/physics.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "gameobject.h" 8 | #include "physics.h" 9 | /// 10 | 11 | //IMPLEMENT YOUR PHYSICS FUNCTIONS HERE 12 | -------------------------------------------------------------------------------- /Code/physics.h: -------------------------------------------------------------------------------- 1 | #ifndef PHYSICS_H 2 | #define PHYSICS_H 3 | 4 | #define GRAVITY 10 5 | 6 | struct Physics { 7 | BYTE velocity_x; 8 | BYTE velocity_y; 9 | WORD mass; 10 | WORD elasticity; 11 | WORD friction; 12 | WORD spin; 13 | //...etc... 14 | }; 15 | 16 | //PROTOTYPES FOR YOU PHYSICS FUNCTIONS BELOW 17 | 18 | #endif /* PHYSICS_H */ 19 | -------------------------------------------------------------------------------- /Code/rainbow.h: -------------------------------------------------------------------------------- 1 | #ifndef RAINBOW_H 2 | #define RAINBOW_H 3 | 4 | #include "display_level.h" 5 | #include "color.h" 6 | 7 | //Gradient flags 8 | #define GRD_SCROLLABLE 0x01 9 | #define GRD_MOVABLE 0x02 10 | #define GRD_BLITABLE 0x03 11 | #define GRD_DITHERED 0x04 12 | 13 | struct CopOp { 14 | UWORD wait; 15 | UWORD size; // number of instructions in the CopOp (WARNING: NOT byte size!) 16 | ULONG* pointer; // pointer to the actual copper list instruction in chipram 17 | }; 18 | 19 | struct Rainbow { 20 | UWORD num_ops; // Number of rainbow CopOps 21 | UWORD num_insts; // list_size can be determined with num_insts * 4 22 | ULONG blitable; // Has movable and/or scrollable gradients 23 | ULONG* list; // In word aligned chipram 24 | struct Gradient** gradList; // createRainbow fills this as a back pointer 25 | UBYTE correspondance[SCREEN_HEIGHT]; 26 | struct CopOp copOps[0]; 27 | }; 28 | 29 | struct Rainbow* newRainbow(UWORD num_ops, UWORD op_size, UWORD num_insts, BOOL blitable, UWORD num_end_insts); 30 | struct Rainbow* createEmptyRainbow(VOID); 31 | struct Rainbow* createRainbow(struct Gradient**, ULONG* end_insts); 32 | VOID freeRainbow(struct Rainbow*); 33 | VOID updateRainbow(struct Rainbow*); 34 | 35 | struct Gradient* createGradient(UBYTE type, UBYTE col_reg, UWORD num_colors, UWORD scr_pos, UWORD vis, UWORD pos, ULONG flags, UBYTE* huelist); 36 | VOID scrollGradientUp(struct Gradient* grd, UWORD pixels); 37 | VOID scrollGradientDown(struct Gradient* grd, UWORD pixels); 38 | VOID setGradientScrollPos(struct Gradient* grd, UWORD pos); 39 | VOID moveGradient(struct Gradient* grd, UWORD scr_pos); 40 | VOID freeGradient(struct Gradient*); 41 | 42 | #endif /* RAINBOW_H */ 43 | -------------------------------------------------------------------------------- /Code/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_H 2 | #define SETTINGS_H 3 | 4 | /****************************************************************************** 5 | * VIDEO * 6 | ******************************************************************************/ 7 | 8 | //Un-comment if you wrote a custom display_level.c which is not compatible with Sevgi_Editor 9 | //#define CUSTOM_LEVEL_DISPLAY 10 | 11 | #ifdef CUSTOM_LEVEL_DISPLAY 12 | #include "custom_display_settings.h" 13 | #else 14 | //Un-comment to activate 24bit AGA color features. 15 | //#define CT_AGA 16 | //Set the default fade in/out speed. Smaller is faster. (2-256) 17 | #define CT_DEFAULT_STEPS 64 18 | 19 | //Un-comment to activate per-frame dynamic copperlist generation. 20 | //#define DYNAMIC_COPPERLIST 21 | //Un-comment to activate smart sprite algorithms. 22 | //#define SMART_SPRITES 23 | //Un-comment to activate dual-playfield mode. 24 | //#define DUALPLAYFIELD 25 | //Select bitplane and sprite fetch modes 26 | #define BPL_FMODE 1 // Bitplane fetch mode (1, 2 or 4) 27 | #define SPR_FMODE 1 // Sprite fetch mode (1, 2 or 4) 28 | 29 | #define TOP_PANEL_HEIGHT 0 30 | #define BOTTOM_PANEL_HEIGHT 0 31 | 32 | #define SCREEN_WIDTH 320 // Visible resolution of the level screen 33 | #define SCREEN_HEIGHT 256 // " " " " " " 34 | #define SCR_WIDTH_EXTRA 64 // Additional horizontal pixels for scroll 35 | #define SCR_HEIGHT_EXTRA 32 // Additional vertical pixels for scroll (2 extra tiles) 36 | #define SCREEN_DEPTH 6 // How many bitplanes (1-6 on OCS/ECS, 1-8 on AGA) 37 | 38 | //Set these to valid values in DUALPLAYFIELD mode 39 | #define BITMAP_DEPTH_PF2 5 40 | #define BITMAP_HEIGHT_PF2 256 41 | 42 | #endif //CUSTOM_LEVEL_DISPLAY 43 | 44 | /****************************************************************************** 45 | * AUDIO * 46 | ******************************************************************************/ 47 | 48 | #define PAULA_PAL_CYCLES 3546895 49 | #define PAULA_NTSC_CYCLES 3579545 50 | #define PAULA_MIN_PERIOD 124 51 | 52 | //Set PAL/NTSC 53 | #define PAULA_CYCLES PAULA_PAL_CYCLES 54 | //Set the default module playback volume. (0-64) 55 | #define PTVT_DEFAULT_VOLUME 64 56 | //Set the default audio fade in/out speed. Smaller is faster. (1-256) 57 | #define PTVT_DEFAULT_STEPS 64 58 | //Default playback volume for sound samples (0-64) 59 | #define SFX_DEFAULT_VOLUME 64 60 | //Default playback channel for sound samples (0-3 / -1 for best avail. channel) 61 | #define SFX_DEFAULT_CHANNEL -1 62 | //Default playback priority for sound samples (1-127) 63 | #define SFX_DEFAULT_PRIORITY 1 64 | 65 | /****************************************************************************** 66 | * FONTS * 67 | ******************************************************************************/ 68 | 69 | #define NUM_TEXTFONTS 1 // Number of Amiga TextFonts to load 70 | #define TF_DEFAULT 0 // Index of the first loaded TextFont 71 | 72 | #define NUM_GAMEFONTS 1 // Number of GameFonts to load 73 | #define GF_DEFAULT 0 // Index of the first loaded GameFont 74 | 75 | /****************************************************************************** 76 | * GAMEOBJECTS * 77 | ******************************************************************************/ 78 | 79 | #define NUM_SPRITES 8 80 | #define NUM_BOBS 10 81 | #define NUM_GAMEOBJECTS 0 82 | 83 | #define SMALL_IMAGE_SIZES 84 | //#define BIG_IMAGE_SIZES 85 | //#define SMALL_HITBOX_SIZES 86 | 87 | #endif /* SETTINGS_H */ 88 | -------------------------------------------------------------------------------- /Code/sevgi.h: -------------------------------------------------------------------------------- 1 | #ifndef SEVGI_H 2 | #define SEVGI_H 3 | 4 | #include "settings.h" 5 | #include "system.h" 6 | #include "keyboard.h" 7 | #include "input.h" 8 | #include "tiles.h" 9 | #include "tilemap.h" 10 | #include "color.h" 11 | #include "audio.h" 12 | #include "fonts.h" 13 | #include "gameobject.h" 14 | #include "display.h" 15 | #include "level.h" 16 | #include "diskio.h" 17 | #include "display_splash.h" 18 | #include "display_loading.h" 19 | #include "display_menu.h" 20 | #include "display_level.h" 21 | #include "functions.h" 22 | 23 | #endif /* SEVGI_H */ 24 | -------------------------------------------------------------------------------- /Code/system.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSTEM_H 2 | #define SYSTEM_H 3 | 4 | #include "missing_hardware_defines.h" 5 | 6 | /****************************************************************************** 7 | * The global variable "chipset" will hold one of the values below. * 8 | * To access from other .c files, declare as: * 9 | * extern ULONG chipset; * 10 | ******************************************************************************/ 11 | #define CHIPSET_OCS 0 12 | #define CHIPSET_ECS 1 13 | #define CHIPSET_AGA 2 14 | 15 | VOID detectChipset(VOID); 16 | BOOL takeOverSystem(VOID); 17 | VOID giveBackSystem(VOID); 18 | VOID WaitVBL(VOID); 19 | VOID waitVBeam(ULONG); 20 | VOID WaitVBeam(ULONG); 21 | VOID waitTOF(VOID); 22 | VOID busyWaitBlit(VOID); 23 | VOID setVBlankEvents(VOID (*function)(VOID)); 24 | VOID removeVBlankEvents(VOID); 25 | 26 | /****************************************************************************** 27 | * The macros below provide a non-blocking time delay check using the * 28 | * g_frame_counter. To use them you should declare a static ULONG variable to * 29 | * hold the rendezvous frame in your anim function and set it with one of the * 30 | * initDelay macros below. Then to test if the rendezvous time has come use * 31 | * testDelay() macro with your static declared variable. Example: * 32 | * * 33 | * animFunc(struct GameObject* go) * 34 | * { * 35 | * static ULONG anim_wait = 0; * 36 | * if (testDelay(anim_wait)) { * 37 | * // your animation routines * 38 | * anim_wait = initDelaySeconds(1); * 39 | * } * 40 | * } * 41 | * * 42 | * Your animation routines will be executed with one second intervals. * 43 | * NOTE: don't forget to import the frame_counter global in your .c file. as: * 44 | * extern volatile ULONG g_frame_counter; * 45 | ******************************************************************************/ 46 | #define initDelayFrames(f) (g_frame_counter + f) 47 | #define initDelaySeconds(s) (g_frame_counter + s * 50) //WARNING: This assumes a PAL system 48 | #define initDelayMinutes(m) (g_frame_counter + m * 300) //WARNING: This assumes a PAL system 49 | #define testDelay(r) (g_frame_counter >= r) 50 | 51 | #endif /* SYSTEM_H */ 52 | -------------------------------------------------------------------------------- /Code/tilemap.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | 6 | #include "tiles.h" 7 | #include "display_level.h" 8 | #include "tilemap.h" 9 | /// 10 | 11 | ///newTileMap(width, height) 12 | struct TileMap *newTileMap(ULONG width, ULONG height, UWORD scr_width, UWORD scr_height) 13 | { 14 | ULONG size = width * height; 15 | 16 | struct TileMap *map = AllocMem(sizeof(struct TileMap) + size * sizeof(TILEID), MEMF_ANY); 17 | if (map) 18 | { 19 | ULONG actualMapWidthInPixels = 0; 20 | ULONG actualMapHeightInPixels = 0; 21 | 22 | if (size) { 23 | actualMapWidthInPixels = (width - 1) * TILESIZE; 24 | actualMapHeightInPixels = (height - 1) * TILESIZE; 25 | } 26 | 27 | map->width = width; 28 | map->height = height; 29 | map->size = size; 30 | map->mapPosX = 0; 31 | map->mapPosY = 0; 32 | map->mapPosX2 = scr_width - 1; 33 | map->mapPosY2 = scr_height - 1; 34 | map->maxMapPosX = actualMapWidthInPixels > scr_width ? actualMapWidthInPixels - scr_width : 0; 35 | map->maxMapPosY = actualMapHeightInPixels > scr_height ? actualMapHeightInPixels - scr_height : 0; 36 | } 37 | 38 | return map; 39 | } 40 | /// 41 | ///disposeTileMap(map) 42 | VOID disposeTileMap(struct TileMap *map) 43 | { 44 | if (map) { 45 | FreeMem(map, sizeof(struct TileMap) + map->size * sizeof(TILEID)); 46 | } 47 | } 48 | /// 49 | -------------------------------------------------------------------------------- /Code/tilemap.h: -------------------------------------------------------------------------------- 1 | #ifndef TILEMAP_H 2 | #define TILEMAP_H 3 | 4 | #include "tiles.h" 5 | 6 | typedef UWORD TILEID; // Every tile ID is a 16 bit integer (65535 possible ID's) 7 | 8 | // Formula below calculates the tile ID at a given GameObject's map coordinate 9 | // To understand the +1's have look at loadTileMap() function 10 | #define TILEID_AT_COORD(m, x, y) (m->data[((((y) >> TILESIZE_BSMD) + 1) * m->width) + ((x) >> TILESIZE_BSMD) + 1]) 11 | 12 | struct TileMap { 13 | ULONG width; 14 | ULONG height; 15 | ULONG size; // how many tiles (width*height) 16 | LONG mapPosX; // The actual stored values for each map's... 17 | LONG mapPosY; // ...position displayed by the level_display... 18 | LONG mapPosX2; // ...which will update these values by its... 19 | LONG mapPosY2; // ...global pointers with the same name. 20 | LONG maxMapPosX; // The maximum values for map positions which... 21 | LONG maxMapPosY; // ...will restrict over scrolling. 22 | //struct TileSet *tileset; // tileset for this map //NOTE: Not yet implemented 23 | //struct GameObject *gameobjects; //NOTE: Not yet implemented 24 | TILEID data[0]; // an array of UWORDS that holds tile id's 25 | }; 26 | 27 | struct TileMap *newTileMap(ULONG width, ULONG height, UWORD scr_width, UWORD scr_height); 28 | VOID disposeTileMap(struct TileMap *map); 29 | 30 | #endif /* TILEMAP_H */ 31 | -------------------------------------------------------------------------------- /Code/tiles.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "tiles.h" 8 | /// 9 | 10 | ///newTileSet(size, friend) 11 | struct TileSet* newTileSet(ULONG size, struct BitMap *friend) 12 | { 13 | struct TileSet* tileset = (struct TileSet*)AllocMem(sizeof(struct TileSet), MEMF_ANY); 14 | 15 | if (tileset) { 16 | UBYTE* mem = AllocMem(sizeof(struct Tile) * size, MEMF_CHIP); 17 | if (mem) { 18 | tileset->size = size; 19 | tileset->tiles = (struct Tile*)mem; 20 | } 21 | else { 22 | FreeMem(tileset, sizeof(struct TileSet)); 23 | tileset = NULL; 24 | } 25 | } 26 | 27 | return tileset; 28 | } 29 | /// 30 | ///disposeTileSet(tileset) 31 | VOID disposeTileSet(struct TileSet* tileset) 32 | { 33 | if (tileset) { 34 | FreeMem((UBYTE*)tileset->tiles, sizeof(struct Tile) * tileset->size); 35 | FreeMem(tileset, sizeof(struct TileSet)); 36 | } 37 | } 38 | /// 39 | -------------------------------------------------------------------------------- /Code/tiles.h: -------------------------------------------------------------------------------- 1 | #ifndef TILES_H 2 | #define TILES_H 3 | 4 | #include "settings.h" 5 | 6 | #define TILESIZE 16 // Tiles are square so this stands for both TILEWIDTH and TILEHEIGHT 7 | //NOTE: This below being define limits the possibility of different depth tilesets within a game. 8 | #define TILEDEPTH SCREEN_DEPTH // How many bitplanes do the tiles have 9 | 10 | #if TILESIZE == 8 11 | #define TILESIZE_BSMD 3 // Bitshift multiplier/divider 12 | #define TILESIZE_MASK 0xFFFFFFF8L // Trims a coordinate to tile boundary 13 | typedef UBYTE TILEROW_t; 14 | #elif TILESIZE == 16 15 | #define TILESIZE_BSMD 4 // Bitshift multiplier/divider 16 | #define TILESIZE_MASK 0xFFFFFFF0L // Trims a coordinate to tile boundary 17 | typedef UWORD TILEROW_t; 18 | #elif TILESIZE == 32 19 | #define TILESIZE_BSMD 5 // Bitshift multiplier/divider 20 | #define TILESIZE_MASK 0xFFFFFFE0L // Trims a coordinate to tile boundary 21 | typedef ULONG TILEROW_t; 22 | #else 23 | #error Incorrect tilesize! 24 | #endif 25 | 26 | /* Non-Interleaved tile structure 27 | struct Tile { 28 | struct { 29 | TILEROW_t row[TILESIZE]; // Every plane has TILESIZE rows of 16 bits (pixels) each 30 | } plane[TILEDEPTH]; // Every tile has TILEDEPTH planes 31 | };*/ 32 | 33 | // Interleaved tile structure 34 | struct Tile { 35 | struct { 36 | TILEROW_t planeline[TILEDEPTH]; // Every row has TILEDEPTH planelines of 16 bits (pixels) each 37 | } row[TILESIZE]; // There are TILESIZE pixel rows in a tile 38 | }; 39 | 40 | struct TileSet { 41 | ULONG size; 42 | struct Tile* tiles; // pointer to tile raster data 43 | }; 44 | 45 | struct TileSet* newTileSet(ULONG size, struct BitMap *friend); 46 | VOID disposeTileSet(struct TileSet* tileset); 47 | 48 | #endif /* TILES_H */ 49 | -------------------------------------------------------------------------------- /Code/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #define ENGINE_NAME "Sevgi_Engine" 5 | #define ENGINE_VERSION 0 6 | #define ENGINE_REVISION 179 7 | #define ENGINE_VERSION_STRING "0.179" 8 | #define GAME_NAME "sevgi_engine" 9 | #define GAME_VERSION 0 10 | #define GAME_REVISION 1 11 | #define GAME_VERSION_STRING "0.1" 12 | 13 | #endif /* VERSION_H */ 14 | -------------------------------------------------------------------------------- /Docs.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Docs.info -------------------------------------------------------------------------------- /Docs/Sevgi_Editor.guide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Docs/Sevgi_Editor.guide -------------------------------------------------------------------------------- /Docs/Sevgi_Editor.guide.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Docs/Sevgi_Editor.guide.info -------------------------------------------------------------------------------- /Docs/Sevgi_Engine.guide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Docs/Sevgi_Engine.guide -------------------------------------------------------------------------------- /Docs/Sevgi_Engine.guide.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Docs/Sevgi_Engine.guide.info -------------------------------------------------------------------------------- /Docs/ptplayer_licence: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | 26 | -------------------------------------------------------------------------------- /Docs/ptplayer_licence.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Docs/ptplayer_licence.info -------------------------------------------------------------------------------- /Extras/Sevgi_Engine_Gameobject_Properties.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "color": "#ffa0a0a4", 4 | "drawFill": true, 5 | "id": 4, 6 | "members": [ 7 | { 8 | "name": "anim_frame", 9 | "type": "int", 10 | "value": 0 11 | }, 12 | { 13 | "name": "anim_func", 14 | "type": "int", 15 | "value": 0 16 | }, 17 | { 18 | "name": "anim_state", 19 | "type": "int", 20 | "value": 0 21 | }, 22 | { 23 | "name": "anim_type", 24 | "type": "int", 25 | "value": 0 26 | }, 27 | { 28 | "name": "bank", 29 | "type": "int", 30 | "value": 0 31 | }, 32 | { 33 | "name": "collide_func", 34 | "type": "int", 35 | "value": 0 36 | }, 37 | { 38 | "name": "collide_tile_func", 39 | "type": "int", 40 | "value": 0 41 | }, 42 | { 43 | "name": "hit_mask", 44 | "type": "int", 45 | "value": 0 46 | }, 47 | { 48 | "name": "image", 49 | "type": "int", 50 | "value": 0 51 | }, 52 | { 53 | "name": "me_mask", 54 | "type": "int", 55 | "value": 0 56 | }, 57 | { 58 | "name": "priority", 59 | "type": "int", 60 | "value": 0 61 | }, 62 | { 63 | "name": "state", 64 | "propertyType": "state", 65 | "type": "string", 66 | "value": "GOB_ALIVE" 67 | }, 68 | { 69 | "name": "type", 70 | "propertyType": "type", 71 | "type": "int", 72 | "value": 0 73 | } 74 | ], 75 | "name": "Gameobject", 76 | "type": "class", 77 | "useAs": [ 78 | "property", 79 | "object" 80 | ] 81 | }, 82 | { 83 | "id": 5, 84 | "name": "state", 85 | "storageType": "string", 86 | "type": "enum", 87 | "values": [ 88 | "GOB_ALIVE", 89 | "GOB_DEAD", 90 | "GOB_INACTIVE" 91 | ], 92 | "valuesAsFlags": false 93 | }, 94 | { 95 | "id": 7, 96 | "name": "type", 97 | "storageType": "int", 98 | "type": "enum", 99 | "values": [ 100 | "INVISIBLE_OBJECT", 101 | "SPRITE_OBJECT", 102 | "BOB_OBJECT" 103 | ], 104 | "valuesAsFlags": false 105 | } 106 | ] 107 | -------------------------------------------------------------------------------- /Extras/makefile_sas_c: -------------------------------------------------------------------------------- 1 | # Makefile for Sevgi_Engine projects (SAS/C) 2 | 3 | EXE = sevgi_engine 4 | ################################################################################ 5 | AS = sc:c/asm 6 | CC = sc:c/sc nolink 7 | LD = sc:c/sc link 8 | 9 | ################################################################################ 10 | CFLAGS = data=far NOSTKCHK 11 | 12 | ################################################################################ 13 | LFLAGS = 14 | 15 | ################################################################################ 16 | # target 'all' (default target) 17 | all : $(EXE) 18 | 19 | main.o : main.c version.h 20 | $(CC) $(CFLAGS) main.c 21 | 22 | anims.o : anims.c anims.h 23 | $(CC) $(CFLAGS) anims.c 24 | 25 | audio.o : audio.c audio.h settings.h 26 | $(CC) $(CFLAGS) audio.c 27 | 28 | collisions.o : collisions.c collisions.h 29 | $(CC) $(CFLAGS) collisions.c 30 | 31 | color.o : color.c color.h settings.h 32 | $(CC) $(CFLAGS) color.c 33 | 34 | diskio.o : diskio.c diskio.h settings.h 35 | $(CC) $(CFLAGS) diskio.c 36 | 37 | display_level.o : display_level.c level_display_loop.c level_display_gradients.c level_display_gradients.h display_level.h anims.h collisions.h settings.h 38 | $(CC) $(CFLAGS) display_level.c 39 | 40 | display_loading.o : display_loading.c display_loading.h settings.h 41 | $(CC) $(CFLAGS) display_loading.c 42 | 43 | display_menu.o : display_menu.c display_menu.h settings.h 44 | $(CC) $(CFLAGS) display_menu.c 45 | 46 | display_splash.o : display_splash.c display_splash.h version.h 47 | $(CC) $(CFLAGS) display_splash.c 48 | 49 | display.o : display.c display.h 50 | $(CC) $(CFLAGS) display.c 51 | 52 | fonts.o : fonts.c fonts.h assets.h settings.h 53 | $(CC) $(CFLAGS) fonts.c 54 | 55 | gameobject.o : gameobject.c gameobject.h anims.h collisions.h settings.h 56 | $(CC) $(CFLAGS) gameobject.c 57 | 58 | input.o : input.c input.h 59 | $(CC) $(CFLAGS) input.c 60 | 61 | keyboard.o : keyboard.c keyboard.h 62 | $(CC) $(CFLAGS) keyboard.c 63 | 64 | level.o : level.c level.h assets.h settings.h palettes.h 65 | $(CC) $(CFLAGS) level.c 66 | 67 | physics.o : physics.c physics.h 68 | $(CC) $(CFLAGS) physics.c 69 | 70 | ptplayer.o : ptplayer.asm 71 | #ptplayer is linked from a pre-compiled binary 72 | 73 | rainbow.o : rainbow.c rainbow.h settings.h 74 | $(CC) $(CFLAGS) rainbow.c 75 | 76 | system.o : system.c system.h 77 | $(CC) $(CFLAGS) system.c 78 | 79 | tilemap.o : tilemap.c tilemap.h 80 | $(CC) $(CFLAGS) tilemap.c 81 | 82 | tiles.o : tiles.c tiles.h settings.h 83 | $(CC) $(CFLAGS) tiles.c 84 | 85 | OBJS = main.o system.o keyboard.o input.o display.o diskio.o fonts.o \ 86 | display_level.o display_loading.o display_menu.o display_splash.o \ 87 | color.o rainbow.o tiles.o tilemap.o \ 88 | audio.o \ 89 | gameobject.o physics.o level.o anims.o collisions.o 90 | 91 | $(EXE) : $(OBJS) 92 | $(LD) $(LFLAGS) $(OBJS) ptplayer.o TO $(EXE) 93 | 94 | # target 'clean' 95 | clean: 96 | -delete $(EXE) 97 | -delete $(OBJS) 98 | -------------------------------------------------------------------------------- /Extras/ptplayer_sas_c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Extras/ptplayer_sas_c.o -------------------------------------------------------------------------------- /ILBM_image.h: -------------------------------------------------------------------------------- 1 | #ifndef ILBM_IMAGE_H 2 | #define ILBM_IMAGE_H 3 | 4 | struct ILBMImage { 5 | UWORD width; 6 | UWORD height; 7 | ULONG num_colors; 8 | struct BitMap* bitmap; 9 | struct { 10 | UBYTE R, G, B; 11 | }cmap[0]; 12 | }; 13 | 14 | struct ILBMImage* loadILBMImage(STRPTR fileName, ULONG bm_flags); 15 | VOID freeILBMImage(struct ILBMImage* img); 16 | 17 | #endif /* IMAGE_H */ 18 | -------------------------------------------------------------------------------- /Icons/GlowIcons.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/GlowIcons.info -------------------------------------------------------------------------------- /Icons/GlowIcons/Sevgi_Editor.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/GlowIcons/Sevgi_Editor.info -------------------------------------------------------------------------------- /Icons/GlowIcons/Sevgi_Editor_New.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/GlowIcons/Sevgi_Editor_New.info -------------------------------------------------------------------------------- /Icons/MagicWB.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/MagicWB.info -------------------------------------------------------------------------------- /Icons/MagicWB/Sevgi_Editor_MWB.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/MagicWB/Sevgi_Editor_MWB.info -------------------------------------------------------------------------------- /Icons/Mason.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/Mason.info -------------------------------------------------------------------------------- /Icons/Mason/Sevgi_Editor.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/Mason/Sevgi_Editor.info -------------------------------------------------------------------------------- /Icons/Mason_2010.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/Mason_2010.info -------------------------------------------------------------------------------- /Icons/Mason_2010/Sevgi_Editor.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Icons/Mason_2010/Sevgi_Editor.info -------------------------------------------------------------------------------- /Images/MWB_20x20/anim.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/anim.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/boing.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/boing.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/break_point.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/break_point.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/compile.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/compile.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/copy.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/copy.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/cut.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/cut.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/debug.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/debug.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/display.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/display.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/dpaint.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/dpaint.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/editor.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/editor.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/font.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/font.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/gear.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/gear.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/gradient.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/gradient.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/image.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/image.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/joystick.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/joystick.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/linker.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/linker.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/load.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/load.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/map.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/map.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/new.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/new.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/new_display.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/new_display.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/object.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/object.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/objects.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/objects.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/palette.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/palette.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/paste.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/paste.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/redo.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/redo.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/run.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/run.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/save.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/save.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/saveas.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/saveas.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/sprite.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/sprite.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/tileset.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/tileset.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/tool.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/tool.iff -------------------------------------------------------------------------------- /Images/MWB_20x20/undo.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/MWB_20x20/undo.iff -------------------------------------------------------------------------------- /Images/no_image.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Images/no_image.ilbm -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Sevgi Engine](https://s14.gifyu.com/images/bsCeR.gif) 2 | 3 | Sevgi Engine is a new open source video game engine for classic Amiga computers which provides the required tools and generates the boilerplate code to create high performing Amiga games using only the C programming language. It is built around the great [ScrollingTricks](https://aminet.net/package/dev/src/ScrollingTrick) by Georg Steger. 4 | 5 | ### Features 6 | * **Performance** 7 |
All display algorithms aim to perform at a locked 50fps on a single buffered native Amiga chipset display. It implements an optimized version of the algorithm Scroller_XYUnlimited2_64 from [ScrollingTricks](https://aminet.net/package/dev/src/ScrollingTrick). Benefits highly from Fast Ram where available.
8 | * **System friendly** 9 |
Aims to work on all ROM versions (2.0+) providing a clean quit back to OS without needing WHDLoad.
10 | * **AGA Support** 11 |
Supports all features provided by the AGA chipset.
12 | * **No limitations** 13 |
Designed to support all the well known visual tricks known by the popular Amiga video game titles while not limiting more experimental effects to be implemented.
14 | * **Easy development** 15 |
A native editor program is provided to generate code, manage game assets, edit color palettes etc. called **Sevgi Editor**. Other elements like game logic, animation and events require programming knowledge in C. The programming and compiling can be made natively (on the Amiga OS - using native compilers) or cross platfrom (on Windows or Linux PCs - using cross development tools). Sevgi Editor can import game maps made in [Tiled](https://www.mapeditor.org/).
16 | * **Templates** 17 |
Generates ready to compile and run game code from template genres which aims to ease bootstrapping. The templates include test assets.
18 | * **ptplayer** 19 |
Implements the great [ptplayer](https://aminet.net/package/mus/play/ptplayer) by Frank Wille for music and audio effects.
20 | * **No third party dependencies** 21 |
The game executable will not require any libraries[^1]
22 | * **Documentation** 23 |
The engine code is very well commented and documented in detail in Amigaguide format.
24 | 25 | [^1]:Except diskfont.library. And even that is avoidable if you do not use any Amiga font asset. 26 | 27 | ### Sevgi Editor 28 | Sevgi Engine code and template assets are generated using the provided editor called Sevgi Editor. 29 | ![Sevgi Editor](https://s14.gifyu.com/images/bsCei.png) 30 | 31 | ### Requirements 32 | * ECS or AGA Amiga 33 | * Kickstart 2.0+ 34 | * MUI 3.8 (for Sevgi Editor) 35 | 36 | ### Build 37 | This source code which creates Sevgi Editor (which then can generate the engine code) is developed to be compiled with gcc (using any of [adtools](https://github.com/jens-maus/amigaos-cross-toolchain) or [bebbo's](https://github.com/bebbo/amiga-gcc) cross toolchains[^2]). 38 | To compile for 68k[^3] target: 39 | 40 | `make` 41 | 42 | Compiled binaries can also be acquired from [aminet](https://aminet.net/package/dev/c/Sevgi_Engine). 43 | 44 | Sevgi Engine code is suitable to be compiled with any Amiga compiler. Makefiles for SAS/C and gcc are provided and these compilers are tested to work. It includes and uses SDI_headers, so (hopefully) it is compiler agnostic. 45 | 46 | [^2]:These toolchains should be built using MUI and CGX prefixes of course. 47 | [^3]:Since this source includes and utilizes SDI_headers, it can be compiled also for MorphOS and AmigaOS4 targets, yet these two are not tested to work. 48 | 49 | ### Templates 50 | Sevgi Editor comes with some ready to compile and run game templates from different genres which demonstrates its features using some free assets. 51 | 52 | ![TopDownTemplate.gif](https://s14.gifyu.com/images/bsUeC.gif)![PlatformerTemplate](https://s14.gifyu.com/images/bsCej.gif) 53 | 54 | ### Licences 55 | Sevgi Engine and Sevgi Editor is under [MIT Licence](https://opensource.org/license/mit). Meaning you can use it in whatever project you want as long as you include the original copyright and license notice. 56 | ptplayer is public domain under [The Unlicence](https://opensource.org/license/unlicense) licence. 57 | 58 | ### Future Plans 59 | Sevgi Engine is still a work in progress. Some new features planned are: 60 | * Support for different level display implementations (i.e double buffering, split screen etc.) 61 | * More graphical effects 62 | * A native tilemap and gameobject editor 63 | * Functions for UI elements 64 | * More templates for different game genres 65 | 66 | ### Contributions 67 | If you make use of Sevgi Engine and find shortcomings, contributions like feature requests, bug reports or even pull requests will be highly appreciated. Please don't hesitate to fork this repository and open a pull request to add your features and/or bugfixes. 68 | -------------------------------------------------------------------------------- /Sevgi_Editor.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Sevgi_Editor.info -------------------------------------------------------------------------------- /Templates/Platformer.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer.ilbm -------------------------------------------------------------------------------- /Templates/Platformer.text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer.text -------------------------------------------------------------------------------- /Templates/Platformer/anims.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIMS_H 2 | #define ANIMS_H 3 | 4 | #include "level.h" 5 | #include "tiles.h" 6 | #include "tilemap.h" 7 | #include "collisions.h" 8 | #include "gameobject.h" 9 | #include "audio.h" 10 | 11 | /********************************************* 12 | * NUMBER OF ANIMATION FUNCTIONS * 13 | * NOTE: One extra for the NULL initializer! * 14 | *********************************************/ 15 | #define NUM_ANIMS 2 16 | 17 | //Anim States 18 | #define AS_IDLE 0x00 19 | #define AS_RUN 0x01 20 | #define AS_JUMP 0x02 21 | #define AS_FALL 0x03 22 | #define AS_LAND 0x04 23 | 24 | //Anim Frames 25 | #define AF_RIGHT_IDLE_1 0 26 | #define AF_RIGHT_IDLE_2 1 27 | #define AF_RIGHT_IDLE_3 2 28 | #define AF_RIGHT_IDLE_4 3 29 | #define AF_RIGHT_IDLE_5 4 30 | #define AF_RIGHT_IDLE_6 5 31 | #define AF_RIGHT_IDLE_7 6 32 | #define AF_RIGHT_IDLE_8 7 33 | #define AF_RIGHT_IDLE_9 8 34 | #define AF_RIGHT_IDLE_10 9 35 | #define AF_RIGHT_IDLE_11 10 36 | #define AF_RIGHT_IDLE_12 11 37 | #define AF_RIGHT_IDLE_13 12 38 | #define AF_RIGHT_IDLE_14 13 39 | #define AF_RIGHT_IDLE_15 14 40 | #define AF_RIGHT_IDLE_16 15 41 | #define AF_RIGHT_IDLE_17 16 42 | #define AF_RIGHT_IDLE_18 17 43 | 44 | #define AF_LEFT_IDLE_1 59 45 | #define AF_LEFT_IDLE_2 60 46 | #define AF_LEFT_IDLE_3 61 47 | #define AF_LEFT_IDLE_4 62 48 | #define AF_LEFT_IDLE_5 63 49 | #define AF_LEFT_IDLE_6 64 50 | #define AF_LEFT_IDLE_7 65 51 | #define AF_LEFT_IDLE_8 66 52 | #define AF_LEFT_IDLE_9 67 53 | #define AF_LEFT_IDLE_10 68 54 | #define AF_LEFT_IDLE_11 69 55 | #define AF_LEFT_IDLE_12 70 56 | #define AF_LEFT_IDLE_13 71 57 | #define AF_LEFT_IDLE_14 72 58 | #define AF_LEFT_IDLE_15 73 59 | #define AF_LEFT_IDLE_16 74 60 | #define AF_LEFT_IDLE_17 75 61 | #define AF_LEFT_IDLE_18 76 62 | 63 | #define AF_RIGHT_RUN_1 18 64 | #define AF_RIGHT_RUN_2 19 65 | #define AF_RIGHT_RUN_3 20 66 | #define AF_RIGHT_RUN_4 21 67 | #define AF_RIGHT_RUN_5 22 68 | #define AF_RIGHT_RUN_6 23 69 | #define AF_RIGHT_RUN_7 24 70 | #define AF_RIGHT_RUN_8 25 71 | #define AF_RIGHT_RUN_9 26 72 | #define AF_RIGHT_RUN_10 27 73 | #define AF_RIGHT_RUN_11 28 74 | #define AF_RIGHT_RUN_12 29 75 | #define AF_RIGHT_RUN_13 30 76 | #define AF_RIGHT_RUN_14 31 77 | #define AF_RIGHT_RUN_15 32 78 | #define AF_RIGHT_RUN_16 33 79 | #define AF_RIGHT_RUN_17 34 80 | #define AF_RIGHT_RUN_18 35 81 | #define AF_RIGHT_RUN_19 36 82 | #define AF_RIGHT_RUN_20 37 83 | #define AF_RIGHT_RUN_21 38 84 | #define AF_RIGHT_RUN_22 39 85 | #define AF_RIGHT_RUN_23 30 86 | #define AF_RIGHT_RUN_24 41 87 | 88 | #define AF_LEFT_RUN_1 77 89 | #define AF_LEFT_RUN_2 78 90 | #define AF_LEFT_RUN_3 79 91 | #define AF_LEFT_RUN_4 80 92 | #define AF_LEFT_RUN_5 81 93 | #define AF_LEFT_RUN_6 82 94 | #define AF_LEFT_RUN_7 83 95 | #define AF_LEFT_RUN_8 84 96 | #define AF_LEFT_RUN_9 85 97 | #define AF_LEFT_RUN_10 86 98 | #define AF_LEFT_RUN_11 87 99 | #define AF_LEFT_RUN_12 88 100 | #define AF_LEFT_RUN_13 89 101 | #define AF_LEFT_RUN_14 90 102 | #define AF_LEFT_RUN_15 91 103 | #define AF_LEFT_RUN_16 92 104 | #define AF_LEFT_RUN_17 93 105 | #define AF_LEFT_RUN_18 94 106 | #define AF_LEFT_RUN_19 95 107 | #define AF_LEFT_RUN_20 96 108 | #define AF_LEFT_RUN_21 97 109 | #define AF_LEFT_RUN_22 98 110 | #define AF_LEFT_RUN_23 99 111 | #define AF_LEFT_RUN_24 100 112 | 113 | #define AF_RIGHT_JUMP_1 42 114 | #define AF_RIGHT_JUMP_2 43 115 | #define AF_RIGHT_JUMP_3 44 116 | #define AF_RIGHT_JUMP_4 45 117 | #define AF_RIGHT_JUMP_5 46 118 | #define AF_RIGHT_JUMP_6 47 119 | #define AF_RIGHT_JUMP_7 48 120 | #define AF_RIGHT_JUMP_8 49 121 | #define AF_RIGHT_FALL_1 50 122 | #define AF_RIGHT_FALL_2 51 123 | #define AF_RIGHT_FALL_3 52 124 | #define AF_RIGHT_FALL_4 53 125 | #define AF_RIGHT_FALL_5 54 126 | #define AF_RIGHT_FALL_6 55 127 | #define AF_RIGHT_LAND_1 56 128 | #define AF_RIGHT_LAND_2 57 129 | #define AF_RIGHT_LAND_3 58 130 | 131 | #define AF_LEFT_JUMP_1 101 132 | #define AF_LEFT_JUMP_2 102 133 | #define AF_LEFT_JUMP_3 103 134 | #define AF_LEFT_JUMP_4 104 135 | #define AF_LEFT_JUMP_5 105 136 | #define AF_LEFT_JUMP_6 106 137 | #define AF_LEFT_JUMP_7 107 138 | #define AF_LEFT_JUMP_8 108 139 | #define AF_LEFT_FALL_1 109 140 | #define AF_LEFT_FALL_2 110 141 | #define AF_LEFT_FALL_3 111 142 | #define AF_LEFT_FALL_4 112 143 | #define AF_LEFT_FALL_5 113 144 | #define AF_LEFT_FALL_6 114 145 | #define AF_LEFT_LAND_1 115 146 | #define AF_LEFT_LAND_2 116 147 | #define AF_LEFT_LAND_3 117 148 | 149 | //TO ACCESS ANIMS ADD THIS LINE INTO YOUR .c fILE: 150 | //extern VOID (*animFunction[NUM_ANIMS])(struct GameObject*); 151 | 152 | #endif /* ANIMS_H */ 153 | -------------------------------------------------------------------------------- /Templates/Platformer/assets.h: -------------------------------------------------------------------------------- 1 | #ifndef ASSETS_H 2 | #define ASSETS_H 3 | 4 | #ifdef FONTS_H 5 | STATIC struct TextAttr textAttrs[NUM_TEXTFONTS] = {{"Helvetica.font", 9, FS_NORMAL, FPF_DESIGNED}}; 6 | STATIC STRPTR gameFontFiles[NUM_GAMEFONTS] = {"orbitron_15.fnt"}; 7 | #endif 8 | 9 | #ifdef LEVEL_H 10 | // LEVEL 0 (Main Menu) 11 | STATIC STRPTR sprite_banks_0[] = {"MousePointers2.spr", NULL}; 12 | STATIC STRPTR sound_samples_0[] = {"select-granted-05.iff", "select-granted-06.iff", NULL}; 13 | STATIC UBYTE* palettes_0[] = {palette_0_0, NULL}; 14 | STATIC STRPTR gameobj_banks_0[] = {(STRPTR)4, NULL}; 15 | // LEVEL 1 (Level1) 16 | STATIC STRPTR tilesets_1[] = {"FreeCuteTileset.tls", NULL}; 17 | STATIC STRPTR tilemaps_1[] = {"FreeCuteTilemap/Tilemap.map", NULL}; 18 | STATIC STRPTR sprite_banks_1[] = {"RedRidingHood.spr", NULL}; 19 | STATIC STRPTR music_modules_1[] = {"Background.mod", NULL}; 20 | STATIC STRPTR sound_samples_1[] = {"Left_Stomp.iff", "Right_Stomp.iff", "Jump.iff", NULL}; 21 | STATIC UBYTE* palettes_1[] = {palette_1_0, NULL}; 22 | STATIC STRPTR gameobj_banks_1[] = {"FreeCuteTilemap/Gameobjects.obj", NULL}; 23 | STATIC STRPTR bitmaps_1[] = {"[NN]Background.ilbm", NULL}; 24 | 25 | STATIC struct LevelData levelData[NUM_LEVELS] = {{"Main Menu", 26 | NULL, 27 | NULL, 28 | NULL, 29 | sprite_banks_0, 30 | NULL, 31 | sound_samples_0, 32 | palettes_0, 33 | gameobj_banks_0, 34 | NULL, 35 | MD_blitBOB, 36 | MD_unBlitBOB, 37 | MENU_SCREEN_WIDTH, 38 | MENU_SCREEN_HEIGHT, 39 | 0, 40 | 0 41 | }, 42 | {"Level1", 43 | tilesets_1, 44 | tilemaps_1, 45 | NULL, 46 | sprite_banks_1, 47 | music_modules_1, 48 | sound_samples_1, 49 | palettes_1, 50 | gameobj_banks_1, 51 | bitmaps_1, 52 | LD_blitBOB, 53 | LD_unBlitBOB, 54 | SCREEN_WIDTH, 55 | SCREEN_HEIGHT, 56 | 0, 57 | 200 58 | } 59 | }; 60 | #endif 61 | 62 | #endif /* ASSETS_H */ -------------------------------------------------------------------------------- /Templates/Platformer/assets/Background.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/Background.ilbm -------------------------------------------------------------------------------- /Templates/Platformer/assets/FreeCuteTileset.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/FreeCuteTileset.ilbm -------------------------------------------------------------------------------- /Templates/Platformer/assets/FreeCuteTileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/FreeCuteTileset.png -------------------------------------------------------------------------------- /Templates/Platformer/assets/FreeCuteTileset.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Templates/Platformer/assets/MouseSheet2.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/MouseSheet2.iff -------------------------------------------------------------------------------- /Templates/Platformer/assets/Palette.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/Palette.ilbm -------------------------------------------------------------------------------- /Templates/Platformer/assets/sprite_sheet_all_L.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/sprite_sheet_all_L.iff -------------------------------------------------------------------------------- /Templates/Platformer/assets/sprite_sheet_all_R.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/assets/sprite_sheet_all_R.iff -------------------------------------------------------------------------------- /Templates/Platformer/collisions.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "collisions.h" 8 | /// 9 | ///defines 10 | /// 11 | ///globals 12 | extern struct Level current_level; 13 | /// 14 | //prototypes 15 | // Collisions between gameobjects 16 | VOID blockObjectCollision(struct GameObject*, struct GameObject*); 17 | 18 | // Collisions between tiles and gameobjects 19 | VOID testTileColl1(struct GameObject*); 20 | 21 | //exports 22 | VOID (*gobjCollisionFunction[NUM_GOBJ_COLL_FUNCS])(struct GameObject*, struct GameObject*) = {NULL, 23 | blockObjectCollision}; 24 | 25 | VOID (*tileCollisionFunction[NUM_TILE_COLL_FUNCS])(struct GameObject*) = {NULL, 26 | testTileColl1}; 27 | // 28 | 29 | /******************************************** 30 | * Collisions functions between gameobjects * 31 | ********************************************/ 32 | ///blockObjectCollision(gameobject) 33 | /****************************************************************************** 34 | * Prevents the image rectangle of a gameobject entering in. * 35 | * NOTE: This implementation prioritizes pushing go2s out vertical first in * 36 | * the case of entry at corners. This is in accordance with block tiles * 37 | * pushing out horizontal first. Otherwise there will be leakages in blocking.* 38 | * NOTE: You must overlap block objects at least one pixel if you need * 39 | * compound shapes which use more than one gameobject. Otherwise there will * 40 | * be leakages in blocking. Colliding block objects won't push eachother out * 41 | * as long as they don't have an anim.direction. * 42 | ******************************************************************************/ 43 | VOID blockObjectCollision(struct GameObject* go1, struct GameObject* go2) 44 | { 45 | //Collisions fire up by image rectangle 46 | switch (go2->anim.direction) { 47 | case LEFT: 48 | setGameObjectPos(go2, go1->x2 - go2->image->h_offs, go2->y); 49 | break; 50 | case RIGHT: 51 | setGameObjectPos(go2, go1->x1 - go2->image->width - go2->image->h_offs - 1, go2->y); 52 | break; 53 | case DOWN: 54 | setGameObjectPos(go2, go2->x, go1->y1 - go2->image->height - go2->image->v_offs - 1); 55 | break; 56 | case UP: 57 | setGameObjectPos(go2, go2->x, go1->y2 - go2->image->h_offs); 58 | break; 59 | case LEFT|UP: 60 | if (go1->x2 - go2->x1 >= go1->y2 - go2->y1) { 61 | setGameObjectPos(go2, go2->x, go1->y2 - go2->image->h_offs); 62 | } 63 | else { 64 | setGameObjectPos(go2, go1->x2 - go2->image->h_offs, go2->y); 65 | } 66 | break; 67 | case LEFT|DOWN: 68 | if (go1->x2 - 1 - go2->x1 >= go2->y2 - go1->y1) { 69 | setGameObjectPos(go2, go2->x, go1->y1 - go2->image->height - go2->image->v_offs - 1); 70 | } 71 | else { 72 | setGameObjectPos(go2, go1->x2 - go2->image->h_offs, go2->y); 73 | } 74 | break; 75 | case RIGHT|UP: 76 | if (go2->x2 - go1->x1 >= go1->y2 - 1 - go2->y1) { 77 | setGameObjectPos(go2, go2->x, go1->y2 - go2->image->h_offs); 78 | } 79 | else { 80 | setGameObjectPos(go2, go1->x1 - go2->image->width - go2->image->h_offs - 1, go2->y); 81 | } 82 | break; 83 | case RIGHT|DOWN: 84 | if (go2->x2 - go1->x1 >= go2->y2 - go1->y1) { 85 | setGameObjectPos(go2, go2->x, go1->y1 - go2->image->height - go2->image->v_offs - 1); 86 | } 87 | else { 88 | setGameObjectPos(go2, go1->x1 - go2->image->width - go2->image->h_offs - 1, go2->y); 89 | } 90 | break; 91 | } 92 | } 93 | /// 94 | 95 | /******************************************** 96 | * Collisions between tiles and gameobjects * 97 | ********************************************/ 98 | ///testTileColl1(gameobject) 99 | VOID testTileColl1(struct GameObject* go) 100 | { 101 | /* 102 | LONG x = go->x; 103 | LONG y = go->y; 104 | struct TileMap* map = current_level.tilemap[current_level.current.tilemap]; 105 | */ 106 | 107 | /********************************** 108 | * Tile collide per image hotspot * 109 | **********************************/ 110 | /* 111 | TILEID tileID = TILEID_AT_COORD(map, x, y); 112 | */ 113 | 114 | /************************************ 115 | * Tile collide per image rectangle * 116 | ************************************/ 117 | // x1, y1 collision 118 | // tileID = TILEID_AT_COORD(map, go->x1, go->y1); 119 | 120 | // x2, y1 collision 121 | // tileID = TILEID_AT_COORD(map, go->x2, go->y1); 122 | 123 | // x2, y2 collision 124 | // tileID = TILEID_AT_COORD(map, go->x2, go->y2); 125 | 126 | // x1, y2 collision 127 | // tileID = TILEID_AT_COORD(map, go->x1, go->y2); 128 | } 129 | /// 130 | -------------------------------------------------------------------------------- /Templates/Platformer/collisions.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLISIONS_H 2 | #define COLLISIONS_H 3 | 4 | #include "level.h" 5 | #include "tiles.h" 6 | #include "tilemap.h" 7 | #include "gameobject.h" 8 | #include "audio.h" 9 | 10 | /********************************************* 11 | * NUMBER OF COLLISION FUNCTIONS * 12 | * NOTE: One extra for the NULL initializer! * 13 | *********************************************/ 14 | #define NUM_GOBJ_COLL_FUNCS 2 15 | #define NUM_TILE_COLL_FUNCS 2 16 | 17 | //Tile identifiers 18 | #define TI_PLATFORM_LEFT_EDGE_1 42 19 | #define TI_PLATFORM_CENTER 43 20 | #define TI_PLATFORM_RIGHT_EDGE_1 44 21 | #define TI_PLATFORM_LEFT_EDGE_2 45 22 | #define TI_PLATFORM_RIGHT_EDGE_2 46 23 | #define TI_PLATFORM_LEFT_EDGE_3 47 24 | #define TI_PLATFORM_RIGHT_EDGE_3 48 25 | #define TI_PLATFORM_SINGLE 49 26 | 27 | #define TI_SLOPE_45_UP 54 28 | #define TI_SLOPE_45_UP_SUB_1 64 29 | #define TI_SLOPE_45_UP_SUB_2 66 30 | #define TI_SLOPE_45_DOWN 55 31 | #define TI_SLOPE_45_DOWN_SUB_1 65 32 | #define TI_SLOPE_45_DOWN_SUB_2 67 33 | #define TI_SLOPE_22_1_UP 50 34 | #define TI_SLOPE_22_2_UP 51 35 | #define TI_SLOPE_22_1_UP_SUB_1 56 36 | #define TI_SLOPE_22_2_UP_SUB_1 57 37 | #define TI_SLOPE_22_1_UP_SUB_2 60 38 | #define TI_SLOPE_22_2_UP_SUB_2 61 39 | #define TI_SLOPE_22_1_DOWN 52 40 | #define TI_SLOPE_22_2_DOWN 53 41 | #define TI_SLOPE_22_1_DOWN_SUB_1 58 42 | #define TI_SLOPE_22_2_DOWN_SUB_1 59 43 | #define TI_SLOPE_22_1_DOWN_SUB_2 62 44 | #define TI_SLOPE_22_2_DOWN_SUB_2 63 45 | 46 | #define TI_SLOPE_45_UP_SUPER 72 47 | #define TI_SLOPE_45_DOWN_SUPER 73 48 | #define TI_SLOPE_22_1_UP_SUPER 68 49 | #define TI_SLOPE_22_2_UP_SUPER 69 50 | #define TI_SLOPE_22_1_DOWN_SUPER 70 51 | #define TI_SLOPE_22_2_DOWN_SUPER 71 52 | #define TI_SLOPE_END 74 53 | 54 | //TO ACCESS COLLISION FUNCTIONS ADD THESE LINES INTO YOUR .c fILE: 55 | //extern VOID (*gobjCollisionFunction[NUM_GOBJ_COLL_FUNCS])(struct GameObject*, struct GameObject*); 56 | //extern VOID (*tileCollisionFunction[NUM_TILE_COLL_FUNCS])(struct GameObject*); 57 | 58 | #endif /* COLLISIONS_H */ 59 | -------------------------------------------------------------------------------- /Templates/Platformer/data/Background.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/Background.ilbm -------------------------------------------------------------------------------- /Templates/Platformer/data/Background.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/Background.mod -------------------------------------------------------------------------------- /Templates/Platformer/data/FreeCuteTilemap/Gameobjects.obj: -------------------------------------------------------------------------------- 1 | GAMEOBJP -------------------------------------------------------------------------------- /Templates/Platformer/data/FreeCuteTilemap/Tilemap.map: -------------------------------------------------------------------------------- 1 | d !"#$HFG DE%&'()DE6++++++++45FG!"#$H23++++,23B:;45J'()%&H6<= *+,1<=  ;+++++++++H6B1 1 -+.  2 | DE6B DE23BDEJ23<=23++++<=<=  1*+,'() !"#$1*++,*++++,1111  3 | *++,!"#$%&'()1  *+,  4 |  DE%&FG*+++,*, 5 | 1 6 |  7 | H23+++45I  1  8 | 1  9 |   H689:;7I 10 | 1 -++,1*,*+,*+,*+++,!"#$!"#$DE6@ A7FG -++,!"#$ 1*,111*+, -++,  %&'()%&J23@  A45'() 11 | %& 12 | *++. *++, -+++++++++++++++++++++89 :;*+++++++++++++++++++++++,    1   13 |   14 |  15 |  16 |  -------------------------------------------------------------------------------- /Templates/Platformer/data/FreeCuteTileset.tls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/FreeCuteTileset.tls -------------------------------------------------------------------------------- /Templates/Platformer/data/Jump.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/Jump.iff -------------------------------------------------------------------------------- /Templates/Platformer/data/Left_Stomp.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/Left_Stomp.iff -------------------------------------------------------------------------------- /Templates/Platformer/data/MousePointers2.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/MousePointers2.spr -------------------------------------------------------------------------------- /Templates/Platformer/data/RedRidingHood.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/RedRidingHood.spr -------------------------------------------------------------------------------- /Templates/Platformer/data/RedRidingHood_fm2.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/RedRidingHood_fm2.spr -------------------------------------------------------------------------------- /Templates/Platformer/data/Right_Stomp.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/Right_Stomp.iff -------------------------------------------------------------------------------- /Templates/Platformer/data/orbitron_15.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/orbitron_15.fnt -------------------------------------------------------------------------------- /Templates/Platformer/data/orbitron_15.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/orbitron_15.iff -------------------------------------------------------------------------------- /Templates/Platformer/data/select-granted-05.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/select-granted-05.iff -------------------------------------------------------------------------------- /Templates/Platformer/data/select-granted-06.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Platformer/data/select-granted-06.iff -------------------------------------------------------------------------------- /Templates/Platformer/level_display_gradients.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * WARNING: This file is not to be compiled to its own module. It is just * 3 | * inculed by display_level.c. * 4 | * Only use globals from display_level.c and do NOT declare new globals here! * 5 | ******************************************************************************/ 6 | #define SKY_GRD_HEIGHT 172 7 | #define SKY_GRD_COLOR_REG 9 // Between 0 and 31 8 | #define NUM_GRADIENTS 2 // One extra for the NULL termination! 9 | 10 | #if SKY_GRD_HEIGHT > SCREEN_HEIGHT 11 | #undef SKY_GRD_HEIGHT 12 | #define SKY_GRD_HEIGHT SCREEN_HEIGHT 13 | #endif 14 | 15 | STATIC BOOL prepGradients(ULONG level_num) 16 | { 17 | BOOL retval = TRUE; 18 | 19 | #include "level_display_gradients.h" 20 | 21 | switch (level_num) { 22 | case 1: 23 | { 24 | static struct Gradient* grad_list[NUM_GRADIENTS] = {0}; 25 | #ifdef CT_AGA 26 | grad_list[0] = createGradient(GRD_TYPE_AGA, SKY_GRD_COLOR_REG, SKY_GRD_HEIGHT, 0, SKY_GRD_HEIGHT, 0, GRD_BLITABLE, sky_hues_1); 27 | #else 28 | grad_list[0] = createGradient(GRD_TYPE_OCS, SKY_GRD_COLOR_REG, SKY_GRD_HEIGHT, 0, SKY_GRD_HEIGHT, 0, GRD_BLITABLE, sky_hues_1); 29 | #endif 30 | 31 | //Init the color_table of the gradient 32 | grad_list[0]->color_table = newColorTable_GRD(grad_list[0], CT_DEFAULT_STEPS, 0); 33 | grad_list[0]->color_table->state = CT_FADE_IN; 34 | 35 | #if BOTTOM_PANEL_HEIGHT > 0 36 | rainbow = createRainbow(grad_list, end_Instructions); 37 | #else 38 | rainbow = createRainbow(grad_list, NULL); 39 | #endif 40 | 41 | if (!rainbow) { 42 | retval = FALSE; 43 | } 44 | } 45 | break; 46 | } 47 | 48 | return retval; 49 | } 50 | 51 | STATIC VOID freeGradients() 52 | { 53 | if (rainbow) { 54 | if (rainbow->gradList) { 55 | struct Gradient** g = rainbow->gradList; 56 | 57 | while (*g) { 58 | freeGradient(*g); 59 | *g = NULL; 60 | g++; 61 | } 62 | } 63 | 64 | freeRainbow(rainbow); rainbow = NULL; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Templates/Platformer/level_display_gradients.h: -------------------------------------------------------------------------------- 1 | STATIC UBYTE sky_hues_1[] = {1, 2 | 71, 111, 182, 3 | 184, 211, 255}; 4 | -------------------------------------------------------------------------------- /Templates/Platformer/level_display_loop.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * WARNING: This file is not to be compiled to its own module. It is just * 3 | * inculed by display_level.c. * 4 | * Only use globals from display_level.c and do NOT declare new globals here! * 5 | ******************************************************************************/ 6 | STATIC VOID levelDisplayLoop() 7 | { 8 | UWORD quitting = FALSE; 9 | struct GameObject* main_char = ¤t_level.gameobject_bank[0]->gameobjects[0]; 10 | LONG run_speed = 1; 11 | 12 | while (TRUE) { 13 | UBYTE main_char_movement; 14 | WORD scroll_x; 15 | WORD scroll_y; 16 | struct ScrollInfo si; 17 | struct MouseState ms; 18 | 19 | #ifdef DYNAMIC_COPPERLIST 20 | if (new_frame_flag % 2) { 21 | //Unsync detected. Re-scync with the copperlist set by the copper 22 | if (CopperList == CopperList1) 23 | CopperList = CopperList2; 24 | else 25 | CopperList = CopperList1; 26 | } 27 | #endif //DYNAMIC_COPPERLIST 28 | new_frame_flag = 1; 29 | 30 | doKeyboardIO(); 31 | UL_VALUE(ms) = readMouse(0); 32 | 33 | if (!quitting) { 34 | if (keyState(RAW_ESC) || main_char->y > 400) { 35 | quitting = TRUE; 36 | color_table->state = CT_FADE_OUT; 37 | #ifdef DYNAMIC_COPPERLIST 38 | if (rainbow->gradList[0] && rainbow->gradList[0]->color_table) { 39 | rainbow->gradList[0]->color_table->state = CT_FADE_OUT; 40 | } 41 | #endif 42 | volume_table.state = PTVT_FADE_OUT; 43 | } 44 | } 45 | if (quitting == TRUE && color_table->state == CT_IDLE && volume_table.state == PTVT_IDLE) { 46 | break; 47 | } 48 | 49 | //if (JOY_BUTTON1(1) || keyState(RAW_CTRL)); //SHOOT? 50 | main_char_movement = 0; 51 | 52 | if (JOY_LEFT(1) || keyState(RAW_LEFT)) { 53 | switch (main_char->anim.state) { 54 | case AS_IDLE: 55 | case AS_RUN: 56 | main_char->anim.state = AS_RUN; 57 | main_char->anim.direction = LEFT; 58 | main_char_movement = LEFT; 59 | break; 60 | } 61 | moveGameObject(main_char, -run_speed, 0); 62 | main_char_movement = LEFT; 63 | } 64 | else if (JOY_RIGHT(1) || keyState(RAW_RIGHT)) { 65 | switch (main_char->anim.state) { 66 | case AS_IDLE: 67 | case AS_RUN: 68 | main_char->anim.state = AS_RUN; 69 | main_char->anim.direction = RIGHT; 70 | main_char_movement = RIGHT; 71 | break; 72 | } 73 | moveGameObject(main_char, run_speed, 0); 74 | main_char_movement = RIGHT; 75 | } 76 | if (JOY_UP(1) || keyState(RAW_UP)) { 77 | switch (main_char->anim.state) { 78 | case AS_IDLE: 79 | case AS_RUN: 80 | main_char->anim.state = AS_JUMP; 81 | main_char->anim.direction |= UP; 82 | main_char->anim.counter_2 = 0; 83 | main_char_movement |= UP; 84 | break; 85 | } 86 | } 87 | //else if (JOY_DOWN(1) || keyState(RAW_DOWN)) { //Crouch!? } 88 | 89 | if (!main_char_movement && main_char->anim.state != AS_JUMP && main_char->anim.state != AS_FALL && main_char->anim.state != AS_LAND) { 90 | main_char->anim.state = AS_IDLE; 91 | } 92 | 93 | #if TRUE 94 | // This routine below scrolls the tilemap following main_char 95 | scroll_x = main_char->x - *mapPosX - (SCREEN_WIDTH / 2); 96 | scroll_y = main_char->y - *mapPosY - (SCREEN_HEIGHT / 2); 97 | if (scroll_x > 0) si.right = scroll_x; 98 | if (scroll_x < 0) si.left = -scroll_x; 99 | if (scroll_y > 0) si.down = scroll_y; 100 | if (scroll_y < 0) si.up = -scroll_y; 101 | #else 102 | // This routine below scrolls the tilemap with mouse inputs 103 | if (UL_VALUE(ms)) { 104 | if (ms.deltaX > 0) si.right = ms.deltaX; 105 | if (ms.deltaX < 0) si.left = -ms.deltaX; 106 | if (ms.deltaY > 0) si.down = ms.deltaY; 107 | if (ms.deltaY < 0) si.up = -ms.deltaY; 108 | 109 | if (si.right > MAX_SCROLL_SPEED) si.right = MAX_SCROLL_SPEED; 110 | if (si.left > MAX_SCROLL_SPEED) si.left = MAX_SCROLL_SPEED; 111 | if (si.down > MAX_SCROLL_SPEED) si.down = MAX_SCROLL_SPEED; 112 | if (si.up > MAX_SCROLL_SPEED) si.up = MAX_SCROLL_SPEED; 113 | } 114 | #endif 115 | 116 | scroll(&si); 117 | 118 | updateVolume(); 119 | updateColorTable_Partial(color_table, 1, color_table->colors); 120 | #ifdef DYNAMIC_COPPERLIST 121 | if (rainbow->gradList[0]->color_table->state != CT_IDLE) { 122 | updateColorTable(rainbow->gradList[0]->color_table); 123 | setColorTable_GRD(rainbow->gradList[0]->color_table); 124 | updateRainbow(rainbow); 125 | } 126 | #endif 127 | updateGameObjects(); 128 | #ifdef DYNAMIC_COPPERLIST 129 | updateDynamicCopperList(); 130 | #endif 131 | // *(WORD*)0xDFF180 = 0; //DEBUG (displays performance of the above algorithms) 132 | updateBOBs(); 133 | 134 | //Wait until current frame completes 135 | waitTOF(); 136 | 137 | //blit the remaining secondPart tiles first thing on the next frame 138 | scrollRemaining(&si); 139 | 140 | // *(WORD*)0xDFF180 = 0x0F00; //DEBUG (displays performance of the above algorithms) 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /Templates/Platformer/palettes.h: -------------------------------------------------------------------------------- 1 | STATIC UBYTE palette_0_0[] = {3, 2 | 0, 0, 0, 3 | 121, 121, 121, 4 | 180, 180, 180, 5 | 255, 255, 255}; 6 | 7 | STATIC UBYTE palette_1_0[] = {31, 8 | 0, 0, 0, 9 | 72, 76, 109, 10 | 204, 237, 74, 11 | 47, 20, 40, 12 | 90, 53, 45, 13 | 146, 100, 59, 14 | 29, 134, 79, 15 | 105, 198, 30, 16 | 0, 0, 0, 17 | 82, 129, 211, 18 | 166, 207, 234, 19 | 41, 84, 80, 20 | 221, 236, 248, 21 | 59, 142, 96, 22 | 89, 165, 120, 23 | 116, 176, 160, 24 | 0, 0, 0, 25 | 16, 16, 16, 26 | 174, 168, 168, 27 | 134, 43, 42, 28 | 36, 3, 18, 29 | 40, 34, 30, 30 | 73, 10, 30, 31 | 91, 56, 67, 32 | 108, 68, 76, 33 | 89, 80, 71, 34 | 101, 84, 82, 35 | 125, 89, 93, 36 | 162, 83, 66, 37 | 174, 103, 75, 38 | 146, 129, 130, 39 | 170, 147, 147}; 40 | -------------------------------------------------------------------------------- /Templates/Platformer/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_H 2 | #define SETTINGS_H 3 | 4 | /****************************************************************************** 5 | * VIDEO * 6 | ******************************************************************************/ 7 | 8 | //Un-comment to activate 24bit AGA color features. 9 | #define CT_AGA 10 | //Set the default fade in/out speed. Smaller is faster. (2-256) 11 | #define CT_DEFAULT_STEPS 64 12 | 13 | //Un-comment to activate per-frame dynamic copperlist generation. 14 | #define DYNAMIC_COPPERLIST 15 | //Un-comment to activate smart sprite algorithms. 16 | #define SMART_SPRITES 17 | //Un-comment to activate dual-playfield mode. 18 | #define DUALPLAYFIELD 19 | //Select bitplane and sprite fetch modes 20 | #define BPL_FMODE 1 // Bitplane fetch mode (1, 2 or 4) 21 | #define SPR_FMODE 1 // Sprite fetch mode (1, 2 or 4) 22 | 23 | #define TOP_PANEL_HEIGHT 0 24 | #define BOTTOM_PANEL_HEIGHT 0 25 | 26 | #define SCREEN_WIDTH 320 // Visible resolution of the level screen 27 | #define SCREEN_HEIGHT 256 // " " " " " " 28 | #define SCR_WIDTH_EXTRA 64 // Additional horizontal pixels for scroll 29 | #define SCR_HEIGHT_EXTRA 32 // Additional vertical pixels for scroll (2 extra tiles) 30 | #define SCREEN_DEPTH 3 // How many bitplanes (1-6 on OCS/ECS, 1-8 on AGA) 31 | 32 | //Set these to valid values in DUALPLAYFIELD mode 33 | #define BITMAP_DEPTH_PF2 3 34 | #define BITMAP_HEIGHT_PF2 320 35 | 36 | #define MAX_SCROLL_SPEED 16 // pixels per frame 37 | 38 | /****************************************************************************** 39 | * AUDIO * 40 | ******************************************************************************/ 41 | 42 | #define PAULA_PAL_CYCLES 3546895 43 | #define PAULA_NTSC_CYCLES 3579545 44 | #define PAULA_MIN_PERIOD 124 45 | 46 | //Set PAL/NTSC 47 | #define PAULA_CYCLES PAULA_PAL_CYCLES 48 | //Set the default module playback volume. (0-64) 49 | #define PTVT_DEFAULT_VOLUME 64 50 | //Set the default audio fade in/out speed. Smaller is faster. (1-256) 51 | #define PTVT_DEFAULT_STEPS 64 52 | //Default playback volume for sound samples (0-64) 53 | #define SFX_DEFAULT_VOLUME 64 54 | //Default playback channel for sound samples (0-3 / -1 for best avail. channel) 55 | #define SFX_DEFAULT_CHANNEL 1 56 | //Default playback priority for sound samples (1-127) 57 | #define SFX_DEFAULT_PRIORITY 1 58 | 59 | /****************************************************************************** 60 | * FONTS * 61 | ******************************************************************************/ 62 | 63 | #define NUM_TEXTFONTS 1 // Number of Amiga TextFonts to load 64 | #define TF_DEFAULT 0 // Index of the default TextFont 65 | 66 | #define NUM_GAMEFONTS 1 // Number of GameFonts to load 67 | #define GF_DEFAULT 0 // Index of the first loaded GameFont 68 | 69 | /****************************************************************************** 70 | * GAMEOBJECTS * 71 | ******************************************************************************/ 72 | 73 | #define NUM_LEVELS 2 // Number of levels in the game 74 | 75 | #define NUM_SPRITES 8 76 | #define NUM_BOBS 4 77 | #define NUM_GAMEOBJECTS 0 78 | 79 | #define SMALL_IMAGE_SIZES 80 | //#define BIG_IMAGE_SIZES 81 | //#define SMALL_HITBOX_SIZES 82 | 83 | #endif /* SETTINGS_H */ 84 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure.ilbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure.ilbm -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure.text: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure.text -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/anims.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIMS_H 2 | #define ANIMS_H 3 | 4 | #include "level.h" 5 | #include "tiles.h" 6 | #include "tilemap.h" 7 | #include "collisions.h" 8 | #include "gameobject.h" 9 | #include "audio.h" 10 | 11 | /********************************************* 12 | * NUMBER OF ANIMATION FUNCTIONS * 13 | * NOTE: One extra for the NULL initializer! * 14 | *********************************************/ 15 | #define NUM_ANIMS 3 16 | 17 | //Anim States 18 | #define AS_IDLE 0x00 19 | #define AS_WALK 0x01 20 | 21 | //TO ACCESS ANIMS ADD THIS LINE INTO YOUR .c fILE: 22 | //extern VOID (*animFunction[NUM_ANIMS])(struct GameObject*); 23 | 24 | #endif /* ANIMS_H */ 25 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets.h: -------------------------------------------------------------------------------- 1 | #ifndef ASSETS_H 2 | #define ASSETS_H 3 | 4 | #ifdef FONTS_H 5 | static struct TextAttr textAttrs[NUM_TEXTFONTS] = {{"Helvetica.font", 9, FS_NORMAL, FPF_DESIGNED}}; 6 | static STRPTR gameFontFiles[NUM_GAMEFONTS] = {"orbitron_15.fnt"}; 7 | #endif 8 | 9 | #ifdef LEVEL_H 10 | // LEVEL 0 (Main Menu) 11 | STATIC STRPTR sprite_banks_0[] = {"MousePointers1.spr", NULL}; 12 | STATIC STRPTR sound_samples_0[] = {"select-granted-05.iff", "select-granted-06.iff", NULL}; 13 | STATIC UBYTE* palettes_0[] = {palette_0_0, NULL}; 14 | STATIC STRPTR gameobj_banks_0[] = {(STRPTR)4, NULL}; 15 | // LEVEL 1 (Level2) 16 | STATIC STRPTR tilesets_1[] = {"Pixel16.tls", NULL}; 17 | STATIC STRPTR tilemaps_1[] = {"Pixel16/Tilemap.map", NULL}; 18 | STATIC STRPTR bob_sheets_1[] = {"waterfall.sht", NULL}; 19 | STATIC STRPTR sprite_banks_1[] = {"Character.spr", NULL}; 20 | STATIC STRPTR music_modules_1[] = {"walls-beautiful_world.mod", NULL}; 21 | STATIC UBYTE* palettes_1[] = {Pixel16_Palette, NULL}; 22 | STATIC STRPTR gameobj_banks_1[] = {"Pixel16/Gameobjects.obj", NULL}; 23 | 24 | static struct LevelData levelData[NUM_LEVELS] = {{"Main Menu", 25 | NULL, 26 | NULL, 27 | NULL, 28 | sprite_banks_0, 29 | NULL, 30 | sound_samples_0, 31 | palettes_0, 32 | gameobj_banks_0, 33 | NULL, 34 | MD_blitBOB, 35 | MD_unBlitBOB, 36 | MENU_SCREEN_WIDTH, 37 | MENU_SCREEN_HEIGHT, 38 | 0, 39 | 0 40 | }, 41 | {"Level2", 42 | tilesets_1, 43 | tilemaps_1, 44 | bob_sheets_1, 45 | sprite_banks_1, 46 | music_modules_1, 47 | NULL, 48 | palettes_1, 49 | gameobj_banks_1, 50 | NULL, 51 | LD_blitBOB, 52 | LD_unBlitBOB, 53 | SCREEN_WIDTH, 54 | SCREEN_HEIGHT, 55 | 500, 56 | 500 57 | } 58 | }; 59 | #endif 60 | 61 | #endif /* ASSETS_H */ 62 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/Character_Sheet.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/assets/Character_Sheet.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/Character_Sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/assets/Character_Sheet.png -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/MouseSheet1.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/assets/MouseSheet1.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/Pixel16.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/Pixel16_Sheet.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/assets/Pixel16_Sheet.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/Pixel16_Sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/assets/Pixel16_Sheet.png -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/assets/Waterfall.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/assets/Waterfall.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/collisions.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "collisions.h" 8 | /// 9 | ///defines 10 | /// 11 | ///globals 12 | extern struct Level current_level; 13 | /// 14 | //prototypes 15 | // Collisions between gameobjects 16 | VOID blockObjectCollision(struct GameObject*, struct GameObject*); 17 | 18 | // Collisions between tiles and gameobjects 19 | VOID hotSpotTileCollision(struct GameObject*); 20 | 21 | //exports 22 | VOID (*gobjCollisionFunction[NUM_GOBJ_COLL_FUNCS])(struct GameObject*, struct GameObject*) = {NULL, 23 | blockObjectCollision}; 24 | 25 | VOID (*tileCollisionFunction[NUM_TILE_COLL_FUNCS])(struct GameObject*) = {NULL, 26 | hotSpotTileCollision}; 27 | // 28 | 29 | /******************************************** 30 | * Collisions functions between gameobjects * 31 | ********************************************/ 32 | ///blockObjectCollision(gameobject) 33 | /****************************************************************************** 34 | * Prevents the hotspot of a gameobject entering in. * 35 | * NOTE: This implementation prioritizes pushing go2s out vertical first in * 36 | * the case of entry at corners. This is in accordance with block tiles * 37 | * pushing out horizontal first. Otherwise there will be leakages in blocking.* 38 | * NOTE: You must overlap block objects at least one pixel if you need * 39 | * compound shapes which use more than one gameobject. Otherwise there will * 40 | * be leakages in blocking. Colliding block objects won't push eachother out * 41 | * as long as they don't have an anim.direction. * 42 | ******************************************************************************/ 43 | VOID blockObjectCollision(struct GameObject* go1, struct GameObject* go2) 44 | { 45 | //Collisions fire up by image rectangle collisions so we have to check if 46 | //this is an hot spot collision! 47 | //WARNING! This obligates hotspot being inside the image rectangle! 48 | if (go2->x >= go1->x1 && go2->x < go1->x2 && go2->y >= go1->y1 && go2->y < go1->y2) { 49 | switch (go2->anim.direction) { 50 | case LEFT: 51 | setGameObjectPos(go2, go1->x2, go2->y); 52 | break; 53 | case RIGHT: 54 | setGameObjectPos(go2, go1->x1 - 1, go2->y); 55 | break; 56 | case DOWN: 57 | setGameObjectPos(go2, go2->x, go1->y1 - 1); 58 | break; 59 | case UP: 60 | setGameObjectPos(go2, go2->x, go1->y2); 61 | break; 62 | case LEFT|UP: 63 | if (go1->x2 - go2->x >= go1->y2 - go2->y) { 64 | setGameObjectPos(go2, go2->x, go1->y2); 65 | } 66 | else { 67 | setGameObjectPos(go2, go1->x2, go2->y); 68 | } 69 | break; 70 | case LEFT|DOWN: 71 | if (go1->x2 - 1 - go2->x >= go2->y - go1->y1) { 72 | setGameObjectPos(go2, go2->x, go1->y1 - 1); 73 | } 74 | else { 75 | setGameObjectPos(go2, go1->x2, go2->y); 76 | } 77 | break; 78 | case RIGHT|UP: 79 | if (go2->x - go1->x1 >= go1->y2 - 1 - go2->y) { 80 | setGameObjectPos(go2, go2->x, go1->y2); 81 | } 82 | else { 83 | setGameObjectPos(go2, go1->x1 - 1, go2->y); 84 | } 85 | break; 86 | case RIGHT|DOWN: 87 | if (go2->x - go1->x1 >= go2->y - go1->y1) { 88 | setGameObjectPos(go2, go2->x, go1->y1 - 1); 89 | } 90 | else { 91 | setGameObjectPos(go2, go1->x1 - 1, go2->y); 92 | } 93 | break; 94 | } 95 | } 96 | } 97 | /// 98 | 99 | /******************************************** 100 | * Collisions between tiles and gameobjects * 101 | ********************************************/ 102 | ///hotSpotTileCollision(gameobject) 103 | /****************************************************************************** 104 | * Prevents hotspot of a gameobject moving into a block tile. * 105 | ******************************************************************************/ 106 | VOID hotSpotTileCollision(struct GameObject* go) 107 | { 108 | /* 109 | LONG x = go->x; 110 | LONG y = go->y; 111 | struct TileMap* map = current_level.tilemap[current_level.current.tilemap]; 112 | */ 113 | 114 | /********************************** 115 | * Tile collide per image hotspot * 116 | **********************************/ 117 | /* 118 | TILEID tileID = TILEID_AT_COORD(map, x, y); 119 | */ 120 | 121 | /************************************ 122 | * Tile collide per image rectangle * 123 | ************************************/ 124 | // x1, y1 collision 125 | // tileID = TILEID_AT_COORD(map, go->x1, go->y1); 126 | 127 | // x2, y1 collision 128 | // tileID = TILEID_AT_COORD(map, go->x2, go->y1); 129 | 130 | // x2, y2 collision 131 | // tileID = TILEID_AT_COORD(map, go->x2, go->y2); 132 | 133 | // x1, y2 collision 134 | // tileID = TILEID_AT_COORD(map, go->x1, go->y2); 135 | } 136 | /// 137 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/collisions.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLISIONS_H 2 | #define COLLISIONS_H 3 | 4 | #include "level.h" 5 | #include "tiles.h" 6 | #include "tilemap.h" 7 | #include "gameobject.h" 8 | 9 | #define BLOCK_TILE_START 112 10 | #define is_block_tile(i) (i >= BLOCK_TILE_START) 11 | 12 | #define NUM_GOBJ_COLL_FUNCS 2 13 | #define NUM_TILE_COLL_FUNCS 2 14 | 15 | //TO ACCESS COLLISION FUNCTIONS ADD THESE LINES INTO YOUR .c fILE: 16 | //extern VOID (*gobjCollisionFunction[NUM_GOBJ_COLL_FUNCS])(struct GameObject*, struct GameObject*); 17 | //extern VOID (*tileCollisionFunction[NUM_TILE_COLL_FUNCS])(struct GameObject*); 18 | 19 | #endif /* COLLISIONS_H */ 20 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/Character.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/Character.spr -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/MousePointers1.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/MousePointers1.spr -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/Pixel16.tls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/Pixel16.tls -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/Pixel16/Gameobjects.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/Pixel16/Gameobjects.obj -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/Pixel16/Tilemap.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/Pixel16/Tilemap.map -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/orbitron_15.fnt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/orbitron_15.fnt -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/orbitron_15.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/orbitron_15.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/select-granted-05.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/select-granted-05.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/select-granted-06.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/select-granted-06.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/walls-beautiful_world.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/walls-beautiful_world.mod -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/waterfall.iff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Templates/Top-Down_Adventure/data/waterfall.iff -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/data/waterfall.sht: -------------------------------------------------------------------------------- 1 | BOBSHEETwaterfall.iff0 0 0 @ -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/level_display_loop.c: -------------------------------------------------------------------------------- 1 | STATIC VOID levelDisplayLoop() 2 | { 3 | UWORD quitting = FALSE; 4 | struct GameObject* main_char = ¤t_level.gameobject_bank[0]->gameobjects[0]; 5 | 6 | while (TRUE) { 7 | UBYTE main_char_direction; 8 | WORD scroll_x; 9 | WORD scroll_y; 10 | struct ScrollInfo si; 11 | //struct MouseState ms; 12 | 13 | #ifdef DYNAMIC_COPPERLIST 14 | if (new_frame_flag % 2) { 15 | //Unsync detected. Re-scync with the copperlist set by the copper 16 | if (CopperList == CopperList1) 17 | CopperList = CopperList2; 18 | else 19 | CopperList = CopperList1; 20 | } 21 | #endif //DYNAMIC_COPPERLIST 22 | new_frame_flag = 1; 23 | 24 | doKeyboardIO(); 25 | //UL_VALUE(ms) = readMouse(0); 26 | 27 | if (keyState(RAW_ESC) && !quitting) { 28 | quitting = TRUE; 29 | color_table->state = CT_FADE_OUT; 30 | volume_table.state = PTVT_FADE_OUT; 31 | }; 32 | if (quitting == TRUE && color_table->state == CT_IDLE && volume_table.state == PTVT_IDLE) { 33 | break; 34 | } 35 | 36 | //if (JOY_BUTTON1(1) || keyState(RAW_CTRL)) /* SHOOT? */; 37 | main_char->anim.state = AS_IDLE; 38 | main_char_direction = 0; 39 | 40 | if (JOY_UP(1) || keyState(RAW_UP)) { main_char->anim.state = AS_WALK; main_char_direction = UP; } 41 | else if (JOY_DOWN(1) || keyState(RAW_DOWN)) { main_char->anim.state = AS_WALK; main_char_direction = DOWN; } 42 | if (JOY_LEFT(1) || keyState(RAW_LEFT)) { main_char->anim.state = AS_WALK; main_char_direction |= LEFT; } 43 | else if (JOY_RIGHT(1) || keyState(RAW_RIGHT)) { main_char->anim.state = AS_WALK; main_char_direction |= RIGHT; } 44 | 45 | if (main_char_direction) main_char->anim.direction = main_char_direction; 46 | 47 | scroll_x = main_char->x - *mapPosX - (SCREEN_WIDTH / 2); 48 | scroll_y = main_char->y - *mapPosY - (SCREEN_HEIGHT / 2); 49 | if (scroll_x > 0) si.right = scroll_x; 50 | if (scroll_x < 0) si.left = -scroll_x; 51 | if (scroll_y > 0) si.down = scroll_y; 52 | if (scroll_y < 0) si.up = -scroll_y; 53 | 54 | scroll(&si); 55 | 56 | updateVolume(); 57 | updateColorTable_Partial(color_table, 1, color_table->colors); 58 | updateGameObjects(); 59 | #ifdef DYNAMIC_COPPERLIST 60 | updateDynamicCopperList(); 61 | #endif 62 | // *(WORD*)0xDFF180 = 0; //DEBUG (displays performance of the above algorithms) 63 | updateBOBs(); 64 | 65 | //Wait until current frame completes 66 | waitTOF(); 67 | 68 | //blit the remaining secondPart tiles first thing on the next frame 69 | scrollRemaining(&si); 70 | 71 | // *(WORD*)0xDFF180 = 0x0F00; //DEBUG (displays performance of the above algorithms) 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/palettes.h: -------------------------------------------------------------------------------- 1 | STATIC UBYTE palette_0_0[] = {3, 2 | 0, 0, 0, 3 | 121, 121, 121, 4 | 180, 180, 180, 5 | 255, 255, 255}; 6 | 7 | STATIC UBYTE Pixel16_Palette[] = {31, 8 | 0, 0, 0, 9 | 31, 90, 67, 10 | 51, 102, 0, 11 | 8, 120, 7, 12 | 59, 128, 83, 13 | 96, 125, 81, 14 | 75, 175, 53, 15 | 0, 255, 0, 16 | 133, 194, 27, 17 | 127, 127, 0, 18 | 172, 199, 101, 19 | 169, 51, 51, 20 | 154, 77, 118, 21 | 218, 90, 59, 22 | 250, 110, 121, 23 | 191, 146, 101, 24 | 61, 44, 44, 25 | 15, 41, 30, 26 | 88, 57, 68, 27 | 112, 80, 72, 28 | 141, 78, 50, 29 | 164, 108, 78, 30 | 209, 153, 68, 31 | 244, 180, 27, 32 | 51, 89, 103, 33 | 50, 150, 177, 34 | 54, 189, 197, 35 | 235, 156, 118, 36 | 255, 162, 172, 37 | 118, 125, 122, 38 | 176, 167, 184, 39 | 255, 255, 255}; 40 | -------------------------------------------------------------------------------- /Templates/Top-Down_Adventure/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_H 2 | #define SETTINGS_H 3 | 4 | /****************************************************************************** 5 | * VIDEO * 6 | ******************************************************************************/ 7 | 8 | //Un-comment to activate 24bit AGA color features. 9 | #define CT_AGA 10 | //Set the default fade in/out speed. Smaller is faster. (2-256) 11 | #define CT_DEFAULT_STEPS 64 12 | 13 | //Un-comment to activate per-frame dynamic copperlist generation. 14 | #define DYNAMIC_COPPERLIST 15 | //Un-comment to activate smart sprite algorithms. 16 | #define SMART_SPRITES 17 | //Select bitplane and sprite fetch modes 18 | #define BPL_FMODE 1 // Bitplane fetch mode (1, 2 or 4) 19 | #define SPR_FMODE 1 // Sprite fetch mode (1, 2 or 4) 20 | 21 | #define TOP_PANEL_HEIGHT 0 22 | #define BOTTOM_PANEL_HEIGHT 0 23 | 24 | #define SCREEN_WIDTH 320 // Visible resolution of the level screen 25 | #define SCREEN_HEIGHT 256 // " " " " " " 26 | #define SCR_WIDTH_EXTRA 64 // Additional horizontal pixels for scroll 27 | #define SCR_HEIGHT_EXTRA 32 // Additional vertical pixels for scroll (2 extra tiles) 28 | #define SCREEN_DEPTH 5 // How many bitplanes (1-6 on OCS/ECS, 1-8 on AGA) 29 | 30 | #define MAX_SCROLL_SPEED 16 // pixels per frame 31 | 32 | /****************************************************************************** 33 | * AUDIO * 34 | ******************************************************************************/ 35 | 36 | #define PAULA_PAL_CYCLES 3546895 37 | #define PAULA_NTSC_CYCLES 3579545 38 | #define PAULA_MIN_PERIOD 124 39 | 40 | //Set PAL/NTSC 41 | #define PAULA_CYCLES PAULA_PAL_CYCLES 42 | //Set the default module playback volume. (0-64) 43 | #define PTVT_DEFAULT_VOLUME 64 44 | //Set the default audio fade in/out speed. Smaller is faster. (1-256) 45 | #define PTVT_DEFAULT_STEPS 64 46 | //Default playback volume for sound samples (0-64) 47 | #define SFX_DEFAULT_VOLUME 64 48 | //Default playback channel for sound samples (0-3 / -1 for best avail. channel) 49 | #define SFX_DEFAULT_CHANNEL 1 50 | //Default playback priority for sound samples (1-127) 51 | #define SFX_DEFAULT_PRIORITY 1 52 | 53 | /****************************************************************************** 54 | * FONTS * 55 | ******************************************************************************/ 56 | 57 | #define NUM_TEXTFONTS 1 // Number of Amiga TextFonts to load 58 | #define TF_DEFAULT 0 // Index of the default TextFont 59 | 60 | #define NUM_GAMEFONTS 1 // Number of GameFonts to load 61 | #define GF_DEFAULT 0 // Index of the first loaded GameFont 62 | 63 | /****************************************************************************** 64 | * GAMEOBJECTS * 65 | ******************************************************************************/ 66 | 67 | #define NUM_LEVELS 2 // Number of levels in the game 68 | 69 | #define NUM_SPRITES 8 70 | #define NUM_BOBS 4 71 | #define NUM_GAMEOBJECTS 0 72 | 73 | #define SMALL_IMAGE_SIZES 74 | //#define BIG_IMAGE_SIZES 75 | //#define SMALL_HITBOX_SIZES 76 | 77 | #endif /* SETTINGS_H */ 78 | -------------------------------------------------------------------------------- /Tools/BOBSheeter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Tools/BOBSheeter -------------------------------------------------------------------------------- /Tools/ConvertMap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Tools/ConvertMap -------------------------------------------------------------------------------- /Tools/ConvertTiles: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Tools/ConvertTiles -------------------------------------------------------------------------------- /Tools/SpriteBankMerger: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Tools/SpriteBankMerger -------------------------------------------------------------------------------- /Tools/SpriteBanker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/Tools/SpriteBanker -------------------------------------------------------------------------------- /Tools/src/BOBSheeter/makefile: -------------------------------------------------------------------------------- 1 | # Generic Amiga cross-compiler makefile 2 | # - for m68k OS3 binaries use: make 3 | # - for ppc OS4 binaries use: make OS=os4 4 | # - for ppc MorphOS binaries use: make OS=mos 5 | 6 | EXE = BOBSheeter 7 | ################################################################################ 8 | # Target OS 9 | ifndef (OS) 10 | OS = os3 11 | endif 12 | 13 | ifeq ($(OS), os3) 14 | CPU = -m68020 15 | CC = m68k-amigaos-gcc 16 | OPTIONS = -DNO_INLINE_STDARG 17 | LFLAGS = -s -noixemul -lamiga 18 | else 19 | ifeq ($(OS), os4) 20 | CPU = -mcpu=powerpc 21 | CC = ppc-amigaos-gcc 22 | OPTIONS = -DNO_INLINE_STDARG -D__USE_INLINE__ 23 | LFLAGS = -lauto 24 | else 25 | ifeq ($(OS), mos) 26 | CPU = -mcpu=powerpc 27 | CC = ppc-morphos-gcc 28 | OPTIONS = -DNO_PPCINLINE_STDARG 29 | LFLAGS = -s -noixemul 30 | endif 31 | endif 32 | endif 33 | ################################################################################ 34 | # Common options 35 | WARNINGS = -Wall 36 | OPTIMIZE = -Os 37 | DEBUG = 38 | IDIRS = 39 | 40 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 41 | 42 | OBJS = main.o 43 | ################################################################################ 44 | 45 | # target 'all' (default target) 46 | all : $(EXE) 47 | 48 | # $@ matches the target; $< matches the first dependent 49 | main.o : main.c 50 | $(CC) -c $< $(CFLAGS) 51 | 52 | $(EXE) : $(OBJS) 53 | $(CC) -o $(EXE) $(OBJS) $(LFLAGS) 54 | 55 | # target 'clean' 56 | clean: 57 | rm -f $(EXE) 58 | rm -f $(OBJS) 59 | -------------------------------------------------------------------------------- /Tools/src/ConvertMap/makefile: -------------------------------------------------------------------------------- 1 | # Generic Amiga cross-compiler makefile 2 | # - for m68k OS3 binaries use: make 3 | # - for ppc OS4 binaries use: make OS=os4 4 | # - for ppc MorphOS binaries use: make OS=mos 5 | 6 | EXE = ConvertMap 7 | ################################################################################ 8 | # Target OS 9 | ifndef (OS) 10 | OS = os3 11 | endif 12 | 13 | ifeq ($(OS), os3) 14 | CPU = -m68020 15 | CC = m68k-amigaos-gcc 16 | OPTIONS = -DNO_INLINE_STDARG 17 | LFLAGS = -s -noixemul -lamiga 18 | else 19 | ifeq ($(OS), os4) 20 | CPU = -mcpu=powerpc 21 | CC = ppc-amigaos-gcc 22 | OPTIONS = -DNO_INLINE_STDARG -D__USE_INLINE__ 23 | LFLAGS = -lauto 24 | else 25 | ifeq ($(OS), mos) 26 | CPU = -mcpu=powerpc 27 | CC = ppc-morphos-gcc 28 | OPTIONS = -DNO_PPCINLINE_STDARG 29 | LFLAGS = -s -noixemul 30 | endif 31 | endif 32 | endif 33 | ################################################################################ 34 | # Common options 35 | WARNINGS = -Wall 36 | OPTIMIZE = -Os 37 | DEBUG = 38 | IDIRS = 39 | 40 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 41 | 42 | OBJS = main.o utility.o 43 | ################################################################################ 44 | 45 | # target 'all' (default target) 46 | all : $(EXE) 47 | 48 | # $@ matches the target; $< matches the first dependent 49 | main.o : main.c 50 | $(CC) -c $< $(CFLAGS) 51 | 52 | $(EXE) : $(OBJS) 53 | $(CC) -o $(EXE) $(OBJS) $(LFLAGS) 54 | 55 | # target 'clean' 56 | clean: 57 | rm -f $(EXE) 58 | rm -f $(OBJS) 59 | -------------------------------------------------------------------------------- /Tools/src/ConvertMap/utility.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILITY_H 2 | #define UTILITY_H 3 | 4 | #define DOS_RESERVED ":/" 5 | #define DOS_UNRECOMMENDED ";*?#<>~|$`'\"%" 6 | #define DOS_BRACKETS "()[]" 7 | 8 | #define NO_MORE_DEFINITIONS 0 9 | #define MORE_DEFINITIONS -1 10 | #define MORE_VARIABLES -2 11 | #define SYNTAX_ERROR -3 12 | 13 | #define MODE_VARIABLE 0 14 | #define MODE_TYPE 1 15 | 16 | BOOL Exists(STRPTR filename); 17 | BOOL aToi(STRPTR text, LONG *result); 18 | DOUBLE aTof(UBYTE* str); 19 | STRPTR makeString(STRPTR str); 20 | STRPTR makeString2(STRPTR str1, STRPTR str2); 21 | STRPTR makeString3(STRPTR str1, STRPTR str2, STRPTR str3); 22 | VOID freeString(STRPTR str); 23 | 24 | STRPTR makePath(STRPTR dir, STRPTR file, STRPTR extension); 25 | STRPTR stripExtension(STRPTR pathname); 26 | VOID replaceChars(STRPTR str, STRPTR restricted, UBYTE ch); 27 | STRPTR pathPart(STRPTR pathname); 28 | STRPTR searchString(STRPTR source, STRPTR str); 29 | BOOL locateStrInFile(BPTR fh, STRPTR str); 30 | BOOL locateArrayStart(BPTR fh); 31 | BOOL locateArrayEnd(BPTR fh); 32 | LONG readDefinition(BPTR fh, STRPTR* dest_string, ULONG mode); 33 | 34 | #endif /* UTILITY_H */ 35 | -------------------------------------------------------------------------------- /Tools/src/ConvertTiles/makefile: -------------------------------------------------------------------------------- 1 | # Generic Amiga cross-compiler makefile 2 | # - for m68k OS3 binaries use: make 3 | # - for ppc OS4 binaries use: make OS=os4 4 | # - for ppc MorphOS binaries use: make OS=mos 5 | 6 | EXE = ConvertTiles 7 | ################################################################################ 8 | # Target OS 9 | ifndef (OS) 10 | OS = os3 11 | endif 12 | 13 | ifeq ($(OS), os3) 14 | CPU = -m68020 15 | CC = m68k-amigaos-gcc 16 | OPTIONS = -DNO_INLINE_STDARG 17 | LFLAGS = -s -noixemul -lamiga 18 | else 19 | ifeq ($(OS), os4) 20 | CPU = -mcpu=powerpc 21 | CC = ppc-amigaos-gcc 22 | OPTIONS = -DNO_INLINE_STDARG -D__USE_INLINE__ 23 | LFLAGS = -lauto 24 | else 25 | ifeq ($(OS), mos) 26 | CPU = -mcpu=powerpc 27 | CC = ppc-morphos-gcc 28 | OPTIONS = -DNO_PPCINLINE_STDARG 29 | LFLAGS = -s -noixemul 30 | endif 31 | endif 32 | endif 33 | ################################################################################ 34 | # Common options 35 | WARNINGS = -Wall 36 | OPTIMIZE = -Os 37 | DEBUG = 38 | IDIRS = 39 | 40 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 41 | 42 | OBJS = main.o 43 | ################################################################################ 44 | 45 | # target 'all' (default target) 46 | all : $(EXE) 47 | 48 | # $@ matches the target; $< matches the first dependent 49 | main.o : main.c 50 | $(CC) -c $< $(CFLAGS) 51 | 52 | $(EXE) : $(OBJS) 53 | $(CC) -o $(EXE) $(OBJS) $(LFLAGS) 54 | 55 | # target 'clean' 56 | clean: 57 | rm -f $(EXE) 58 | rm -f $(OBJS) 59 | -------------------------------------------------------------------------------- /Tools/src/SpriteBankMerger/makefile: -------------------------------------------------------------------------------- 1 | # Generic Amiga cross-compiler makefile 2 | # - for m68k OS3 binaries use: make 3 | # - for ppc OS4 binaries use: make OS=os4 4 | # - for ppc MorphOS binaries use: make OS=mos 5 | 6 | EXE = SpriteBankMerger 7 | ################################################################################ 8 | # Target OS 9 | ifndef (OS) 10 | OS = os3 11 | endif 12 | 13 | ifeq ($(OS), os3) 14 | CPU = -m68020 15 | CC = m68k-amigaos-gcc 16 | OPTIONS = -DNO_INLINE_STDARG 17 | LFLAGS = -s -noixemul -lamiga 18 | else 19 | ifeq ($(OS), os4) 20 | CPU = -mcpu=powerpc 21 | CC = ppc-amigaos-gcc 22 | OPTIONS = -DNO_INLINE_STDARG -D__USE_INLINE__ 23 | LFLAGS = -lauto 24 | else 25 | ifeq ($(OS), mos) 26 | CPU = -mcpu=powerpc 27 | CC = ppc-morphos-gcc 28 | OPTIONS = -DNO_PPCINLINE_STDARG 29 | LFLAGS = -s -noixemul 30 | endif 31 | endif 32 | endif 33 | ################################################################################ 34 | # Common options 35 | WARNINGS = -Wall 36 | OPTIMIZE = -Os 37 | DEBUG = 38 | IDIRS = 39 | 40 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 41 | 42 | OBJS = main.o 43 | ################################################################################ 44 | 45 | # target 'all' (default target) 46 | all : $(EXE) 47 | 48 | # $@ matches the target; $< matches the first dependent 49 | main.o : main.c 50 | $(CC) -c $< $(CFLAGS) 51 | 52 | $(EXE) : $(OBJS) 53 | $(CC) -o $(EXE) $(OBJS) $(LFLAGS) 54 | 55 | # target 'clean' 56 | clean: 57 | rm -f $(EXE) 58 | rm -f $(OBJS) 59 | -------------------------------------------------------------------------------- /Tools/src/SpriteBanker/makefile: -------------------------------------------------------------------------------- 1 | # Generic Amiga cross-compiler makefile 2 | # - for m68k OS3 binaries use: make 3 | # - for ppc OS4 binaries use: make OS=os4 4 | # - for ppc MorphOS binaries use: make OS=mos 5 | 6 | EXE = SpriteBanker 7 | ################################################################################ 8 | # Target OS 9 | ifndef (OS) 10 | OS = os3 11 | endif 12 | 13 | ifeq ($(OS), os3) 14 | CPU = -m68020 15 | CC = m68k-amigaos-gcc 16 | OPTIONS = -DNO_INLINE_STDARG 17 | LFLAGS = -s -noixemul -lamiga 18 | else 19 | ifeq ($(OS), os4) 20 | CPU = -mcpu=powerpc 21 | CC = ppc-amigaos-gcc 22 | OPTIONS = -DNO_INLINE_STDARG -D__USE_INLINE__ 23 | LFLAGS = -lauto 24 | else 25 | ifeq ($(OS), mos) 26 | CPU = -mcpu=powerpc 27 | CC = ppc-morphos-gcc 28 | OPTIONS = -DNO_PPCINLINE_STDARG 29 | LFLAGS = -s -noixemul 30 | endif 31 | endif 32 | endif 33 | ################################################################################ 34 | # Common options 35 | WARNINGS = -Wall 36 | OPTIMIZE = -Os 37 | DEBUG = 38 | IDIRS = 39 | 40 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 41 | 42 | OBJS = main.o 43 | ################################################################################ 44 | 45 | # target 'all' (default target) 46 | all : $(EXE) 47 | 48 | # $@ matches the target; $< matches the first dependent 49 | main.o : main.c 50 | $(CC) -c $< $(CFLAGS) 51 | 52 | $(EXE) : $(OBJS) 53 | $(CC) -o $(EXE) $(OBJS) $(LFLAGS) 54 | 55 | # target 'clean' 56 | clean: 57 | rm -f $(EXE) 58 | rm -f $(OBJS) 59 | -------------------------------------------------------------------------------- /ackstring.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * AckString * 3 | * Automatically acknowledges string contents when the gadget goes inactive! * 4 | ******************************************************************************/ 5 | ///Includes 6 | #include 7 | #include // <-- Required for tag redirection 8 | 9 | #include 10 | #include 11 | #include // <-- Required for DoSuperMethod() 12 | 13 | #include // Required for 14 | #include // <-- multi platform 15 | #include // compatibility 16 | 17 | #include "dosupernew.h" 18 | #include "ackstring.h" 19 | /// 20 | ///Structs 21 | struct cl_Data 22 | { 23 | // 24 | }; 25 | 26 | struct cl_Msg 27 | { 28 | ULONG MethodID; 29 | // 30 | }; 31 | /// 32 | 33 | // 34 | 35 | ///Dispatcher 36 | SDISPATCHER(cl_Dispatcher) 37 | { 38 | struct cl_Data *data; 39 | if (! (msg->MethodID == OM_NEW)) data = INST_DATA(cl, obj); 40 | 41 | switch(msg->MethodID) 42 | { 43 | case MUIM_GoInactive: 44 | DoMethod(obj, MUIM_Set, MUIA_String_Acknowledge, TRUE); 45 | 46 | default: 47 | return DoSuperMethodA(cl, obj, msg); 48 | } 49 | } 50 | /// 51 | ///Class Creator 52 | struct MUI_CustomClass* MUI_Create_AckString(void) 53 | { 54 | return (MUI_CreateCustomClass(NULL, MUIC_String, NULL, sizeof(struct cl_Data), ENTRY(cl_Dispatcher))); 55 | } 56 | /// 57 | -------------------------------------------------------------------------------- /ackstring.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * AckString * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_AckString_{Attribute} 0x80430001 6 | 7 | //Public Methods 8 | // ex: #define MUIM_AckString_{Method} 0x80430001 9 | 10 | //Public Functions 11 | struct MUI_CustomClass* MUI_Create_AckString(void); 12 | 13 | //Some very useful definitions that are omitted in mui.h 14 | #ifndef MUI_OMMITED_H 15 | #define MUI_OMMITED_H 16 | #define MUIM_GoActive 0x8042491a 17 | #define MUIM_GoInactive 0x80422c0c 18 | #endif // MUI_OMMITED_H 19 | -------------------------------------------------------------------------------- /assets_editor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * AssetsEditor * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_AssetsEditor_{Attribute} 0x80430001 6 | #define MUIA_AssetsEditor_NumLevels 0x80430701 //(..G) 7 | #define MUIA_AssetsEditor_NumTextfonts 0x80430702 //(..G) 8 | #define MUIA_AssetsEditor_NumGamefonts 0x80430703 //(..G) 9 | #define MUIA_AssetsEditor_PaletteSelector 0x80430704 //(.S.) 10 | #define MUIA_AssetsEditor_BitmapSelector 0x80430705 //(.S.) 11 | #define MUIA_AssetsEditor_Edited 0x80430706 //(.SG) 12 | 13 | //Public Methods 14 | // ex: #define MUIM_AssetsEditor_{Method} 0x80430001 15 | #define MUIM_AssetsEditor_Reset 0x80430700 16 | #define MUIM_AssetsEditor_Load 0x8043070A 17 | #define MUIM_AssetsEditor_Save 0x8043070B 18 | 19 | //Public Functions 20 | struct MUI_CustomClass* MUI_Create_AssetsEditor(void); 21 | -------------------------------------------------------------------------------- /bitmap_selector.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * bitmap_selector * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_BitmapSelector_{Attribute} 0x80430D01 6 | #define MUIA_BitmapSelector_Selected 0x80430D02 //(..G) (Listenable) 7 | #define MUIA_BitmapSelector_DataDrawer 0x80430D03 //(.S.) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_bitmap_selector_{Method} 0x80430D01 11 | 12 | //Public Functions 13 | struct MUI_CustomClass* MUI_Create_BitmapSelector(void); 14 | // 15 | -------------------------------------------------------------------------------- /bobsheet_creator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * BobsheetCreator * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_BobsheetCreator_{Attribute} 0x80430001 6 | #define MUIA_BobsheetCreator_AssetsDrawer 0x80430002 //(.S.) 7 | 8 | //Public Methods 9 | // ex: #define MUIM_BobsheetCreator_{Method} 0x80430001 10 | 11 | //Public Functions 12 | struct MUI_CustomClass* MUI_Create_BobsheetCreator(void); 13 | -------------------------------------------------------------------------------- /chunky_image.c: -------------------------------------------------------------------------------- 1 | ///includes 2 | //Amiga headers 3 | #include //TEMP 4 | 5 | #include 6 | #include 7 | 8 | //Amiga protos 9 | #include 10 | #include 11 | 12 | #include "chunky_image.h" 13 | /// 14 | ///globals 15 | extern APTR g_MemoryPool; 16 | /// 17 | 18 | ///newCLUT(ilbm_img) 19 | struct CLUT* newCLUT(struct ILBMImage* img) 20 | { 21 | ULONG size = img->num_colors; 22 | struct CLUT* clut = AllocPooled(g_MemoryPool, sizeof(struct CLUT) + size * sizeof(ARGB)); 23 | 24 | if (clut) { 25 | ULONG c; 26 | 27 | clut->size = size; 28 | 29 | for (c = 0; c < size; c++) { 30 | clut->colors[c].argb.A = 0; 31 | clut->colors[c].argb.R = img->cmap[c].R; 32 | clut->colors[c].argb.G = img->cmap[c].G; 33 | clut->colors[c].argb.B = img->cmap[c].B; 34 | } 35 | } 36 | 37 | return clut; 38 | } 39 | /// 40 | ///freeCLUT(clut) 41 | VOID freeCLUT(struct CLUT* clut) 42 | { 43 | if (clut) { 44 | FreePooled(g_MemoryPool, clut, sizeof(struct CLUT) + clut->size * sizeof(ARGB)); 45 | } 46 | } 47 | /// 48 | ///newLUTPixelArray(bitmap) 49 | /****************************************************************************** 50 | * TODO: This implementation is terribly slow! Find a way to make it faster! * 51 | ******************************************************************************/ 52 | struct LUTPixelArray* newLUTPixelArray(struct BitMap* bm) 53 | { 54 | struct LUTPixelArray* lparr = NULL; 55 | 56 | if (bm) { 57 | UWORD width = GetBitMapAttr(bm, BMA_WIDTH); 58 | UWORD height = GetBitMapAttr(bm, BMA_HEIGHT); 59 | //UWORD depth = GetBitMapAttr(bm, BMA_DEPTH); 60 | 61 | lparr = AllocPooled(g_MemoryPool, sizeof(struct LUTPixelArray) + width * height); 62 | 63 | if (lparr) { 64 | lparr->width = width; 65 | lparr->height = height; 66 | 67 | //Planar to Chunky conversion! 68 | { 69 | ULONG x, y, r; 70 | struct RastPort rp; //a fake rastport to be able to call ReadPixel() 71 | InitRastPort(&rp); 72 | rp.BitMap = bm; 73 | 74 | for (y = 0; y < height; y++) { 75 | r = y * width; 76 | for (x = 0; x < width; x++) { 77 | LONG index = ReadPixel(&rp, x, y); //WARNING: Probably this is slow! 78 | lparr->pixels[r + x] = (UBYTE)index; 79 | } 80 | } 81 | } 82 | } 83 | } 84 | 85 | return lparr; 86 | } 87 | /// 88 | ///freeLUTPixelArray(LUTPixelArray) 89 | VOID freeLUTPixelArray(struct LUTPixelArray* lparr) 90 | { 91 | if (lparr) { 92 | FreePooled(g_MemoryPool, lparr, sizeof(struct LUTPixelArray) + lparr->width * lparr->height); 93 | } 94 | } 95 | /// 96 | 97 | ///scaleLUTPixelArray(srcRect, srcW, srcH, srcMod, rastPort, colTable, destX, destY, scale) 98 | VOID scaleLUTPixelArray(APTR srcRect, UWORD srcW, UWORD srcH, UWORD srcMod, struct RastPort* rp, APTR colTable, UWORD destX, UWORD destY, UWORD scale) 99 | { 100 | switch (scale) { 101 | case 1: 102 | WriteLUTPixelArray(srcRect, 0, 0, srcMod, rp, colTable, destX, destY, srcW, srcH, CTABFMT_XRGB8); 103 | break; 104 | default: 105 | { 106 | UBYTE* src = (UBYTE*)srcRect; 107 | ULONG* lut = (ULONG*)colTable; 108 | ULONG r, c; //source row and column 109 | ULONG x, y; //dest x and y on the rastPort 110 | LONG next_row = srcMod - srcW; 111 | 112 | for (r = 0, y = destY; r < srcH; r++, y += scale) { 113 | for (c = 0, x = destX; c < srcW; c++, x += scale) { 114 | FillPixelArray(rp, x, y, scale, scale, lut[*src]); 115 | src++; 116 | } 117 | src += next_row; 118 | } 119 | } 120 | break; 121 | } 122 | } 123 | /// 124 | -------------------------------------------------------------------------------- /chunky_image.h: -------------------------------------------------------------------------------- 1 | #ifndef CHUNKY_IMAGE_H 2 | #define CHUNKY_IMAGE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "ILBM_image.h" 8 | 9 | typedef union { 10 | struct { 11 | UBYTE A,R,G,B; 12 | }argb; 13 | ULONG value; 14 | } ARGB; 15 | 16 | struct CLUT { 17 | ULONG size; //It is an ULONG to long align the table 18 | ARGB colors[0]; 19 | }; 20 | 21 | struct LUTPixelArray { 22 | UWORD width; 23 | UWORD height; 24 | UBYTE pixels[0]; 25 | }; 26 | 27 | struct CLUT* newCLUT(struct ILBMImage* img); 28 | VOID freeCLUT(struct CLUT* clut); 29 | 30 | struct LUTPixelArray* newLUTPixelArray(struct BitMap* bm); 31 | VOID freeLUTPixelArray(struct LUTPixelArray* lparr); 32 | VOID scaleLUTPixelArray(APTR srcRect, UWORD srcW, UWORD srcH, UWORD srcMod, struct RastPort* rp, APTR colTable, UWORD destX, UWORD destY, UWORD scale); 33 | 34 | #endif /* CHUNKY_IMAGE_H */ 35 | 36 | 37 | /* 38 | WriteLUTPixelArray(data->sheet.lpa->pixels, 0, 0, data->sheet.lpa->width, 39 | _rp(obj), data->sheet.clut->colors, _mleft(obj), _mtop(obj), MIN(_mwidth(obj), data->sheet.lpa->width), MIN(_mheight(obj), data->sheet.lpa->height), CTABFMT_XRGB8); 40 | 41 | printf("srcRect: %lu, srcW: %u, srcH: %u, srcMod: %u\nrp: %lu, lut: %lu, destX: %u, destY: %u, scale: %u\n", 42 | (ULONG)srcRect, srcW, srcH, srcMod, (ULONG)rp, (ULONG)colTable, destX, destY, scale); 43 | 44 | */ 45 | -------------------------------------------------------------------------------- /color_gadget.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * ColorGadget * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | #define MUIA_ColorGadget_Red MUIA_Colorfield_Red //(ISG) 6 | #define MUIA_ColorGadget_Green MUIA_Colorfield_Green //(ISG) 7 | #define MUIA_ColorGadget_Blue MUIA_Colorfield_Blue //(ISG) 8 | #define MUIA_ColorGadget_RGB MUIA_Colorfield_RGB //(ISG) 9 | #define MUIA_ColorGadget_Index 0x80430301 //(I.G) 10 | #define MUIA_ColorGadget_Selected 0x80430302 //(ISG) 11 | 12 | //Public Methods 13 | // ex: #define MUIM_ColorGadget_{Method} 0x80430001 14 | 15 | //Public Functions 16 | struct MUI_CustomClass* MUI_Create_ColorGadget(void); 17 | -------------------------------------------------------------------------------- /color_palette.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * ColorPalette * 3 | ******************************************************************************/ 4 | #define DEFAULT_PALLETTE_SIZE 8 5 | 6 | //Public Attributes 7 | #define MUIA_ColorPalette_NumColors 0x80430201 // (ISG) 8 | #define MUIA_ColorPalette_Selected 0x80430202 // (ISG) 9 | #define MUIA_ColorPalette_Palette 0x80430203 // (ISG) 10 | #define MUIA_ColorPalette_RGB 0x80430204 // (.SG) 11 | #define MUIA_ColorPalette_DisplayOnly 0x80430205 // (I..) 12 | #define MUIA_ColorPalette_Edited 0x80430206 // (.SG) 13 | 14 | //Public Methods 15 | // ex: #define MUIM_ColorPalette_{Method} 0x80430001 16 | 17 | //Public Functions 18 | struct MUI_CustomClass* MUI_Create_ColorPalette(void); 19 | VOID freePalette(UBYTE* palette); 20 | -------------------------------------------------------------------------------- /display_creator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * DisplayCreator * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_DisplayCreator_{Attribute} 0x80430C01 6 | #define MUIA_DisplayCreator_PaletteSelector 0x80430C01 //(.S.) 7 | #define MUIA_DisplayCreator_AGACheck 0x80430C02 //(.S.) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_DisplayCreator_{Method} 0x80430C01 11 | 12 | //Public Functions 13 | struct MUI_CustomClass* MUI_Create_DisplayCreator(void); 14 | // 15 | -------------------------------------------------------------------------------- /dosupernew.c: -------------------------------------------------------------------------------- 1 | #if defined(__amigaos4__) 2 | #include 3 | #include // <-- Required for DoSuperMethod() 4 | #include 5 | #else 6 | #include // <-- Required for DoSuperMethod() 7 | #endif 8 | #include 9 | 10 | #include // Required for 11 | #include // <-- multi platform 12 | #include // compatibility 13 | 14 | #if !defined(__MORPHOS__) 15 | Object* VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...) 16 | { 17 | Object *rc; 18 | VA_LIST args; 19 | 20 | VA_START(args, obj); 21 | #if defined(__AROS__) 22 | rc = (Object *) DoSuperNewTagList(cl, obj, NULL, (struct TagItem *) VA_ARG(args, IPTR)); 23 | #else 24 | rc = (Object *) DoSuperMethod(cl, obj, OM_NEW, VA_ARG(args, ULONG), NULL); 25 | #endif 26 | VA_END(args); 27 | 28 | return rc; 29 | } 30 | #endif // !__MORPHOS__ 31 | -------------------------------------------------------------------------------- /dosupernew.h: -------------------------------------------------------------------------------- 1 | #ifndef DOSUPERNEW_H 2 | #define DOSUPERNEW_H 3 | 4 | #if !defined(__MORPHOS__) 5 | Object* VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...); 6 | #endif 7 | 8 | #endif //DOSUPERNEW_H 9 | -------------------------------------------------------------------------------- /dtpicdisplay.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * DtPicDisplay * 3 | ******************************************************************************/ 4 | ///Includes 5 | #include 6 | 7 | #include 8 | #include // <-- Required for tag redirection 9 | 10 | #include 11 | #include 12 | #include // <-- Required for DoSuperMethod() 13 | 14 | #include // Required for 15 | #include // <-- multi platform 16 | #include // compatibility 17 | 18 | #include "dosupernew.h" 19 | #include "utility.h" 20 | #include "dtpicdisplay.h" 21 | /// 22 | ///Structs 23 | struct cl_ObjTable 24 | { 25 | Object* root_group; 26 | Object* dtPic; 27 | }; 28 | 29 | struct cl_Data 30 | { 31 | struct cl_ObjTable obj_table; 32 | STRPTR picture; 33 | }; 34 | 35 | struct cl_Msg 36 | { 37 | ULONG MethodID; 38 | // 39 | }; 40 | /// 41 | 42 | // 43 | ///m_SetPicture(cl, obj, picture) 44 | static ULONG m_SetPicture(struct IClass* cl, Object* obj, STRPTR picture) 45 | { 46 | struct cl_Data* data = INST_DATA(cl, obj); 47 | 48 | if (strcmp(data->picture, picture)) { 49 | if (DoMethod(data->obj_table.root_group, MUIM_Group_InitChange)) { 50 | if (data->picture) { 51 | //free the dtpic object 52 | DoMethod(data->obj_table.root_group, OM_REMMEMBER, data->obj_table.dtPic); 53 | MUI_DisposeObject(data->obj_table.dtPic); 54 | data->obj_table.dtPic = NULL; 55 | freeString(data->picture); 56 | data->picture = NULL; 57 | } 58 | 59 | if (picture && Exists(picture)) { 60 | data->obj_table.dtPic = MUI_NewObject(MUIC_Dtpic, 61 | MUIA_Dtpic_Name, picture, 62 | TAG_END); 63 | 64 | if (data->obj_table.dtPic) { 65 | DoMethod(data->obj_table.root_group, OM_ADDMEMBER, data->obj_table.dtPic); 66 | data->picture = makeString(picture); 67 | } 68 | } 69 | 70 | DoMethod(data->obj_table.root_group, MUIM_Group_ExitChange); 71 | } 72 | } 73 | 74 | if (data->picture) { 75 | DoMethod(obj, MUIM_Set, MUIA_Window_Open, TRUE); 76 | } 77 | else { 78 | DoMethod(obj, MUIM_Set, MUIA_Window_Open, FALSE); 79 | } 80 | 81 | return 0; 82 | } 83 | /// 84 | 85 | ///Overridden OM_NEW 86 | static ULONG m_New(struct IClass* cl, Object* obj, struct opSet* msg) 87 | { 88 | struct cl_Data *data; 89 | Object* root_group; 90 | 91 | if ((obj = (Object *) DoSuperNew(cl, obj, 92 | MUIA_Window_Title, "Sevgi Editor - Picture Display", 93 | MUIA_Window_RootObject, (root_group = MUI_NewObject(MUIC_Group, 94 | TAG_END)), 95 | TAG_MORE, msg->ops_AttrList))) 96 | { 97 | data = (struct cl_Data *) INST_DATA(cl, obj); 98 | 99 | data->obj_table.root_group = root_group; 100 | data->obj_table.dtPic = NULL; 101 | data->picture = NULL; 102 | 103 | DoMethod(obj, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, obj, 3, 104 | MUIM_Set, MUIA_Window_Open, FALSE); 105 | 106 | // 107 | if (/**/ TRUE) { 108 | 109 | return((ULONG) obj); 110 | } 111 | else CoerceMethod(cl, obj, OM_DISPOSE); 112 | } 113 | 114 | return (ULONG) NULL; 115 | } 116 | /// 117 | ///Overridden OM_DISPOSE 118 | static ULONG m_Dispose(struct IClass* cl, Object* obj, Msg msg) 119 | { 120 | struct cl_Data *data = INST_DATA(cl, obj); 121 | 122 | freeString(data->picture); 123 | 124 | return DoSuperMethodA(cl, obj, msg); 125 | } 126 | /// 127 | ///Overridden OM_SET 128 | //***************** 129 | static ULONG m_Set(struct IClass* cl, Object* obj, struct opSet* msg) 130 | { 131 | //struct cl_Data *data = INST_DATA(cl, obj); 132 | struct TagItem *tags, *tag; 133 | 134 | for (tags = msg->ops_AttrList; (tag = NextTagItem(&tags));) 135 | { 136 | switch (tag->ti_Tag) 137 | { 138 | // 139 | case MUIA_DtPicDisplay_Picture: 140 | m_SetPicture(cl, obj, (STRPTR)tag->ti_Data); 141 | break; 142 | } 143 | } 144 | 145 | return (DoSuperMethodA(cl, obj, (Msg) msg)); 146 | } 147 | /// 148 | ///Overridden OM_GET 149 | //***************** 150 | static ULONG m_Get(struct IClass* cl, Object* obj, struct opGet* msg) 151 | { 152 | struct cl_Data *data = INST_DATA(cl, obj); 153 | 154 | switch (msg->opg_AttrID) 155 | { 156 | case MUIA_DtPicDisplay_Picture: 157 | *msg->opg_Storage = (ULONG)data->picture; 158 | return TRUE; 159 | } 160 | 161 | return (DoSuperMethodA(cl, obj, (Msg) msg)); 162 | } 163 | /// 164 | ///Dispatcher 165 | SDISPATCHER(cl_Dispatcher) 166 | { 167 | struct cl_Data *data; 168 | if (! (msg->MethodID == OM_NEW)) data = INST_DATA(cl, obj); 169 | 170 | switch(msg->MethodID) 171 | { 172 | case OM_NEW: 173 | return m_New(cl, obj, (struct opSet*) msg); 174 | case OM_DISPOSE: 175 | return m_Dispose(cl, obj, msg); 176 | case OM_SET: 177 | return m_Set(cl, obj, (struct opSet*) msg); 178 | case OM_GET: 179 | return m_Get(cl, obj, (struct opGet*) msg); 180 | 181 | // 182 | 183 | default: 184 | return DoSuperMethodA(cl, obj, msg); 185 | } 186 | } 187 | /// 188 | ///Class Creator 189 | struct MUI_CustomClass* MUI_Create_DtPicDisplay(void) 190 | { 191 | return (MUI_CreateCustomClass(NULL, MUIC_Window, NULL, sizeof(struct cl_Data), ENTRY(cl_Dispatcher))); 192 | } 193 | /// 194 | -------------------------------------------------------------------------------- /dtpicdisplay.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * DtPicDisplay * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_DtPicDisplay_{Attribute} 0x80430501 6 | #define MUIA_DtPicDisplay_Picture 0x80430501 //(.SG) 7 | 8 | //Public Methods 9 | // ex: #define MUIM_DtPicDisplay_{Method} 0x80430501 10 | 11 | //Public Functions 12 | struct MUI_CustomClass* MUI_Create_DtPicDisplay(void); 13 | -------------------------------------------------------------------------------- /editor_settings.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * EditorSettings * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_EditorSettings_{Attribute} 0x80430A01 6 | #define MUIA_EditorSettings_IDE 0x80430A01 7 | #define MUIA_EditorSettings_Compiler 0x80430A02 8 | #define MUIA_EditorSettings_Output 0x80430A03 9 | 10 | //Public Methods 11 | // ex: #define MUIM_EditorSettings_{Method} 0x80430A01 12 | 13 | //Public Functions 14 | struct MUI_CustomClass* MUI_Create_EditorSettings(void); 15 | // 16 | 17 | //getting MUIA_EditorSettings_Compiler will return one of these below: 18 | enum { 19 | COMPILER_GCC, 20 | COMPILER_SAS_C 21 | }; 22 | -------------------------------------------------------------------------------- /game_settings.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * GameSettings * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_GameSettings_{Attribute} 0x80430801 6 | #define MUIA_GameSettings_Edited 0x80430801 //(.SG) 7 | #define MUIA_GameSettings_AGACheck 0x80430802 //(..G) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_GameSettings_{Method} 0x80430801 11 | #define MUIM_GameSettings_Load 0x80430801 12 | #define MUIM_GameSettings_Save 0x80430802 13 | 14 | //Public Functions 15 | struct MUI_CustomClass* MUI_Create_GameSettings(void); 16 | -------------------------------------------------------------------------------- /gamefont_creator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * GamefontCreator * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_GamefontCreator_{Attribute} 0x80430401 6 | #define MUIA_GamefontCreator_AssetsDrawer 0x80430401 7 | 8 | //Public Methods 9 | // ex: #define MUIM_GamefontCreator_{Method} 0x80430401 10 | 11 | //Public Functions 12 | struct MUI_CustomClass* MUI_Create_GamefontCreator(void); 13 | 14 | /* 15 | STRIP FONT FILE FORMAT DESIGN: 16 | "GAMEFONT" // eight char identifier 17 | "Stripname.iff" // filename string to strip image (NULL terminated) 18 | UBYTE type // fixed or proportional (0/1) 19 | UBYTE width // width for fixed (width of space char for proportional) 20 | UBYTE height // height of the gamefont 21 | UBYTE spacing // space between every letter 22 | UBYTE start // how many letters this strip contains beginning from... 23 | UBYTE end // ..ascii start to ascii end! 24 | // file ends here for type fixed 25 | // for proportional: 26 | struct { 27 | UWORD offset; 28 | }letter[end - start + 2]; 29 | */ 30 | -------------------------------------------------------------------------------- /image_display.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * ImageDisplay * 3 | ******************************************************************************/ 4 | #include "ILBM_image.h" 5 | #include "chunky_image.h" 6 | #include "image_spec.h" 7 | 8 | //Public Attributes 9 | // ex: #define MUIA_ImageDisplay_{Attribute} 0x80430401 10 | #define MUIA_ImageDisplay_Sheet 0x80430401 //(ISG) 11 | #define MUIA_ImageDisplay_ImageSpec 0x80430402 //(ISG) 12 | #define MUIA_ImageDisplay_Scale 0x80430403 //(ISG) 13 | 14 | //Public Methods 15 | // ex: #define MUIM_ImageDisplay_{Method} 0x80430401 16 | #define MUIM_ImageDisplay_Update 0x80430401 17 | 18 | //Public Functions 19 | struct MUI_CustomClass* MUI_Create_ImageDisplay(void); 20 | -------------------------------------------------------------------------------- /image_editor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * ImageEditor * 3 | ******************************************************************************/ 4 | 5 | //Public Attributes 6 | // ex: #define MUIA_ImageEditor_{Attribute} 0x80430001 7 | 8 | //Public Methods 9 | // ex: #define MUIM_ImageEditor_{Method} 0x80430001 10 | 11 | //Public Functions 12 | struct MUI_CustomClass* MUI_Create_ImageEditor(void); 13 | -------------------------------------------------------------------------------- /image_spec.h: -------------------------------------------------------------------------------- 1 | #ifndef IMAGE_SPEC_H 2 | #define IMAGE_SPEC_H 3 | 4 | #include "ILBM_image.h" 5 | 6 | //BOBSheet types 7 | #define BST_DISTRUBUTED 0 8 | #define BST_IRREGULAR 1 9 | 10 | struct HitBox { 11 | struct MinNode node; 12 | WORD x1, y1; 13 | WORD x2, y2; 14 | UWORD index; 15 | UWORD next; 16 | }; 17 | 18 | struct ImageSpec { 19 | UWORD x; //x coord of image on the sheet 20 | UWORD y; //y coord of image on the sheet 21 | UWORD width; 22 | UWORD height; 23 | WORD h_offs; 24 | WORD v_offs; 25 | struct HitBox* active_hitbox; 26 | struct MinList hitboxes; 27 | }; 28 | 29 | struct Sheet { 30 | STRPTR sheet_file; //The file path for the bobsheet or the spritebank 31 | STRPTR ilbm_file; //The file name for the ilbm file of the bobsheet 32 | APTR sprite_bank; 33 | ULONG sprite_bank_size; 34 | UWORD type; 35 | UWORD num_images; 36 | UWORD num_hitboxes; 37 | struct ILBMImage* image; 38 | struct ImageSpec spec[0]; 39 | }; 40 | 41 | struct Sheet* loadBOBSheet(STRPTR fileName); 42 | struct Sheet* loadSpriteBank(STRPTR fileName); 43 | VOID freeSheet(struct Sheet* bs); 44 | 45 | struct HitBox* newHitBox(WORD x1, WORD y1, WORD x2, WORD y2, UWORD index, UWORD next); 46 | VOID deleteHitBox(struct HitBox* hb); 47 | 48 | #endif /* IMAGE_SPEC_H */ 49 | 50 | /* 51 | for (hb = (struct HitBox*)list->mlh_Head; hb->node.mln_Succ; hb = (struct HitBox*)hb->node.mln_Succ) { 52 | 53 | } 54 | if (hb_next->node.mln_Succ) 55 | hb_new = newHitBox(hb->x1, hb->y1, hb->x2, hb->y2, h, UWORD next); 56 | 57 | */ 58 | -------------------------------------------------------------------------------- /includes/SDI_compiler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/includes/SDI_compiler.h -------------------------------------------------------------------------------- /includes/SDI_interrupt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/includes/SDI_interrupt.h -------------------------------------------------------------------------------- /includes/SDI_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/includes/SDI_lib.h -------------------------------------------------------------------------------- /includes/SDI_misc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/includes/SDI_misc.h -------------------------------------------------------------------------------- /includes/SDI_stdarg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/includes/SDI_stdarg.h -------------------------------------------------------------------------------- /includes/readme.md: -------------------------------------------------------------------------------- 1 | For more information on SDI-headers refer to: 2 | http://aminet.net/package/dev/c/SDI_headers -------------------------------------------------------------------------------- /integer_gadget.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Integer Gadget * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | #define MUIA_Integer_Value 0x80470001 //(ISG) (LONG) 6 | #define MUIA_Integer_Min 0x80470002 //(ISG) (LONG) 7 | #define MUIA_Integer_Max 0x80470003 //(ISG) (LONG) 8 | #define MUIA_Integer_Incr 0x80470004 //(ISG) (LONG) 9 | #define MUIA_Integer_Buttons 0x80470005 //(IS.) (BOOL) 10 | #define MUIA_Integer_Buttons_Inverse 0x80470006 //(IS.) (BOOL) 11 | #define MUIA_Integer_Button_Inc_Text 0x80470007 //(I..) (STRPTR) 12 | #define MUIA_Integer_Button_Dec_Text 0x80470008 //(I..) (STRPTR) 13 | #define MUIA_Integer_Input 0x80470009 //(I..) (BOOL) 14 | #define MUIA_Integer_124 0x8047000A //(I..) (BOOL) 15 | #define MUIA_Integer_ASCII 0x8047000B //(I..) (BOOL) 16 | #define MUIA_Integer_PaletteSize 0x8047000C //(I..) (BOOL) 17 | 18 | //Public Methods 19 | #define MUIM_Integer_Increase 0x80470001 20 | #define MUIM_Integer_Decrease 0x80470002 21 | #define MUIM_Integer_Keystroke 0x80470003 //NOTE: Make this private 22 | #define MUIM_Integer_Acknowledge 0x80470004 //NOTE: Make this private 23 | 24 | //Public Functions 25 | struct MUI_CustomClass* MUI_Create_Integer(void); 26 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alpyre/Sevgi_Engine/22c2876b82e3bc8e81196ac7c7e58c0148ca817e/main.c -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | # Generic Amiga cross-compiler makefile 2 | # - for m68k OS3 binaries use: make 3 | # - for ppc OS4 binaries use: make OS=os4 4 | # - for ppc MorphOS binaries use: make OS=mos 5 | 6 | EXE = Sevgi_Editor 7 | ################################################################################ 8 | # Target OS 9 | ifndef (OS) 10 | OS = os3 11 | endif 12 | 13 | ifeq ($(OS), os3) 14 | CPU = -m68020 15 | CC = m68k-amigaos-gcc 16 | OPTIONS = -DNO_INLINE_STDARG 17 | LFLAGS = -s -noixemul -lamiga -lmui 18 | else 19 | ifeq ($(OS), os4) 20 | CPU = -mcpu=powerpc 21 | CC = ppc-amigaos-gcc 22 | OPTIONS = -DNO_INLINE_STDARG -D__USE_INLINE__ 23 | LFLAGS = -lauto 24 | else 25 | ifeq ($(OS), mos) 26 | CPU = -mcpu=powerpc 27 | CC = ppc-morphos-gcc 28 | OPTIONS = -DNO_PPCINLINE_STDARG 29 | LFLAGS = -s -noixemul 30 | endif 31 | endif 32 | endif 33 | ################################################################################ 34 | # Common options 35 | WARNINGS = -Wall 36 | OPTIMIZE = -Os 37 | DEBUG = 38 | IDIRS = -Iincludes 39 | 40 | CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(CPU) $(OPTIONS) $(IDIRS) 41 | 42 | OBJS = main.o dosupernew.o utility.o toolbar.o tooltypes.o \ 43 | popasl_string.o ackstring.o integer_gadget.o gamefont_creator.o \ 44 | tileset_creator.o tilemap_creator.o bobsheet_creator.o \ 45 | spritebank_creator.o color_gadget.o color_palette.o palette_editor.o \ 46 | game_settings.o assets_editor.o \ 47 | ILBM_image.o chunky_image.o image_spec.o image_display.o image_editor.o \ 48 | dtpicdisplay.o new_project.o editor_settings.o palette_selector.o \ 49 | display_creator.o bitmap_selector.o 50 | ################################################################################ 51 | 52 | # target 'all' (default target) 53 | all : $(EXE) 54 | 55 | # $@ matches the target; $< matches the first dependent 56 | main.o : main.c 57 | $(CC) -c $< $(CFLAGS) 58 | 59 | bitmap_selector.o : bitmap_selector.c 60 | $(CC) -c $< $(CFLAGS) 61 | 62 | $(EXE) : $(OBJS) 63 | $(CC) -o $(EXE) $(OBJS) $(LFLAGS) 64 | 65 | # target 'clean' 66 | clean: 67 | rm -f $(EXE) 68 | rm -f $(OBJS) 69 | find . -name '*.uaem' -delete 70 | -------------------------------------------------------------------------------- /new_project.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * NewProject * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_NewProject_{Attribute} 0x80430901 6 | #define MUIA_NewProject_Create 0x80430901 //(...) (Listenable) 7 | #define MUIA_NewProject_Drawer 0x80430902 //(..G) 8 | #define MUIA_NewProject_Name 0x80430903 //(..G) 9 | 10 | //Public Methods 11 | // ex: #define MUIM_NewProject_{Method} 0x80430901 12 | 13 | //Public Functions 14 | struct MUI_CustomClass* MUI_Create_NewProject(void); 15 | -------------------------------------------------------------------------------- /palette_editor.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * PaletteEditor * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_PaletteEditor_{Attribute} 0x80430501 6 | #define MUIA_PaletteEditor_Edited 0x80430501 //(.SG) 7 | #define MUIA_PaletteEditor_List 0x80430502 //(..G) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_PaletteEditor_{Method} 0x80430501 11 | #define MUIM_PaletteEditor_Load 0x8043050B 12 | #define MUIM_PaletteEditor_Save 0x8043050C 13 | 14 | //Public Functions 15 | struct MUI_CustomClass* MUI_Create_PaletteEditor(void); 16 | -------------------------------------------------------------------------------- /palette_selector.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * PaletteSelector * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_PaletteSelector_{Attribute} 0x80430B01 6 | #define MUIA_PaletteSelector_SourceList 0x80430B01 //(.S.) 7 | #define MUIA_PaletteSelector_Selected 0x80430B02 //(..G) (Listenable) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_PaletteSelector_{Method} 0x80430B03 11 | 12 | //Public Functions 13 | struct MUI_CustomClass* MUI_Create_PaletteSelector(void); 14 | // 15 | -------------------------------------------------------------------------------- /popasl_string.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * PopASLString * 3 | ******************************************************************************/ 4 | #include 5 | 6 | //Public Attributes 7 | // ex: #define MUIA_PopASLString_{Attribute} 0x80430FF1 8 | #define MUIA_PopASLString_Requester 0x80430FF1 //(I..) (struct FileRequester*) // !!MANDATORY!! 9 | #define MUIA_PopASLString_StringFunc 0x80430FF2 //(ISG) (VOID (*)(struct FileRequester*, Object*)) 10 | #define MUIA_PopASLString_StringObject 0x80430FF3 //(..G) (Object*) 11 | #define MUIA_PopASLString_PopButton 0x80430FF4 //(..G) (Object*) 12 | #define MUIA_PopASLString_IgnoreContents 0x80430FF5 //(ISG) (BOOL) 13 | //All ASLFR_{*} tags are recognized 14 | //MUIA_Image_Spec will set the image on the pop button (defaults to MUII_PopFile) 15 | 16 | //Public Methods 17 | // ex: #define MUIM_PopASLString_{Method} 0x80430FF1 18 | 19 | //Public Functions 20 | struct MUI_CustomClass* MUI_Create_PopASLString(void); 21 | // 22 | -------------------------------------------------------------------------------- /spritebank_creator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * SpritebankCreator * 3 | ******************************************************************************/ 4 | 5 | //Public Attributes 6 | // ex: #define MUIA_SpritebankCreator_{Attribute} 0x80430001 7 | #define MUIA_SpritebankCreator_AssetsDrawer 0x80430002 //(.S.) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_SpritebankCreator_{Method} 0x80430001 11 | 12 | //Public Functions 13 | struct MUI_CustomClass* MUI_Create_SpritebankCreator(void); 14 | -------------------------------------------------------------------------------- /tilemap_creator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * TilemapCreator * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_TilemapCreator_{Attribute} 0x80430001 6 | #define MUIA_TilemapCreator_AddZeroButton 0x80430001 //(..G) 7 | #define MUIA_TilemapCreator_AssetsDrawer 0x80430002 //(.S.) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_TilemapCreator_{Method} 0x80430001 11 | 12 | //Public Functions 13 | struct MUI_CustomClass* MUI_Create_TilemapCreator(void); 14 | -------------------------------------------------------------------------------- /tileset_creator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * TilesetCreator * 3 | ******************************************************************************/ 4 | //Public Attributes 5 | // ex: #define MUIA_TilesetCreator_{Attribute} 0x80430001 6 | #define MUIA_TilesetCreator_AddZeroButton 0x80430001 //(..G) 7 | #define MUIA_TilesetCreator_AssetsDrawer 0x80430002 //(.S.) 8 | 9 | //Public Methods 10 | // ex: #define MUIM_TilesetCreator_{Method} 0x80430001 11 | 12 | //Public Functions 13 | struct MUI_CustomClass* MUI_Create_TilesetCreator(void); 14 | -------------------------------------------------------------------------------- /toolbar.c: -------------------------------------------------------------------------------- 1 | ///Includes 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | //Amiga headers 9 | #include 10 | #include 11 | 12 | //Amiga protos 13 | #include 14 | #include 15 | 16 | /* MUI headers */ 17 | #include 18 | #include 19 | 20 | #include "utility.h" 21 | #include "toolbar.h" 22 | /// 23 | ///Globals 24 | extern APTR g_MemoryPool; 25 | 26 | #define NUM_IMAGE_SPECS (sizeof(g_imageFiles) / sizeof(STRPTR)) 27 | STRPTR g_imageFiles[] = {TOOLBAR_IMAGE_FILES}; 28 | STRPTR g_imageSpecs[NUM_IMAGE_SPECS] = {NULL}; 29 | /// 30 | 31 | BOOL createImageSpecs() 32 | { 33 | ULONG num_specs = NUM_IMAGE_SPECS; 34 | ULONG i; 35 | UBYTE spec[256]; //WARNING! Buffer overrun potential! 36 | 37 | for (i = 0; i < num_specs; i++) { 38 | strcpy(spec, "5:"); 39 | strcat(spec, TOOLBAR_IMAGE_DIR); 40 | strcat(spec, "/"); 41 | strcat(spec, TOOLBAR_IMAGE_STYLE); 42 | strcat(spec, "/"); 43 | strcat(spec, g_imageFiles[i]); 44 | 45 | g_imageSpecs[i] = AllocPooled(g_MemoryPool, strlen(spec) + 1); 46 | if (g_imageSpecs[i]) { 47 | strcpy(g_imageSpecs[i], spec); 48 | } 49 | else { 50 | freeImageSpecs(); 51 | return FALSE; 52 | } 53 | } 54 | 55 | return TRUE; 56 | } 57 | 58 | VOID freeImageSpecs() 59 | { 60 | ULONG num_specs = NUM_IMAGE_SPECS; 61 | LONG i; 62 | for (i = num_specs - 1; i >= 0; i--) { 63 | freeString(g_imageSpecs[i]); 64 | g_imageSpecs[i] = NULL; 65 | } 66 | } 67 | 68 | Object* MUI_NewImageButton(ULONG spec, STRPTR short_help, ULONG disabled) 69 | { 70 | return MUI_NewObject(MUIC_Image, 71 | MUIA_Image_Spec, g_imageSpecs[spec], 72 | MUIA_ShortHelp, short_help, 73 | MUIA_InputMode, MUIV_InputMode_RelVerify, 74 | MUIA_Frame, MUIV_Frame_ImageButton, 75 | MUIA_Image_FreeVert, TRUE, 76 | MUIA_Image_FreeHoriz, TRUE, 77 | MUIA_FixHeight, TOOLBAR_BUTTON_HEIGHT, 78 | MUIA_FixWidth, TOOLBAR_BUTTON_WIDTH, 79 | MUIA_InnerLeft, 0, 80 | MUIA_InnerRight, 0, 81 | MUIA_InnerTop, 0, 82 | MUIA_InnerBottom, 0, 83 | MUIA_Disabled, disabled ? TRUE : FALSE, 84 | TAG_END); 85 | } 86 | 87 | Object* MUI_NewImageButtonSeparator() 88 | { 89 | return MUI_NewObject(MUIC_Rectangle, 90 | MUIA_Rectangle_VBar, TRUE, 91 | MUIA_FixWidth, 6, 92 | MUIA_FixHeight, TOOLBAR_BUTTON_HEIGHT, 93 | TAG_END); 94 | } 95 | 96 | Object* MUI_HorizontalSeparator() 97 | { 98 | return MUI_NewObject(MUIC_Rectangle, 99 | MUIA_Rectangle_HBar, TRUE, 100 | MUIA_FixHeight, 4, 101 | TAG_END); 102 | } 103 | -------------------------------------------------------------------------------- /toolbar.h: -------------------------------------------------------------------------------- 1 | #ifndef TOOLBAR_H 2 | #define TOOLBAR_H 3 | 4 | #define TOOLBAR_IMAGE_DIR "Images" 5 | #define TOOLBAR_IMAGE_STYLE "MWB_20x20" 6 | #define TOOLBAR_BUTTON_WIDTH 20 7 | #define TOOLBAR_BUTTON_HEIGHT 20 8 | 9 | #define TOOLBAR_IMAGE_FILES "new.iff", \ 10 | "load.iff", \ 11 | "save.iff", \ 12 | "saveas.iff", \ 13 | "undo.iff", \ 14 | "redo.iff", \ 15 | "cut.iff", \ 16 | "copy.iff", \ 17 | "paste.iff", \ 18 | "font.iff", \ 19 | "tileset.iff", \ 20 | "map.iff", \ 21 | "boing.iff", \ 22 | "sprite.iff", \ 23 | "image.iff", \ 24 | "objects.iff", \ 25 | "palette.iff", \ 26 | "gear.iff", \ 27 | "linker.iff", \ 28 | "editor.iff", \ 29 | "new_display.iff", \ 30 | "compile.iff", \ 31 | "run.iff" 32 | 33 | enum { 34 | IMG_SPEC_NEW, 35 | IMG_SPEC_LOAD, 36 | IMG_SPEC_SAVE, 37 | IMG_SPEC_SAVEAS, 38 | IMG_SPEC_UNDO, 39 | IMG_SPEC_REDO, 40 | IMG_SPEC_CUT, 41 | IMG_SPEC_COPY, 42 | IMG_SPEC_PASTE, 43 | IMG_SPEC_FONT, 44 | IMG_SPEC_TILE, 45 | IMG_SPEC_MAP, 46 | IMG_SPEC_BOB, 47 | IMG_SPEC_SPRITE, 48 | IMG_SPEC_IMAGE, 49 | IMG_SPEC_OBJECTS, 50 | IMG_SPEC_PALETTE, 51 | IMG_SPEC_SETTINGS, 52 | IMG_SPEC_ASSETS, 53 | IMG_SPEC_EDITOR, 54 | IMG_SPEC_DISPLAY, 55 | IMG_SPEC_COMPILE, 56 | IMG_SPEC_RUN 57 | }; 58 | 59 | #define MUIA_Enabled 0 //Not a real attribute, just a value to make reading easier 60 | 61 | //Prototypes 62 | BOOL createImageSpecs(); 63 | VOID freeImageSpecs(); 64 | Object* MUI_NewImageButton(ULONG spec, STRPTR short_help, ULONG disabled); 65 | Object* MUI_NewImageButtonSeparator(); 66 | Object* MUI_HorizontalSeparator(); 67 | 68 | #endif /* TOOLBAR_H */ 69 | -------------------------------------------------------------------------------- /tooltypes.h: -------------------------------------------------------------------------------- 1 | #ifndef TOOLTYPES_H 2 | #define TOOLTYPES_H 3 | 4 | //ToolTypePref types 5 | #define TTP_END 0 //Terminator for struct ToolTypePref array 6 | #define TTP_KEYWORD 1 //Key will be saved as {key} or ({key}) depending on data.is_true 7 | #define TTP_BOOL 2 //Key will be saved as {key} = TRUE or FALSE depending on data.is_true 8 | #define TTP_STRING 3 //Key will be saved as {key} = {data.string} 9 | #define TTP_VALUE 4 //Key will be saved as {key} = {data.value} 10 | 11 | struct ToolTypePref { 12 | ULONG type; 13 | STRPTR key; 14 | union { 15 | BOOL is_true; 16 | STRPTR string; 17 | LONG value; 18 | }data; 19 | }; 20 | 21 | BOOL getTooltypes(STRPTR prog_path, struct ToolTypePref* tt_prefs); 22 | VOID setTooltypes(STRPTR prog_path, struct ToolTypePref* tt_prefs); 23 | VOID freeToolTypePrefStrings(struct ToolTypePref* ttprefs); 24 | 25 | #endif /* TOOLTYPES_H */ 26 | -------------------------------------------------------------------------------- /utility.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILITY_H 2 | #define UTILITY_H 3 | 4 | #define DOS_RESERVED ":/" 5 | #define DOS_UNRECOMMENDED ";*?#<>~|$`'\"%" 6 | #define DOS_BRACKETS "()[]" 7 | #define NON_ALPHANUMERIC "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~" 8 | #define ALPHANUMERIC "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 9 | #define MAX_STR_LENGTH 256 10 | #define MAX_CMD_LENGTH 512 11 | #define TEMP_RETURN_STR "T:svgedtr_return_str" 12 | 13 | #if !defined (__MORPHOS__) 14 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) 15 | #define MIN(a, b) ((a) > (b) ? (b) : (a)) 16 | #endif 17 | 18 | #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) 19 | 20 | #define readString(f, d) readCStyleDataString(f, d) 21 | 22 | struct ReturnInfo { 23 | LONG code; 24 | UBYTE string[MAX_STR_LENGTH]; 25 | }; 26 | 27 | struct PathListEntry { 28 | BPTR ple_Next; 29 | BPTR ple_Lock; 30 | }; 31 | 32 | STRPTR getProgDir(); 33 | BPTR getSystemPathList(); 34 | BOOL Exists(STRPTR filename); 35 | BOOL CopyFile(STRPTR fileSrc, STRPTR fileDest); 36 | #define CopyDir(dirSrc, dirDest) CopyFile(dirSrc, dirDest) 37 | BOOL execute(struct ReturnInfo* ri, STRPTR command); 38 | LONG runCommand(STRPTR command, STRPTR dir, STRPTR output); 39 | LONG getFileSize(STRPTR filename); 40 | 41 | BOOL aToi(STRPTR text, LONG *result); 42 | STRPTR makeString(STRPTR str); 43 | STRPTR makeString2(STRPTR str1, STRPTR str2); 44 | STRPTR makeString3(STRPTR str1, STRPTR str2, STRPTR str3); 45 | VOID writeString(BPTR fh, STRPTR str); 46 | STRPTR readStringFromFile(BPTR fh); 47 | STRPTR setString(STRPTR dest, STRPTR src); 48 | STRPTR setString2(STRPTR dest, STRPTR src1, STRPTR src2); 49 | VOID toLower(STRPTR str); 50 | VOID toUpper(STRPTR str); 51 | VOID freeString(STRPTR str); 52 | 53 | STRPTR makePath(STRPTR dir, STRPTR file, STRPTR extension); 54 | STRPTR stripExtension(STRPTR pathname); 55 | VOID replaceChars(STRPTR str, STRPTR restricted, UBYTE ch); 56 | STRPTR pathPart(STRPTR pathname); 57 | BOOL searchString(STRPTR source, STRPTR str, ULONG* pos); 58 | BOOL locateStrInFile(BPTR fh, STRPTR str); 59 | BOOL locateArrayStart(BPTR fh); 60 | BOOL readCStyleDataString(BPTR fh, STRPTR* dest_string); 61 | BOOL getString(BPTR fh, STRPTR* dest_string); 62 | 63 | Object* MUI_NewButton(STRPTR text, UBYTE hi_char, STRPTR short_help); 64 | Object* MUI_NewCheckMark(Object** obj, BOOL state, STRPTR label, UBYTE key, STRPTR help); 65 | Object* MUI_GetChild(Object* obj, ULONG order); 66 | Object* MUI_HorizontalTitle(STRPTR title); 67 | 68 | #endif /* UTILITY_H */ 69 | --------------------------------------------------------------------------------