Skip to content

Commit

Permalink
Moving everything to Trunk in prep for Branch "helper app" Open Emu p…
Browse files Browse the repository at this point in the history
…roject.

git-svn-id: https://openemu.svn.sourceforge.net/svnroot/openemu/Trunk@669 a16923d9-94c8-4a39-ae78-11df2d60a2ba
  • Loading branch information
vade committed Apr 4, 2010
1 parent da2db54 commit c143e77
Show file tree
Hide file tree
Showing 3,039 changed files with 862,403 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added BSNES/BSNES.xcodeproj/TemplateIcon.icns
Binary file not shown.
2,440 changes: 2,440 additions & 0 deletions BSNES/BSNES.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions BSNES/BSNESInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* BSNESInterface.h
* BSNES
*
* Created by Joshua Weinberg on 7/20/09.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
#pragma once

//#include <base.hpp>
#include "system/interface/interface.hpp"
#import "OERingBuffer.h"

class BSNESInterface : public SNES::Interface {
public:
void video_refresh(uint16_t *data, unsigned pitch, unsigned *line, unsigned width, unsigned height);
void audio_sample(uint16_t left, uint16_t right);
void input_poll();
int16_t input_poll(unsigned deviceid, unsigned id);
OERingBuffer *ringBuffer;
int width;
int height;
int pitch;
int16_t pad[2][12];
uint16_t *video;
};
62 changes: 62 additions & 0 deletions BSNES/BSNESInterface.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#include <base.hpp>
#include "BSNESInterface.h"

void BSNESInterface::video_refresh(uint16_t *input, unsigned apitch, unsigned *line, unsigned awidth, unsigned aheight) {

width = awidth;
height = aheight;
pitch = apitch;


pitch >>= 1;

uint16_t *output = video;
for(unsigned y = 0; y < height; y++)
{
if(width == 512 && line[y] == 256)
{
for(unsigned x = 0; x < 256; x++)
{
uint16_t p = *input++;
*output++ = p;
*output++ = p;
}
input += 256;
}
else
{
for(unsigned x = 0; x < width; x++)
{
uint16_t p = *input++;
*output++ = p;
}
}
input += pitch - width;
output += pitch - width;
}
}

void BSNESInterface::audio_sample(uint16_t left, uint16_t right) {
// if(config.audio.mute) left = right = 0;
// audio.sample(left, right);
//printf("sampled");

[ringBuffer write:&left maxLength:2];
[ringBuffer write:&right maxLength:2];
}

void BSNESInterface::input_poll() {
// inputManager.poll();
}

int16_t BSNESInterface::input_poll(unsigned deviceid, unsigned a) {
//NSLog(@"polled input: device: %d id: %d", deviceid, id);
if (deviceid == SNES::Input::DeviceIDJoypad1) {
return pad[0][a];
}
else if(deviceid == SNES::Input::DeviceIDJoypad2) {
return pad[1][a];
}

return 0;//inputManager.getStatus(deviceid, id);
}
7 changes: 7 additions & 0 deletions BSNES/BSNES_Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'BSNES' target in the 'BSNES' project.
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
Loading

0 comments on commit c143e77

Please sign in to comment.