English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   project.Amiga Game Factory (https://eab.abime.net/forumdisplay.php?f=69)
-   -   Turrican 2 MS-DOS AGA conversion (https://eab.abime.net/showthread.php?t=106735)

jotd 06 May 2021 08:57

Well, simplest thing: if you have one programming error like game writing slightly out of allocated memory block, then you corrupt the system when returning to the OS.

with whdload it can't really happen because even games using the OS are virtualized through kickstart emulation, and some of your productions (Tiny Bobble, Tiny Galaga & Invaders and soon WrongWayDriver so I can play it :)) make a minimal use of the OS so I can trivially patch the calls.

Plus whdload protects memory blocks so nothing can be read or written outside them (exception: blitter going crazy and killing chipmem out of bounds, but that's rare). whdload also has a SNOOP option (with MMU) which checks that custom registers aren't accessed the wrong way (read of write-only register, not waiting for blitter to finish before starting new blit, invalid bits in bplcon...)

Disabling the caches on startup just because someone has a problem is pretty counter-productive. You know how to get/set the VBR and MMU TC so disabling CACR is also easy. Read, write zero, write old value on exit (some 1993-94 ECS 68020-aware games already do that). once again whdload has a NOCACHE option that does exactly that :)

pink^abyss 06 May 2021 09:32

Quote:

Originally Posted by jotd (Post 1481679)
Well, simplest thing: if you have one programming error like game writing slightly out of allocated memory block, then you corrupt the system when returning to the OS.

with whdload it can't really happen because even games using the OS are virtualized through kickstart emulation, and some of your productions (Tiny Bobble, Tiny Galaga & Invaders and soon WrongWayDriver so I can play it :)) make a minimal use of the OS so I can trivially patch the calls.

Plus whdload protects memory blocks so nothing can be read or written outside them (exception: blitter going crazy and killing chipmem out of bounds, but that's rare). whdload also has a SNOOP option (with MMU) which checks that custom registers aren't accessed the wrong way (read of write-only register, not waiting for blitter to finish before starting new blit, invalid bits in bplcon...)

Disabling the caches on startup just because someone has a problem is pretty counter-productive. You know how to get/set the VBR and MMU TC so disabling CACR is also easy. Read, write zero, write old value on exit (some 1993-94 ECS 68020-aware games already do that). once again whdload has a NOCACHE option that does exactly that :)


Thanks for the information.
I'm aware of these possible issues but wondered if all of my games maybe trigger the same issue because of an oversight (because i re-use my startup/exit code)..

Muzza 06 May 2021 10:33

Quote:

Originally Posted by jotd (Post 1481674)
Muzza this is a lot cause. Even TinyAbyss games (which have a very good startup/end wrapper) end up crashing on some configurations

There are so many differences that can exist (DTack, MMU zero page move, caches, graphical boards, network cards...)

Don't change anything, leave whdload do the work (once I adapted your first version, that is). I never play non-whdload games anyway :)


I know its hopeless to support every setup, but if there are common issues with say, 060's, then I would like to address them.
The first demo I put out uses DOS for file loading, but I've since moved to using a bootblock/trackdisk approach. Using DOS was appealing as the program ran from Workbench or floppy, but there was one problem I could not resolve. Turrican plays music during the loading phases. TFMX wants level 4 and 6 interrupts, plus audio DMA of course. So far I've been unable to find any combination of re-enabling the OS that both allowed both DOS loading to work and didn't disable or trash the interrupts needed for music.
It does make life easier ignoring the OS, but it makes me unhappy. :(

jotd 06 May 2021 10:53

don't worry, a lot of "os compliant" games just ignore the OS when they run.

hooverphonique 06 May 2021 11:02

Quote:

Originally Posted by Muzza (Post 1481697)
TFMX wants level 4 and 6 interrupts, plus audio DMA of course. So far I've been unable to find any combination of re-enabling the OS that both allowed both DOS loading to work and didn't disable or trash the interrupts needed for music.

Did you use the OS when adding your ISRs, or did you modify the vectors directly?


https://wiki.amigaos.net/wiki/Exec_Interrupts

pink^abyss 06 May 2021 11:45

Quote:

Originally Posted by Muzza (Post 1481697)
I know its hopeless to support every setup, but if there are common issues with say, 060's, then I would like to address them.
The first demo I put out uses DOS for file loading, but I've since moved to using a bootblock/trackdisk approach. Using DOS was appealing as the program ran from Workbench or floppy, but there was one problem I could not resolve. Turrican plays music during the loading phases. TFMX wants level 4 and 6 interrupts, plus audio DMA of course. So far I've been unable to find any combination of re-enabling the OS that both allowed both DOS loading to work and didn't disable or trash the interrupts needed for music.
It does make life easier ignoring the OS, but it makes me unhappy. :(


A solution would be to ditch any loading at all and unpack from RAM (when you target A1200+4MB Fast). The MSDOS version was around 2MB packed.
Tho it would be a nice challenge to fit the whole game into 2MB chip. May work when shrinkling the data and not using bitplanes for packing the data.. :)

Muzza 06 May 2021 11:55

Quote:

Originally Posted by hooverphonique (Post 1481710)
Did you use the OS when adding your ISRs, or did you modify the vectors directly?


No, I'm mixing system takeover with OS use, which know is a no-no and the source of my problems.

The newer version is system-takeover only. I would, in an ideal world, like to support both, but being practical it is not something I should aim for in the near future.

Muzza 06 May 2021 11:58

Quote:

Originally Posted by pink^abyss (Post 1481720)
A solution would be to ditch any loading at all and unpack from RAM (when you target A1200+4MB Fast). The MSDOS version was around 2MB packed.
Tho it would be a nice challenge to fit the whole game into 2MB chip. May work when shrinkling the data and not using bitplanes for packing the data.. :)


That's certainly a possibility.

pink^abyss 06 May 2021 12:26

Quote:

Originally Posted by Muzza (Post 1481726)
That's certainly a possibility.


I did so with TinyBobble and Tinyus which ran on 512chip+512kb. It didn't use shrinkler because its too slow on A500 but i used Doynax/Doynamite. Very fast and good lz compression. You find it here:
https://github.com/AxisOxy/Planet-Ro...s/doynamite68k

One space saving trick i used in 'Coda':
To get much better pack ratio with bitplane gfx you can pack the gfx as 8bit chunky and then do a chunk2planar after decrunching. It often gave me upto 30% better pack ratio. Longer TFMX samples could be packed to 4bit ADPCM if you really need it (they won't pack that good). I would not touch the small, quick looping ones.

BigD 06 May 2021 14:47

Quote:

Originally Posted by Muzza (Post 1481648)
Thanks. Do you get problems with many other games on this system, or just this one?


I set up a WinUAE config to 060, with a Cyberstorm Mk1 expansion ROM. The game ran on it, although the music occasionally sounded off for some reason.
If anyone knows of any common gotchas with 060s, or expansions like this one for system takeover games, I'd appreciate any ideas.

Like other I mainly use WHDLoad these day but an interesting exception there is Batman The Movie works on the 060 but not the 030 weird!

Tiny Bubble works from floppy on both machine. Also, I've got The Ministry Zool AGA crack to work on the 060 but not the 030. Only the first level works with graphics glitches but the 030 just keeps asking for disk 1 when it's time to ask for disk 2! Funny incompatibilities between the Motorola CPUs me thinks?

For heavy hitting things like TFX I switch to Workbench 3.1 with Oxypatcher rather than OS3.9 BB2 but this is loading from floppy so the Workbench/AmigaOS version on the hard drive shouldn't matter!

ross 06 May 2021 15:20

Quote:

Originally Posted by pink^abyss (Post 1481732)
Longer TFMX samples could be packed to 4bit ADPCM if you really need it (they won't pack that good). I would not touch the small, quick looping ones.

If you use the Intel ADPCM reference encoder you would better if you add this step (because it was born mainly for 16-bit samples..):
Code:

                /* Step 0 - get 8 bit signed PCM and convert to 16 bit signed */
        val = (*inp++);
        val += (val==-128) ? -32768+128 : val*256;

I simply applied the same principle used for 4 bit to 8 bit color component 'expansion': a better mapping for the values in the 16 bit spectrum.

In extreme cases of memory shortage I even applied a compression for the sample bringing 8 bits to 1 (but the result, even if intelligible, is not really the best :D)

StingRay 06 May 2021 17:10

Quote:

but an interesting exception there is Batman The Movie works on the 060 but not the 030 weird!

What happens on 030? I didn't have any 030 machine at my disposal when I updated the patch some years ago. Also, it is better to report such problems in the Mantis bugtracker as chances are much higher that they will be noticed then.

BigD 06 May 2021 19:52

Quote:

Originally Posted by StingRay (Post 1481809)
What happens on 030? I didn't have any 030 machine at my disposal when I updated the patch some years ago. Also, it is better to report such problems in the Mantis bugtracker as chances are much higher that they will be noticed then.

The WHDLoad version doesn't even get to the intro screen after the WHDLoad window pops up it just does black screen I think on my 030.

StingRay 06 May 2021 20:01

Quote:

Originally Posted by BigD (Post 1481842)
The WHDLoad version doesn't even get to the intro screen after the WHDLoad window pops up it just does black screen I think on my 030.

That sounds like your 030 Amiga may run a TCP/IP stack or something similar. It needs to be disabled when running WHDLoad patches. Please check and if that is not the reason for the black screen, send me a PM and I'll have a look.

//end of off-topic and sorry to Muzza. :)

Pyromania 06 May 2021 22:58

@Muzza

Nice job, thanx.

Apollon 06 May 2021 23:01

i have been dreaming of an aga conversion of the ms dos vga version since the 90s. thanks for that! but please don't bug the developer with an amiga cd/cd32 version with cd audio... let him first finish the project as he sees fit! Of course an optional CD audio track would be cool, you can take a cue from the soon to be released Turrican Anthology, but like i said, let him finish the project first. The Turrican Anthology should be out sometime this year for the current consoles.

jotd 06 May 2021 23:38

I just had a quick go, the colors are great, the features are there. Excellent work

(please change the main character sprite to the amiga version :))

Apollon 07 May 2021 22:17

Quote:

Originally Posted by jotd (Post 1481931)

(please change the main character sprite to the amiga version :))

NO!:nuts ;)

TjLaZer 09 May 2021 00:53

Tested on two A4000's in PAL mode. One has GVP 4060 and the other A3660. Doesn't run, locks up at grey screen.

katarakt 15 May 2021 22:28

Quote:

Originally Posted by Muzza (Post 1479342)
I've tested on my real A1200 with Blizzard 1220/4


Oh, if you can solder, i still have some ADD4MB kits for sale i think...just send me a PM if intrested.



Btw. great work with Turrican AGA, are you the same person working on the Mega65 version :)


All times are GMT +2. The time now is 14:14.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.06761 seconds with 11 queries