Permalink
Browse files

MegaZeux 2.80b release.

  • Loading branch information...
1 parent f9d5114 commit 75617b7e04d7c3b0c8a6b0363b99ea4e6f6b78dc @ajs1984 committed Aug 11, 2008
Showing with 790 additions and 353 deletions.
  1. +6 −8 COPYING.DOC
  2. +1 −1 Makefile
  3. +1 −1 Makefile.linux
  4. +27 −7 audio.cpp
  5. +3 −4 block.cpp
  6. +26 −6 board.cpp
  7. +66 −0 changelog.txt
  8. +13 −3 char_ed.cpp
  9. +1 −1 config.txt
  10. +1 −1 configure.cpp
  11. +34 −30 counter.cpp
  12. +89 −62 edit.cpp
  13. +191 −131 game.cpp
  14. +5 −5 game2.cpp
  15. +1 −1 graphics.cpp
  16. +1 −1 graphics.h
  17. +79 −6 help.doc
  18. +10 −4 intake.cpp
  19. +3 −1 param.cpp
  20. +57 −5 rasm.cpp
  21. +108 −21 robo_ed.cpp
  22. +1 −1 robot.h
  23. +41 −41 runrobo2.cpp
  24. +1 −1 sfx.cpp
  25. +4 −1 sfx_edit.cpp
  26. +1 −3 window.cpp
  27. +18 −6 world.cpp
  28. +1 −1 world.h
View
@@ -2,7 +2,8 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -279,7 +280,7 @@ POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -291,7 +292,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
+ Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -305,15 +306,14 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -338,5 +338,3 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
-
-
View
@@ -10,7 +10,7 @@ OBJS = main.o graphics.o window.o hexchar.o event.o \
PREFIX = /usr
-BIN = mzx280.exe
+BIN = mzx280b.exe
CC = gcc
CPP = g++
View
@@ -10,7 +10,7 @@ OBJS = main.o graphics.o window.o hexchar.o event.o \
PREFIX = /usr
-BIN = mzx280
+BIN = mzx280b
CC = gcc
CPP = g++
View
@@ -24,6 +24,7 @@
#include <math.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#include "audio.h"
@@ -70,8 +71,9 @@ void audio_callback(void *userdata, Uint8 *stream, int len)
{
// Reset position
audio.current_mod->mSoundFile.SetCurrentPos(0);
- // Zero out remainder bytes
- memset(audio.mod_buffer + read_len, 0, len - read_len);
+ // Read anew remaining bytes
+ ModPlug_Read(audio.current_mod, audio.mod_buffer + read_len,
+ len - read_len);
}
}
else
@@ -311,11 +313,7 @@ void play_sample(int freq, char *filename)
// FIXME - destroy least recently used?
if(audio.num_samples_playing >= MAX_SAMS)
- {
- // Out of samples, so destroy a random existing one.
- int r = rand() % 16;
- end_individual_sample(r);
- }
+ return;
if((extension_pos >= 0) && !strcasecmp(filename + extension_pos, ".sam"))
{
@@ -346,11 +344,32 @@ void play_sample(int freq, char *filename)
if(sample_loaded)
{
+ int sample_length = sample_loaded->mSoundFile.Ins[1].nLength;
+
// A little hack to modify the pitch
sample_loaded->mSoundFile.Ins[1].nC4Speed = (freq_conversion / freq) / 2;
sample_loaded->mSoundFile.Ins[2].nC4Speed = (freq_conversion / freq) / 2;
sample_loaded->mSoundFile.Ins[1].nVolume = (256 * sound_gvol) / 8;
sample_loaded->mSoundFile.Ins[2].nVolume = (256 * sound_gvol) / 8;
+
+ // This number is pretty much obtained via experimentation. It can probably
+ // stand to be a little higher.
+ sample_length /= 110;
+
+ if(sample_length < 256)
+ {
+ sample_loaded->mSoundFile.Patterns[0][0].param = sample_length;
+ sample_loaded->mSoundFile.Patterns[0][2].command = CMD_PATTERNBREAK;
+ }
+ else
+ {
+ int row_duration = sample_length / 255;
+ sample_loaded->mSoundFile.Patterns[0][0].param = 255;
+ if(row_duration < 62)
+ sample_loaded->mSoundFile.Patterns[0][2 + row_duration].command =
+ CMD_PATTERNBREAK;
+ }
+
// Find a free position to put it
for(i = 0; i < 16; i++)
{
@@ -365,6 +384,7 @@ void play_sample(int freq, char *filename)
}
free(input_buffer);
+ fclose(input_file);
}
}
View
@@ -206,25 +206,24 @@ char col2ansi[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
char exdi_types[3] = { DE_RADIO, DE_BUTTON, DE_BUTTON };
char exdi_xs[3] = { 2, 5, 15 };
-char exdi_ys[3] = { 3, 9, 9 };
+char exdi_ys[3] = { 3, 8, 8 };
char *exdi_strs[3] =
{
"Board file (MZB)\n"
"Character set (CHR)\n"
- "Text file (TXT)\n"
"Palette (PAL)\n"
"Sound effects (SFX)",
"OK", "Cancel"
};
-int exdi_p1s[3] = { 5, 0, -1 };
+int exdi_p1s[3] = { 4, 0, -1 };
int exdi_p2s[1] = { 19 };
void *exdi_storage[1] = { NULL };
dialog exdi =
{
- 26, 4, 53, 15, "Export as:", 3, exdi_types, exdi_xs, exdi_ys,
+ 26, 5, 53, 15, "Export as:", 3, exdi_types, exdi_xs, exdi_ys,
exdi_strs, exdi_p1s, exdi_p2s, exdi_storage, 0
};
View
@@ -62,6 +62,12 @@ Board *load_board_allocate(FILE *fp, int savegame)
Board *cur_board = (Board *)malloc(sizeof(Board));
load_board(cur_board, fp, savegame);
+ if(!cur_board->board_width)
+ {
+ free(cur_board);
+ return NULL;
+ }
+
return cur_board;
}
@@ -79,6 +85,7 @@ Board *load_board_allocate_direct(FILE *fp, int savegame)
void load_board(Board *cur_board, FILE *fp, int savegame)
{
int board_size = fgetd(fp);
+
if(board_size)
{
int board_location, last_location;
@@ -92,7 +99,7 @@ void load_board(Board *cur_board, FILE *fp, int savegame)
}
else
{
- memset(cur_board, 0, sizeof(Board));
+ cur_board->board_width = 0;
// And skip board location
fseek(fp, 4, SEEK_CUR);
}
@@ -108,24 +115,35 @@ void load_board_direct(Board *cur_board, FILE *fp, int savegame)
Scroll *cur_scroll;
Sensor *cur_sensor;
+ char *test_buffer;
+
board_mode = fgetc(fp);
overlay_mode = fgetc(fp);
if(!overlay_mode)
{
+ int overlay_width;
+ int overlay_height;
+
overlay_mode = fgetc(fp);
- int overlay_width = fgetw(fp);
- int overlay_height = fgetw(fp);
+ overlay_width = fgetw(fp);
+ overlay_height = fgetw(fp);
+
size = overlay_width * overlay_height;
cur_board->overlay = (char *)malloc(size);
cur_board->overlay_color = (char *)malloc(size);
load_RLE2_plane(cur_board->overlay, fp, size);
+ test_buffer = (char *)malloc(1024);
+ free(test_buffer);
+
// Skip sizes
fseek(fp, 4, SEEK_CUR);
- load_RLE2_plane(cur_board->overlay_color, fp, size);
+ load_RLE2_plane(cur_board->overlay_color, fp, size);
+ test_buffer = (char *)malloc(1024);
+ free(test_buffer);
}
else
{
@@ -579,12 +597,14 @@ void save_RLE2_plane(char *plane, FILE *fp, int size)
{
current_char = plane[i];
runsize = 1;
+
while((plane[i + 1] == current_char) && (runsize < 127) &&
- (i < size))
+ (i < (size - 1)))
{
i++;
runsize++;
}
+
// Put the runsize if necessary
if((runsize > 1) || current_char & 0x80)
{
@@ -617,7 +637,7 @@ void clear_board(Board *cur_board)
free(cur_board->level_under_id);
free(cur_board->level_under_param);
free(cur_board->level_under_color);
-
+
if(cur_board->overlay_mode)
{
free(cur_board->overlay);
View
@@ -0,0 +1,66 @@
+August 11, 2004 - MZX 2.80b
+
++ Made it possible for robots to move through teleporters
++ Fixed bug with pressing shift in text entry boxes
++ Made it so alt + tab does not switch draw modes in editor
++ Fixed a disassembly error for color intensity N percent command
++ Fixed problem with looping on mods that do not loop explicitely
++ Fixed alt + dir scrolling in the char editor
++ Fixed not being able to click the rightmost char in the char editor
++ Readded unmark (alt + u) to robot editor (mysteriously disappeared??)
++ Fixed key label so it returns proper unicode values
++ The player and pushable robots can now be pushed by the push command
++ Fixed bug where you could clone the player by switching boards
++ Fixed bug where you could either turn off overlay or switch to boards
+ that don't have it while in overlay edit mode...
++ Fixed bug where remains of debug window would not be cleared in editor
+ if the board width is too small
++ Fixed bug where turning off the menu with a board too small would mess
+ things up
++ Fixed bug where run lengths were saved one too large... this could fix
+ stability problems in at least occasional cases (with saved worlds or
+ save games, at least)
++ Fixed placing solid things beneath robots (like bombs)
++ Added support for a keyboard plus in the char editors
++ Fixed previous button in SFX editor
++ Made robot name box disappear when robot char box comes up...
++ Fixed bug where mods restart after pressing P if they're the same mod
+ as what was playing before
++ Fixed problem with changing params (with P) in the editor.
++ Fixed bug where null boards were not being pruned from old worlds upon
+ load
++ Made file name saving box larger (for saving games and worlds)
++ Fixed bug where default (100%) palette intensity values would not be
+ applied to the palette a game loads with
++ Fixed bug where exporting char sets that are full size caused a 0
+ byte charset to be exported (8bit wraparound)
+- Removed export text in the board editor. Don't think anyone wanted it...
++ Added support for forms such as :line
++ Fixed sporadic incompletion of strings without trailing quotes at the
+ end of the line
++ Fixed bug where clearing/cutting the last line of a robot crashed MZX
++ F4 in robot editor now works more generally
++ Made line numbers in robot editor error report start at 1
++ Added ctrl + G to go to a line in the robot editor (ala nano)
++ Made it possible to change a robot's color in the editor
++ Fixed bug where spitfire, seekers, and missiles didn't hurt something
+ immediate adjacent to whatever shot it
++ Fixed editing of spitfires
++ Made default speed 4 again (5, bleh)
++ Readded quicksave/quickload
++ Readded F8 clear (always works - be careful)
++ Fixed autorepeat problems for spacepressed/delpressed.
++ Wrapped around sprite values so LogiCow's bad code would work (HTMCIAB)
++ Cleared block commands inbetween board changing and other things like
+ that
++ Fixed bug where MZX would crash if put dir player overwrote the robot
+ doing it
++ Fixed bug where playing SAMs would eventually crash MZX
++ Fixed some mod * problems (hopefully?)
++ Fixed bug where pasting blocks over the edge of the board in the editor
+ would cause MZX to crash
++ Uses new GDM2S3M source that fixes some bugs. If your converted GDM's
+ have problems, delete the S3M's it generated.
+
+August 9, 2004 - First release, MZX 2.80 BETA
+
Oops, something went wrong.

0 comments on commit 75617b7

Please sign in to comment.