New ST project - Pole Position arcade conversion

All about ST/STE games

Moderators: simonsunnyboy, Mug UK, Doctor Bob Gordon, ICS, Moderator Team

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Fri Aug 29, 2014 9:05 pm

Marakatti wrote:Great improvement! Any chance for a new demo to try out?


Sure ... here you go. 1 Meg only for now ... it does some very odd things on a 520ST. I think you mentioned that you have access to a real ST so let me know if it works for you.

(AtariZoll - Any observations you have on the odd way it runs on a 520 would be welcome as I'm a bit stumped - I think there should be enough memory to fit it all in!)
You do not have the required permissions to view the files attached to this post.

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2047
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: New ST project - Pole Position arcade conversion

Postby calimero » Sat Aug 30, 2014 12:32 am

I just played arcade version and visually there are really close. Speed is also great, I only notice little bit slowdown on ST when there are many or big sprites!
otherwise it is almost perfect clone of original! :) :)
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Sat Aug 30, 2014 9:01 am

chicane wrote:
Marakatti wrote:Great improvement! Any chance for a new demo to try out?


Sure ... here you go. 1 Meg only for now ... it does some very odd things on a 520ST. I think you mentioned that you have access to a real ST so let me know if it works for you.

(AtariZoll - Any observations you have on the odd way it runs on a 520 would be welcome as I'm a bit stumped - I think there should be enough memory to fit it all in!)


Looks and work fine - with 1MB or more RAM :D

Now the errors: I ran it through Steem Debugger , what you really should try, because I observed first error after 10 seconds - alternate screen is set to $80000 - what is above 512K RAM space, so normal that looks horrible on 512 ST :D
Second error is that SP is set too high, and you have pretty big unused RAM area, while RAM is tight on target 512KB machines.

SP should be set aprox. 1KB above last RAM address you use with game. And that last RAM address should be same as section bss end address (visible in TOS header) . Currently, if using TOS 1.04 UK, it is $AA56 (code start) + $17718 ( code len) + $3D840 (data len) + $18B8 ( bss len) = $61266 . Alernately, you can set SP to top of RAM, as after screen there is 768 bytes unused space. But that will fail on Falcon for instance, so not recommended.
After correcting SP you will have plenty of space for alt screen on 512K machines .

The solution: I already wrote here that you should set alt screen to address : regular screen base - $8000 , and not as fixed one. This will not only make it work well on 512K RAM, but will make it to work from hard disk. Because then whole executable may go higher in RAM, since there is plenty of space until 1MB (what is minimum for hard disk work).
Then in case of 1MB RAM screen will be at: $F8000 - normal screen base, what you "inherit", and $F0000 . In case of 512K: $78000 and $70000 .

Places for correction: when code start is at $AA56 (TOS 1.04) , at aprox. $219E2 is some calculation of address, after what comes setting of SP. All that code seems messy for me, and in any case the result is setting of SP too high. And that is not good, as will conflict with screen in case of 512K RAM. So, as said, set SP about 1KB above bss end.

Screen base setting: at $CE82 is XBIOS call to get screen base, then writing of it to variable for first scrren, and after that you should instead move.l #$80000, secondscreen ... to use sub.l #$8000,d0 ; move.l d0,secondscreen, and same address few lines lower, instead move.l #$80000,-(a7), so move.l d0,-(a7) ....

I did change of screen base and SP on fly, in Debugger, and after that it worked flawless in Steem set to 512KB RAM .
Negative feedback has usually positive effect.

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Sat Aug 30, 2014 3:41 pm

FedePede04 wrote:It starts to look really solid keep up the good work :)


Thanks :D

calimero wrote:I just played arcade version and visually there are really close. Speed is also great, I only notice little bit slowdown on ST when there are many or big sprites!
otherwise it is almost perfect clone of original! :) :)


Thanks! That's one of my aims with this project - to prove that it's not always necessary to compromise on the size and variety of the visuals when bringing an arcade game to the ST :D It runs really smoothly at 16Mhz by the way - almost uncannily like the arcade machine. I'd love to see it running on a Mega STE.

AtariZoll wrote:The solution: I already wrote here that you should set alt screen to address : regular screen base - $8000 , and not as fixed one. This will not only make it work well on 512K RAM, but will make it to work from hard disk. Because then whole executable may go higher in RAM, since there is plenty of space until 1MB (what is minimum for hard disk work).


AtariZoll wrote:SP should be set aprox. 1KB above last RAM address you use with game. And that last RAM address should be same as section bss end address (visible in TOS header) . Currently, if using TOS 1.04 UK, it is $AA56 (code start) + $17718 ( code len) + $3D840 (data len) + $18B8 ( bss len) = $61266 .


Sorry - I think I misunderstood last time you talked about setting the alt screen base, but I've definitely got it this time! I've made the change as per your suggestion and it works nicely. I've also used a tool called m68k-atari-mint-stack to change the stack size to 1024 bytes - it was previously 65536 bytes! No wonder I was having problems on a 520ST. The good news is that with these changes I now have a build that works on a 520ST! Thanks for imparting your knowledge on this and similar matters - it's been really helpful.

One other thing I've been looking into (as per another of your suggestions!) is packing the executable to help with what is currently rather a lengthly floppy load time. So far i've tried UPX and a Windows tool called PackFire.exe - neither of which seem to do the job. UPX just hangs when I try to run it, and PackFire.exe successfully produces an executable file which unfortunately gives a TOS Error #35 when I try to run it. I'm going to spend a bit more time trying to work out what's going on with this at some point.

Updated disk image is attached - no changes apart from the fact that it now works on a 520. Really pleased about this.
You do not have the required permissions to view the files attached to this post.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Sat Aug 30, 2014 4:45 pm

Chicane, you attached same image from yesterday again. Likely because it is not easy to attach image with same name here - I had problems earlier. Maybe best would be to add version number in file name.
I tried to pack it with UPX (latest version from 30.09.2013) and it works. Well packable - 84356 bytes for main exec. , 8548 fir title.
Negative feedback has usually positive effect.

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Sat Aug 30, 2014 5:37 pm

AtariZoll wrote:Chicane, you attached same image from yesterday again. Likely because it is not easy to attach image with same name here - I had problems earlier. Maybe best would be to add version number in file name.
I tried to pack it with UPX (latest version from 30.09.2013) and it works. Well packable - 84356 bytes for main exec. , 8548 fir title.


Thanks - I'll change the filename next time I attach a disk image. Would you mind giving more information on the configuration of the machine you've used UPX on? I'm still getting just a flashing cursor when I run UPX.TTP regardless of what parameters I provide - it's a fresh copy of UPX 3.91 downloaded from upx.sourceforge.net. This is on Hatari 1.8, TOS 1.4 and 4 Meg.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Sat Aug 30, 2014 6:06 pm

Ah, I forgot that latest UPX, Atari version worked for me not too . I just use Windows executable - if nothing else, it is much faster :D
Usage is really simple: type in command prompt or in Total Commander's prompt bar: upx polepos.prg - then it will overwrite original file with packed one. So, if want to keep original, copy it somewhere, or do packing is some temporary directory.
There should be Linux version too.
Btw. I have my packer for TOS executables, but it is not so good in packing as UPX. And I even did not try to make Atari version of it - that would work very slow with my primitive algorithm.
Negative feedback has usually positive effect.

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Sat Aug 30, 2014 6:56 pm

AtariZoll wrote:Ah, I forgot that latest UPX, Atari version worked for me not too . I just use Windows executable - if nothing else, it is much faster :D


I didn't realise that the Linux version could pack Atari TOS executables - that would have saved some fiddling around :D
Anyway, here's a disk image containing the 520ST version with UPX compression. Title screen displayed in 2 seconds, game fully loaded in 13 seconds and no ugly screen flashing or messages - I'm really impressed with UPX!
You do not have the required permissions to view the files attached to this post.

User avatar
tjlazer
Atari Super Hero
Atari Super Hero
Posts: 594
Joined: Mon Feb 02, 2004 4:00 am
Location: Tacoma, WA USA
Contact:

Re: New ST project - Pole Position arcade conversion

Postby tjlazer » Sat Aug 30, 2014 11:00 pm

Great job really impressed. This looks like it was released from Atari for the ST! :)
Atari Computer Collector since 1984

From the 8-bit Atari 400 to the 32-bit Atari TT030!

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1026
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby MasterOfGizmo » Sun Aug 31, 2014 8:04 am

Runs nicely on the MIST board :-)

In STEroids (extremely overclocked CPU) mode it's super-fluid, but sprites (cars, start banner) are flickering somewhat.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
TwiliteZoner
Atari User
Atari User
Posts: 37
Joined: Tue Jul 29, 2003 3:18 pm
Location: USA

Re: New ST project - Pole Position arcade conversion

Postby TwiliteZoner » Sun Aug 31, 2014 1:02 pm

Thank you for releasing this. Very impressive.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1540
Joined: Sun Jul 31, 2011 1:11 pm

Re: New ST project - Pole Position arcade conversion

Postby Eero Tamminen » Sun Aug 31, 2014 6:34 pm

Looks impressive!

I think I hit a but though. Shortly after car had gone first round, the speed suddenly went to zero and the car disappeared. Other cars were still moving (passing by), so game hadn't frozen. It just didn't react to joystick anymore.

This was with TOS v1.04 / 4MB in Hatari.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Sun Aug 31, 2014 6:58 pm

You need to qualify for race, so make lap under 68 secs .

Considering flickering, I will test on Mega STE at 16MHz tomorrow. In Steem, when is set to 16 MHz no flickering, but at 32 MHz it is present.
So, problem should arrive only on TT or some fast clone. There are ways to avoid it, by adding some extra v-sync. But I think that it will be not some priority.
Negative feedback has usually positive effect.

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Sun Aug 31, 2014 7:38 pm

tjlazer wrote:Great job really impressed. This looks like it was released from Atari for the ST!


Eero Tamminen wrote:Looks impressive!


MasterOfGizmo wrote:Runs nicely on the MIST board


Thanks all!

Eero Tamminen wrote:I think I hit a but though. Shortly after car had gone first round, the speed suddenly went to zero and the car disappeared. Other cars were still moving (passing by), so game hadn't frozen. It just didn't react to joystick anymore.


AtariZoll wrote:You need to qualify for race, so make lap under 68 secs


Yep, AtariZoll is correct - you need to make qualifying to enter the race. Although you're correct in observing that the game shouldn't just effectively "hang" if you fail to qualify. It's one thing in a big list of issues I need to tackle before I can consider this conversion complete. I'll take a look at what the arcade version does in this scenario and work out why mine isn't doing the same. Things like this are one of the painful aspects of writing a game - you get the fundamental gameplay running in a couple of weeks and then it takes months to add all the polish and tie up all the loose ends :D

MasterOfGizmo wrote:In STEroids (extremely overclocked CPU) mode it's super-fluid, but sprites (cars, start banner) are flickering somewhat.


AtariZoll wrote:Considering flickering, I will test on Mega STE at 16MHz tomorrow. In Steem, when is set to 16 MHz no flickering, but at 32 MHz it is present.
So, problem should arrive only on TT or some fast clone. There are ways to avoid it, by adding some extra v-sync. But I think that it will be not some priority.


I've observed this under emulation on Steem - I suspect it happens when the number of frames generated per second exceeds the refresh rate of the "monitor". AtariZoll - I'll be interested to see whether or not this happens on the Mega STE. (By the way, I'm a bit jealous that you have a Mega STE - I'm always on the lookout for one on Ebay but they're very rare...)

User avatar
tjlazer
Atari Super Hero
Atari Super Hero
Posts: 594
Joined: Mon Feb 02, 2004 4:00 am
Location: Tacoma, WA USA
Contact:

Re: New ST project - Pole Position arcade conversion

Postby tjlazer » Wed Sep 10, 2014 12:15 am

Why is there hissing sound while playing?
Atari Computer Collector since 1984

From the 8-bit Atari 400 to the 32-bit Atari TT030!

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Wed Sep 10, 2014 1:02 pm

Worked fine on Atari Mega STE and Falcon - both at 16 MHz, and with hard disk - so not starting from floppy.
Framerate even better. But inconsistent movement of trackside objects is very noticeable. What reminds me on what Chicane said about some look-up tables, and not understanding it. On machines without FPU, some math is done with tables, because of speed. So, trigonometrical functions as SIN, COS, TANG in 3D games. Maybe those tables are such, or like. In any case, I think that may be possible to write code in 68000 ASM, what will act 100% like original. That seems easier as converting it to C.
Audio is other thing what should be improved, for sure. So, still lot of work ahead, it seems.
Negative feedback has usually positive effect.

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Sat Sep 20, 2014 7:46 pm

AtariZoll wrote:Worked fine on Atari Mega STE and Falcon - both at 16 MHz, and with hard disk - so not starting from floppy.


Thanks for testing! Were the colours correct on Falcon? I seem to remember when testing in Hatari Falcon mode that the raster bars didn't work, therefore ruining the appearance of half the screen.

AtariZoll wrote:But inconsistent movement of trackside objects is very noticeable. What reminds me on what Chicane said about some look-up tables, and not understanding it. On machines without FPU, some math is done with tables, because of speed. So, trigonometrical functions as SIN, COS, TANG in 3D games. Maybe those tables are such, or like. In any case, I think that may be possible to write code in 68000 ASM, what will act 100% like original. That seems easier as converting it to C.


Are you seeing the odd movement off trackside objects only on or near the horizon, or as objects draw nearer as well? I'm only aware of this happening when objects are close to the horizon, and it's not massively noticable, although I agree that it's something that does need sorting out at some point. Probably once I've overcome my obsession with optimisation (I managed to add another 10% onto the frame rate the other day - it's getting pretty smooth on an 8Mhz ST now :D).

If you have time, it might be worth you taking a look at the arcade original in MAME to check that some of the glitches you're seeing on this conversion don't also appear there.

AtariZoll wrote:Audio is other thing what should be improved, for sure. So, still lot of work ahead, it seems.


tjlazer wrote:Why is there hissing sound while playing?


I have to admit that the YM chip is proving to be rather enigmatic to me - I've always struggled with sound programming as I'm more of a graphics/game logic kind of guy. So far, I can't work out what values to drop into the YM registers to get a "pure" tone rather than one that's accompanied by "noise" or "hissing". If anybody wants to help I'll be only too glad to discuss in the coding forums :D

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Sun Sep 21, 2014 7:49 am

chicane wrote: Were the colours correct on Falcon? I seem to remember when testing in Hatari Falcon mode that the raster bars didn't work, therefore ruining the appearance of half the screen.

Are you seeing the odd movement off trackside objects only on or near the horizon, or as objects draw nearer as well? I'm only aware of this happening when objects are close to the horizon, and it's not massively noticable, although I agree that it's something that does need sorting out at some point. Probably once I've overcome my obsession with optimisation (I managed to add another 10% onto the frame rate the other day - it's getting pretty smooth on an 8Mhz ST now :D).

If you have time, it might be worth you taking a look at the arcade original in MAME to check that some of the glitches you're seeing on this conversion don't also appear there.


Colors on real Falcon were OK. It worked practically flawless. Falcon emulation is still far from perfect. I tried in Hatari too, and it was pretty bad.

After some struggling to find working polepos ROM files I tried it in Mame. And there are same errors in trackside objects movement - when they are nearer. So, this is problem with original Namco arcade too. And if you try Pole Position 2, may see that they corrected the problem :D
Negative feedback has usually positive effect.

User avatar
npomarede
Atari God
Atari God
Posts: 1160
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: New ST project - Pole Position arcade conversion

Postby npomarede » Sun Sep 21, 2014 5:57 pm

chicane wrote:I have to admit that the YM chip is proving to be rather enigmatic to me - I've always struggled with sound programming as I'm more of a graphics/game logic kind of guy. So far, I can't work out what values to drop into the YM registers to get a "pure" tone rather than one that's accompanied by "noise" or "hissing". If anybody wants to help I'll be only too glad to discuss in the coding forums :D

I can't help with the music or sound fx themselves, but turning noise on voice A/B/C is easy. You need to modify reg7 of the YM2149, note that bits are inverted, so 0=ON and 1=OFF. Bits 0-2 are for tone A/B/C and bits 3-5 are for noise A/B/C.
So, you can use something like this:

Code: Select all

move.b #7,$ff8800
move.b #$38,$ff8802

This will turn tones A/B/C ON and noise OFF. You can then change volume and period for each voice.

chicane
Atari freak
Atari freak
Posts: 69
Joined: Mon Jul 02, 2012 11:25 am
Location: Leeds, UK

Re: New ST project - Pole Position arcade conversion

Postby chicane » Mon Sep 22, 2014 11:02 am

npomarede wrote:I can't help with the music or sound fx themselves, but turning noise on voice A/B/C is easy. You need to modify reg7 of the YM2149, note that bits are inverted, so 0=ON and 1=OFF. Bits 0-2 are for tone A/B/C and bits 3-5 are for noise A/B/C.
So, you can use something like this:

Code: Select all

move.b #7,$ff8800
move.b #$38,$ff8802

This will turn tones A/B/C ON and noise OFF. You can then change volume and period for each voice.


Thanks very much - I now have a tolerable (if slightly weedy) engine sound! The value I was pushing into ff8802 was $62 previously but I'm not quite sure how I came to this value. Might well be the inverted bits as you've mentioned. Appreciate your help.

evil
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 139
Joined: Sun Nov 12, 2006 8:03 pm

Re: New ST project - Pole Position arcade conversion

Postby evil » Sun Oct 05, 2014 3:51 pm

npomarede wrote:

Code: Select all

move.b #7,$ff8800
move.b #$38,$ff8802

This will turn tones A/B/C ON and noise OFF. You can then change volume and period for each voice.


There is also I/O control on YM-reg 7, best not to set them in case something is using it (Falcon/ST-Book IDE? Or was that r14.. hum)

So read out the data;

lea $ffff8800.w,a0

move.b #7,(a0)
move.b (a0),d0

Then set new data:

or.b #bits,d0
move.b #7,(a0)
move.b d0,2(a0)

User avatar
npomarede
Atari God
Atari God
Posts: 1160
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: New ST project - Pole Position arcade conversion

Postby npomarede » Sun Oct 05, 2014 4:31 pm

evil wrote:
npomarede wrote:

Code: Select all

move.b #7,$ff8800
move.b #$38,$ff8802

This will turn tones A/B/C ON and noise OFF. You can then change volume and period for each voice.


There is also I/O control on YM-reg 7, best not to set them in case something is using it (Falcon/ST-Book IDE? Or was that r14.. hum)

So read out the data;

lea $ffff8800.w,a0

move.b #7,(a0)
move.b (a0),d0

Then set new data:

or.b #bits,d0
move.b #7,(a0)
move.b d0,2(a0)


You're right, I wanted to keep the example code simple.
But then, if we want to be really correct, a "and" is missing from your code :) Else previous bits 0-5 are not cleared.

Code: Select all

and.b #$c0,d0
or.b #bits,d0
move.b #7,(a0)
move.b d0,2(a0)

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2796
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariZoll » Sun Oct 05, 2014 5:01 pm

evil wrote:There is also I/O control on YM-reg 7, best not to set them in case something is using it (Falcon/ST-Book IDE? Or was that r14.. hum)
So read out the data;
lea $ffff8800.w,a0
move.b #7,(a0)
move.b (a0),d0
Then set new data:
or.b #bits,d0
move.b #7,(a0)
move.b d0,2(a0)

Reg 7 controls directions of ports 14 and 15. And you don't change port 14 to input, otherwise machine will stop to work.
Port 14 controls FDC on ST, STE machines - 3 bits. On Mega STE , ST Book, Falcon there are some other bits used, so need to keep their state.
But port 14 is not accessed during sound generation.
All above means that masking is not necessary in this case. Just need to know exactly purpose of bits in reg 7 .
Negative feedback has usually positive effect.

User avatar
Greyfox™
Captain Atari
Captain Atari
Posts: 341
Joined: Thu Jul 24, 2008 10:27 am
Location: Dublin, Ireland
Contact:

Re: New ST project - Pole Position arcade conversion

Postby Greyfox™ » Wed Feb 04, 2015 6:28 pm

It's been three months, just wondering has the project ceased or is it still going to make Atari ST history?

Any updates would be great big or small :cheers:
↓↓Click Banner to See More↓↓
Image
-== Making Atari great once more ==-

User avatar
AtariCrypt
Captain Atari
Captain Atari
Posts: 354
Joined: Fri Mar 14, 2014 5:04 pm
Location: Lancashire, England
Contact:

Re: New ST project - Pole Position arcade conversion

Postby AtariCrypt » Sat Apr 11, 2015 11:06 am

Also wondering the same today :)
Steve
AtariCrypt ... ST/e gaming https://ataricrypt.blogspot.com


Social Media

     

Return to “Games - General”

Who is online

Users browsing this forum: No registered users and 4 guests