Basilisk II PSP Port (Mac Emulator)

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

Moderators: cheriff, TyRaNiD

Post Reply
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Here's test6. This one has the minor cleanup of the audio... should sound better for apps that do distinct clips instead of streaming. Major change - I got tired of looking for what was wrong with 4 bit video, so I did a hack - I convert the four bit video into 8 bit and then use the 8 bit code. Works fine. One thing this tells me - the Mac is drawing the four bit correctly, so the problem is with the GU_PSM_T4 handling. I can't spot the problem... I'll leave it for another time. This at least makes it where you can read the damn display so initial installs and four bit games should be usable now.

SendSpace
binary
source

MediaFire
binary
source
siulmagic
Posts: 42
Joined: Sun Jul 06, 2008 1:50 pm

Post by siulmagic »

nice work cant wait to test it

edit: i have a problem 7.5 is booting anymore aim playing around with the settings see if i can make it boot again

edit2: hmm seems no matter what 7.5 wont boot =/ any ideas?

after i choose basilisk to boot it goes to a black screen the psp crashes
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Okay, I figured out the problem with GU_PSM_T4... and it IS a problem with GU_PSM_T4, not the emulator. The issue is that the PSP GPU takes little-endian to an all-time low. We all know the PSP has a little-endian CPU. It's rather like the x86 in that respect. No big deal. It makes a little difference in the graphics for converting games written for something like the Amiga or Mac where the CPU is big-endian. All your bytes are "backwards". Where a big-endian CPU interprets a longword this way,

Byte 0: bits 31-24, Byte 1: bits 23-16, Byte 2:bits 15-8, Byte 3:bits 7-0

a little-endian CPU interprets it this way,

Byte 3: bits 31-24, Byte 2: bits 23-16, Byte 1:bits 15-8, Byte 0:bits 7-0

No problem. Keep it in mind and you're fine. That clearly affects video modes with more than one byte per pixel. It clearly doesn't affect modes using one byte per pixel. Now the FREAKY part... and you WILL FREAK!

In sixteen color chunky graphics, each pixel takes four bits, so you can put two in every byte. But there's clearly two ways you could do it:

pixel 0: bits 7-4, pixel 1: bits 3-0

or

pixel 1: bits 7-4, pixel 0: bits 3-0


EVERY SINGLE COMPUTER AND VIDEO CARD IN THE UNIVERSE USES THE FIRST ORDERING!!!!!! So, now the million dollar question: which way doe the PSP's GU_PSM_T4 texture mode do it?? DING DING DING DING DING!!! You're right!! It does it the SECOND WAY. I always wondered why no one ever used four bit textures... I have yet to see a PSP app/game that did. Now I know why - people couldn't figure out why all their textures came out screwed up. So what you have to do is swap all the nibbles in the bytes of the texture:

Code: Select all

    int i,j;
    for &#40;j=0; j<576; j++&#41;
        for &#40;i=0; i<768/8; i++&#41;
        &#123;
            uint32 v = srp&#91;j*768/8 + i&#93;;
            uint32 vv1 = &#40;v>>4&#41;&0x0F0F0F0F | &#40;v<<4&#41;&0xF0F0F0F0;
            dp&#91;j*768/8 + i&#93; = vv1;
        &#125;
That's what I now do before passing the result on to a stretch blit set for GU_PSM_T4, and it works great. So now that you know the "trick", feel free to start using four bit textures. ;)

In my case, when I do my new video refresh routines, I just need to remember to do this swap. I'll probably use a logic op to handle it.
siulmagic
Posts: 42
Joined: Sun Jul 06, 2008 1:50 pm

Post by siulmagic »

ok i got it to show something that is if i mount something to the cd drive it boots but to a grey screen with no icon or anything just gray lines, do 7.5 still does not boot
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

What gives? When I start the program and run the emulation it just sit there and shuts down. Could this be a problem with that new built?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

siulmagic wrote:ok i got it to show something that is if i mount something to the cd drive it boots but to a grey screen with no icon or anything just gray lines, do 7.5 still does not boot
What is this "7.5" thing you tried mounting as a CD, and where did you get it? Note that if it's not an actual bootable Mac CDROM that you made an ISO dump of, it's not going to boot when mounted as a CDROM.

If it's a hardfile that you didn't create yourself, heaven only knows if it's any good. I have a several bootable media and all boot fine.

OS 8.1 CD I dumped myself.
OS 8.1 hardfile I made myself, installing from the CD above.
OS 7.5.5 "Starterdisk" hardfile that was on a major Basilisk II fansite for years.
OS 7.5 Network Access disk Apple used to distribute.

Note that currently having a header on the front of CDs or floppies will make them unreadable.

Preview of upcoming build... I fixed the ENTER key - had the wrong Mac keycode. Implemented qualifiers: while the OSK is up, pressing the SELECT button toggles between several qualifiers (currently none, CMD, OPT, CTRL, and CMD+OPT). If a qualifier is active, it shows at the bottom middle of the display exactly like the CD/floppy menu (uses the same display code). Exiting the OSK clears the qualifier flag.

Because of this, pressing START to activate the OSK will take you out of the CD/floppy menu if you were in it when you pressed START. You'll see what I'm talking about when I post it later this evening.
siulmagic
Posts: 42
Joined: Sun Jul 06, 2008 1:50 pm

Post by siulmagic »

im sorry if i wasent clear my bad XD, well heres the version thas broken in test 6, 7.5.5 thas what it says in the (about this macintosh)

also what i ment when i said mount to the cdrom, is that the only way i get to dysplay something in test6 is if i mount something to the cdrom, but 7..5.5 does not boot. it does fine with test5
Last edited by siulmagic on Tue Jul 08, 2008 12:49 pm, edited 1 time in total.
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Oh, never mind, it worked. I set the Memory too high (14 MB), when I decreased it a little to 13 MB it worked fine. Hey I'm gonna post a video on YouTube. Should I do it? Give them the files? Maybe I'll post the link of the video for you to check it out. I'll have to edit the description to tell them to set the Memory to 13 MB, so they don't go "It doesn't work T.T". Nice work J.F. by the way.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

dennis96411 wrote:Oh, never mind, it worked. I set the Memory too high (14 MB), when I decreased it a little to 13 MB it worked fine. Hey I'm gonna post a video on YouTube. Should I do it? Give them the files? Maybe I'll post the link of the video for you to check it out. I'll have to edit the description to tell them to set the Memory to 13 MB, so they don't go "It doesn't work T.T". Nice work J.F. by the way.
I cant see why teaser videos wouldn't be ok :)

But builds.. No.. the one word i will say is "noobs"

Wally
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Wally4000 wrote:
dennis96411 wrote:Oh, never mind, it worked. I set the Memory too high (14 MB), when I decreased it a little to 13 MB it worked fine. Hey I'm gonna post a video on YouTube. Should I do it? Give them the files? Maybe I'll post the link of the video for you to check it out. I'll have to edit the description to tell them to set the Memory to 13 MB, so they don't go "It doesn't work T.T". Nice work J.F. by the way.
I cant see why teaser videos wouldn't be ok :)

But builds.. No.. the one word i will say is "noobs"

Wally
Yeah, the noobs need to wait until there's a nice doc and whatnot. This is for non-idiots at the moment. A video is fine though. I'll fine tune the memory after it's done. Too much going on right now to worry about that.
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Okay, uploading video now...
Man I love this app. It's great. I like DosBox too, because I like to emulate Windows. I just love OSes. Ha ha.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

http://au.youtube.com/watch?v=g0cv7srTDrI <-- My video on youtube.

Go J.F Go!
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Wally4000 wrote:http://au.youtube.com/watch?v=g0cv7srTDrI <-- My video on youtube.

Go J.F Go!
Hey can you send me all your hfv files? When I'm done uploading the video, it has my hdd.hfv. Please? Oh, and... J.F. YOU RULE!!!
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

dennis96411 wrote:
Wally4000 wrote:http://au.youtube.com/watch?v=g0cv7srTDrI <-- My video on youtube.

Go J.F Go!
Hey can you send me all your hfv files? When I'm done uploading the video, it has my hdd.hfv. Please? Oh, and... J.F. YOU RULE!!!
No.. 7.6.1 is not public domain :)

Wally

P.S J.F I'll write a manual up for ya when you fix that header issue :)
siulmagic
Posts: 42
Joined: Sun Jul 06, 2008 1:50 pm

Post by siulmagic »

great news iv run warcraft 2 in 7.5.5 test5
to me it seems at fully playable i whent to campaign the sound is ok
some sttuderig but thats due to me using test5 and running basiliskII at 222mhz it wil probly run faster at 333mhz i have to test it
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

dennis96411 wrote:Okay, the video is up: http://www.youtube.com/watch?v=mhr3JBHazPE
So I guess you dont have any mac games ;)

try some of these!

http://www.68kshrine.net

Or if you feel like it

http://www.68kshrine.net/68k

I need feedback!

Wally
siulmagic
Posts: 42
Joined: Sun Jul 06, 2008 1:50 pm

Post by siulmagic »

im having trouble installing quick time i found it XD
its verrsion 4.0.3
its gives me and error in the middle of the installation saying disck not found system folder no present

also netscape is giving me and error just quitting application and crashing

iv made shure the connection is made

when i use basiliskII offline it works ok it just gives me the no connection error
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

siulmagic wrote:im having trouble installing quick time i found it XD
its verrsion 4.0.3
its gives me and error in the middle of the installation saying disck not found system folder no present

also netscape is giving me and error just quitting application and crashing

iv made shure the connection is made

when i use basiliskII offline it works ok it just gives me the no connection error
Quicktime works fine here BTW..

Wally
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Still waits for Phrase Craze Plus to work J.F :D
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

QuickTime went hand in hand with certain system versions. You can't run any old QT on any old system. Someone should probably make a chart of what goes with what. :)

You all are lucky son's of bitches! I couldn't sleep (it's after 4am here), so I decided to work on B2 a bit more. Now most folks would screw up their program, working on it at 4am, but I not only have a bitchin' new update, but I solved one of the Holy Mysteries of the PSP!! That makes me TWO for TWO in just over a day! :D Forgive me if I seem a bit smug... I'm feeling Holier than Thou.

Anywho, I was adding TV support and working on my new refresh routines. I noticed that IRRITATING problem of making stretch blits seamless. They only seem to work at specific source and destination sizes. I made a hack for my TV version of SDL, but was not very happy. When I started running the Mac on the TV and at 4:3 on the LCD, I was even less happy. :( It seemed that either you got gaps in the blits, or you put up with non-seamless joints between the blits. That's when I went to bed about 1am. But I just couldn't sleep... and then I had an epiphany and had to rush back to the computer. What am I talking about? Look at the original coord calculations in the typical stretch blit:

Code: Select all

		vertices&#91;0&#93;.x = dstrect->x + slice * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
		vertices&#91;1&#93;.x = vertices&#91;0&#93;.x + PSP_SLICE_SIZE * dstrect->w / srcrect->w;
That doesn't work for many different src and dest sizes - it leaves gaps in the destination. I made this change, which fills in the gaps, but has a clear seam in some cases:

Code: Select all

		vertices&#91;0&#93;.x = dstrect->x + slice * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
		vertices&#91;1&#93;.x = vertices&#91;0&#93;.x + PSP_SLICE_SIZE * dstrect->w / srcrect->w + 1;
Something occurred to me, so I tried this:

Code: Select all

		vertices&#91;0&#93;.x = dstrect->x + slice * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
		vertices&#91;1&#93;.x = dstrect->x + &#40;slice+1&#41; * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
But isn't that the SAME THING as the first code??? Algebraically, yes, it is. But we aren't doing algebra! This is INTEGER ARITHMETIC!! They are NOT the same for many values of the src and dest width! Doing it that last way gives PERFECT and SEAMLESS stretch blits! I'll be making some changes to my SDL to correct that sometime this week.

Anywho, back to B2. Here's test 7. Major features!!! TV SUPPORT!!! YAY!!!! Even for interlaced/composite TVs. Add to that the improvement in the scaling and the graphics got a major boost here. I'm not done with the refresh yet - I still need to accelerate the four bit conversion if I can, and do the swapping on the 15 and 24 bit modes. At that point, the graphics will be complete.

Major feature! The OSK is better - I fixed ENTER and added qualifiers like I mentioned previously.

We're getting closer to the finish line here. Need to work on detecting headers on various files, and work on the extfs and networking.

MediaFire
binary
source

SendSpace
binary
source

Okay, I'm gonna go crash....
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

well the folders have checker marks on them, I can't remember that :P

However this is a great update, and a great achievement in such a small time :/

How you did it.. I don't know!

Wally
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Hey wally how do I install the games?
jas0nuk
Posts: 137
Joined: Thu Apr 27, 2006 8:00 am

Post by jas0nuk »

J.F.... you're on fire :D The fact that you're working on it at that time shows real dedication! xD

Nice discoveries. That stuff about the little endian is really odd. Updating to test7 now. :p
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

Hey, I found Mac OS 8.1 update, but it's in smi.bin format. How do I run it with the PSP Basilisk? I also found some software for Mac (iCab, iDraw...) but it's in .sit format. How do I open it? If we figure it out, we can use iCab to browse the internet! Whoo!!

Mac 8.1: http://download.info.apple.com/Apple_Su ... .1_Update/

Mac Softwares: http://wiki.oldos.org/Downloads/MacOSClassic
siulmagic
Posts: 42
Joined: Sun Jul 06, 2008 1:50 pm

Post by siulmagic »

nice release, but its seems 7.5.5 still wont boot back to test5
gaar i wana try this so bad XD
User avatar
dennis96411
Posts: 70
Joined: Sun Jul 06, 2008 4:59 am

Post by dennis96411 »

So can anyone get iCab to work? It'll be kinda cool to browse the internet with Mac. We've already got the internet working, so iCab should work.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

J.F. wrote:It seemed that either you got gaps in the blits, or you put up with non-seamless joints between the blits.
Nice. I was getting seams in a few occasionally used modes and this fixes it.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

crazyc wrote:
J.F. wrote:It seemed that either you got gaps in the blits, or you put up with non-seamless joints between the blits.
Nice. I was getting seams in a few occasionally used modes and this fixes it.
Yeah, this should help a LOT of folks. Anyone using the old example sliced blit code should change the coord calculations.

For folks who want some stuff to play with in B2, here's a CD of shareware, free, and demo stuff I put together YEARS back.

part 1
part 2
part 3
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Well looky what we got here, boys! Looks like test 8. This version should take care of headers on nearly everything. Also now includes proper refresh of thousands and millions mode. Millions is a wee bit slow, but that's a lot of data for an emu like this to be pushing around. Stick to 256 color mode most of the time. Thousands isn't bad, but because of the two-pass blit I do to convert from Mac to PSP format, the green will be slightly off if you're using gamma correction. Turn gamma correction off for perfect color.

MediaFire
binary
source

SendSpace
binary
source
Post Reply