*** R-TYPE DELUXE SOURCE CODE ***

Latest news in the Atari world

Moderators: Mug UK, Silver Surfer, Moderator Team

User avatar
bod/STAX
Atari Super Hero
Atari Super Hero
Posts: 508
Joined: Wed Nov 24, 2004 8:13 pm
Location: Halesowen, West Midlands, England

*** R-TYPE DELUXE SOURCE CODE ***

Postby bod/STAX » Sun Feb 07, 2016 3:44 pm

OK Guys after many hours of pondering this I have decided to release the source code, but not all of it! Just the main game itself. I'll still be incharge of overview and putting the game together that way I can still be involved in not just handing the project over. You'll need a level file so download the game from STNICCC and extract and select a level file, unpack it (It's ICE packed) and save it to disk. In the source find the label 'level_data' and incbin it there. Set the label 'stage' to whatever stage you're playing. At the top of the source find the line 'move.w #-1,cheat_flag' uncomment this to turn the cheat off. Have fun! :)
You do not have the required permissions to view the files attached to this post.
So let it be written, So let it be done. I'm sent here by the chosen one.

User avatar
MiggyMog
Atari Super Hero
Atari Super Hero
Posts: 772
Joined: Sun Oct 30, 2005 4:43 pm
Location: Scotland

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby MiggyMog » Sat Jul 16, 2016 9:23 pm

A Parting gift from an atari scene great ..sad times
('< o o o o |''| STM,2xSTFM,2xSTE+HD,C-Lab Falcon MK2+HD,Satandisk,Ultrasatandisk,Ethernat.

User avatar
alien
Atari maniac
Atari maniac
Posts: 85
Joined: Sat May 01, 2004 4:01 am
Location: USA
Contact:

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby alien » Sun Jul 17, 2016 3:45 am

Thanks Bod/Stax, even though you can't read this.
Alien / ST-Connexion

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

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby AtariCrypt » Tue Jul 19, 2016 3:56 pm

yeah this is kinda spooky and sad (i mean that respectfully ofc)
But, dear Stephen... it's one last "thank you" from me and I truly hope somebody with equal talent picks this up and continues the hard work already done.
Steve

fenarinarsa
Retro freak
Retro freak
Posts: 15
Joined: Sat Mar 15, 2014 11:23 pm

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby fenarinarsa » Sat Nov 05, 2016 11:55 am

Has someone even tried to run this ? :)

It doesn't assemble directly in Devpac, there's some typos in the source code. But after fixing two "(" missing and some REPT located on the same lines than labels (which devpac seems not to like), it works. Don't forget to ICE-unpack the levels with a tool like Multi depacker.

I wanted to check if a single level could work on a 16Mhz CPU (the complete game doesn't), but it doesn't. Even switching to 16Mhz when playing the level hangs the game. Still don't know why.

(and there's graphic and gameplay bugs on level 1, don't know if it's the source code which may be not final or the level data that are corrupted).

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

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby AtariZoll » Sat Nov 05, 2016 1:59 pm

I need to check Devpac 3 manual. Never seen label x - and here is plenty, probably just mean current one, but why is not local then ? , set 0 ????
In any case, preview release works well at 16, 32 MHz in Steem Debugger. And as I remember it worked fine on Mega STE at 16 MHz.
I'm not against GMO, I'm against that children play with fire.

fenarinarsa
Retro freak
Retro freak
Posts: 15
Joined: Sat Mar 15, 2014 11:23 pm

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby fenarinarsa » Sat Nov 05, 2016 11:25 pm

Like in this block ?

Code: Select all

x   set   0
   rept   10
   movem.l   d0-d7/a2-a6,x(a0)
x   set   x+(4*13)
   endr

x is not a label, it's a macro variable defined to 0, then the block between REPT and ENDR is repeated 10 times. x is incremented by 4*13 between each REPT loop.

That's because on ST it's more efficient to unroll loops in memory instead of making actual loops - I guess it's different on Mega STE because of the associative cache, but it's difficult to check on emulators, I think none of them emulate this cache.

I was talking about some occurences of a label being declared on the same line of a a REPT :

Code: Select all

bydo_sheild_tab   rept   15

...and devpac does not like this (the label seems to be ignored).

There is also two typos in REPT blocks, in this case Devpac just throw a "garbage instruction" error and points to the ENDR, but the error is actually located in the instructions above it.
Last edited by fenarinarsa on Sun Nov 06, 2016 3:07 pm, edited 1 time in total.

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

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby AtariZoll » Sun Nov 06, 2016 9:15 am

Of course I used rept:

Code: Select all


   rept   228

   movem.l  (a7)+,d0-d7/a0-a3     *108T (12+12*8)  preload 16+8 colors 
* complete P0 and first half  of P1

   movem.l  d1-d7,(a5)   * 64T   * P0 col 2-15
   move.w  d0,(a4)    * 8T     * P0 col1 , 15 colors of P0 written
   swap   d0    * 4T

* 184T so far

*boe
   move.w  d0,(a6)   * 8T  update color 0 of P0  at exact line start

   movem.l  (a7)+,d0-d3  *  12+4*8 = 44T   - second half of P1

   movem.l  a0-a3,(a6)     *  40 T  first half of P1 to shifter     at px 56

   move.l   usp,a3     * 4T    px

   movem.l  d0-d3,(a3)   *  40T   second half   P1    at px 100

   movem.l  (a7)+,d0-d7   * 76T , complete P2 pref.   at px 140

*   movem.l  d0-d7,(a6)   *  72T   all 16 colors  P2   at px 216

* Instead, do it in 2 steps

   movem.l  d0-d3,(a6)    * 8+8x4=40
   movem.l  d4-d7,(a3)    * 40T

* 20T states free here for :


*       addq.l   #1,d0   * 8T
       asr.l   #6,d0   * 20T

*bos
*   move.w  $40.w,(a6)      * 16T    need 312T from  boe ( move.w a5,(a6) ) - here relative +8T wr.

*   nop
   moveq   #0,d0
   move.w   d0,(a6)
   nop


* Total 184+312+16=512 - superisha !


   endr



Above is just a part - there is total 273 line on screen. I guess that I did not use macro for looong time.
Btw. Unroll is more efficient even with cache. Especially if we loop short code - because no dbf or other jumps to loop begin, which just eat CPU time, while doing nothing "useful" .
Anyway, more interesting is why you had problems at 16MHz, on Mega STE ? May be that it is cache sensitive. I need to check it again on MSTE.
In any case, it works well and smooth at 8 MHz, so no need to push over.
I already did some mod of this game - replaced ICE packed files with better packing, what depacks much faster. Really don't get why ICE is so much used (seen even in some commercial releases). viewtopic.php?f=28&t=29047&hilit=rtype+deluxe&start=50
Maybe we could do new release for floppy users - I will provide you repacked files and source of depacker, so you can add it in src. file and assemble.
I really have too much things to work on currently, and you already fixed src.
I'm not against GMO, I'm against that children play with fire.

User avatar
Marakatti
Atari God
Atari God
Posts: 1257
Joined: Sat Jun 18, 2005 9:58 am
Location: Finland
Contact:

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby Marakatti » Sun Nov 06, 2016 2:55 pm

AtariZoll wrote:it works well and smooth at 8 MHz, so no need to push over.

Actually it chokes quite badly when using some power-ups. See the video from 9.10 https://www.youtube.com/watch?v=sDmDPCsmERU
Some power boost would be very welcome.
-------------< Member of Atarimania >-----------
-< ST / STe / Falcon030 / TT030 archiver >-
-------------> www.atarimania.com <-------------

fenarinarsa
Retro freak
Retro freak
Posts: 15
Joined: Sat Mar 15, 2014 11:23 pm

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby fenarinarsa » Sun Nov 06, 2016 3:40 pm

AtariZoll wrote:Btw. Unroll is more efficient even with cache. Especially if we loop short code - because no dbf or other jumps to loop begin, which just eat CPU time, while doing nothing "useful" .


Yes, there's the jump test time, but it all depends on the size of the loop itself, given that the cache avoids memory access - provided the loop code doesn't write or read on memory locations that collide with the ones of the code, which should be cached after the first iteration.

AtariZoll wrote:Anyway, more interesting is why you had problems at 16MHz, on Mega STE ? May be that it is cache sensitive. I need to check it again on MSTE.


It shouldn't be, at least if I understand correctly how the cache works (unless the blitter is used to generate code or some other nasty trick). But it doesn't work on Hatari when set at frequency > 8Mhz either, which is very strange because there doesn't seem to be time-critical code nor generated/self-modifying code. I'm going to try to disable some subrouts to see if I find a culprit.

I already did some mod of this game - replaced ICE packed files with better packing, what depacks much faster. Really don't get why ICE is so much used (seen even in some commercial releases). http://atari-forum.com/viewtopic.php?f= ... e&start=50
Maybe we could do new release for floppy users - I will provide you repacked files and source of depacker, so you can add it in src. file and assemble.
I really have too much things to work on currently, and you already fixed src.


Sorry, I forgotten about your thread and version. It was nearly a year ago, and I didn't have time to try to compile the source before now. Thanks for the work :)

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

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby AtariZoll » Sun Nov 06, 2016 5:37 pm

Here are repacked files, and src for depacking:
UPXP.ZIP
You do not have the required permissions to view the files attached to this post.
I'm not against GMO, I'm against that children play with fire.

mlynn1974
Atari maniac
Atari maniac
Posts: 82
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby mlynn1974 » Sun Nov 06, 2016 8:59 pm

I think with respect we should establish and document the correct configuration to build the project.

The source code is quite big at 400k so the text buffer has to be allocated at least 500k. This is set in Editor\Preferences.
The compiled code is about 523k so we need to allocate a maximum of 600k. This is set in Program\Assemble. Max: 600k
So you need an ST or emulator configuration with at least 2Mb for this project.

I think it is important to mention why it doesn't assemble using Devpac v2.09
In many places in the code it uses the conditional assembly directive IFEQ\ELSE.
This is not available in Devpac 2.09. Changing the code to use ELSEIF gets it further and shows the same errors outlined above.

Assembling on a hard disk in a subdirectory caused errors for me. Specifying the full path name fixed this.
Adding my path to the INCDIR didn't solve the problem but should be explained for people trying to assemble the code in different locations.
I only have Devpac 2.09 and 3.10 because that's what I used back in the day.

So exactly which version of Devpac did Bod use or did he use a different assembler or toolchain?
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

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

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby AtariZoll » Mon Nov 07, 2016 6:10 am

I assembled some longer sources than this with Devpac 3, without problems. Should look what is latest version. I have 3.1 as highest v.
I think that it must be Devpac, at least it looks pretty much as source for it. I see 3.5 for Amiga mentioned, but for ST 3.1 seems as last one.
I'm not against GMO, I'm against that children play with fire.

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

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby AtariZoll » Mon Nov 07, 2016 1:18 pm

OK, I managed to assemble it after only removing 2 brackets in problematic lines. Did not correct lines where label and rept was together.
Works fine - level 4 in Steem Debugger.
But, this is not same as SITNICC preview. As is stated by bod/STAX self. We need RTYPE.TOS (2.2 KB depacked) - what controls intro, level loads. Sadly he is not among us anymore, so we need to disasm. it . I will probably do it, and changing depacking for begin. In any case, it will not fit on single DD floppy.
Not clear is some bug fixing needed, code optimizing, making slow parts faster - if possible at all without serious rewrites ?
I'm not against GMO, I'm against that children play with fire.

mlynn1974
Atari maniac
Atari maniac
Posts: 82
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: *** R-TYPE DELUXE SOURCE CODE ***

Postby mlynn1974 » Wed Nov 09, 2016 12:50 am

Yes you need to change this:

Code: Select all

dc.l   .data+x+(2*4)*60)

To this:

Code: Select all

dc.l   .data+x+(2*4)*60

In 2 places. Then it builds correctly.
There was a misleading error message from GenST in Devpac 3.10 there.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).


Social Media

     

Return to “News & Announcements”

Who is online

Users browsing this forum: No registered users and 3 guests