forked from OpenEmu/OpenEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving everything to Trunk in prep for Branch "helper app" Open Emu p…
…roject. git-svn-id: https://openemu.svn.sourceforge.net/svnroot/openemu/Trunk@669 a16923d9-94c8-4a39-ae78-11df2d60a2ba
- Loading branch information
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.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.