From 3d97e3d9c20a984e70dae5e63e7c5069fb136c91 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 5 Dec 1998 18:29:06 +0100 Subject: [PATCH] rnd-19981205-2 --- CHANGES | 15 ++-- INSTALL | 151 +++++++++++++++++++---------------- README | 213 +++++++++++++++++++++++++++++--------------------- src/files.c | 10 +-- src/misc.c | 4 + src/msdos.c | 12 ++- src/screens.c | 19 +++++ 7 files changed, 254 insertions(+), 170 deletions(-) diff --git a/CHANGES b/CHANGES index b4cb9a2f..4a42a215 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ -Release Version 1.2 [WILL HOPEFULLY SOON BE RELEASED...] +Release Version 1.2.0 [5 DEC 1998] -------------------------------------------------------- + - DOS/Windows version - new WAV sound loader - new PCX graphics loader - network multiplayer games with upto four players @@ -36,12 +37,12 @@ Release Version 1.2 [WILL HOPEFULLY SOON BE RELEASED...] level directory, standalone server execution and verbose execution -Release Version 1.1 [NOT RELEASED] +Release Version 1.1 [???] [NOT RELEASED] ---------------------------------- - new (but broken) GIF graphics loader to be independent from the XPM library and replace all graphics by GIFs. -Release Version 1.0 [9 APR 97] [NOT RELEASED] +Release Version 1.0 [9 APR 1997] [NOT RELEASED] --------------------------------------------- - the game now contains many really playable levels, not only a few levels for testing @@ -58,7 +59,11 @@ Release Version 1.0 [9 APR 97] [NOT RELEASED] to make it possible to go on with a game at any tape position -Prerelease Version 0.9b [4 NOV 95] +Prerelease Version 0.9b2 [21 NOV 1995] [NOT RELEASED] +--------------------------------------------------- + - new game elements + +Prerelease Version 0.9b [4 NOV 1995] ---------------------------------- - the game is now completely Freeware - the game is now better playable by keyboard @@ -74,6 +79,6 @@ Prerelease Version 0.9b [4 NOV 95] - FreeBSD sound and joystick support (thanks to Jean-Marc Zucconi) -Prerelease Version 0.9 [23 OCT 95] +Prerelease Version 0.9 [23 OCT 1995] ---------------------------------- - first (pre)release version diff --git a/INSTALL b/INSTALL index 298ff6d6..697475a7 100644 --- a/INSTALL +++ b/INSTALL @@ -1,68 +1,85 @@ -WHAT TO DO TO INSTALL "ROCKS_N_DIAMONDS-0.9" ON YOUR SYSTEM -=========================================================== - -If you have a Linux system (Intel based, a.out, kernel 1.2.x), you -can use the precompiled binary. - -If you have another Unix system, or an ELF system or just want to -compile the program by yourself, do the following: - -Edit the file "Makefile" and set the following options: - -XPM_INCLUDE_FILE - change this to the location where you - have your XPM-Library include file. - - You must have the XPM-Library "libXpm" - installed on your system to run this game. - If you don't have it, look at your local - FTP site with X11 archive to get it! :) - -GAME_DIR - You can leave these values untouched - if you use the default location for - the game directory. - If you want to move it to other places in - your directory tree, just change them - accordingly. (You can use symlinks instead, - of course.) - You might want to set GAME_DIR to the full - path of the game in your file system, so - you don't have to go to the game directory - when you want to play it. - -SOUNDS - If you never want to hear any sounds, - set this to "-DNO_SOUNDS", but be warned: - It's much less fun playing without sound! :) - (The program detects by itself if it can - play sounds or not, anyway.) - -SCORE_ENTRIES - Set this to "-DONE_PER_NAME" if you want - to allow only one entry per player in the - score file for each level. This is useful - if there are many players to prevent one - single player to "flood" the Hall Of Fame - of every level completely with his name... - On single user systems, "-DMANY_PER_NAME" - might be useful to have your name more - than once in the list. - -SYSTEM - If you have problems with the default - settings, it might be useful to uncomment - one of the defines for "SYSTEM" in the - Makefile, which defines values like - "-DSYSV" and something like that. - -CC, INCL, LIBS - Set these ones to the appropriate values - you usually use on your system to compile. - - -Now you can 'make clean' and 'make' and the game binary should be -compiled right out of the box. I have tested it with "-Wall" on my -system, so I hope that it compiles fine on other systems, too. - -The program should compile and run on Linux (of course), -HP-UX, AIX, Net-BSD, SUN and IRIX. - -Have fun! - -Holger Schemel, 22. Oktober 1995 +Installation instructions for Rocks'n'Diamonds 1.2.0 +==================================================== + +Compilation +----------- + +If your system supports Linux/i386/ELF/libc5 executables (Linux package) +or if you run DOS/Windows (DOS package), you can directly use the included +precompiled binary. + +If you use a different system, just recompile the game: + +If you use Linux with gcc or DOS/Windows with djgpp, just try 'make' +which should work without problems. + +If you use SUN/Solaris with gcc and GNU make, try 'make solaris'. + +If the above doesn't work, edit the Makefile in the top level directory. +If it doesn't work either, edit the Makefile in the 'src' subdirectory. + +If you had to modify any Makefile to compile it, please drop me a note +about it to 'aeglos@valinor.owl.de'. Thanks! + + +Customization +------------- + +The following configuration options in the top level Makefile help +you to customize the game to your system and your environment: + +CC Choose your favorite ANSI C compiler. + Default is 'gcc'. + +PLATFORM Choose your platform, if auto detection fails. + Auto detection should work for Linux and DOS + (just type 'make'), on SUN/Solaris systems 'make solaris' + should work. Other systems may need additional editing + of 'src/Makefile' to set some additional compiler options. + +X11_PATH Specify the path to your X11 installation. Include files + and libraries are searched for at $(X11_PATH)/include and + $(X11_PATH)/lib, if you set this variables. If you don't + set this variable, your compiler must be able to find X11 + by itself, which works fine for Linux, for example. + +GAME_DIR Specify the directory where the program looks for all the + graphics, sounds, levels and high scores. If you leave this + commented out, the current directory ('.') is used, which + lets you use the game without installing it somewhere in + your system (although you have to 'cd' to the game directory + each time you want to play it). + +JOYSTICK Uncomment this line if your system does not support game + port hardware like joysticks (and has therefore no joystick + include file). Currently the game should work with joysticks + on Linux and FreeBSD. + +SOUNDS Uncomment this line if your system does not support audio + hardware. Currently the game should work with sound support + on Linux, FreeBSD, SUN/Solaris, HP-UX and most Unix system + that support '/dev/dsp' or '/dev/audio' devices. + +SCORE_ENTRIES Choose if you want to allow many entries in the high score + table for one player or exactly one entry. Systems with a + lot of users maybe want to limit high score entries to only + one entry for each player (and therefore set 'SCORE_ENTRIES' + to 'ONE_PER_NAME') where systems used by only one person + maybe want to use the default of 'MANY_PER_NAME' which is + automatically choosen if you leave everything commented out. + +Modifications of the Makefile in the directory 'src' are normally not needed. +If the game fails to compile out of the box, you may have to modify some +of the system variables there to get it to compile. + +SYSTEM May need to be set to some system dependend values. + +INCL, LIBS Maybe some more directories for include files and libraries + have to be added to this variables depending on your system. + + +If you have any comments, additions or modifications to the Makefile(s), +please send me mail: 'aeglos@valinor.owl.de'. Thanks! + +05-DEC-1998, Holger Schemel diff --git a/README b/README index e8933d0d..a16fd5ed 100644 --- a/README +++ b/README @@ -1,16 +1,15 @@ Welcome to - R O C K S ' N ' D I A M O N D S - ----------------------------------- + R O C K S ' N ' D I A M O N D S ' 9 8 + ------------------------------------------- -A game for Unix/X11 by Holger Schemel, (c) 1995 by Holger Schemel. +A game for Unix/X11 by Holger Schemel, (c) 1995-98 by Holger Schemel. Introduction ============ This is a nice little game with color graphics and sound for your Unix system with color X11. You need an 8-Bit color display or better. -It is not recommended on black&white systems, and maybe not on gray -scale systems. +It will not work on black&white systems, and maybe not on gray scale systems. If you know the game "Boulderdash" (Commodore C64) or "Emerald Mine" (Amiga), you know what "ROCKS'N'DIAMONDS" is about. @@ -18,48 +17,53 @@ If you know the game "Boulderdash" (Commodore C64) or "Emerald Mine" Getting started =============== -Just 'cd' to the 'rocks_n_diamonds' directory and type 'rocksndiamonds'! -This works only on Linux boxes, because the included binary was -compiled for Linux systems. If you have another Unix system like -HPUX, NetBSD or SUN, you first have to type 'make' to compile it. -This may be needed on Linux systems, too, if you have an older -system (kernel, libraries, ...) or if you have only ELF libraries. +Just 'cd' to the directory 'rocksndiamonds-*' (Unix) or 'rocks-*' (DOS) +and type 'rocksndiamonds' (Linux) or 'rocks' (DOS/Windows)! +This works only on Linux and DOS systems, because the included binary was +compiled for Linux (i386/libc5) (if you have the Unix package) and DOS +(if you have the DOS/Windows package). +If you have another Unix system like HPUX, NetBSD or SUN, you first have to +type 'make' to compile it. +This may be needed on Linux systems, too, depending on your kernel version, +your libc version, your binary format, your processor, ... (The included binary was compiled on the following system: -Kernel 1.2.13, libc 4.5.26, GCC 2.5.8, 'a.out' format) +AMD K6, kernel 2.0.35, libc5, gcc 2.7.2.1, ELF format) + The Menues ========== You can see eight blue circles on the left side of the eight green menu texts; these are buttons to activate the menu commands by simply clicking -on them with the left mouse button. The button will then change to red. +on them with a mouse. The button will then change to red. (You can control the menues over the keyboard or joystick, too. Just use the arrow keys and the 'Return' or 'Enter' key or, if you use a joystick, the appropriate direction and the fire button.) -The menu 'name' ---------------- +The menu 'name' / 'team' +------------------------ When you start the game the first time, your login name will appear in the 'NAME:' field. If you want to use a different name for playing, for example a funny player name or a name for cheating, you can click on the button and enter a new name. -If you choose a certain special name, you will be in a cheat mode where -you can choose all levels without playing the lower levels before... :) +This menu will show the text 'team' instead of 'name' if you activated +the team (local multiplayer) mode in the setup menu. See below. The menue 'level' ----------------- -If you have played some levels of this game, you can choose the already -played levels at any time, but you cannot choose the higher levels. This -means, you can choose levels from level 0 to the highest level that you -have ever won. This is known as your 'handicap'. +Choose any level from the current level series you want. The former +'handicap' limitation in choosing levels has been removed because of +beeing annoying. -If the level number is red, you have choosen a 'ready' level, if it is -yellow, you have choosen a 'user' level, which is blank and can be -edited by yourself with the built-in level editor (see below). +If the level number is red, you have choosen a 'ready' level series (which +is read-only and cannot be modified by the level editor); if it is yellow +you have choosen a 'user' level series (which is writable and can be changed +by the builf-in level editor). See below for using the level editor. To choose new level series, click on the button on the left and choose -the new level serie. +the new level series. Scroll the page up and down with the blue arrow +buttons if there are more level series than would fit on the screen. Hall of fame ------------ @@ -69,46 +73,81 @@ Click again to go back to the main menu. Level creator ------------- This brings you to the level editor, if you have switched to a 'yellow' -level, which are empty and can be filled by yourself. See below. +(writable) level series. Info screen ----------- This screen shows you all elements which appear in the game and presents you the background music loops which you can listen to while playing the -levels (only available on Linux systems). +levels (not available on all systems). Start game ---------- -This will start the game. +This will start the game. The game will be automatically recorded 'on tape' +if you have choosen this from the setup menu (see below). If you haven't +choosen auto-recording level, but want to record this certain game, press +the 'record' button on the level tape recorder to start game and recording. Setup ----- To change some things in the game, use the setup menu. You can enable/disable "Sound" (enables/disables _all_ sounds in -the game), "Sound loops" (only allowed on Linux systems with -VoxWare[tm] sound driver; don't worry if you never heard of it -- -it's the name of the standard Linux sound driver), "Game music" +the game), "Sound loops" (only useful on Linux systems), "Game music" (can always be enabled on very fast systems [exception: you don't like it], on slower systems it will take some percent of CPU time which will slow things down a bit) and "Toons", which will forbid/ permit the little animated toons. -"Buffered Gfx" can be set to "off" on slower systems, "Fading" gives -a nice fading effect when displaying new screens, but unfortunately -I haven't found a system which is fast enough to display it so far. -(Maybe this works better on highly accelerated X servers.) Better set -this to "off" if you have a normal system... +Forget about the setup options "Buffered Gfx" and "Fading" -- they +have no effect at the moment and will probably disappear in future +versions of the game. (Double-buffering is now always activated, because +systems are fast enough now compared to 1995, when the last version of the +game was released. Especially soft-scrolling needs the double-buffering. +About fading from one screen to another with silly effects: Most players +will probably deactivate it after a few minutes (see also "quick doors").) + +Enable "scroll delay" to avoid scrolling at each step, giving you an area +where you can walk without scrolling until you get near enough to the screen +border. + +Enable "soft scroll" for soft-scrolling. Looks nice, but may need a +relatively fast graphics card. Systems from 1998 and later should be fast +enough for enabling soft-scrolling. + +Enable "quick doors" if you are unpatient when switching between the +several game screens where the doors have to be opened or closed. You will +almost surely enable this if you design your own levels and therefore +often switch between game and editor screens. Set "auto-record" to "on" if you want to automatically record each game -to tape. +by the built-in level tape recorder. -If you have a Linux system with a joystick, you can choose the "1st" or -the "2nd" joystick port and use "Cal. Joystick" to calibrate it. Use -"Save and exit" after calibration to save it for later playing sessions. +For configuration of input devices like keyboard and joysticks, choose +the sub-menu "input devices". "Exit" quits the setup menu without saving the changes, "Save and exit" will save and then return to the main menu. + +Input Devices (sub-menu of the setup menu) +------------------------------------------ + +"Player" lets you choose one of the four players. + +"Device" lets you choose the input device you want for this player; +you can choose between the keyboard and one of the maximal four supported +joysticks. (Normally you won't have more than two joysticks, but the Linux +joystick driver supports more than two joysticks.) + +"Customize" / "Calibrate" lets you calibrate a joystick or customize the +keyboard keys used for moving left, right, up and down, "snapping" fields +without moving towards them and placing bombs. Just press the key you want +to use for the specified action or press Return or Enter to stay with the +already configured values. + +"Exit" brings you back to the setup screen. + + Quit ---- Exit the game. @@ -141,55 +180,39 @@ Stop/Pause/Play Game controls to stop the game, pause it and go on Music buttons The three music buttons can be used to control the background music loop, the 'looping' sounds and all other sounds. The little red light shows you - if it is enabled or disabled. On slower systems - (and a 486DX33 with Soundblaster _is_ a slower - system) it increases the game speed to turn off - background music. You can completely turn off all - sound effects in the setup menu, although it is - much more fun to have them enabled when it - doesn't eats up to much speed. - - (A little note: The sound server currently needs - about 10% CPU time on my 486DX/33/SBPro system - when playing background music. I wonder if this - would get better with a better soundcard, like - Gravis Ultrasound, or if only pure CPU power - helps in this case...) + if it is enabled or disabled. About the game itself: Of course you know Boulderdash, so you will know how to play the game. :) -If not: You can move your playing figure (the smiley) with the arrow -keys or with the joystick (if you have no joystick and even no arrow -keys on your keyboard, you can use the keys 'i', 'j', 'k' and 'm' for -the directions. To 'snap' a field near you without moving to it, you +If not: You can move your playing figure with the configured keys (which +will normally and by default be the arrow keys) or with a joystick. +To 'snap' a field near you without moving to it, you can use the left fire button on your joystick (hold it down, move the -stick to 'snap' the field, release the button) or the keys 'e', 's', -'d' and 'x'. To place a piece of dynamite, use the right fire button -on your joystick or use the 'b' key (and, after placing the dynamite, -better see to move away from this field...). +stick to 'snap' the field, release the button) or the key you have +configured for this action (by default one of the left modifier keys like +'Shift' or 'Control'). +To place a piece of dynamite, use the right fire button on your joystick or +use the key you have configured for this (by default one of the right modifier +keys, but you can change all this to what you like). +After placing the dynamite, better see to move away from this field...). Just try the levels from the 'tutorial' level serie to see what most of the elements do or have a look at the info screen! -Note: It is *highly recommended* to use a joystick for playing this -game! It is possible to play it with the keyboard, but it is *much -more fun* to play with a joystick, and some levels are very difficult -to solve with the keyboard. So, the best platform for this game is a -Linux system (which gives you background music, too). The Level Editor ================ -To build your own levels, just choose a 'yellow', empty level. If you -cannot find any 'yellow' levels, choose a different level serie or -choose the higher level numbers (if you have a small 'handicap' number, -the higher levels will be skipped to reach the 'empty' levels. - -Another way is to create your own level series. Just add a line to the -file 'levels/ROCKS.levelinfo' with the following entries: -- the name of the level directory (create this directory under 'levels') -- the name of the level serie (don't use any whitespaces within the name) -- the 'ready' (red) levels (start with zero) -- the 'empty' (yellow) levels (set this to some number of blank levels) +To create your own levels, it's a good idea to start with your personal +level series, which has been created automatically the first time you +started the game (together with some configuration files). These personal +files are stored in '~/.rocksndiamonds' on Unix systems and in 'userdata' +in the current playing directory (which normally is the game directory) +on DOS/Windows systems. + +The levels that come with the game are normally read-only, to avoid +problems on multi user systems, but you can set them to 'writable' in +the file 'levelinfo.conf' ('lvlinfo.cnf' on DOS systems) in each level +directory. To edit a level, you can use all three mouse buttons to draw in the level window. Click into the elements field with one of the three buttons @@ -217,12 +240,9 @@ played games. Just use them like a normal video recorder. Recording a game on tape: ------------------------- -Just press the 'record' button (the one with the red point on it) and -either press 'Start Game' or press on 'record' or 'pause' to end the -pause mode and start playing and recording. - -If you have set "auto record" in the setup menu to "on", you just have -to press 'Start Game' as usual. +If you have enabled "auto-record", every game will automatically be recorded, +so you just have to press "start game". Pressing the 'record' button on the +tape recorder will start game and record it in any case. Saving a game tape: ------------------- @@ -240,23 +260,38 @@ or the playing of the tape and continue by pressing 'pause' again. You can use either the tape recorder buttons or the game control buttons for this purpose. +If you want to continue a previously recorded game, press 'pause' while +playing, then 'record' to switch from 'paused playing' to 'paused recording' +and then continue the game by pressing 'record' or 'pause'. If you want +to fast-forward the tape to get faster to the point where you want to +continue playing, press 'play' again while already playing, therefore +activating 'fast forward' playing mode. Press again the 'play' button +to enter a special playing mode: 'pause before end' will stop a few seconds +before the end of the tape (which will in most cases stop a few seconds +before you get killed in the previous playing recorded on that tape) -- +after the automatic stop (which enters the 'pause' mode) you can continue +the game as described above. + And Now Have Fun! ================= Have fun playing the game, building new levels and breaking all high -scores! ;) +scores! :-) + +If you have designed new levels, mail them to me to include them in the +next version (which will be released much earlier than again after three +years like this version... ;-) If you have any comments, problems, suggestions, donations, flames, send them to aeglos@valinor.owl.de -or aeglos@uni-paderborn.de -or Snail Mail +or Snail Mail to Holger Schemel - Sennehof 28 - 33659 Bielefeld + Oststrasse 11a + 33604 Bielefeld GERMANY Have fun, diff --git a/src/files.c b/src/files.c index ba39f3f3..21309b82 100644 --- a/src/files.c +++ b/src/files.c @@ -1151,16 +1151,16 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->player_name = getStringCopy(getLoginName()); si->sound = TRUE; - si->sound_loops = FALSE; - si->sound_music = FALSE; - si->sound_simple = FALSE; + si->sound_loops = TRUE; + si->sound_music = TRUE; + si->sound_simple = TRUE; si->toons = TRUE; si->double_buffering = TRUE; si->direct_draw = !si->double_buffering; - si->scroll_delay = FALSE; + si->scroll_delay = TRUE; si->soft_scrolling = TRUE; si->fading = FALSE; - si->autorecord = FALSE; + si->autorecord = TRUE; si->quick_doors = FALSE; for (i=0; itype = (mouse_b & i ? ButtonPress : ButtonRelease); - xbutton->button = i; + xbutton->type = (mouse_b & bitmask ? ButtonPress : ButtonRelease); + xbutton->button = mapping[i]; xbutton->x = mouse_x - display->screens[display->default_screen].x; xbutton->y = mouse_y - display->screens[display->default_screen].y; } diff --git a/src/screens.c b/src/screens.c index adbda0da..c0a3b8c6 100644 --- a/src/screens.c +++ b/src/screens.c @@ -804,6 +804,7 @@ void HandleChooseLevel(int mx, int my, int dx, int dy, int button) static unsigned long choose_delay = 0; static int redraw = TRUE; int x = (mx + 32 - SX) / 32, y = (my + 32 - SY) / 32; + int step = (button == 1 ? 1 : button == 2 ? 5 : 10); int num_page_entries; if (num_leveldirs <= MAX_LEVEL_SERIES_ON_SCREEN) @@ -851,7 +852,13 @@ void HandleChooseLevel(int mx, int my, int dx, int dy, int button) if (first_entry > 0 && (dy || DelayReached(&choose_delay, 150))) { +#if 0 first_entry--; +#else + first_entry -= step; + if (first_entry < 0) + first_entry = 0; +#endif drawChooseLevelList(first_entry, num_page_entries); drawChooseLevelInfo(first_entry); DrawGraphic(0, choice - 1, GFX_KUGEL_ROT); @@ -863,7 +870,13 @@ void HandleChooseLevel(int mx, int my, int dx, int dy, int button) if (first_entry + num_page_entries < num_leveldirs && (dy || DelayReached(&choose_delay, 150))) { +#if 0 first_entry++; +#else + first_entry += step; + if (first_entry + num_page_entries > num_leveldirs) + first_entry = num_leveldirs - num_page_entries; +#endif drawChooseLevelList(first_entry, num_page_entries); drawChooseLevelInfo(first_entry + num_page_entries - 1); DrawGraphic(0, choice - 1, GFX_KUGEL_ROT); @@ -1120,12 +1133,18 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button) } else if (y==7) { +#if 0 if (setup.double_buffering) DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE); else DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW); setup.double_buffering = !setup.double_buffering; setup.direct_draw = !setup.double_buffering; +#else + DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW); + setup.double_buffering = TRUE; + setup.direct_draw = !setup.double_buffering; +#endif } else if (y==8) { -- 2.34.1