Skip to content

Commit

Permalink
Update to ares v117 release.
Browse files Browse the repository at this point in the history
[No official changelog available for this version. -Ed.]
  • Loading branch information
near-san committed Feb 8, 2021
1 parent fabde30 commit 7656765
Show file tree
Hide file tree
Showing 1,395 changed files with 19,084 additions and 23,498 deletions.
21 changes: 21 additions & 0 deletions ares/Shaders/Curvature.shader/curvature.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#version 150
#define distortion 0.2

uniform sampler2D source[];
uniform vec4 sourceSize[];

in Vertex {
vec2 texCoord;
};

out vec4 fragColor;

vec2 radialDistortion(vec2 coord) {
vec2 cc = coord - vec2(0.5);
float dist = dot(cc, cc) * distortion;
return coord + cc * (1.0 - dist) * dist;
}

void main() {
fragColor = texture(source[0], radialDistortion(texCoord));
}
4 changes: 4 additions & 0 deletions ares/Shaders/Curvature.shader/manifest.bml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
program
filter: linear
wrap: border
fragment: curvature.fs
25 changes: 25 additions & 0 deletions ares/Shaders/Edge Detection.shader/edge-detection.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#version 150

uniform sampler2D source[];
uniform vec4 sourceSize[];

in Vertex {
vec2 texCoord;
};

out vec4 fragColor;

vec3 grayscale(vec3 color) {
return vec3(dot(color, vec3(0.3, 0.59, 0.11)));
}

void main() {
vec2 offset = fract(texCoord * sourceSize[0].xy) - 0.5;
offset /= sourceSize[0].xy;

vec3 cx = texture(source[0], texCoord - offset).xyz;
vec3 cy = texture(source[0], texCoord).xyz;
vec3 cz = vec3(5.0 * grayscale(abs(cx - cy)));

fragColor = vec4(clamp(cz, 0.0, 1.0), 1.0);
}
4 changes: 4 additions & 0 deletions ares/Shaders/Edge Detection.shader/manifest.bml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
program
filter: linear
wrap: edge
fragment: edge-detection.fs
4 changes: 4 additions & 0 deletions ares/Shaders/Scanline.shader/manifest.bml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
program
filter: linear
wrap: border
fragment: scanline.fs
20 changes: 20 additions & 0 deletions ares/Shaders/Scanline.shader/scanline.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#version 150

uniform sampler2D source[];

in Vertex {
vec2 texCoord;
};

out vec4 fragColor;

void main() {
vec4 rgba = texture(source[0], texCoord);
vec4 intensity;
if(fract(gl_FragCoord.y * (0.5 * 4.0 / 3.0)) > 0.5) {
intensity = vec4(0);
} else {
intensity = smoothstep(0.2, 0.8, rgba) + normalize(rgba);
}
fragColor = intensity * -0.25 + rgba * 1.1;
}
4 changes: 1 addition & 3 deletions ares/ares/debug/debug.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
namespace ares {

struct Debug {
static constexpr auto enabled() -> bool { return true; }

auto reset() -> void;

template<typename... P> auto unhandled(P&&... p) -> void {
Expand Down Expand Up @@ -37,4 +35,4 @@ extern Debug _debug;

}

#define debug(function, ...) if constexpr(ares::_debug.enabled()) ares::_debug.function(__VA_ARGS__)
#define debug(function, ...) if constexpr(1) ares::_debug.function(__VA_ARGS__)
7 changes: 4 additions & 3 deletions ares/ares/information.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace ares {
static const string Name = "ares";
static const string Version = "116.8";
static const string Version = "117";
static const string Copyright = "Near";
static const string License = "CC BY-NC-ND 4.0";
static const string LicenseURI = "https://creativecommons.org/licenses/by-nc-nd/4.0/";
static const string Website = "ares.dev";
static const string WebsiteURI = "https://ares.dev";

//incremented only when serialization format changes
static const u32 SerializerSignature = 0x31545341; //"AST1" (little-endian)
static const string SerializerVersion = "116";
static const u32 SerializerSignature = 0x31545342; //"BST1" (little-endian)
static const string SerializerVersion = "117";
}
2 changes: 1 addition & 1 deletion ares/ares/node/debugger/tracer/instruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct Instruction : Tracer {
_depth = depth;
_history.reset();
_history.resize(depth);
for(auto& history : _history) history = ~0ull;
for(auto& history : _history) history = ~0;
}

auto address(u32 address) -> bool {
Expand Down
8 changes: 6 additions & 2 deletions ares/ares/node/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@

#define DeclareClass(Type, Name) \
static inline const string identifier = Name; \
virtual auto identity() const -> string { return Name; } \
static auto create() -> Node::Object { return new Type; } \
auto identity() const -> string override { return Name; } \
private: static inline Class::Register<Type> register; public: \

struct Object : shared_pointer_this<Object> {
DeclareClass(Object, "object")
static inline const string identifier = "Object";
static auto create() -> Node::Object { return new Object; }
virtual auto identity() const -> string { return "Object"; }
private: static inline Class::Register<Object> register; public:
//DeclareClass(Object, "object")

Object(string name = {}) : _name(name) {}
virtual ~Object() = default;
Expand Down
2 changes: 1 addition & 1 deletion ares/ares/scheduler/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ struct Scheduler;

struct Thread {
enum : uintmax { Second = (uintmax)-1 >> 1 };
enum : uintmax { Size = 8_KiB * sizeof(void*) };
enum : uintmax { Size = 16_KiB * sizeof(void*) };

struct EntryPoint {
cothread_t handle = nullptr;
Expand Down
152 changes: 2 additions & 150 deletions ares/ares/types.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using b1 = nall::Boolean;

using i1 = nall::Integer< 1>;
using i2 = nall::Integer< 2>;
using i3 = nall::Integer< 3>;
Expand All @@ -7,15 +9,6 @@ using i6 = nall::Integer< 6>;
using i7 = nall::Integer< 7>;
using i8 = nall::Integer< 8>;
using i9 = nall::Integer< 9>;
using i01 = nall::Integer< 1>;
using i02 = nall::Integer< 2>;
using i03 = nall::Integer< 3>;
using i04 = nall::Integer< 4>;
using i05 = nall::Integer< 5>;
using i06 = nall::Integer< 6>;
using i07 = nall::Integer< 7>;
using i08 = nall::Integer< 8>;
using i09 = nall::Integer< 9>;
using i10 = nall::Integer<10>;
using i11 = nall::Integer<11>;
using i12 = nall::Integer<12>;
Expand Down Expand Up @@ -81,15 +74,6 @@ using n6 = nall::Natural< 6>;
using n7 = nall::Natural< 7>;
using n8 = nall::Natural< 8>;
using n9 = nall::Natural< 9>;
using n01 = nall::Natural< 1>;
using n02 = nall::Natural< 2>;
using n03 = nall::Natural< 3>;
using n04 = nall::Natural< 4>;
using n05 = nall::Natural< 5>;
using n06 = nall::Natural< 6>;
using n07 = nall::Natural< 7>;
using n08 = nall::Natural< 8>;
using n09 = nall::Natural< 9>;
using n10 = nall::Natural<10>;
using n11 = nall::Natural<11>;
using n12 = nall::Natural<12>;
Expand Down Expand Up @@ -148,135 +132,3 @@ using n64 = nall::Natural<64>;

using r32 = nall::Real<32>;
using r64 = nall::Real<64>;

//deprecated long-form variants:

using int1 = nall::Integer< 1>;
using int2 = nall::Integer< 2>;
using int3 = nall::Integer< 3>;
using int4 = nall::Integer< 4>;
using int5 = nall::Integer< 5>;
using int6 = nall::Integer< 6>;
using int7 = nall::Integer< 7>;
using int8 = nall::Integer< 8>;
using int9 = nall::Integer< 9>;
using int10 = nall::Integer<10>;
using int11 = nall::Integer<11>;
using int12 = nall::Integer<12>;
using int13 = nall::Integer<13>;
using int14 = nall::Integer<14>;
using int15 = nall::Integer<15>;
using int16 = nall::Integer<16>;
using int17 = nall::Integer<17>;
using int18 = nall::Integer<18>;
using int19 = nall::Integer<19>;
using int20 = nall::Integer<20>;
using int21 = nall::Integer<21>;
using int22 = nall::Integer<22>;
using int23 = nall::Integer<23>;
using int24 = nall::Integer<24>;
using int25 = nall::Integer<25>;
using int26 = nall::Integer<26>;
using int27 = nall::Integer<27>;
using int28 = nall::Integer<28>;
using int29 = nall::Integer<29>;
using int30 = nall::Integer<30>;
using int31 = nall::Integer<31>;
using int32 = nall::Integer<32>;
using int33 = nall::Integer<33>;
using int34 = nall::Integer<34>;
using int35 = nall::Integer<35>;
using int36 = nall::Integer<36>;
using int37 = nall::Integer<37>;
using int38 = nall::Integer<38>;
using int39 = nall::Integer<39>;
using int40 = nall::Integer<40>;
using int41 = nall::Integer<41>;
using int42 = nall::Integer<42>;
using int43 = nall::Integer<43>;
using int44 = nall::Integer<44>;
using int45 = nall::Integer<45>;
using int46 = nall::Integer<46>;
using int47 = nall::Integer<47>;
using int48 = nall::Integer<48>;
using int49 = nall::Integer<49>;
using int50 = nall::Integer<50>;
using int51 = nall::Integer<51>;
using int52 = nall::Integer<52>;
using int53 = nall::Integer<53>;
using int54 = nall::Integer<54>;
using int55 = nall::Integer<55>;
using int56 = nall::Integer<56>;
using int57 = nall::Integer<57>;
using int58 = nall::Integer<58>;
using int59 = nall::Integer<59>;
using int60 = nall::Integer<60>;
using int61 = nall::Integer<61>;
using int62 = nall::Integer<62>;
using int63 = nall::Integer<63>;
using int64 = nall::Integer<64>;

using uint1 = nall::Natural< 1>;
using uint2 = nall::Natural< 2>;
using uint3 = nall::Natural< 3>;
using uint4 = nall::Natural< 4>;
using uint5 = nall::Natural< 5>;
using uint6 = nall::Natural< 6>;
using uint7 = nall::Natural< 7>;
using uint8 = nall::Natural< 8>;
using uint9 = nall::Natural< 9>;
using uint10 = nall::Natural<10>;
using uint11 = nall::Natural<11>;
using uint12 = nall::Natural<12>;
using uint13 = nall::Natural<13>;
using uint14 = nall::Natural<14>;
using uint15 = nall::Natural<15>;
using uint16 = nall::Natural<16>;
using uint17 = nall::Natural<17>;
using uint18 = nall::Natural<18>;
using uint19 = nall::Natural<19>;
using uint20 = nall::Natural<20>;
using uint21 = nall::Natural<21>;
using uint22 = nall::Natural<22>;
using uint23 = nall::Natural<23>;
using uint24 = nall::Natural<24>;
using uint25 = nall::Natural<25>;
using uint26 = nall::Natural<26>;
using uint27 = nall::Natural<27>;
using uint28 = nall::Natural<28>;
using uint29 = nall::Natural<29>;
using uint30 = nall::Natural<30>;
using uint31 = nall::Natural<31>;
using uint32 = nall::Natural<32>;
using uint33 = nall::Natural<33>;
using uint34 = nall::Natural<34>;
using uint35 = nall::Natural<35>;
using uint36 = nall::Natural<36>;
using uint37 = nall::Natural<37>;
using uint38 = nall::Natural<38>;
using uint39 = nall::Natural<39>;
using uint40 = nall::Natural<40>;
using uint41 = nall::Natural<41>;
using uint42 = nall::Natural<42>;
using uint43 = nall::Natural<43>;
using uint44 = nall::Natural<44>;
using uint45 = nall::Natural<45>;
using uint46 = nall::Natural<46>;
using uint47 = nall::Natural<47>;
using uint48 = nall::Natural<48>;
using uint49 = nall::Natural<49>;
using uint50 = nall::Natural<50>;
using uint51 = nall::Natural<51>;
using uint52 = nall::Natural<52>;
using uint53 = nall::Natural<53>;
using uint54 = nall::Natural<54>;
using uint55 = nall::Natural<55>;
using uint56 = nall::Natural<56>;
using uint57 = nall::Natural<57>;
using uint58 = nall::Natural<58>;
using uint59 = nall::Natural<59>;
using uint60 = nall::Natural<60>;
using uint61 = nall::Natural<61>;
using uint62 = nall::Natural<62>;
using uint63 = nall::Natural<63>;
using uint64 = nall::Natural<64>;
12 changes: 6 additions & 6 deletions ares/component/audio/ay38910/ay38910.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace ares {

#include "serialization.cpp"

auto AY38910::clock() -> array<uint4[3]> {
auto AY38910::clock() -> array<n4[3]> {
toneA.clock();
toneB.clock();
toneC.clock();
noise.clock();
envelope.clock();

array<uint4[3]> output;
array<n4[3]> output;
if((toneA.output | channelA.tone) & (noise.output | channelA.noise)) {
output[0] = channelA.envelope ? envelope.output : channelA.volume;
}
Expand Down Expand Up @@ -65,8 +65,8 @@ auto AY38910::Envelope::clock() -> void {
}
}

auto AY38910::read() -> uint8 {
uint8 data;
auto AY38910::read() -> n8 {
n8 data;

switch(io.register) {
case 0:
Expand Down Expand Up @@ -135,7 +135,7 @@ auto AY38910::read() -> uint8 {
return data;
}

auto AY38910::write(uint8 data) -> void {
auto AY38910::write(n8 data) -> void {
switch(io.register) {
case 0:
toneA.period.bit(0, 7) = data.bit(0,7);
Expand Down Expand Up @@ -204,7 +204,7 @@ auto AY38910::write(uint8 data) -> void {
}
}

auto AY38910::select(uint4 data) -> void {
auto AY38910::select(n4 data) -> void {
io.register = data;
}

Expand Down
Loading

0 comments on commit 7656765

Please sign in to comment.