Jo Engine 2026.11.6
Jo Sega Saturn Engine
Loading...
Searching...
No Matches
conf.h
Go to the documentation of this file.
1/*
2** Jo Sega Saturn Engine
3** Copyright (c) 2012-2026, Johannes Fetz (johannesfetz@gmail.com)
4** All rights reserved.
5**
6** Redistribution and use in source and binary forms, with or without
7** modification, are permitted provided that the following conditions are met:
8** * Redistributions of source code must retain the above copyright
9** notice, this list of conditions and the following disclaimer.
10** * Redistributions in binary form must reproduce the above copyright
11** notice, this list of conditions and the following disclaimer in the
12** documentation and/or other materials provided with the distribution.
13** * Neither the name of the Johannes Fetz nor the
14** names of its contributors may be used to endorse or promote products
15** derived from this software without specific prior written permission.
16**
17** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
34
35#ifndef __JO_CONF_H__
36# define __JO_CONF_H__
37
38/*
39 _ _ _ _ _ _ _ _ __ _ _
40 | | ( ) | | | | | | | | | (_) / _(_) |
41 __| | ___ _ __ |/| |_ | |_ ___ _ _ ___| |__ | |_| |__ _ ___ | |_ _| | ___
42 / _` |/ _ \| '_ \ | __| | __/ _ \| | | |/ __| '_ \ | __| '_ \| / __| | _| | |/ _ \
43 | (_| | (_) | | | | | |_ | || (_) | |_| | (__| | | | | |_| | | | \__ \ | | | | | __/
44 \__,_|\___/|_| |_| \__| \__\___/ \__,_|\___|_| |_| \__|_| |_|_|___/ |_| |_|_|\___|
45
46 All options are now available on your Makefile.
47
48 makefile sample:
49
50 JO_COMPILE_WITH_VIDEO_MODULE = 0
51 JO_COMPILE_WITH_TGA_MODULE = 1
52 JO_COMPILE_WITH_AUDIO_MODULE = 1
53 JO_COMPILE_WITH_AUDIO_DRIVER_MODULE = 0 (the 68000 runs a sound driver: glides, tones; needs the audio module)
54 JO_COMPILE_WITH_AUDIO_DSP_MODULE = 0 (the DSP of the SCSP makes a reverberation; needs the audio module)
55 JO_COMPILE_WITH_3D_MODULE = 1
56 JO_COMPILE_WITH_EFFECTS_MODULE = 1
57 JO_COMPILE_WITH_DUAL_CPU_MODULE = 1
58 JO_COMPILE_WITH_PRINTF_MODULE = 1
59 JO_COMPILE_WITH_RAM_CARD_MODULE = 1
60 JO_COMPILE_WITH_STORYBOARD_MODULE = 1
61 JO_COMPILE_WITH_SPRITE_HASHTABLE = 0
62 JO_GLOBAL_MEMORY_SIZE_FOR_MALLOC = 524288
63 JO_PSEUDO_SATURN_KAI_SUPPORT = 1
64 JO_MAX_FS_BACKGROUND_JOBS = 4
65 JO_MAX_SPRITE = 255
66 JO_MAP_MAX_LAYER = 8
67 JO_MAX_SPRITE_ANIM = 16
68 JO_MAX_FILE_IN_IMAGE_PACK = 32
69 JO_DEBUG = 1
70 JO_NTSC = 0
71 JO_SCREEN_WIDTH = 320 (320, 352, 640 or 704; optional)
72 JO_SCREEN_HEIGHT = 240 (224, 240, 256 in PAL; 448, 480, 512 in PAL: interlace; optional)
73 SRCS=main.c
74 include ../Compiler/COMMON/jo_engine_makefile
75
76 The smallest engine: JO_MINIMAL = 1
77
78 JO_MINIMAL = 1
79 SRCS=main.c
80 include ../Compiler/COMMON/jo_engine_makefile
81
82 Every module is off unless the makefile turns it on, even the 5 modules on by default: the file system (FS: on with
83 the TGA, AUDIO, VIDEO and LEVEL modules, they read files), jo_printf() (PRINTF), the RAM cartridge (RAM_CARD), the
84 slave CPU (DUAL_CPU) and jo_sprite_name2id() (SPRITE_HASHTABLE). What stays: jo_core_init() and the main loop, the
85 VDP1 (sprites added from images in the program, jo_sprite_draw_rectangle()...), the VDP2 (the back color, the NBG1
86 bitmap, the palettes), the inputs, jo_malloc(), the math, the lists, the time. Without jo_printf() an error of the
87 engine (JO_DEBUG = 1) shows a red screen, press START to go on. A module can still be chosen one by one:
88
89 JO_MINIMAL = 1
90 JO_COMPILE_WITH_PRINTF_MODULE = 1 (jo_printf() and the messages of the errors)
91 JO_DEBUG = 0 (no check, no error message: the smallest program)
92
93 The helpers that are always compiled (maps, sprite animations, physics, sprite fonts, images, palettes) cost no byte
94 in a program that does not call them: the link time optimization keeps only the functions used. Sizes of
95 Samples/demo - minimal (game.raw): 29052 bytes with the default engine, 20940 with JO_MINIMAL = 1, 17616 with
96 JO_MINIMAL = 1 and JO_DEBUG = 0
97*/
98
99/*
100** PARAMS
101*/
102
106#if defined(JO_SCREEN_WIDTH)
107 # define JO_TV_WIDTH (JO_SCREEN_WIDTH)
108#else
109 # define JO_TV_WIDTH (320)
110#endif
114#if defined(JO_SCREEN_HEIGHT)
115 # define JO_TV_HEIGHT (JO_SCREEN_HEIGHT)
116#elif defined(JO_NTSC_VERSION)
117 # define JO_TV_HEIGHT (240)
118#else
119 # define JO_TV_HEIGHT (256)
120#endif
122# define JO_TV_WIDTH_2 (JO_TV_WIDTH / 2)
124# define JO_TV_WIDTH_4 (JO_TV_WIDTH / 4)
126# define JO_TV_HEIGHT_2 (JO_TV_HEIGHT / 2)
128# define JO_TV_HEIGHT_4 (JO_TV_HEIGHT / 4)
129
130#if JO_TV_WIDTH != 320 && JO_TV_WIDTH != 352 && JO_TV_WIDTH != 640 && JO_TV_WIDTH != 704
131# error "JO_SCREEN_WIDTH must be 320, 352, 640 or 704"
132#endif
133#if JO_TV_HEIGHT != 224 && JO_TV_HEIGHT != 240 && JO_TV_HEIGHT != 448 && JO_TV_HEIGHT != 480 && \
134 (defined(JO_NTSC_VERSION) || (JO_TV_HEIGHT != 256 && JO_TV_HEIGHT != 512))
135# error "JO_SCREEN_HEIGHT must be 224, 240, 448 or 480 (256 and 512 in PAL)"
136#endif
137
139# define JO_VDP2_SIZE (0x02) /* 512x256 */
141# define JO_VDP2_WIDTH (512)
143# define JO_VDP2_HEIGHT (256)
144
146# define JO_PRINTF_BUF_SIZE (64)
148# define JO_MAX_FILENAME_LENGTH (13)
150# define JO_FS_MAX_FILES (256)
151
152#if JO_FRAMERATE < 1
153# error "JO_FRAMERATE must be greater than zero"
154#endif
155
156#endif /* !__JO_CONF_H__ */
157
158/*
159** END OF FILE
160*/