What is Play! ?
Play! is a PlayStation2 emulator for Windows, macOS, UNIX, Android, iOS & web browser platforms. For more information about this project please visit the "About" section of this site.

Compatibility Status
Fetching compatibility status...

Development Log

Make "1987.elf" work.
Posted on 2005-09-11 00:00:00
Made the FPU code a bit cleaner by putting some functions into the instruction factory base class.

I also checked why the 1987 logo wasn't showing, and it was because the OpenGL GS handler was interpreting the (only) texture upload as being something that's going to be put in the frame buffer. That was because the FRAME1 register wasn't initialized before the texture upload. Made the registers reset to zero when the GS handler is instancied. But this should be done each time you reset the machine, but that's something the virtual machine doesn't know about yet. This direct frame buffer write is a tricky thing to do with OpenGL... Only the "Final Heaven" demo uses this for now, so I dunno how more complicated this could become. But fixing this problem didn't break this particular demo.

Here's what it gives with the logo on the screen. I have no clue if the logo should be showing during the star field part. I don't really have any references for that, except nSX2 that seems to run this demo pretty badly.


Screenshot #000018
Screenshot #000019


Next things up to do is to be able to filter the log and to implement the missing opcodes that appear later in the demo (SDL, SDR, LDL, LDR I think).

Make "1987.elf" work.
Posted on 2005-09-10 00:00:00
Nothing special today. Added opcodes ADD.S, SUB.S, MUL.S, DIV.S, CVT.W.S, LWC1, SWC1, MFC1.

Some stuff were bugging me though while adding those.

MFC1 sign extends the value stored to the GPR to the lenght of the register... Yet, the lenght of the GPRs are known by main CPU module only. I'd probably need to move that concept into the base instruction factory class.

For LWC1 and SWC1, I don't think there would be a need to rewrite the function for calculating the memory access address in the COP1 module like I did right now... Maybe I should put this in the base class too.

For CVT.W.S, the rounding mode has to be known to make this instruction work correctly. But this demo doesn't change the rounding mode at all (this is controlled by the FCSR). We'll just assume that it doesn't really care about it for now, but that will need to be taken in consideration later.

I also added the line primitive and the demo starts to show some stuff.


Screenshot #000016


Those lines are supposed to make up the 1987 logo at the beginning of this demo. It's kinda hard to explain how it's supposed to work and there's a bug with the logo actually not showing to make things worse...


Screenshot #000017


This is the star field that appears later on and I think there's some text supposed to appear, but it doesn't work either apparently.

Between those 2 screens, there's another effect that's supposed to show, but due to missing opcodes in the CPU core, all we see it a black screen.

I'll be working on that after I clear up the points that's been bugging me. And I'd also need to implement the logging filter thing too because it's slowing down the thing a lot in debug mode.

Make "1987.elf" work.
Posted on 2005-09-09 00:00:00
Terminated the changes to the FPU register viewer window. I shouldn't need to touch this again for a while.

I chose to hardcode the 32x 64-bits register mode into the FPU implementation for now... But I know this is controlled by a flag in the COP0, and I don't know if it's set to 1 or 0 yet. But this should be visible in the code when a program will be using double precision registers... Only the even numbered FPU registers will be used for double precision operations if the FPU is set to operate in 16x 64-bits register mode.

But this demo only uses single precision operations, so there's no way to tell for now.

It too me a bit to get back into the x86 FPU bath, but I was able to implement the MTC1 and CVT.S.W opcodes. I should be able to complete the remaining FPU opcodes for this function tomorrow.


Make "1987.elf" work.
Posted on 2005-09-08 00:00:00
To make the display of FPU registers in the registers window, I had an idea that consisted of adding a little tab strip in the bottom of the registers window that would change the current set of registers to view.

Well, converting that old tabs class I made for a previous project to the newest framework was a bit annoying and took some time, but it seems to work good now.

I didn't do much after fixing the class... I tweaked a bit the register view window class to support multiple pages and added the FPU page in, which doesn't contain the right information yet because I haven't added the FPU registers in the MIPS context.

Here's a little screen shot showing the recent changes in the debugger window.


Screenshot #000015

Make "1987.elf" work.
Posted on 2005-09-07 00:00:00
There's a non-standard COP0 opcode that those demos seem to use... I checked in the nSX2 disassembler and it seems that this instruction is called EI, probably standing for "Enable Interrupts". I added this instruction in the matrix for now, but it's doing nothing since I don't know what it's doing exactly and because there's no interrupts involved right now. This instruction is probably a shortcut to set the "interrupts enabled" bit in the COP0 STATUS register.

I wonder if there's a lot of those non standard extensions... There was this thing with the MULT/MULTU instructions that allowed the result to be stored directly in a register and now it's this instruction. I'll need to find some documentation about those.

Also implemented instruction SLTI in the basic R5xxx core.

The basic framework for COP0/COP1 is completed. Added some disassembly for the FPU instructions used in this demo. I'll need to add the FPU registers to the registers window, then I'll be able to implement the actual instructions.

I let the demo run a bit even though some instructions are missing and it's sending some stuff to the GS, but they are line primitives, which aren't supported yet. So, no screen shots for now.

Make "1987.elf" work.
Posted on 2005-09-06 00:00:00
Completed the function editor to a usable state for now. It allows you to view a list of currently configured functions, import the list from the ELF symbols table, add and delete functions from the list.

Also changed the disassembly a bit to display the function names and the jump targets for easier comprehension of the program.

Added opcodes J and DSRA32 in the basic R5xxx core.

Fixed a stupid problem with the calculation of the stack pointer address upon the call of the RFU060 system call. I was dumb enough to only copy the provided stack address as the real stack pointer when it should actually be the provided address plus the stack size, since it grows backwards... That caused a problem in the __do_global_ctors function of this demo. The method of loading the executable into memory has also been changed to something more appropriate because I thought that it was probably caused by a problem with this method.

Work on implementing the basic COP0/COP1 functionality has started.


Make "1987.elf" work.
Posted on 2005-09-05 00:00:00
Didn't do much today. Fixed three bugs: The one related to the deadlock with the Log/VM/UI threads, a crash that was occuring when closing the program if the VM was running and another one caused by the deinitialization of the OpenGL context being misplaced in the destroy sequence.

Work on the function editor is continuing.

Make "1987.elf" work.
Posted on 2005-09-04 00:00:00
This time I'll be working on a demo that's based on a different framework as the 3 demos I've been working on before.

Unfortunately, I don't have any screen shots to show you for now as it doesn't run at all on Purei. It also seems to work a bit wierd on nSX2. But from the looks of it, it seems to be an old school type of demo.

Looking at the disassembly real fast, I could see that it's using some FPU stuff, which should be interesting to implement.

But first, I gotta make some adjustments to the debugger and user interface. I've been working on better function defineing in the debugger for easier navigation in the disassembly.

I also found some deadlock problem with the Log/VM/UI threads which I'm currently working on fixing.

Hopefully, I'll have some preliminary screen shots to show tomorrow.

Tasks:
- Add better function navigation in the debugger.
- Save function names in a file and load this file when the emulator is loaded.
- Add a function editor window. This window will let you add functions, jump to functions and import function names from the ELF symbol table.
- Display jump targets names in the disassembly.
- Implement basic COP0 support.
- Implement basic COP1 (FPU) support.


Make "demo2d.elf" work.
Posted on 2005-09-03 00:00:00
After a bit of reading, I figured out some stuff about the alpha blending process of the GS. First, this demo was using an alpha value of 0x80 (128) for the visible pixels in its textures, which seemed a bit odd to me.

Then I checked the GS alpha blending formulae again and everything started to make sense. Here's the way this demo setups the formulae:

D = D + (S - D) * (As >> 7)

D stands for the destination color, S for the source color and As the alpha value of the source. The (As >> 7) part can be rewritten as (As / 128). So, if we take a pixel that has an alpha value of 128, then the above formulae can be simplified like this:

D = S

This represents a normal pixel copy, which means that the alpha value for an opaque pixel is 0x80 when alpha blending is enabled and set up this way. So all the text in this demo is supposed to look opaque. I don't know why GStaris isn't doing it right... Maybe it was fixed in a more recent version... Anyways, that's not important.

So knowing this, I changed the GS handler so it enables alpha blending on sprite primitives that need it and so that it sets up the OpenGL blending function correctly in this demo's case. Also made OpenGL multiply all the alpha values by 2 when it uploads the textures to obtain the right results on screen. Here's what it gives:


Screenshot #000013 Screenshot #000014


This is all for this demo. And there isn't more in this series anymore, so the next one will probably be more interesting.

Make "demo2d.elf" work.
Posted on 2005-09-02 00:00:00
Added the line strip primitive in the OpenGL GS renderer. The border around the blue boxes are displaying now.

Removed the old "Subject/Observer" stuff from the program and replaced it with an "Events/Delegates" system. This is used to inform the user interface that the PS2 virtual machine has been paused/resume or that the internal state of the machine has changed.

Added a frame tick event to allow UI stuff to count frames for displaying a counter. Here's the result of today's work:


Screenshot #000012


Well, that's all for today. Happy birthday to me!

<< Older Log Entries Newer Log Entries >>