Basilisk II PSP Port (Mac Emulator)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
ChaosKnight
Posts: 142
Joined: Thu Apr 14, 2005 2:08 am
Location: Florida, USA

Post by ChaosKnight »

sHARD>> wrote:To solve the mouse problem why not utilize the analog sensitivity to accelerate the mouse? I know at least one homebrew already did, I'll see if I can dig up the code to take a look at.
I did that initially and had a lot of problems with the mouse being too sensitive, so I locked it down. I'll revisit it onc I get some other more important things working (proper color, ethernet, os 8)
w00t
sHARD>>
Posts: 10
Joined: Wed Oct 05, 2005 10:09 am

Post by sHARD>> »

ChaosKnight wrote:
sHARD>> wrote:To solve the mouse problem why not utilize the analog sensitivity to accelerate the mouse? I know at least one homebrew already did, I'll see if I can dig up the code to take a look at.
I did that initially and had a lot of problems with the mouse being too sensitive, so I locked it down. I'll revisit it onc I get some other more important things working (proper color, ethernet, os 8)
Cool, if you don't mind and I find the time, I might have a look myself.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

ChaosKnight wrote:
sHARD>> wrote:To solve the mouse problem why not utilize the analog sensitivity to accelerate the mouse? I know at least one homebrew already did
I actually kinda like it this way for Basilisk. The screen isn't that big anyway, you get around pretty fast. But maybe you can add in a configurable accellerator later on. Don't think it's a very important issue though - it works very well now. Getting the analog sensitivity just right is very hard.
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

Arwin wrote:Getting the analog sensitivity just right is very hard.
The controller seems sensitive near the centre, so I believe the best solution involves a cubic spline. SDL's joystick code does this and the values are currently something like this:

Code: Select all

// 4 points define the bezier-curve.  
static point a = { 0, 0 };
static point b = { 50, 0  };
static point c = { 78, 32767 };
static point d = { 128, 32767 };
This seems to work a lot better than a simple linear approach. I just made up the numbers - and I'm open to suggestion on the best values for the curve.

Although with something like Basilisk, perhaps it would be better to use d-pad for the cursor and use the analog stick somehow for keyboard input.
User avatar
ChaosKnight
Posts: 142
Joined: Thu Apr 14, 2005 2:08 am
Location: Florida, USA

Post by ChaosKnight »

rinco wrote:

Code: Select all

// 4 points define the bezier-curve.  
static point a = { 0, 0 };
static point b = { 50, 0  };
static point c = { 78, 32767 };
static point d = { 128, 32767 };
I don't quite understand this code. The values you get from the analog pad are 0-255 with 128 being the center. How are you scaling to get 32767?
rinco wrote:Although with something like Basilisk, perhaps it would be better to use d-pad for the cursor and use the analog stick somehow for keyboard input.
I was think about using the p-sprint code and just using select to switch input modes (while still retaining the analog pad for mouse movement) Dunno. I'm open to suggestion.[/quote]
w00t
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

Those values are the x/y coordinates that can be plugged into any cubic spline routine. Here is a link to an appet which can help visualise the curve created by the 4 points (the initial curve is nothing like the values I posted - you will have to move the points around): http://www.saltire.com/applets/advanced ... spline.htm

The values are only calculated to 128 because the negative of an axis is calculated by changing the sign of a value calculated on the positive (so 128 sample points). SDL_sysjoystick.c has the code that you can pluck if you wish to calculate the curve, and cache into an array during initialisation.

I'd like to see a solution with both mouse and keyboard, as one button for the mouse is the same cost as one button to switch between mouse and keyboard.
holger
Posts: 204
Joined: Thu Aug 18, 2005 10:57 am

Post by holger »

you could use the "select"-key to switch between mouse/keyboard/joystick mode. I think one of the atari emulators does it like this.
Mysticales
Posts: 5
Joined: Thu Oct 13, 2005 5:04 am
Location: USA,VA
Contact:

Post by Mysticales »

Hello wanted to give my praise. Right now looking at the OS8.1 support, just talked to Chaos who said next release should hold the model ID to help support that correctly.

I use this on my PC, and well, trying to see how well my PC disk image will port to the PSP.

Rather use my .hfv file I had on my PC and port it to the PSP which is what I am trying for. Cause yes, it had netscape and more.

Also I should point out that this emu will NOT support PPC right now. (Mac OSX and hell.. even 8.2 I think)

If it DID support it ever.. we could play Warcraft 1, 2, and Diablo! =D

Anyways Im here as well to offer my support on things. =) Got mine working fine, just once that model ID changes, Ill be able to run the OS8 without it giving me a model not supported issue atm. Which unless I compile the source myself I am at a dead end. =/

I would like to know the prefered boot order however. I mean cause if I look at it, system.dsk will always be 1st to load. But what if I wanted to have the .hfv file to load 1st cause that would mean it boots from the HD file which holds the OS, vs the system disk file which is only 7.5.5
~Battlez-avec la Mystique?~
eco
Posts: 3
Joined: Thu Oct 13, 2005 7:28 am

...

Post by eco »

...i got EVERYTHING working... now im trying to figure out how to get Oregon Trail to work... im clueless! I already got the rom... 'otrail.bin' (1 and 2) tried to figure out hvfexplorer... but this is my first time really experiencing MAC OS... since about 3/4th grade... im in college now... if anyone could PLEASE help, you would rock!

thanks...
...eco
PSPuccyEatern
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Folks, a little reminder here:
ChaosKnight wrote:This is off-topic (devlopment only) so in the future please post any support related questions on the Animezilla Basilisk II PSP forum here: http://forum.animezilla.net/Default.aspx?g=posts&m=4&#4
Specifically for the two posts above this one. ;)
eco
Posts: 3
Joined: Thu Oct 13, 2005 7:28 am

Post by eco »

^^^ my BAD ^^^
didn't notice that link!
still can't get that BEAST WORKING! ArrrrRGH~!
PSPuccyEatern
DarkStar448
Posts: 1
Joined: Thu Oct 13, 2005 9:05 am

Post by DarkStar448 »

Have you had a chance to fix up the video colours yet? If not I did some looking at RGB values. I didn't have much to work on, however, by looking at the apple logo top left it appears that the red field and the blue one need to be swapped. Green is in the correct place.

From top to bottom, the colours of the apple logo you have:
Green (0,255,0)
Cyan (0,255,255)
Blue (0,0,255)
Purple? (255,0,255)
Red? (255,0,0)

Swapping the two fields would yield something like this:
Green (0,255,0)
Yellow (255,0,0)
Red (255,0,0)
Purple (255,0,255)
Blue (0,0,255)
Which would resemble the apple logo much better.

Also the USA flag would look about right.

Gray would remain gray, white would remain white and black will remain black.

Is it possible that you have an array that is being indexed backwards?

Nice work with this emulator can't wait to see some more features added in :) It's making me want to go and replace my stock 32MB stick already =D (I've had my PSP 4 days now)
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

For a really quick test, I tried this ... no keycode translation yet, but I noticed some values are probably the same (F keys notably) and once it works, I can translate easily enough. Can't get it to work yet though, my problem is probably with CPP projects, with which I have no experience.

I added an include to my p_sprint.h (if you try this, be sure to get the 63a version of the include, as the older versions reset the pad so don't work well if you also do that yourself already), then modified the following bit of code (very slightly as you can see):

Code: Select all

struct p_sp_Key myKey;


int Psp60HzTimer(SceSize args, void *argp)
{
	while (true)
	{
		// Wait another 60Hz.
		sceKernelDelayThread(16625);
		
		// Read input
		sceCtrlReadBufferPositive(&pad, 1);
		
		// Setup analog dead zone and read "mouse"
		if &#40;pad.Lx > 108 && pad.Lx < 148&#41; pad.Lx = LastX = 128;
		else
		&#123;
			if &#40;pad.Lx > 127&#41; ADBMouseMoved&#40; 2, 0&#41;;
			if &#40;pad.Lx < 127&#41; ADBMouseMoved&#40;-2, 0&#41;;
		&#125;
		if &#40;pad.Ly > 108 && pad.Ly < 148&#41; pad.Ly = LastY = 128;
		else
		&#123;
			if &#40;pad.Ly > 127&#41; ADBMouseMoved&#40;0,  2&#41;;
			if &#40;pad.Ly < 127&#41; ADBMouseMoved&#40;0, -2&#41;;
		&#125;
		
		if &#40;pad.Buttons != 0&#41;
		&#123;
			if &#40;pad.Buttons & PSP_CTRL_RTRIGGER&#41;
			&#123;
				ADBMouseDown&#40;0&#41;;
				MouseDown = true;
			&#125;
			else if &#40;&#40;pad.Buttons & PSP_CTRL_RTRIGGER&#41; && MouseDown&#41;
			&#123;
				ADBMouseUp&#40;0&#41;;
				MouseDown = false;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_START&#41;
			&#123;
				ADBKeyDown&#40;0x24&#41;;
				EnterPressed = true;
			&#125;
			else if &#40;&#40;pad.Buttons & PSP_CTRL_START&#41; && EnterPressed&#41;
			&#123;
				ADBKeyUp&#40;0x24&#41;;
				EnterPressed = false;
			&#125;
		&#125;
		else
		&#123;
			// Reset anything set.
			if &#40;MouseDown&#41; &#123; ADBMouseUp&#40;0&#41;; MouseDown = false; &#125;
			if &#40;EnterPressed&#41; &#123; ADBKeyUp&#40;0x24&#41;; EnterPressed = false; &#125;
		&#125;

		//release previous key
		if&#40;myKey.keycode>0&#41;
		&#123;
			ADBKeyUp&#40;myKey.keycode&#41;;
		&#125;
		//read current key
		p_spReadKeyEx&#40;&myKey,pad.Buttons&#41;;

		//press current key
		if&#40;myKey.keycode>0&#41;
		&#123;
			ADBKeyDown&#40;myKey.keycode&#41;;
		&#125;

		
		// Trigger 60Hz interrupt.
		SetInterruptFlag&#40;INTFLAG_60HZ&#41;;
		TriggerInterrupt&#40;&#41;;
	&#125;
&#125;
Finally I added p_sprint.o in the Makefile like so:

Code: Select all

OBJS = ../main.o p_sprint.o main_psp.o ../prefs.o prefs_psp.o \
    prefs_editor_psp.o sys_psp.o ../rom_patches.o \
    ../slot_rom.o ../rsrc_patches.o ../emul_op.o \
    ../macos_util.o ../xpram.o xpram_psp.o ../timer.o \
    timer_psp.o clip_psp.o ../adb.o ../serial.o \
    serial_psp.o ../ether.o ether_psp.o ../sony.o ../disk.o \
    ../cdrom.o ../scsi.o scsi_psp.o ../video.o video_psp.o \
    ../audio.o audio_psp.o \
    ../user_strings.o user_strings_psp.o \
But I get an error "undefined reference to p_spReadKeyEx(p_sp_Key*,unsigned int)

Can anyone point out the probably obvious error here?

Thanks!
pspaddict
Posts: 10
Joined: Thu Oct 13, 2005 10:32 am

Can OS 8 work

Post by pspaddict »

Hey has any1 confirmed that Mac OS 8.0 works. Please Tell
PSPADDICTED :):)
sHARD>>
Posts: 10
Joined: Wed Oct 05, 2005 10:09 am

Re: Can OS 8 work

Post by sHARD>> »

pspaddict wrote:Hey has any1 confirmed that Mac OS 8.0 works. Please Tell
It won't until he fixes some stuff. It currently states that you have an incompatable model. The problem may be as simple as adding more models to the supported list, or the emu could have some other issues. I guess we shall see.
Mysticales
Posts: 5
Joined: Thu Oct 13, 2005 5:04 am
Location: USA,VA
Contact:

Post by Mysticales »

I already talked that over with Chaos, it was a simple Model ID setting which he fixed, he changed it to Model 14. That should be all we need to support 8.0, Long as you had a good rom file to go with it. Not the LC III.
Next release he said will include his fix.
~Battlez-avec la Mystique?~
sHARD>>
Posts: 10
Joined: Wed Oct 05, 2005 10:09 am

Post by sHARD>> »

Mysticales wrote:I already talked that over with Chaos, it was a simple Model ID setting which he fixed, he changed it to Model 14. That should be all we need to support 8.0, Long as you had a good rom file to go with it. Not the LC III.
Next release he said will include his fix.
1) That means I need to go setup this thing to compile it myself :P
2) You live in VA too?
pspaddict
Posts: 10
Joined: Thu Oct 13, 2005 10:32 am

OS8

Post by pspaddict »

Anyway what rom do you need to get OS8 to work. I tried doing a normal boot disk... finder/system. Just tell me what rom I need. I have a Powerbook 180c(OS7) , Powerbook 540c (OS8). Also how do you make the fix.. can some1 host a file so i can use OS8 cuz i have the cd
PSPADDICTED :):)
Mysticales
Posts: 5
Joined: Thu Oct 13, 2005 5:04 am
Location: USA,VA
Contact:

Post by Mysticales »

8.0 WONT work in "This' release, due to that when it was compiled, it was compiled using a model ID that didnt support OS8, Think Chaos used the LC III ID, Not the Quadra. Which is fixed in next release.

Yes I live in VA, Beach.

Once this model is fixed, then 8.0 should work.
~Battlez-avec la Mystique?~
User avatar
ChaosKnight
Posts: 142
Joined: Thu Apr 14, 2005 2:08 am
Location: Florida, USA

Post by ChaosKnight »

Ok, there's been a lot of talk about the model issue and OS8 and such, so I will release this small patch version. There's nothing really extra in it except that it has the corrected model number and it scans for HFV files now instead of HFS like it was before... small typo on my part.

http://animezilla.org/BasiliskII-PSP-bin-tiny.zip
w00t
sHARD>>
Posts: 10
Joined: Wed Oct 05, 2005 10:09 am

Post by sHARD>> »

ChaosKnight wrote:and it scans for HFV files now instead of HFS like it was before... small typo on my part.
Oooh. Damn. That explains a lot. :P
Mysticales
Posts: 5
Joined: Thu Oct 13, 2005 5:04 am
Location: USA,VA
Contact:

Post by Mysticales »

Ok sadly, it still wont boot my OS8, still says run the newest installer for this disk.

HOWEVER When I load your system.dsk to boot it, it DOES now see my HD OS8! So meaning my image file from my PC (300 Megs) DOES respond to 7.5.5

Also I tried a OS 7 boot disk, that didnt boot either. So seems ONLY your "system.dsk" is booting, nothing else will boot. I hope I dont need to make a clean .hfv hard drive, then install the whole system manually.. that MIGHT work.. then again I dont know. =(

I would have to try some hardcore testing on that tonight. =(

Edit its nice to see the bootup mode is changed, no more debug code. Good work.
~Battlez-avec la Mystique?~
User avatar
ChaosKnight
Posts: 142
Joined: Thu Apr 14, 2005 2:08 am
Location: Florida, USA

Post by ChaosKnight »

Ok, I got real color working but it's slowww.. so I won'tbe releasing it right now, I'll work on making it much faster tomorrow.
w00t
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Ok, so I'm probably missing the extern "C" thing. This should do the trick, right?:

Code: Select all

extern "C"
&#123;
 #include "p_sprint.h"
&#125;
And now that I think of it, there are in the standard libs all these compile options that add externs depending on if the compiler is C or not. I'll have a look at that, maybe I should include that in the p_sprint.c library also so you don't have to worry about that in cpp projects at all.

If this does the trick, I'll try getting p_sprint in Basilisk up and running tonight, as it looks like I'll have some time.
pspaddict
Posts: 10
Joined: Thu Oct 13, 2005 10:32 am

Post by pspaddict »

Just Wondering if you can install OS7 fully on the PSP using a 32 mg stick.
Or do you have to copy it from an old computer
PSPADDICTED :):)
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Ok, piece of cake! It works, and pretty smooth too. Now I just have to enter the right keyvalues and basic typing is in. :)

Then I'll start working out the best way to get the control keys in there.
User avatar
ChaosKnight
Posts: 142
Joined: Thu Apr 14, 2005 2:08 am
Location: Florida, USA

Post by ChaosKnight »

Arwin wrote:Ok, piece of cake! It works, and pretty smooth too. Now I just have to enter the right keyvalues and basic typing is in. :)

Then I'll start working out the best way to get the control keys in there.
The keycodes are listed in some other files in the distro. I think the unix folder actually has a file called Keycodes for mapping normal PC keycodes to mac. You might get a huge head start with that.

Looks like we need some kind of CVS, and it doesn't seem that PS2DEV is willing to host it (i asked a few days ago and still have no response). So I'll be looking around, if anyone has a suggestion, I'm open to that.
w00t
pspaddict
Posts: 10
Joined: Thu Oct 13, 2005 10:32 am

Post by pspaddict »

Try Megaupload
this has been edited since posting
PSPADDICTED :):)
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

ChaosKnight wrote:
Arwin wrote:Ok, piece of cake! It works, and pretty smooth too. Now I just have to enter the right keyvalues and basic typing is in. :)

Then I'll start working out the best way to get the control keys in there.
The keycodes are listed in some other files in the distro. I think the unix folder actually has a file called Keycodes for mapping normal PC keycodes to mac. You might get a huge head start with that.

Looks like we need some kind of CVS, and it doesn't seem that PS2DEV is willing to host it (i asked a few days ago and still have no response). So I'll be looking around, if anyone has a suggestion, I'm open to that.
Probably a good idea, but it's not going to be a big problem atm. The lines of code actually affecting Basilisk files are minimal, except for 1 include, 1 variable and 1 init, everything takes place in the 60hz routine, and it won't be much more than 10-15 consecutive lines. So for now I'll post the occasional test .elf here, and send you the any updates as source, and it won't take you a minute to update your project.
User avatar
ChaosKnight
Posts: 142
Joined: Thu Apr 14, 2005 2:08 am
Location: Florida, USA

Post by ChaosKnight »

Great! I'll look forward to integrating it!
w00t
Post Reply