Skip to content

Commit

Permalink
MegaZeux 2.80b release.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelva1984 committed Aug 11, 2008
1 parent f9d5114 commit 75617b7
Show file tree
Hide file tree
Showing 28 changed files with 790 additions and 353 deletions.
14 changes: 6 additions & 8 deletions COPYING.DOC
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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.


2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
2 changes: 1 addition & 1 deletion Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
34 changes: 27 additions & 7 deletions audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

#include "audio.h"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"))
{
Expand Down Expand Up @@ -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++)
{
Expand All @@ -365,6 +384,7 @@ void play_sample(int freq, char *filename)
}

free(input_buffer);
fclose(input_file);
}
}

Expand Down
7 changes: 3 additions & 4 deletions block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
32 changes: 26 additions & 6 deletions board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -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);
}
Expand All @@ -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
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
66 changes: 66 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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

Loading

0 comments on commit 75617b7

Please sign in to comment.