Skip to content

Commit

Permalink
v3.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
zesinger authored May 13, 2024
1 parent 5d75a4e commit ee404ed
Show file tree
Hide file tree
Showing 13 changed files with 795 additions and 281 deletions.
554 changes: 554 additions & 0 deletions ZeDMD.h

Large diffs are not rendered by default.

Binary file modified paste.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions resource.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//{{NO_DEPENDENCIES}}
// fichier Include Microsoft Visual C++.
// Utilisé par ColorizingDMD.rc
//




#define IDC_MYICON 2
#define IDD_COLORIZINGDMD_DIALOG 102
#define IDI_CROM 103
Expand Down Expand Up @@ -429,8 +429,8 @@
#define IDC_FRAME64 1217
#define IDC_STATIC -1

// Next default values for new objects
//


#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
Expand Down
119 changes: 71 additions & 48 deletions serum.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,88 @@

typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned int UINT32;
typedef unsigned int UINT;

typedef struct
enum
{
// in former format (prior to 2.0.0) the returned frame replaces the original frame, so this is not
// part of this
UINT8* frame; // return the colorized frame
UINT8* palette; // and its palette
UINT8* rotations; // and its color rotations
UINT32* triggerID; // return 0xffff if no trigger for that frame, the ID of the trigger if one is set for that frame
UINT* frameID; // for CDMD ingame tester
}Serum_Frame;
SERUM_V1,
SERUM_V2
};


enum
{
FLAG_REQUEST_32P_FRAMES = 1,
FLAG_REQUEST_64P_FRAMES = 2,
FLAG_REQUEST_FILL_MODIFIED_ELEMENTS = 4,
};

enum
{
FLAG_RETURNED_32P_FRAME_OK = 1,
FLAG_RETURNED_64P_FRAME_OK = 2,
};

enum
{
FLAG_RETURNED_V1_ROTATED = 0x10000,
FLAG_RETURNED_V2_ROTATED32 = 0x10000,
FLAG_RETURNED_V2_ROTATED64 = 0x20000,
};

typedef struct
{
// the frame (frame32 or frame64) corresponding to the original resolution must ALWAYS be defined
// but the frame corresponding to the extra resolution must be defined only if we request it
// if a frame is defined, its width, rotations and rotationsinframe must be defined

UINT8* frame;
UINT8* palette;
UINT8* rotations;



UINT16* frame32;
UINT* width32; // 0 is returned if the 32p colorized frame is not available for this frame
UINT width32;
UINT16* rotations32;
UINT16* rotationsinframe32; // [(96 or 128)*32*2] precalculated array to tell if a color is in a color rotations of the frame ([X*Y*0]=0xffff if not part of a rotation)
UINT16* rotationsinframe32;
UINT8* modifiedelements32;
UINT16* frame64;
UINT* width64; // 0 is returned if the 64p colorized frame is not available for this frame
UINT width64;
UINT16* rotations64;
UINT16* rotationsinframe64; // [(192 or 256)*64*2] precalculated array to tell if a color is in a color rotations of the frame ([X*Y*0]=0xffff if not part of a rotation)
UINT32* triggerID; // return 0xffff if no trigger for that frame, the ID of the trigger if one is set for that frame
UINT8* flags; // return flags:
// if flags & 1 : frame32 has been filled
// if flags & 2 : frame64 has been filled
// if none of them, display the original frame
UINT* frameID; // for CDMD ingame tester
}Serum_Frame_New;

const int MAX_DYNA_4COLS_PER_FRAME = 16; // max number of color sets for dynamic content for each frame (old version)
const int MAX_DYNA_SETS_PER_FRAMEN = 32; // max number of color sets for dynamic content for each frame (new version)
const int MAX_SPRITE_SIZE = 128; // maximum size of the sprites
const int MAX_SPRITE_WIDTH = 256; // maximum width of the new sprites
const int MAX_SPRITE_HEIGHT = 64; // maximum height of the new sprites
const int MAX_SPRITES_PER_FRAME = 32; // maximum amount of sprites to look for per frame
const int MAX_COLOR_ROTATIONS = 8; // maximum amount of color rotations per frame
const int MAX_COLOR_ROTATIONN = 4; // maximum number of new color rotations per frame
const int MAX_LENGTH_COLOR_ROTATION = 64; // maximum number of new colors in a rotation
const int MAX_SPRITE_DETECT_AREAS = 4; // maximum number of areas to detect the sprite
UINT16* rotationsinframe64;
UINT8* modifiedelements64;

UINT SerumVersion;







UINT8 flags;
unsigned int nocolors;
unsigned int ntriggers;
UINT triggerID;
UINT frameID;
UINT rotationtimer;
}Serum_Frame_Struc;

const int PALETTE_SIZE = 64 * 3; // size of a palette
const int ROTATION_SIZE = 3 * MAX_COLOR_ROTATIONS; // size of a color rotation block
const int MAX_SPRITE_TO_DETECT = 16; // max number of sprites detected in a frame
const int MAX_BACKGROUND_IMAGES = 255; // max number of background images
const int MAX_DYNA_4COLS_PER_FRAME = 16;
const int MAX_DYNA_SETS_PER_FRAMEN = 32;
const int MAX_SPRITE_SIZE = 128;
const int MAX_SPRITE_WIDTH = 256;
const int MAX_SPRITE_HEIGHT = 64;
const int MAX_SPRITES_PER_FRAME = 32;
const int MAX_COLOR_ROTATIONS = 8;
const int MAX_COLOR_ROTATIONN = 4;
const int MAX_LENGTH_COLOR_ROTATION = 64;
const int MAX_SPRITE_DETECT_AREAS = 4;

// Flags sent with Serum_Load
const int FLAG_REQUEST_32P_FRAMES = 1; // there is a output DMD which is 32 leds high
const int FLAG_REQUEST_64P_FRAMES = 2; // there is a output h is 64 leds high
const int FLAG_32P_FRAME_OK = 1; // the 32p frame has been filled
const int FLAG_64P_FRAME_OK = 2; // the 64p frame has been filled
const int PALETTE_SIZE = 64 * 3;
const int ROTATION_SIZE = 3 * MAX_COLOR_ROTATIONS;
const int MAX_BACKGROUND_IMAGES = 255;

typedef bool (*Serum_LoadFunc)(const char* const altcolorpath, const char* const romname, unsigned int* pnocolors, unsigned int* pntriggers, unsigned char flags, unsigned int* width32, unsigned int* width64, UINT8* isnewformat);
typedef Serum_Frame_Struc* (*Serum_LoadFunc)(const char* const altcolorpath, const char* const romname, UINT8 flags);
typedef void (*Serum_DisposeFunc)(void);
typedef bool (*Serum_ColorizeFunc)(UINT8* frame, Serum_Frame* poldframe, Serum_Frame_New* pnewframe);
typedef bool (*Serum_ApplyRotationsFunc)(Serum_Frame* poldframe);
typedef bool (*Serum_ApplyRotationsNFunc)(Serum_Frame_New* pnewframe, UINT8* modelements32, UINT8* modelements64);
typedef UINT (*Serum_ColorizeFunc)(UINT8* frame);
typedef UINT (*Serum_RotateFunc)(void);
typedef const char* (*Serum_GetVersionFunc)(void);
Binary file modified serum64.dll
Binary file not shown.
Loading

0 comments on commit ee404ed

Please sign in to comment.