Skip to content

Commit d2a15a1

Browse files
author
redcode
committed
WIP-
1 parent 6ffccdb commit d2a15a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1743
-1095
lines changed
File renamed without changes.

development/Xcode/μZX (OS X).xcodeproj/project.pbxproj

+43-25
Large diffs are not rendered by default.

development/Xcode/μZX (iOS).xcodeproj/project.pbxproj

+86-26
Large diffs are not rendered by default.

resources/OS X/property lists/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>936</string>
24+
<string>1222</string>
2525
<key>LSMinimumSystemVersion</key>
2626
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2727
<key>NSHumanReadableCopyright</key>

resources/common/shaders/Simple.fsh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#version 110
2+
3+
uniform sampler2D texture;
4+
varying vec2 texture_point;
5+
6+
void main(void)
7+
{
8+
gl_FragColor = texture2D(texture, texture_point);
9+
}

resources/common/shaders/Simple.vsh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#version 110
2+
3+
uniform mat4 transform;
4+
varying vec2 texture_point;
5+
6+
void main(void)
7+
{
8+
gl_Position = gl_Vertex * transform;
9+
texture_point = vec2(gl_Vertex.x, -gl_Vertex.y) * vec2(0.5) + vec2(0.5);
10+
}

resources/iOS/UI/Base.lproj/LaunchScreen.xib

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
56
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
67
</dependencies>
78
<objects>
+4-14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="BYZ-38-t0r">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
66
</dependencies>
77
<scenes>
88
<!--Main View Controller-->
@@ -13,13 +13,8 @@
1313
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
1414
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1515
<subviews>
16-
<view contentMode="scaleToFill" id="GAJ-qZ-Fhu" customClass="GLOutputView">
17-
<rect key="frame" x="0.0" y="20" width="320" height="296"/>
18-
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
19-
<color key="backgroundColor" red="0.8196079731" green="0.48235300180000001" blue="0.91372597219999996" alpha="1" colorSpace="calibratedRGB"/>
20-
</view>
2116
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translucent="NO" id="ObK-ec-A8D">
22-
<rect key="frame" x="0.0" y="316" width="320" height="44"/>
17+
<rect key="frame" x="0.0" y="524" width="320" height="44"/>
2318
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
2419
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
2520
<items>
@@ -37,15 +32,10 @@
3732
</viewController>
3833
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
3934
</objects>
40-
<point key="canvasLocation" x="34" y="396"/>
35+
<point key="canvasLocation" x="-289" y="59"/>
4136
</scene>
4237
</scenes>
4338
<resources>
4439
<image name="Joystick.png" width="50" height="50"/>
4540
</resources>
46-
<simulatedMetricsContainer key="defaultSimulatedMetrics">
47-
<simulatedStatusBarMetrics key="statusBar"/>
48-
<simulatedOrientationMetrics key="orientation"/>
49-
<simulatedScreenMetrics key="destination" type="retina4"/>
50-
</simulatedMetricsContainer>
5141
</document>

resources/iOS/UI/MachineView.xib

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" variant="6xAndEarlier" propertyAccessControl="none">
3+
<dependencies>
4+
<deployment version="1072" identifier="iOS"/>
5+
<development version="5100" identifier="xcode"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
7+
</dependencies>
8+
<objects>
9+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MachineViewController">
10+
<connections>
11+
<outlet property="view" destination="iN0-l3-epB" id="dBh-7O-mcD"/>
12+
</connections>
13+
</placeholder>
14+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15+
<view contentMode="scaleToFill" id="iN0-l3-epB">
16+
<rect key="frame" x="0.0" y="20" width="408" height="516"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<subviews>
19+
<view contentMode="scaleToFill" id="TKW-zG-72O" customClass="GLVideoView">
20+
<rect key="frame" x="0.0" y="0.0" width="408" height="315"/>
21+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
22+
<color key="backgroundColor" red="0.92615244389883267" green="0.79587435955079466" blue="1" alpha="1" colorSpace="calibratedRGB"/>
23+
</view>
24+
</subviews>
25+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
26+
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
27+
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
28+
<point key="canvasLocation" x="257" y="315"/>
29+
</view>
30+
</objects>
31+
</document>

sources/Linux/ALSAAudioOutputPlayer.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class ALSAAudioOutputPlayer {
1919
private:
2020
std::thread _thread;
2121
snd_pcm_t* _device;
22-
ZKit::RingBuffer _buffer;
23-
volatile ZKit::Boolean _must_stop;
22+
Zeta::RingBuffer _buffer;
23+
volatile Zeta::Boolean _must_stop;
2424

2525
public:
26-
ZKit::Boolean playing;
26+
Zeta::Boolean playing;
2727

2828
ALSAAudioOutputPlayer();
2929
~ALSAAudioOutputPlayer();
30-
ZKit::RingBuffer *buffer() {return &_buffer;}
30+
Zeta::RingBuffer *buffer() {return &_buffer;}
3131
void start();
3232
void stop();
3333

sources/OS X/CoreAudioOutputPlayer.cpp sources/OS X & iOS/CoreAudioOutputPlayer.cpp

+15-7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
#import <AudioToolbox/AudioToolbox.h>
99
#import <Z/types/base.h>
1010
#import "system.h"
11+
#import <Z/inspection/OS.h>
1112

12-
using namespace ZKit;
13+
using namespace Zeta;
1314

1415

1516
static OSStatus FillBuffer(
@@ -44,8 +45,14 @@ CoreAudioOutputPlayer::CoreAudioOutputPlayer()
4445
// Configure the search parameters to find the default playback output unit. |
4546
//---------------------------------------------------------------------------'
4647
AudioComponentDescription output_description = {
47-
.componentType = kAudioUnitType_Output,
48-
.componentSubType = kAudioUnitSubType_DefaultOutput,
48+
.componentType = kAudioUnitType_Output,
49+
50+
# if Z_OS == Z_OS_MAC_OS_X
51+
.componentSubType = kAudioUnitSubType_DefaultOutput,
52+
# elif Z_OS == Z_OS_IOS
53+
.componentSubType = kAudioUnitSubType_GenericOutput,
54+
# endif
55+
4956
.componentManufacturer = kAudioUnitManufacturer_Apple,
5057
.componentFlags = 0,
5158
.componentFlagsMask = 0
@@ -84,10 +91,11 @@ CoreAudioOutputPlayer::CoreAudioOutputPlayer()
8491
//NSAssert1(error == noErr, @"Error setting maximum frames per slice: %hd", error);
8592

8693
// Set the buffer size
87-
88-
error = AudioUnitSetProperty
89-
(_audio_unit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global,
90-
0, &frames, sizeof(frames));
94+
# if Z_OS == Z_OS_MAC_OS_X
95+
error = AudioUnitSetProperty
96+
(_audio_unit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global,
97+
0, &frames, sizeof(frames));
98+
# endif
9199

92100
//NSAssert1(error == noErr, @"Error setting buffer frame size: %hd", error);
93101

sources/OS X/CoreAudioOutputPlayer.hpp sources/OS X & iOS/CoreAudioOutputPlayer.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,22 @@
44
| ____________/\__\ Released under the GNU General Public License v3.
55
|_*/
66

7-
#import <CoreAudio/CoreAudio.h>
87
#import <AudioToolbox/AudioToolbox.h>
98
#import <Z/classes/buffering/RingBuffer.hpp>
109

1110
class CoreAudioOutputPlayer {
1211
private:
1312
AudioComponentInstance _audio_unit;
14-
ZKit::RingBuffer _buffer;
13+
Zeta::RingBuffer _buffer;
1514
zuint _buffer_frame_count;
1615
double _sample_rate;
1716

1817
public:
19-
ZKit::Boolean playing;
18+
Zeta::Boolean playing;
2019

2120
CoreAudioOutputPlayer();
2221
~CoreAudioOutputPlayer();
23-
ZKit::RingBuffer *buffer() {return &_buffer;}
22+
Zeta::RingBuffer *buffer() {return &_buffer;}
2423
void start();
2524
void stop();
2625
};

sources/OS X & iOS/GLVideoView.h

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* _________ ___
2+
_____ \_ /\ \/ / OS X/GLVideoOutputView.h
3+
| | |_/ /__> < Copyright © 2014-2015 Manuel Sainz de Baranda y Goñi.
4+
| ____________/\__\ Released under the GNU General Public License v3.
5+
|_*/
6+
7+
#import "GLFrameBufferRenderer.hpp"
8+
9+
#if Z_OS == Z_OS_MAC_OS_X
10+
# import <Cocoa/Cocoa.h>
11+
#elif Z_OS == Z_OS_IOS
12+
# import <UIKit/UIKit.h>
13+
#endif
14+
15+
@interface GLVideoView :
16+
17+
# if Z_OS == Z_OS_MAC_OS_X
18+
19+
NSView {NSOpenGLContext* _GLContext;
20+
CGLContextObj _CGLContext;
21+
NSOpenGLPixelFormat* _pixelFormat;
22+
23+
# elif Z_OS == Z_OS_IOS
24+
25+
UIView {CAEAGLLayer* _EAGLLayer;
26+
EAGLContext* _GLContext;
27+
GLuint _renderBuffer;
28+
# endif
29+
30+
GLFrameBufferRenderer* _renderer;
31+
32+
struct {BOOL reshaped :1;
33+
BOOL active :1;
34+
BOOL blank :1;
35+
} _flags;
36+
}
37+
@property (nonatomic, readonly) Zeta::TripleBuffer* buffer;
38+
@property (nonatomic, assign) Zeta::Value2D<Zeta::Real> contentSize;
39+
@property (nonatomic, assign) ZKey(SCALING) scaling;
40+
41+
- (void) setResolution: (Zeta::Value2D<Zeta::Size>) resolution
42+
format: (Zeta::UInt ) format;
43+
44+
- (void) start;
45+
46+
- (void) stop;
47+
48+
- (void) blank;
49+
50+
- (void) setLinearInterpolation: (BOOL) value;
51+
@end

0 commit comments

Comments
 (0)