-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
504 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
TOPDIR := $(realpath ..) | ||
|
||
DELTA := 1 | ||
|
||
DEMONAME = Demo | ||
MODULE := JazzCat-ElectricLifeforms | ||
|
||
OBJECTS := data/$(MODULE).trk.o | ||
|
||
ifeq ($(DELTA), 1) | ||
OBJECTS += data/$(MODULE)-Delta.smp.o | ||
else | ||
OBJECTS += data/$(MODULE).smp.o | ||
endif | ||
|
||
LIBS := libpt | ||
|
||
CLEAN-FILES := data/$(MODULE)*.o data/$(MODULE).{smp,trk}* data/loader.c | ||
|
||
SOURCES := main.c load.c empty.c | ||
MAIN := # | ||
|
||
CPPFLAGS += -DDELTA=$(DELTA) -I. | ||
|
||
PNG2C.loader := --bitmap loader,64x64x1 --palette loader,2 | ||
|
||
include $(TOPDIR)/build/effect.mk | ||
|
||
data/%.trk data/%.smp: data/%.mod | ||
$(PYTHON3) $(TOPDIR)/effects/playpt/data/ptsplit.py $^ | ||
mv data/$*.mod.trk data/$*.trk | ||
mv data/$*.mod.smp data/$*.smp | ||
|
||
OBJCOPY-CHIP := --rename-section .data=.datachip,alloc,load,data,contents | ||
|
||
data/%.trk.o: data/%.trk | ||
@echo "[OBJCOPY] $(DIR)$< -> $(DIR)$@" | ||
$(OBJCOPY) -I binary -O amiga \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_trk_start=_Module \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_trk_end=_ModuleEnd \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_trk_size=_ModuleSize \ | ||
$^ $@ | ||
|
||
data/%-Delta.smp: data/%.smp | ||
@echo "[DELTA] $(DIR)$< -> $(DIR)$@" | ||
$(PYTHON3) delta.py $< $@ | ||
|
||
data/%.smp.o: data/%.smp | ||
@echo "[OBJCOPY] $(DIR)$< -> $(DIR)$@" | ||
$(OBJCOPY) $(OBJCOPY-CHIP) -I binary -O amiga \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_smp_start=_Samples \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_smp_end=_SamplesEnd \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_smp_size=_SamplesSize \ | ||
$^ $@ | ||
|
||
data/%.o: data/%.txt | ||
@echo "[OBJCOPY] $(DIR)$< -> $(DIR)$@" | ||
$(OBJCOPY) -I binary -O amiga \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_txt_start=_Text \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_txt_end=_TextEnd \ | ||
--redefine-sym _binary_data_$(subst -,_,$*)_txt_size=_TextSize \ | ||
$^ $@ | ||
|
||
REPOHEAD := $(shell git rev-parse --short HEAD) | ||
|
||
%.exe.packed: %.exe | ||
@echo "[PACK] $(DIR)$< -> $(DIR)$@" | ||
Shrinkler -o -f 0xdff180 \ | ||
-t "$(DEMONAME) by Ghostown (build: $(REPOHEAD))" $< $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.c | ||
*.delta |
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@track EffectNumber | ||
$0000 0 !step | ||
$1000 -1 | ||
@end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
from array import array | ||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser( | ||
description='Encode 8-bit samples with delta encoding.') | ||
parser.add_argument( | ||
'decoded', metavar='DECODED', type=str, help='Decoded samples file.') | ||
parser.add_argument( | ||
'encoded', metavar='ENCODED', type=str, help='Encoded samples file.') | ||
args = parser.parse_args() | ||
|
||
data = array('B') | ||
|
||
with open(args.decoded, 'rb') as f: | ||
data.frombytes(f.read()) | ||
data.append(0) | ||
|
||
out = array('B') | ||
for i in range(len(data) - 1): | ||
out.append((data[i] - data[i - 1]) & 255) | ||
|
||
with open(args.encoded, 'wb') as f: | ||
f.write(out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef __DEMO_H__ | ||
#define __DEMO_H__ | ||
|
||
#include <bitmap.h> | ||
#include <palette.h> | ||
#include <sync.h> | ||
#include <effect.h> | ||
|
||
short UpdateFrameCount(void); | ||
|
||
static inline short FromCurrKeyFrame(TrackT *track) { | ||
return frameCount - CurrKeyFrame(track); | ||
} | ||
|
||
static inline short TillNextKeyFrame(TrackT *track) { | ||
return NextKeyFrame(track) - frameCount; | ||
} | ||
|
||
void FadeBlack(const u_short *colors, short count, u_int start, short step); | ||
|
||
#endif /* !__DEMO_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <effect.h> | ||
|
||
static void Init(void) { | ||
} | ||
|
||
static void Kill(void) { | ||
} | ||
|
||
static void Render(void) { | ||
} | ||
|
||
EFFECT(Empty, NULL, NULL, Init, Kill, Render, NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#include <demo.h> | ||
#include <debug.h> | ||
#include <copper.h> | ||
#include <blitter.h> | ||
#include <gfx.h> | ||
#include <line.h> | ||
|
||
#define _SYSTEM | ||
#include <system/memory.h> | ||
#include <system/interrupt.h> | ||
|
||
#include "data/loader.c" | ||
|
||
#define X1 96 | ||
#define Y1 (120 + 32) | ||
#define X2 224 | ||
#define Y2 (136 + 24) | ||
|
||
/* from 0 to 256 */ | ||
static volatile short LoadProgress = 0; | ||
|
||
static int ProgressBarUpdate(void) { | ||
static __code short x = 0; | ||
short newX = LoadProgress >> 1; | ||
for (; x < newX; x++) { | ||
CpuLine(X1 + x, Y1, X1 + x, Y2); | ||
} | ||
return 0; | ||
} | ||
|
||
INTSERVER(ProgressBarInterrupt, 0, (IntFuncT)ProgressBarUpdate, NULL); | ||
|
||
static void LoadData(void) { | ||
while (LoadProgress < 256) { | ||
LoadProgress++; | ||
WaitVBlank(); | ||
} | ||
} | ||
|
||
#define WIDTH 320 | ||
#define HEIGHT 256 | ||
#define DEPTH 1 | ||
|
||
void LoadDemo(void) { | ||
BitmapT *screen = NewBitmap(WIDTH, HEIGHT, DEPTH, BM_CLEAR); | ||
CopListT *cp = NewCopList(40); | ||
|
||
CpuLineSetup(screen, 0); | ||
CpuLine(X1 - 1, Y1 - 2, X2 + 1, Y1 - 2); | ||
CpuLine(X1 - 1, Y2 + 1, X2 + 1, Y2 + 1); | ||
CpuLine(X1 - 2, Y1 - 1, X1 - 2, Y2 + 1); | ||
CpuLine(X2 + 2, Y1 - 1, X2 + 2, Y2 + 1); | ||
|
||
SetupPlayfield(MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); | ||
LoadColors(loader_colors, 0); | ||
|
||
EnableDMA(DMAF_BLITTER); | ||
BitmapCopy(screen, (WIDTH - loader_width) / 2, Y1 - loader_height - 16, | ||
&loader); | ||
WaitBlitter(); | ||
DisableDMA(DMAF_BLITTER); | ||
|
||
CopSetupBitplanes(cp, screen, DEPTH); | ||
CopListFinish(cp); | ||
CopListActivate(cp); | ||
|
||
EnableDMA(DMAF_RASTER); | ||
|
||
AddIntServer(INTB_VERTB, ProgressBarInterrupt); | ||
LoadData(); | ||
RemIntServer(INTB_VERTB, ProgressBarInterrupt); | ||
|
||
DisableDMA(DMAF_RASTER); | ||
DeleteCopList(cp); | ||
|
||
DeleteBitmap(screen); | ||
} |
Oops, something went wrong.