Skip to content

Commit 9ce8c59

Browse files
committed
Fix tricked_out example
1 parent 5b1f9a7 commit 9ce8c59

File tree

11 files changed

+37
-28
lines changed

11 files changed

+37
-28
lines changed

examples/box/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)

examples/logo/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121

examples/nehe/lesson02/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)

examples/nehe/lesson03/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)

examples/nehe/lesson04/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)

examples/nehe/lesson05/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)

examples/performance/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)

examples/tricked_out/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
EE_BIN = tricked_out.elf
2-
EE_CFLAGS := -I$(PS2SDK)/ports/include -I../shared_code/ $(EE_CFLAGS)
3-
EE_CXXFLAGS := -I$(PS2SDK)/ports/include -I../shared_code/ $(EE_CXXFLAGS)
4-
EE_OBJS = tricked_out.o bollboard_renderer.o ../shared_code/text_stuff.o
2+
EE_CFLAGS := -I$(PS2SDK)/ports/include -I../shared_code/ -I../../vu1 $(EE_CFLAGS)
3+
EE_CXXFLAGS := -I$(PS2SDK)/ports/include -I../shared_code/ -I../../vu1 $(EE_CXXFLAGS)
4+
EE_OBJS = tricked_out.o billboard_renderer.o ../shared_code/text_stuff.o billboard_renderer.vo
55
EE_LDFLAGS += -L$(PS2SDK)/ports/lib
66
EE_LIBS = -lps2glut -lps2gl -lps2stuff -lpad -ldma
77

@@ -14,8 +14,8 @@ endif
1414
WARNING_FLAGS = -Wno-strict-aliasing -Wno-conversion-null
1515

1616
# VU0 code is broken so disable for now
17-
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
18-
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS
17+
EE_CFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
18+
EE_CXXFLAGS += $(WARNING_FLAGS) -DNO_VU0_VECTORS -DNO_ASM
1919

2020
all: $(EE_BIN)
2121
$(EE_STRIP) --strip-all $(EE_BIN)
@@ -34,3 +34,6 @@ sim: $(EE_BIN)
3434

3535
include $(PS2SDK)/samples/Makefile.pref
3636
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
37+
38+
%.vo: %_vcl.vsm
39+
dvp-as -o $@ $<

examples/tricked_out/billboard_renderer.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@
2424
* code
2525
*/
2626

27-
void* CBillboardRenderer::Microcode = NULL;
27+
#define VU_FUNCTIONS(name) \
28+
void vsm##name##_CodeStart(); \
29+
void vsm##name##_CodeEnd()
2830

29-
extern "C" void vsmBillboards();
30-
extern "C" void vsmBillboardsEnd();
31+
#define mVsmAddr(name) ((void*)vsm##name##_CodeStart)
32+
#define mVsmSize(name) ((u8*)vsm##name##_CodeEnd - (u8*)vsm##name##_CodeStart)
33+
34+
extern "C" {
35+
VU_FUNCTIONS(Billboards);
36+
}
3137

3238
CBillboardRenderer::CBillboardRenderer()
33-
: CLinearRenderer(Microcode,
39+
: CLinearRenderer(mVsmAddr(Billboards), mVsmSize(Billboards),
3440
1, // 1 input quad per vertex
3541
0, // the number of output quads per vert doesn't actually matter
3642
// (it's only used for strips)
@@ -45,8 +51,6 @@ CBillboardRenderer::CBillboardRenderer()
4551
CBillboardRenderer*
4652
CBillboardRenderer::Register()
4753
{
48-
Microcode = (void*)vsmBillboards;
49-
5054
// create a renderer and register it
5155

5256
CBillboardRenderer* renderer = new CBillboardRenderer;
@@ -110,7 +114,7 @@ void CBillboardRenderer::InitContext(GLenum primType, tU32 rcChanges, bool userR
110114

111115
bool alpha = drawContext.GetBlendEnabled();
112116
bool useTexture = glContext.GetTexManager().GetTexEnabled();
113-
GS::tPrim prim = { PRIM : 6, IIP : 0, TME : useTexture, FGE : 0, ABE : alpha, AA1 : 0, FST : 0, CTXT : 0, FIX : 0 };
117+
GS::tPrim prim = { prim_type : 6, iip : 0, tme : useTexture, fge : 0, abe : alpha, aa1 : 0, fst : 0, ctxt : 0, fix : 0 };
114118
tGifTag giftag = { NLOOP : 0, EOP : 1, pad0 : 0, id : 0, PRE : 1, PRIM : *(tU64*)&prim, FLG : 0, NREG : 4, REGS0 : 2, REGS1 : 4, REGS2 : 2, REGS3 : 4 };
115119

116120
packet.Pad96();

examples/tricked_out/billboard_renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef bb_renderer_h
88
#define bb_renderer_h
99

10-
#include "ps2s/matrix.h"
10+
//#include "ps2s/matrix.h"
1111
#include "ps2s/packet.h"
1212

1313
#include "GL/gl.h"

0 commit comments

Comments
 (0)