Page 1 of 1

Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 12:42 am
by insane
After a year of beta testing here it is:
Worms for your CT60 Falcon.
You'll need the original Data files to run this.
Video: https://www.youtube.com/watch?v=e740hR3TG4M
www: http://insane.tscc.de

And before somebody asks - CT60 only because it's a port of the Macintosh version -
which is identical to the DOS version, which in turn is IMHO superior to the Amiga version.
And the Macintosh version runs too slow on a 040 - so CT60 it is!

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 8:50 am
by lotek_style

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 3:28 pm
by jury
Plays beautifuly! THANKS.
And I found OpenJazz on your site. I didnt know of this port so I must try it.

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 3:46 pm
by TheNameOfTheGame
Thanks and Merry Christmas!!

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 7:08 pm
by rian_ata
Best Atari Christmas gift 2016! Thanks so much guys _0_

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 7:46 pm
by Cyprian
cool.
What about Aranym port?

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 9:00 pm
by marss
Excellent Xmas gift.
Where to find the files, please?
Thanks

Re: Worms Engine for the CT60 RELEASED

Posted: Sun Dec 25, 2016 11:18 pm
by Strider
Nice Christmas gift, thanks a lot!

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 10:31 am
by lotek_style
btw the mac version where it was ported from can be found here:

http://www.myabandonware.com/download/481-worms

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 11:39 am
by marss
thanks. and the mods from the Jaguar must be put into the DATA directory also?

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 12:46 pm
by insane
@marss: no, you only need the data directory from the dos or mac version of worms or worms united.
The music is already included.

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 1:06 pm
by CiH
Thanks for doing this Insane.

What's next up, another look at the Descent port, or something else?

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 1:12 pm
by fidzen
Brilliant work!
This is the best christmas gift of all.

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 1:16 pm
by insane
@CiH: I'm looking at Adlib emulation on DSP right now. This should allow music in doom, hexen, tyrian and some other ports

Re: Worms Engine for the CT60 RELEASED

Posted: Mon Dec 26, 2016 3:03 pm
by marss
Thanks. Dos version downloaded

Re: Worms Engine for the CT60 RELEASED

Posted: Tue Dec 27, 2016 7:31 am
by jury
insane wrote:@CiH: I'm looking at Adlib emulation on DSP right now. This should allow music in doom, hexen, tyrian and some other ports


Yeah! :)

Re: Worms Engine for the CT60 RELEASED

Posted: Tue Dec 27, 2016 9:35 pm
by Eero Tamminen
Works with Hatari Falcon emulation both with EmuTOS and TOS v4.04, but is slow. I could later try profiling this a bit.

Does NOT work unless:
  • 030 or 040 CPU is used instead of 060 CPU emulation
  • DSP is disabled. If DSP is enabled, there's sound in the intro, but game itself freezes at startup to some DSP interaction

Would it be possible to:
  • Have option for sound effects without DSP (I don't care about music)?
  • Provide a non-stripped version of the worms.tos so that profiling results are more meaningful and I can get callgraphs?

(I have the SoldOut DOS version of Worms United. I played it quite a bit with a friend in 90's, as I did before that the Worms DOS demo. It's still my favorite version of Worms, I don't really appreciate the 3D look in later versions. Didn't try yet whether the game would work with Worms demo version.)

Re: Worms Engine for the CT60 RELEASED

Posted: Wed Dec 28, 2016 2:09 pm
by insane
@Eero: The non-stripped version has nearly no routine-names either, only names such as sub_40122 etc, as it is still only a patched disassembly of the very unoptimized C compiled MAC Worms code.
The DSP code used in the game is a DMA-Fifo i.e. the 060 calculates the MOD (using MULs - urgh) and transfers the soundframe to the ST-Ram and then instructs the DMA to do a one-shot play. The code in the DSP then makes sure that the samples are played in the correct speed.
This allows me to forget about Timer-A and place the replay in the VBL.
I've originally planned to use my new DSP-based mixer which also uses DMA for sample transfer - this cuts the needed CPU for audio to next to nothing.
But I didn't manage to finish it in time for the Christmas release.
The DSP interaction is asking the DSP how many samples were played since the last frame.
If one wants to create a 030 version I'd suggest disassembling the Jaguar version and rewriting the RISC GPU+DSP code into 030/56k.
I'll see what i can do for the non-sound version but I haven't planned on optimizing the 1.2MB(!) disassembled source as it runs one-framed on 060

Re: Worms Engine for the CT60 RELEASED

Posted: Wed Dec 28, 2016 8:45 pm
by Eero Tamminen
For symbol names it's enough that they're unique, they don't need to be descriptive. What would be more important is that all subroutines do have a label (costs assigned to a label are for all the addresses from that address to a next address that has a label assigned to it).

As I already stated, the code *is* 030 code, it does not work on 060 (emulation). It has instructions that are missing on 060...

When 030 CPU core is selected:

Code: Select all

> disasm 0x3a2a0
$0003a2a0 : 3029 0014                          move.w    $14(a1),d0
$0003a2a4 : 47f0 0400                          lea       (a0,d0.w*4),a3
$0003a2a8 : 2013                               move.l    (a3),d0
$0003a2aa : 4c3a 0405 1018                     mulu.l    $3b2c6(pc),d0,d5
$0003a2b0 : 2845                               movea.l   d5,a4


When 060 CPU core is selected:

Code: Select all

68060 unimplemented opcode 4C3A, PC=0003a2aa
...
> disasm 0x3a2a0
$0003a2a0 : 3029 0014                          move.w    $14(a1),d0
$0003a2a4 : 47f0                               DC.W      $47f0
$0003a2a6 : 0400 2013                          subi.b    #$13,d0
$0003a2aa : 4c3a                               DC.W      $4c3a
$0003a2ac : 0405 1018                          subi.b    #$18,d5
$0003a2b0 : 2845                               movea.l   d5,a4


-> This is one of the MULU variants that was dropped on 060. If it works on CT60, I guess it's through opcode exception and emulation?

(Could also explain the DSP problem, maybe that exception handling makes CPU side slow enough that DSP wait doesn't miss?)

Re: Worms Engine for the CT60 RELEASED

Posted: Wed Dec 28, 2016 8:58 pm
by insane
Never stated that it isn't 030 code :D
I think the compiler target was 020-040 back then.
My code for the audio mixer uses muls as they are fast enough - that's what i meant with 060 only as the vbl will take too much time on 030@16mhz and the game crashes.
If I disable the audio mixer or use my experimental dsp mixer it starts to work in hatari - the dsp mixer will be included in a v1.1 release.
And with 030 variant i meant a code fast enough to run in falcon030 16mhz mode - one could try optimizing the 1.2MB disassembly to dead but i've got other projects to finish
EDIT: and yes, the CT60 has an exception handler and emulates the missing opcodes.
So "proper" 060 emulation needs to be improper in that all opcodes are available - or one must install the ct60 emulation stuff into hatari somehow (extracting the patched TOS?) - as it is the official motorola compatibility pack for 060 (ilsp or sth like that) maybe someone could create an TSR out of that?

Re: Worms Engine for the CT60 RELEASED

Posted: Wed Dec 28, 2016 11:07 pm
by Beetle
Hats off and a big "Thank You" for the CodeMeister insane [smilie=greencolorz4_pdt_12.gif]
I played it for hours already!

Re: Worms Engine for the CT60 RELEASED

Posted: Thu Dec 29, 2016 8:47 am
by joska
insane wrote:And before somebody asks - CT60 only because it's a port of the Macintosh version -
which is identical to the DOS version, which in turn is IMHO superior to the Amiga version.
And the Macintosh version runs too slow on a 040 - so CT60 it is!


Just tested this on my Falcon/Afterburner (VGA monitor). With caches in copyback mode the game is highly playable. I have never played Worms so I don't know how fast it's supposed to be, but the graphics runs smoothly. Moving around the playfield with the mouse is smooth and fluent, no jerky scrolling. When I compare it to the youtube-video I can see no difference in the in-game graphics, but some of the overlayed menus are a bit slower than on the CT. The mouse cursor is also lagging slightly in the menus.

I don't have speakers/headset connected to this Falcon right now so I can't test sound. Will do that later.

Edit: Couldn't wait, so I hooked up a small radio I had in my office. Sound appears to be working correctly.

Edit2: The game is also working under MiNT if memory protection is disabled.

Now I just have to figure out what this game is about :)