Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit c52294b
Author: Krystian Bacławski <[email protected]>
Date:   Sat Dec 16 16:50:33 2023 +0100

    Backport miscellaneous changes from ELF

commit f3d5a5c
Author: Aleksandra <[email protected]>
Date:   Sun Dec 10 21:42:21 2023 +0100

    PNG2C rewrite in Golang (#91)

    Co-authored-by: Krystian Bacławski <[email protected]>

commit feb97ba
Author: Krystian Bacławski <[email protected]>
Date:   Sun Nov 26 09:13:22 2023 +0100

    Clean up PaletteT interface and use cases (backported from 6498094)

commit 445c236
Author: Krystian Bacławski <[email protected]>
Date:   Mon Nov 20 21:29:05 2023 +0100

    Fix type comparison in Python source code.

commit 535c594
Author: Krystian Bacławski <[email protected]>
Date:   Mon Nov 20 21:12:36 2023 +0100

    CopListReset: it's useful to return the pointer (backported from 011df6f)

commit 0bc9420
Author: Krystian Bacławski <[email protected]>
Date:   Sat Jul 22 22:36:02 2023 +0200

    Clean up CopList interface (backported from 839fddd)

     * Replace CopInit with CopListReset.
     * NewCopList initialises the list by default (as if CopListReset was called).
     * Replace CopEnd with CopListFinish that returns copper list pointer.
     * Clean up MakeCopperList in the effects.
     * Panic if used more copper list entries than available.
     * Fix double buffering in some effects.

commit a015394
Author: Krystian Bacławski <[email protected]>
Date:   Sat Jul 22 17:14:21 2023 +0200

    Always pass flags to NewBitmap (backported from fda8ae8)

     * Remove NewBitmapCustom.
     * Replace BM_DISPLAYABLE with BM_CPUONLY of opposite meaning.

commit bc7ca92
Author: Krystian Bacławski <[email protected]>
Date:   Wed Jul 19 22:35:36 2023 +0200

    Pair of CopInsT to store 32-bit pointers (backported from 3f01af7)

    * Introduce CopInsPairT to express 32-bit pointer stores.
    * multipipe: put all cop insns per line into single structure
    * prisms: similar trick as for multipipe
    * Fix effects in intro directory.

commit 963eb7b
Author: Krystian Bacławski <[email protected]>
Date:   Wed Jul 19 21:59:09 2023 +0200

    Keep LOADED/READY state in Load/Init lower bit (backported from dd7cba0)

commit e679bcd
Author: Aleksandra <[email protected]>
Date:   Tue Jul 4 21:52:32 2023 +0200

    Backported changes from f4f7128

    * Add VBlank hook to effects
    * Make effects use the VBlank handler
    * Remove ptplayer.asm features on demand
    * Fix mt_data symbol address
    * Fix anim-polygons Makefile
    * EffectRun: do not render same frame multiple times.
  • Loading branch information
cahirwpz committed Dec 16, 2023
1 parent b270512 commit e52be45
Show file tree
Hide file tree
Showing 140 changed files with 1,954 additions and 1,632 deletions.
94 changes: 5 additions & 89 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,93 +1,9 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
BasedOnStyle: LLVM
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ TAILQ_FOREACH, SPLAY_FOREACH, RB_FOREACH, WITH_MTX_LOCK,
WITH_SPIN_LOCK, WITH_RW_LOCK, SET_FOREACH, LIST_FOREACH,
TAILQ_FOREACH_REVERSE, TAILQ_FOREACH_SAFE,
LIST_FOREACH_SAFE, WITH_VM_MAP_LOCK ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IndentCaseBlocks: true
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...

SortIncludes: Never
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ahxWaves filter=lfs diff=lfs merge=lfs -text
*.akp filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.BIN filter=lfs diff=lfs merge=lfs -text
*.mod filter=lfs diff=lfs merge=lfs -text
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gdb-dashboard
*.exe.map
*.rom
*.7z
*.dSYM

# AmigaOS files
*.info
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
TOPDIR = $(realpath .)

SUBDIRS = tools lib effects
SUBDIRS = tools lib system effects
EXTRA-FILES = tags cscope.out
CLEAN-FILES = bootloader.bin a500rom.bin addchip.bootblock.bin vbrmove
Expand Down
2 changes: 1 addition & 1 deletion build/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ CONV2D := $(TOPDIR)/tools/conv2d.py
GRADIENT := $(TOPDIR)/tools/gradient.py
TMXCONV := $(TOPDIR)/tools/tmxconv/tmxconv
PCHG2C := $(TOPDIR)/tools/pchg2c/pchg2c
PNG2C := $(TOPDIR)/tools/png2c.py
PNG2C := $(TOPDIR)/tools/png2c/png2c
PSF2C := $(TOPDIR)/tools/psf2c.py
SYNC2C := $(TOPDIR)/tools/sync2c/sync2c
SVG2C := $(TOPDIR)/tools/svg2c/svg2c
Expand Down
5 changes: 3 additions & 2 deletions build/effect.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ LIBS += libblit libgfx libmisc libc
LDEXTRA = $(TOPDIR)/system/system.a
LDEXTRA += $(foreach lib,$(LIBS),$(TOPDIR)/lib/$(lib)/$(lib).a)

CRT0 = $(TOPDIR)/system/crt0.o $(TOPDIR)/effects/main.o
CRT0 = $(TOPDIR)/system/crt0.o
MAIN ?= $(TOPDIR)/effects/main.o
BOOTLOADER = $(TOPDIR)/bootloader.bin
ROMSTARTUP = $(TOPDIR)/a500rom.bin
BOOTBLOCK = $(TOPDIR)/addchip.bootblock.bin
Expand Down Expand Up @@ -44,7 +45,7 @@ $(TOPDIR)/%.bin: FORCE

include $(TOPDIR)/build/common.mk

$(EFFECT).exe.dbg $(EFFECT).exe: $(CRT0) $(OBJECTS) $(LDEXTRA) $(LDSCRIPT)
$(EFFECT).exe.dbg $(EFFECT).exe: $(CRT0) $(MAIN) $(OBJECTS) $(LDEXTRA) $(LDSCRIPT)
@echo "[LD] $(addprefix $(DIR),$(OBJECTS)) -> $(DIR)$@"
$(LD) $(LDFLAGS) -L$(TOPDIR)/system -T$(LDSCRIPT) -Map=$@.map -o $@ \
--start-group $(filter-out %.lds,$^) --end-group
Expand Down
1 change: 1 addition & 0 deletions effects/Config.fs-uae
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ amiga_model = A500
# uae_cpu_model = 68010
# uae_cpu_multiplier = 16
automatic_input_grab = 0
stereo_separation = 0
floppy_drive_speed = 800
# floppy_drive_speed = 100
floppy_drive_volume = 10
Expand Down
2 changes: 2 additions & 0 deletions effects/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SUBDIRS := \
flatshade-convex \
floor \
floor-old \
game-of-life \
glitch \
growing-tree \
gui \
Expand Down Expand Up @@ -45,6 +46,7 @@ SUBDIRS := \
tilezoomer \
transparency \
twister-rgb \
turmite \
uvlight \
uvmap \
uvmap-rgb \
Expand Down
2 changes: 1 addition & 1 deletion effects/anim-polygons/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ PNG2C.dancing-pal := --pixmap gradient,16x22x12

include $(TOPDIR)/build/effect.mk

%.c: %.svg
data/%.c: data/%.svg
@echo "[ANIM] $(DIR)$< -> $(DIR)$@"
$(PYTHON3) encode.py $< > $@
19 changes: 9 additions & 10 deletions effects/anim-polygons/anim-polygons.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define DEPTH 4

static BitmapT *screen;
static CopInsT *bplptr[DEPTH];
static CopInsPairT *bplptr;
static CopListT *cp;
static short active = 0;
static short maybeSkipFrame = 0;
Expand All @@ -25,9 +25,9 @@ static short maybeSkipFrame = 0;
/* Reading polygon data */
static short current_frame = 0;

static void MakeCopperList(CopListT *cp) {
CopInit(cp);
CopSetupBitplanes(cp, bplptr, screen, DEPTH);
static CopListT *MakeCopperList(void) {
CopListT *cp = NewCopList(100 + gradient.height * (gradient.width + 1));
bplptr = CopSetupBitplanes(cp, screen, DEPTH);
{
short *pixels = gradient.pixels;
short i, j;
Expand All @@ -37,17 +37,16 @@ static void MakeCopperList(CopListT *cp) {
for (j = 0; j < 16; j++) CopSetColor(cp, j, *pixels++);
}
}
CopEnd(cp);
return CopListFinish(cp);
}

static void Init(void) {
screen = NewBitmap(WIDTH, HEIGHT, DEPTH + 1);
screen = NewBitmap(WIDTH, HEIGHT, DEPTH + 1, BM_CLEAR);
EnableDMA(DMAF_BLITTER);
BitmapClear(screen);

SetupPlayfield(MODE_LORES, DEPTH, X(0), Y(YOFF), WIDTH, HEIGHT);
cp = NewCopList(100 + gradient.height * (gradient.width + 1));
MakeCopperList(cp);
cp = MakeCopperList();
CopListActivate(cp);
EnableDMA(DMAF_RASTER);
}
Expand Down Expand Up @@ -127,7 +126,7 @@ static void Render(void) {
while (--n >= 0) {
short i = mod16(active + n + 1 - DEPTH, DEPTH + 1);
if (i < 0) i += DEPTH + 1;
CopInsSet32(bplptr[n], screen->planes[i]);
CopInsSet32(&bplptr[n], screen->planes[i]);
}
}

Expand All @@ -136,4 +135,4 @@ static void Render(void) {
maybeSkipFrame = 1;
}

EFFECT(AnimPolygons, NULL, NULL, Init, Kill, Render);
EFFECT(AnimPolygons, NULL, NULL, Init, Kill, Render, NULL);
2 changes: 1 addition & 1 deletion effects/anim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TOPDIR := $(realpath ../..)

CLEAN-FILES := data/running.c data/running-pal.c

PNG2C.running-pal := --palette running_pal,16
PNG2C.running-pal := --palette running,16

include $(TOPDIR)/build/effect.mk

Expand Down
25 changes: 9 additions & 16 deletions effects/anim/anim.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define DEPTH 4

static BitmapT *screen;
static CopInsT *bplptr[DEPTH];
static CopInsPairT *bplptr;
static CopListT *cp;
static short active = 0;

Expand All @@ -23,29 +23,21 @@ typedef struct {
#include "data/running-pal.c"
#include "data/running.c"

static void Load(void) {
screen = NewBitmap(WIDTH, HEIGHT, DEPTH + 1);
static void Init(void) {
screen = NewBitmap(WIDTH, HEIGHT, DEPTH + 1, 0);

Log("Animation has %d frames %d x %d.\n",
running.count, running.width, running.height);
}

static void UnLoad(void) {
DeleteBitmap(screen);
}

static void Init(void) {
EnableDMA(DMAF_BLITTER);
BitmapClear(screen);

SetupPlayfield(MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT);
LoadPalette(&running_pal, 0);
LoadColors(running_colors, 0);

cp = NewCopList(100);
CopInit(cp);
CopSetupBitplanes(cp, bplptr, screen, DEPTH);
CopEnd(cp);

bplptr = CopSetupBitplanes(cp, screen, DEPTH);
CopListFinish(cp);
CopListActivate(cp);
EnableDMA(DMAF_RASTER);
}
Expand All @@ -54,6 +46,7 @@ static void Kill(void) {
DisableDMA(DMAF_COPPER | DMAF_RASTER | DMAF_BLITTER);

DeleteCopList(cp);
DeleteBitmap(screen);
}

static void DrawSpans(u_char *bpl) {
Expand Down Expand Up @@ -100,7 +93,7 @@ static void Render(void) {
short i = (active + n + 1 - DEPTH) % (DEPTH + 1);
if (i < 0)
i += DEPTH + 1;
CopInsSet32(bplptr[n], screen->planes[i]);
CopInsSet32(&bplptr[n], screen->planes[i]);
}
}

Expand All @@ -109,4 +102,4 @@ static void Render(void) {
active = (active + 1) % (DEPTH + 1);
}

EFFECT(Anim, Load, UnLoad, Init, Kill, Render);
EFFECT(Anim, NULL, NULL, Init, Kill, Render, NULL);
4 changes: 2 additions & 2 deletions effects/ball/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ TOPDIR := $(realpath ../..)

CLEAN-FILES := data/dragon-bg.c data/texture-15.c data/ball.c

PNG2C.dragon-bg := --bitmap background,320x256x4 --palette background_pal,16
PNG2C.texture-15 := --pixmap texture,128x128x4 --palette texture_pal,16
PNG2C.dragon-bg := --bitmap background,320x256x4 --palette background,16
PNG2C.texture-15 := --pixmap texture,128x128x4 --palette texture,16

include $(TOPDIR)/build/effect.mk

Expand Down
Loading

0 comments on commit e52be45

Please sign in to comment.