Flying Notes and Bytes Oh My!
Posted: Tue Nov 17, 2015 10:40 pm
Hi guys,
Been having a bit of trouble converting a small bit of code to use less ram and am getting a very strange effect.
Changing this:
To this:
Causes the notes to gain super speed for some reason. Changing just the initiation code stops it from moving. I'm very new to 68k assembly so i'm gonna chalk it up to a newbie mistake. Any assistance in this matter would be greatly appreciated.
Sincerely,
Scorpion Illuminati
Been having a bit of trouble converting a small bit of code to use less ram and am getting a very strange effect.
Changing this:
Code: Select all
; ************************************
; initialize everything
; ************************************
move.w #1, (tempo) ; initialize tempo
move.w #note_start_position_y, (greennote_position_y) ; Set green note's y position
move.w #note_start_position_y, (rednote_position_y) ; Set red note's y position
move.w #note_start_position_y, (yellownote_position_y) ; Set yellow note's y position
move.w #rockindicator_start_position_x, (rockindicator_position_x) ; Set rock indicator's x position
; ******************************************************************
; Main game loop
; ******************************************************************
GameLoop:
; green note movement code
move.w (greennote_position_y), d0 ; green note y position in d0
add.w (tempo), d0 ; add the tempo
cmp.w #(note_plane_border_offset-note_bounds_bottom), d0 ; does the player miss the note entirely
blt @GreenNoteNotWithinBounds ; branch if the player hasn't
move.w #note_start_position_y, d0 ; otherwise the player has so move the note back to the top
@GreenNoteNotWithinBounds:
move.w d0, (greennote_position_y) ; set the green note's position normally
; red note movement code
move.w (rednote_position_y), d0 ; red note y position in d0
add.w (tempo), d0 ; add the tempo
cmp.w #(note_plane_border_offset-note_bounds_bottom), d0 ; does the player miss the note entirely
blt @RedNoteNotWithinBounds ; branch if the player hasn't
move.w #note_start_position_y, d0 ; otherwise the player has so move the note back to the top
@RedNoteNotWithinBounds:
move.w d0, (rednote_position_y) ; set the red note's position normally
; yellow note movement code
move.w (yellownote_position_y), d0 ; yellow note y position in d0
add.w (tempo), d0 ; add the tempo
cmp.w #(note_plane_border_offset-note_bounds_bottom), d0 ; does the player miss the note entirely
blt @YellowNoteNotWithinBounds ; branch if the player hasn't
move.w #note_start_position_y, d0 ; otherwise the player has so move the note back to the top
@YellowNoteNotWithinBounds:
move.w d0, (yellownote_position_y) ; set the yellow note's position normally
Code: Select all
; ************************************
; initialize everything
; ************************************
move.b #1, (tempo) ; initialize tempo
move.w #note_start_position_y, (greennote_position_y) ; Set green note's y position
move.w #note_start_position_y, (rednote_position_y) ; Set red note's y position
move.w #note_start_position_y, (yellownote_position_y) ; Set yellow note's y position
move.w #rockindicator_start_position_x, (rockindicator_position_x) ; Set rock indicator's x position
; ******************************************************************
; Main game loop
; ******************************************************************
GameLoop:
; green note movement code
move.w (greennote_position_y), d0 ; green note y position in d0
add.b (tempo), d0 ; add the tempo
cmp.w #(note_plane_border_offset-note_bounds_bottom), d0 ; does the player miss the note entirely
blt @GreenNoteNotWithinBounds ; branch if the player hasn't
move.w #note_start_position_y, d0 ; otherwise the player has so move the note back to the top
@GreenNoteNotWithinBounds:
move.w d0, (greennote_position_y) ; set the green note's position normally
; red note movement code
move.w (rednote_position_y), d0 ; red note y position in d0
add.b (tempo), d0 ; add the tempo
cmp.w #(note_plane_border_offset-note_bounds_bottom), d0 ; does the player miss the note entirely
blt @RedNoteNotWithinBounds ; branch if the player hasn't
move.w #note_start_position_y, d0 ; otherwise the player has so move the note back to the top
@RedNoteNotWithinBounds:
move.w d0, (rednote_position_y) ; set the red note's position normally
; yellow note movement code
move.w (yellownote_position_y), d0 ; yellow note y position in d0
add.b (tempo), d0 ; add the tempo
cmp.w #(note_plane_border_offset-note_bounds_bottom), d0 ; does the player miss the note entirely
blt @YellowNoteNotWithinBounds ; branch if the player hasn't
move.w #note_start_position_y, d0 ; otherwise the player has so move the note back to the top
@YellowNoteNotWithinBounds:
move.w d0, (yellownote_position_y) ; set the yellow note's position normally
Sincerely,
Scorpion Illuminati