Jump to content
IGNORED

Modern game disassembly's


Recommended Posts

9 hours ago, Ecernosoft said:

Sure!

ICT2 (18).a26 This is the latest version of ICT2, V9. Have fun with it @Retrogamerrhys1!

Do you have the source code for this, because the .a26 is a compiled assembly file? If I'm not  mistaken, thanks. Good looking game however not sure what you have to do in it though? 

Edited by Retrogamerrhys1
Link to comment
Share on other sites

You might also like to check out my tutorial, Collect, which covers writing a complete 2K game from scratch. Since it's a tutorial I went overboard with the comments, to an extent that you most likely will not see in other source code or disassemblies. 

 

Some examples from Collect, everything after a ; is a comment. Comments can occur on lines by themselves, as well as after code.

 

 

;===============================================================================
; Initialize dasm
;===============================================================================

    ; Dasm supports a number of processors, this line tells dasm the code
    ; is for the 6502 CPU.  The Atari has a 6507, which is 6502 that's been
    ; put into a "reduced package".  This packaging limits the 6507 to an 8K
    ; address space and also removes support for external interrupts.
    
    PROCESSOR 6502
    
    ; vcs.h contains the standard definitions for TIA and RIOT registers 
        include vcs.h       
    
    ; macro.h contains commonly used routines which aid in coding
        include macro.h

 

 

;===============================================================================
; Define RAM Usage
;===============================================================================

    ; define a segment for variables
    ; .U means uninitialized, does not end up in ROM
        SEG.U VARS
    
    ; RAM starts at $80
        ORG $80             

    ; Holds 2 digit score for each player, stored as BCD (Binary Coded Decimal)
Score:          ds 2    ; stored in $80-81
    ; CODING TIP - The : is optional. However, if you remember to include the :
    ;              in all of your labels you can then easily find where
    ;              something is defined by including : in the search.
    ;              Find "Score:" will bring you here, find "Score" will locate
    ;              all places that the variable Score is used.

    ; Offsets into digit graphic data
DigitOnes:      ds 2    ; stored in $82-83, DigitOnes = Score, DigitOnes+1 = Score+1
DigitTens:      ds 2    ; stored in $84-85, DigitTens = Score, DigitTens+1 = Score+1

 

 

;===============================================================================
; Define Start of Cartridge
;===============================================================================

    ; define a segment for code
    SEG CODE    
    
    ; 2K ROM starts at $F800, 4K ROM starts at $F000
    ORG $F800

 

 

;===============================================================================
; PosObject
;----------
; subroutine for setting the X position of any TIA object
; when called, set the following registers:
;   A - holds the X position of the object
;   X - holds which object to position
;       0 = player0
;       1 = player1
;       2 = missile0
;       3 = missile1
;       4 = ball
; the routine will set the coarse X position of the object, as well as the
; fine-tune register that will be used when HMOVE is used.
;
; Note: The X position differs based on the object, for player0 and player1
;       0 is the leftmost pixel while for missile0, missile1 and ball 1 is
;       the leftmost pixel:
;           players     - X range is 0-159
;           missiles    - X range is 1-160
;           ball        - X range is 1-160
; Note: Setting players to double or quad size will affect the position of
;       the players.
;===============================================================================
PosObject:
        sec
        sta WSYNC
DivideLoop
        sbc #15        ; 2  2 - each time thru this loop takes 5 cycles, which is 
        bcs DivideLoop ; 2  4 - the same amount of time it takes to draw 15 pixels
        eor #7         ; 2  6 - The EOR & ASL statements convert the remainder
        asl            ; 2  8 - of position/15 to the value needed to fine tune
        asl            ; 2 10 - the X position
        asl            ; 2 12
        asl            ; 2 14
        sta.wx HMP0,X  ; 5 19 - store fine tuning of X
        sta RESP0,X    ; 4 23 - set coarse X position of object
        rts            ; 6 29

 

  • Like 2
Link to comment
Share on other sites

12 hours ago, Retrogamerrhys1 said:

Do you have the source code for this, because the .a26 is a compiled assembly file? If I'm not  mistaken, thanks. Good looking game however not sure what you have to do in it though? 

Lol... I meant to send the source ;)

Here it is @Retrogamerrhys1

ICT2 (1).a

Edited by Ecernosoft
Link to comment
Share on other sites

18 hours ago, SpiceWare said:

You might also like to check out my tutorial, Collect, which covers writing a complete 2K game from scratch. Since it's a tutorial I went overboard with the comments, to an extent that you most likely will not see in other source code or disassemblies. 

 

Some examples from Collect, everything after a ; is a comment. Comments can occur on lines by themselves, as well as after code.

 

Thanks for your tutorial, it really helps me as a beginner,

 

14 hours ago, Ecernosoft said:

Sorry to ask... but....

WHY

I guess its because he wants to keep his source a secret as in Intellectual Copyrights, it would be nice if coders revealed the game logic in their games but people have the right not to share what they make. 

Edited by Retrogamerrhys1
  • Like 1
Link to comment
Share on other sites

37 minutes ago, Retrogamerrhys1 said:

Thanks for your tutorial, it really helps me as a beginner,

 

I guess its because he wants to keep his source a secret as in Intellectual Copyrights, it would be nice if coders revealed the game logic in their games but people have the right not to share what they make. 

Yeah.............. true.

Link to comment
Share on other sites

I've always been on the fence about sharing source code.

 

For me, it's not about keeping secrets, but of providing something of HIGH value that's useful to others that they can learn from.  Most source code just isn't commented / documented enough to really be useful.  This is mostly because the developer/programmer has a lot of information in their head about the program that just isn't written down.

 

I think the best source of information for someone who is new to Atari programming are the tutorials available here.  If you have questions about game logic, then the best thing to do is ASK.  People are more than willing to answer questions.  If enough people ask, maybe someone will write up a tutorial about it.

  • Like 1
Link to comment
Share on other sites

19 hours ago, SpiceWare said:

You might also like to check out my tutorial, Collect, which covers writing a complete 2K game from scratch. Since it's a tutorial I went overboard with the comments, to an extent that you most likely will not see in other source code or disassemblies. 

 

Thanks!  I'll take a look.   Are the modules mostly plug and play for coding and work with each other?

Link to comment
Share on other sites

1 hour ago, LatchKeyKid said:

Are the modules mostly plug and play for coding and work with each other?

 

There are some subroutines, like the PosObject shown above and the sound effect routines in sfx.asm, that can be used as-is in other programs.

 

Other routines, like the Kernel for drawing the visible screen and ProcessJoystick for player actions, tend to be game specific.  You can use what's there as a starting point, but more likely than not will be making extensive changes to those routines for your game.

  • Like 1
Link to comment
Share on other sites

5 hours ago, splendidnut said:

I've always been on the fence about sharing source code.

 

For me, it's not about keeping secrets, but of providing something of HIGH value that's useful to others that they can learn from.  Most source code just isn't commented / documented enough to really be useful.  This is mostly because the developer/programmer has a lot of information in their head about the program that just isn't written down.

 

I think the best source of information for someone who is new to Atari programming are the tutorials available here.  If you have questions about game logic, then the best thing to do is ASK.  People are more than willing to answer questions.  If enough people ask, maybe someone will write up a tutorial about it.

Yeah.... You are right.

 

And my source code isn't the best to use. Not only do I use ILLEGAL opcodes (LAX, SAX) in my source, as well as special techniques (Replacing lda VALUE and #$80 beq/bne LOCATION with lda VALUE bpl/bmi LOCATION and other things) to save ROM space, but sometimes I also use "random" label names. (Those are usually something going on at that time) When I don't really need an important name for a label (Or I barely ever use it) then I don't give it a super-descriptive name of WHY that label exists. 

Edit: I honestly don't know why I do that, but I'm weird like that. 

 

If you ever need me to, I can make a more newbie-friendly source for my games.

 

Then again, there is a point where there are SO MANY COMMENTS that it just gets messy. Some of the 8bitworkshop sample programs suffer from this.

 

Edited by Ecernosoft
Link to comment
Share on other sites

On 10/20/2022 at 10:50 AM, Retrogamerrhys1 said:

Does anyone have an archive of disassembly's from modern WIPs and completed games they would be willing to share with a new programmer? 

Disassemblies, or source code?

 

Disassembly is what someone who wants to know how it works comes up with.  Source code is what the developer used.  By "new programmer" I guess you mean the latter?

Edited by ChildOfCv
Link to comment
Share on other sites

28 minutes ago, Retrogamerrhys1 said:

Yeah, I mean source code I think? Although I have come across disassemblies from archives which seem to offer what I want, a breakdown of the program.

A raw disassembly wouldn't be much use, you can get this for any game using Stella in any case.

 

The ones with comments, labels, constants etc have been reversed engineered to the point where it could be considered as good as having the original source code, probably better because back in the day they didn't have the space or time to put extensive comments. So there's a big difference between 'commented disassembly' and 'disassembly'.

Link to comment
Share on other sites

I recently saw there is a program called NESmaker that seems like making an NES game out of plug and play chunks (kind of like "hacking" in this scene).  

 

https://www.thenew8bitheroes.com/

 

Obviously this is not the best way to learn to code but for those just trying to make a functional game it might work.  I messaged them about possibly making a 2600 plugin but it's not on the menu unfortunately.  :( 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...