h5n1xp / Omega

Bare metal Amiga Emulator
Mozilla Public License 2.0
69 stars 7 forks source link

Blitter Emulation does not work for ROMs 2 and 3 (seems to work ok for ROM 1) #20

Closed h5n1xp closed 5 years ago

dirkwhoffmann commented 5 years ago

Sorry that I post this here, because it’s not related to your Blitter bug. Nevertheless it’s related to the Blitter itself. My emulator proudly performed it’s first blit.

Blitter: Microcode loaded
Blitter: Executing micro instruction 0 (0)
Blitter: Executing micro instruction 1 (0)
Blitter: Executing micro instruction 2 (0)
Blitter: Executing micro instruction 3 (400)
Blitter: BLTDONE
EventHandler: cancel(4)

It happens here:

screenshot 2019-03-06 at 16 42 32

In FCADC2, $41 is written into BLTSIZE which starts a blit a couple of cycles later when the Blitter DMA is enabled. The blit uses astonishing large size parameters (width = height = 1 😲). Because BLTCON0 is zero at that time, this is the most meaningless blit operation I can imagine (A,B,C,D are all switched off 😟). Hence, I am wondering if my emulator starts the blit with the right parameters.

Does your emulator perform the same blit operation when booting Kick 1.2? It’s the first blit operation after boot. Do you know by chance what the meaning of this blit operation could be (internal pipeline initialisation ???).

Before celebration this epic moment with my emulator (first blit 🥳), I want to make sure that it is the correct blit operation.

h5n1xp commented 5 years ago

Congratulation on getting it blitting... regardless of how sucessful.

Attached are the first 917 Blitter operations that Kick1.2 will do upon boot BlitterOutput.txt.zip

The numbers in brackets are the bltmod values. Let me know if I can help anymore.

mithrendal commented 5 years ago

The same first A=B=C=D=null and w=h=1 blit operation. Why was Commodore Softwareteam doing this? @h5n1xp what is the first blit in the 2.x/3.x ROMS ? Is this maybe the same first blit there too ?

h5n1xp commented 5 years ago

I’m wondering if that was an early way to set up the blitter pipeline state...

dirkwhoffmann commented 5 years ago

Thanks a lot for the list!!! This is very very helpful for me.

I think the first blit is really for initialising the Blitter. The Blitter contains several internal pipeline registers that get "flushed through" when the Blitter is activated this way (if activated with the minimal config, it performs four (idle) cycles."

h5n1xp commented 5 years ago

The same first A=B=C=D=null and w=h=1 blit operation. Why was Commodore Softwareteam doing this? @h5n1xp what is the first blit in the 2.x/3.x ROMS ? Is this maybe the same first blit there too ?

If you go into Blitter.c, there are some printf()s commented out... uncomment them and it will give you this debugging info 😄 I really should make a nice GUI like Dirk has... but I’m feeling a bit worn out by this project at the moment (also I have paid work to be doing)...

dirkwhoffmann commented 5 years ago

"but I’m feeling a bit worn out by this project"

Don't worry. Emulators are a complicated piece of software with the tendency to suck lots of energy out of developers. Just let the project aside for a couple of days and you will find yourself being "recharged" pretty soon.

h5n1xp commented 5 years ago

Well, since both OS2 and OS3 ROMs seems to bootstrap (despite the kickstart screen corruption), I've started work implementing IDE drive support. taking a break from floppy drive and graphics issues.

h5n1xp commented 5 years ago

According the Toni, the Blitter isn’t used by OS2+ trackdisk.device... so maybe the Blitter isn’t at fault 🤷🏻‍♂️

h5n1xp commented 5 years ago

Blitter not at fault, my Floppy Drive emulation was not correctly remembering CIA state.