don't click here

Trying to learn asm, but

Discussion in 'Engineering & Reverse Engineering' started by .hack//zero, Oct 4, 2006.

Thread Status:
Not open for further replies.
  1. .hack//zero

    .hack//zero

    Member
    3,011
    4
    18
    Working on a vulkan game engine for fun. Learning Ray-Tracing.
    How do you a do you apply it to sonic hacking? My head is hurting from trying to learn this shit.
     
  2. Stealth

    Stealth

    Tech Member
    594
    30
    28
    Sonic Mania, HCGE, Sonic Megamix, SonED2, [...]
    You don't "learn ASM", you memorize an instruction set, or familiarize yourself enough that you can quickly work with references, at least. You learn to program, which is pretty much applying the familiarity of the language you learn (in this case, 68k ASM) and a certain similar knowledge of the hardware you're using (in this case, the various parts of the Genesis) to solving a problem (you want one particular thing to happen in the game). If you're working with a pre-built program (like Sonic), you need to use what you know about the language it's written in and the hardware it's written for to familiarize yourself with the way it works. Only then will you be able to manipulate what's there and integrate new parts

    When you try to work directly with the program with these disassemblies, you're no longer "hacking" so much as you're programming/reprogramming (Some people don't seem to understand this, or that even trying to modify certain parts in a hex editor require knowledge of the program and programming in general). If you don't know how to apply knowledge of a certain programming language and a certain group of hardware to accomplish a certain task on that hardware with or without pre-written code, you need to learn some programming basics.

    You'll also have to learn some math you may not already know
     
  3. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    I would suggest you try tackling an easier language, or as I'll say, a dummny language, such as Game Maker. It helped me to understand some programming basics, which in turn helped me to learn how to code through ASM. Using a dummy language can be a big help, though it's your choice as to which language you want to use. Since you are learning some C++, or C, I forget which, try that.

    Also, try making smaller changes, learning how the commands work. for example, try changing a few add.w with some sub.w, see how the change affects gameplay, and go on from there.

    Try to take it simply. Don't rush towards object porting, as it's insanely difficult. Also, look at some sample code(such as this, or this), try to figure out how it works, and see how you can apply it to your mod.

    and finally, take it slowly, one step at a time, it'll help out to try over and over again.

    About those links, I don't know if you need to be a registered member to view those specific sub-forums.
     
  4. .hack//zero

    .hack//zero

    Member
    3,011
    4
    18
    Working on a vulkan game engine for fun. Learning Ray-Tracing.
    This is what I'm doing rigtht now sorta. I'm mainly just taking out commands, and seeing what happens. Also, I'm not just think about porting enemies. I also want to make my own.
     
  5. .hack//zero

    .hack//zero

    Member
    3,011
    4
    18
    Working on a vulkan game engine for fun. Learning Ray-Tracing.
    Just made my playground area. This how I should have done the object notes, and yes. I did make this.

    Code (Text):
    1. ; ----------------------------------------------------------------------------
    2. ; Sprite
    3. ;
    4. ; Octopus badnick from OOZ
    5. ; ----------------------------------------------------------------------------
    6.  
    7. Octopus:            ; DATA XREF: ROM:0001600C o
    8.         moveq   #0,d0
    9.         move.b  $24(a0),d0
    10.         move.w  octo_maininfopointer(pc,d0.w),d1
    11.         jmp       octo_maininfopointer(pc,d1.w)
    12. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    13. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    14. octo_maininfopointer:   dc.w octo_maininfo-octo_maininfopointer;
    15.                 dc.w octoanimate-octo_maininfopointer;
    16.                 dc.w loc_2CA46-octo_maininfopointer; 2
    17.                 dc.w octoshoot-octo_maininfopointer;
    18. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    19. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    20.  
    21. octoshoot:          ; DATA XREF: h+15AAE o
    22.         subi.w  #1,$2C(a0)
    23.         bmi.s   octoshoot2
    24.         rts
    25. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    26. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    27.  
    28. octoshoot2:         ; CODE XREF: h+15ABC j
    29.         bsr.w   octo_speedtopos
    30.         lea (octo_spritetablepointers).l,a1
    31.         bsr.w   octo_Animatesprite
    32.         bra.w   loc_2CCB0
    33. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    34. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    35.  
    36. loc_2CA46:          ; DATA XREF: h+15AAE o
    37.         subq.w  #1,$2C(a0)
    38.         beq.w   octo_freeobject
    39.         bra.w   octo_displaysprite
    40. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    41. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    42.  
    43. octo_maininfo:          ; DATA XREF: h+15AAE o
    44.         move.l  #Octo_sprite_mappings,4(a0)
    45.         move.w  #$2538,2(a0)
    46.         ori.b   #4,1(a0)
    47.         move.b  #$A,$20(a0)
    48.         move.b  #4,$18(a0)
    49.         move.b  #$10,$19(a0)
    50.         move.b  #$B,$16(a0)
    51.         move.b  #8,$17(a0)
    52.         bsr.w   octo_objectfall
    53.         jsr (loc_1EDFA).l
    54.         tst.w   d1
    55.         bpl.s   octoinfo2
    56.         add.w   d1,$C(a0)
    57.         move.w  #0,$12(a0)
    58.         addq.b  #2,$24(a0)
    59.         move.w  8(a0),d0
    60.         sub.w   ($FFFFB008).w,d0
    61.         bpl.s   octoinfo2
    62.         bchg    #0,$22(a0)
    63.  
    64. octoinfo2:          ; CODE XREF: h+15B1C j h+15B34 j
    65.         move.w  $C(a0),$2A(a0)
    66.         rts
    67. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    68. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    69.  
    70. octoanimate:            ; DATA XREF: h+15AAE o
    71.         moveq       #0,d0
    72.         move.b  $25(a0),d0
    73.         move.w  octo2ndpointers(pc,d0.w),d1
    74.         jsr     octo2ndpointers(pc,d1.w)
    75.         lea     (octo_spritetablepointers).l,a1
    76.         bsr.w       octo_Animatesprite
    77.         bra.w       loc_2CCB0
    78. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    79. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    80. octo2ndpointers:    dc.w grounded_octo-octo2ndpointers;
    81.             dc.w airborn_octo-octo2ndpointers;
    82.             dc.w octo_shoot-octo2ndpointers;
    83.             dc.w octo_airtime-octo2ndpointers;
    84.             dc.w octo_backonground-octo2ndpointers; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    85. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    86.  
    87. grounded_octo:          ; DATA XREF: h+15B60 o
    88.         move.w  8(a0),d0
    89.         sub.w   ($FFFFB008).w,d0
    90.         cmpi.w  #$80,d0; '?'
    91.         bgt.s   grounded_octo_end
    92.         cmpi.w  #-$80,d0
    93.         blt.s   grounded_octo_end
    94.         addq.b  #2,$25(a0)
    95.         move.b  #3,$1C(a0)
    96.         move.w  #$20,$2C(a0); ' '
    97.  
    98. grounded_octo_end:          ; CODE XREF: h+15B76 j h+15B7C j
    99.         rts
    100. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    101. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    102.  
    103. airborn_octo:           ; DATA XREF: h+15B60 o
    104.         subq.w  #1,$2C(a0)
    105.         bmi.s   airborn_octo2
    106.         rts
    107. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    108. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    109.  
    110. airborn_octo2:          ; CODE XREF: h+15B94 j
    111.         addq.b  #2,$25(a0)
    112.         move.b  #4,$1C(a0)
    113.         move.w  #-$200,$12(a0)
    114.         bra.w   octo_speedtopos
    115. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    116. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    117.  
    118. octo_shoot:         ; DATA XREF: h+15B60 o
    119.         addi.w  #$10,$12(a0)
    120.         bpl.s   octo_shoot2
    121.         bra.w   octo_speedtopos
    122. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    123. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    124.  
    125. octo_shoot2:            ; CODE XREF: h+15BB2 j
    126.         addq.b  #2,$25(a0)
    127.         move.w  #$3C,$2C(a0); '<'
    128.         bra.w   octo_backonground3
    129. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    130. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    131.  
    132. octo_airtime:           ; DATA XREF: h+15B60 o
    133.         subq.w  #1,$2C(a0)
    134.         bmi.s   octo_airtime2
    135.         rts
    136. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    137. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    138.  
    139. octo_airtime2:          ; CODE XREF: h+15BCA j
    140.         addq.b  #2,$25(a0)
    141.         rts
    142. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    143. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    144.  
    145. octo_backonground:          ; DATA XREF: h+15B60 o
    146.         addi.w  #$10,$12(a0)
    147.         move.w  $C(a0),d0
    148.         cmp.w   $2A(a0),d0
    149.         bcc.s   octo_backonground2
    150.         bra.w   octo_speedtopos
    151. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    152. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    153.  
    154. octo_backonground2:         ; CODE XREF: h+15BE2 j
    155.         clr.b   $25(a0)
    156.         clr.b   $1C(a0)
    157.         clr.w   $12(a0)
    158.         move.b  #1,$1A(a0)
    159.         rts
    160. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    161. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    162.  
    163. octo_backonground3:         ; CODE XREF: h+15BC2 j
    164.         jsr (allocObject).l
    165.         bne.s   octo_backonground_end
    166.         move.b  #$4A,0(a1); 'J'
    167.         move.b  #6,$24(a1)
    168.         move.l  #Octo_sprite_mappings,4(a1)
    169.         move.w  #$2538,2(a1)
    170.         move.b  #4,$18(a1)
    171.         move.b  #$10,$19(a1)
    172.         move.w  8(a0),8(a1)
    173.         move.w  $C(a0),$C(a1)
    174.         move.w  #$F,$2C(a1)
    175.         move.b  1(a0),1(a1)
    176.         move.b  $22(a0),$22(a1)
    177.         move.b  #2,$1C(a1)
    178.         move.b  #-$68,$20(a1)
    179.         move.w  #-$200,$10(a1)
    180.         btst    #0,1(a1)
    181.         beq.s   octo_backonground_end
    182.         neg.w   $10(a1)
    183.  
    184. octo_backonground_end:          ; CODE XREF: h+15C02 j h+15C60 j
    185.         rts
    186. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    187. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    188. octo_spritetablepointers:   dc.w octo_spritetable1-octo_spritetablepointers; 0
    189.         dc.w octo_spritetable2-octo_spritetablepointers; 1
    190.         dc.w octo_spritetable3-octo_spritetablepointers; 2 air?
    191.         dc.w octo_spritetable4-octo_spritetablepointers; 3 air?
    192.         dc.w octo_spritetable5-octo_spritetablepointers; 4 spinning in air?
    193. octo_spritetable1:  dc.b  $F,  1,  0,$FF; 0; DATA XREF: h+15C68 o
    194. octo_spritetable2:  dc.b   3,  1,  2,  3,$FF; 0; DATA XREF: h+15C68 o
    195. octo_spritetable3:  dc.b   2,  5,  6,$FF,  0; 0; DATA XREF: h+15C68 o
    196. octo_spritetable4:  dc.b  $F,  4,$FF,  0; 0; DATA XREF: h+15C68 o
    197. octo_spritetable5:  dc.b   7,  0,  1,$FD,  1,  0; 0; DATA XREF: h+15C68 o
    198. ; ----------------------------------------------------------------------------
    199. ; Unknown Sprite Mappings
    200. ; ----------------------------------------------------------------------------
    201. Octo_sprite_mappings:           ; DATA XREF: h+15ADE o h+15C10 o ...
    202.         dc.w octo_sprite_mappings1-Octo_sprite_mappings; 0
    203.         dc.w octo_sprite_mappings2-Octo_sprite_mappings; 1
    204.         dc.w octo_sprite_mappings3-Octo_sprite_mappings; 2
    205.         dc.w octo_sprite_mappings4-Octo_sprite_mappings; 3 on ground?
    206.         dc.w octo_sprite_mappings5-Octo_sprite_mappings; 4 on ground?
    207.         dc.w octo_shot_anime-Octo_sprite_mappings; 5
    208.         dc.w octo_shot_anime2-Octo_sprite_mappings; 6
    209. octo_sprite_mappings1:  dc.w 2      ; DATA XREF: h+15C8A o
    210.         dc.w $EB0D, 0,  0,$FFF0; 0
    211.         dc.w $FB0D, 8,  4,$FFF0; 4
    212. octo_sprite_mappings2:  dc.w 3      ; DATA XREF: h+15C8A o
    213.         dc.w $F00D, 0,  0,$FFF0; 0
    214.         dc.w     9,  $10,   8,$FFE8; 4
    215.         dc.w     9,  $16,   $B,    0; 8
    216. octo_sprite_mappings3:  dc.w 3      ; DATA XREF: h+15C8A o
    217.         dc.w $F00D, 0,  0,$FFF0; 0
    218.         dc.w     9,  $1C,   $E,$FFE8; 4
    219.         dc.w     9,  $22,  $11,    0; 8
    220. octo_sprite_mappings4:  dc.w 3      ; DATA XREF: h+15C8A o
    221.         dc.w $F00D, 0,  0,$FFF0; 0
    222.         dc.w     9,  $28,  $14,$FFE8; 4
    223.         dc.w     9,  $2E,  $17,    0; 8
    224. octo_sprite_mappings5:  dc.w 4      ; DATA XREF: h+15C8A o
    225.         dc.w $F001,  $34,  $1A,$FFF7; 0
    226.         dc.w $F00D, 0,  0,$FFF0; 4
    227.         dc.w     9,  $10,   8,$FFE8; 8
    228.         dc.w     9,  $16,   $B,    0; 12
    229. octo_shot_anime:    dc.w 1      ; DATA XREF: h+15C8A o
    230.         dc.w $F201,  $36,  $1B,$FFF0; 0
    231. octo_shot_anime2:   dc.w 1      ; DATA XREF: h+15C8A o
    232.         dc.w $F201,  $38,  $1C,$FFF0; 0
    233.         dc.w     0  ; 4
    234. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    235. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    236.  
    237. octo_displaysprite:         ; CODE XREF: h+15ADA j
    238.         jmp DisplaySprite
    239. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    240. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    241.  
    242. octo_freeobject:            ; CODE XREF: h+15AD6 j
    243.         jmp freeObject
    244. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    245. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    246.  
    247. loc_2CCB0:          ; CODE XREF: h+15ACE j h+15B5C j
    248.         jmp loc_163D2
    249. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    250. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    251.  
    252. octo_Animatesprite:         ; CODE XREF: h+15ACA p h+15B58 p
    253.         jmp AnimateSprite
    254. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    255. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    256.  
    257. octo_objectfall:            ; CODE XREF: h+15B10 p
    258.         jmp ObjectFall
    259. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    260. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    261.  
    262. octo_speedtopos:            ; CODE XREF: h+15AC0 p h+15BA8 j ...
    263.         jmp speedtopos
    264. ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    265. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
     
Thread Status:
Not open for further replies.