Basilisk II PSP Port (Mac Emulator)
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
SendSpace
binary
source
MediaFire
binary
source
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:
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.
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 (j=0; j<576; j++)
for (i=0; i<768/8; i++)
{
uint32 v = srp[j*768/8 + i];
uint32 vv1 = (v>>4)&0x0F0F0F0F | (v<<4)&0xF0F0F0F0;
dp[j*768/8 + i] = vv1;
}
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.
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
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.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
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.
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
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.
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
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 :)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.
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.Wally4000 wrote:I cant see why teaser videos wouldn't be ok :)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.
But builds.. No.. the one word i will say is "noobs"
Wally
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
Okay, the video is up: http://www.youtube.com/watch?v=mhr3JBHazPE
So I guess you dont have any mac games ;)dennis96411 wrote:Okay, the video is up: http://www.youtube.com/watch?v=mhr3JBHazPE
try some of these!
http://www.68kshrine.net
Or if you feel like it
http://www.68kshrine.net/68k
I need feedback!
Wally
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
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..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
Wally
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:
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:
Something occurred to me, so I tried this:
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....
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[0].x = dstrect->x + slice * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
vertices[1].x = vertices[0].x + PSP_SLICE_SIZE * dstrect->w / srcrect->w;
Code: Select all
vertices[0].x = dstrect->x + slice * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
vertices[1].x = vertices[0].x + PSP_SLICE_SIZE * dstrect->w / srcrect->w + 1;
Code: Select all
vertices[0].x = dstrect->x + slice * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
vertices[1].x = dstrect->x + (slice+1) * PSP_SLICE_SIZE * dstrect->w / srcrect->w;
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....
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
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
Mac 8.1: http://download.info.apple.com/Apple_Su ... .1_Update/
Mac Softwares: http://wiki.oldos.org/Downloads/MacOSClassic
- dennis96411
- Posts: 70
- Joined: Sun Jul 06, 2008 4:59 am
Yeah, this should help a LOT of folks. Anyone using the old example sliced blit code should change the coord calculations.crazyc wrote:Nice. I was getting seams in a few occasionally used modes and this fixes it.J.F. wrote:It seemed that either you got gaps in the blits, or you put up with non-seamless joints between the blits.
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
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
MediaFire
binary
source
SendSpace
binary
source