;This code will apply the horizontal shaking when ram address ;$7E:1887 is non-zero, causing the shaking effect to both ;shake vertically and horizontally. !freeram_Xoffset_lo = $1923 ;\Layer 1 image relative X position, these two address !freeram_Xoffset_hi = $1924 ;/don't have to be adjacent to each other. org $00A2CB ;>hijack part of earthquake routine. autoclean JML maincode ;>jump to a new code going to be inserted. freecode ;>search freeram. nop #2 ;>get rid of extra bytes after the jump code. maincode: LDA #$00 ;\compatable with long addresses. STA !freeram_Xoffset_lo ;| STA !freeram_Xoffset_hi ;/ LDA $1887 ;\limit value to 0-3 values (4 different values). AND #$03 ;/ TAY ;>use for table. LDA lo_x_table,y ;\load values from table and store to x position STA !freeram_Xoffset_lo ;/low byte. CLC : ADC $1A ;\adjust x position. STA $1A ;| LDA hi_x_table,y ;| STA !freeram_Xoffset_hi ;| ADC $1B ;| STA $1B ;/ ;restore_smw_code: LDA.W GrndShakeDispYHi,Y ;\restore a part of the earthquake effect. STA.W $1889 ;/ JML $00A2D1 ;>and return back to the code the game left off. lo_x_table: db $FE,$00,$02,$00 hi_x_table: db $FF,$00,$00,$00 GrndShakeDispYHi: db $FF,$00,$00,$00