# .font: font.text_2
# .autowrap: false
# .centered: true
boulder dash for newcomers 35
# .font: font.text_1
by
# .font: font.text_2
dustin
# .centered: false

# .font: font.value_1
# .autowrap: false
DUSTIN                            2023-08-09 15:31
# .font: font.value_2
# .autowrap: true
THE SIXTH CAVE ABOUT THE ΘΘΘ AMOEBA ALREADY, AND IT HAS STILL NEW SURPRISES FOR Κ!  IT TURNS OUT THAT A CERTAIN MILLING SOUND IS QUITE ANNOYING FOR THE GROWING ANIMAL THAT IT IMMEDIATELY... WELL, JUST TRY IT OUT FOR YOURSELF :D  
  
IDEAS BEHIND THIS CAVE:  
| SHOW HOW THE ΛΛΛ STOPS THE ΘΘΘ

# .font: font.value_1
# .autowrap: false
DARKSTOORM                        2023-08-09 23:11
# .font: font.value_2
# .autowrap: true
WOAH, IT'S BEEN 35 CAVES ALREADY! :D

# .font: font.value_1
# .autowrap: false
DUSTIN                            2023-08-09 23:52
# .font: font.value_2
# .autowrap: true
YEAH, AND THERE'RE STILL THINGS TO EXPLORE FOR NEWCOMER-Κ! :D

# .font: font.value_1
# .autowrap: false
DUSTIN                            2023-08-10 20:53
# .font: font.value_2
# .autowrap: true
PERHAPS THIS IS THE RIGHT CAVE TO EXPLAIN WHY THE ΛΛΛ CAN SOMETIMES STOP THE ΘΘΘ BUT SOMETIMES NOT. IN FACT, THE WHOLE ΛΛΛ-STOPS-ΘΘΘ-RULE WAS NEVER AN INTENDED FEATURE AT ALL!  
  
| THE STORY STARTS WITH THE VERY FIRST BD1 GAME. THE ENGINE USED FOR THIS GAME HAD A BUG CONCERNING THE ΛΛΛ: EVERY TIME A Β WAS THROWN THROUGH THE ΛΛΛ, THE CAVESCAN RESTARTED. THIS HAD SEVERAL UNINTENDED EFFECTS:  
  
1. CHOPPY MOVEMENTS WHEN THE ΛΛΛ CONVERTS ΒΒΒ. THIS IS SOMETHING EVERY BD1 PLAYER HAS EXPERIENCED, ESPECIALLY IN CAVE O WHERE THE ΛΛΛ CONVERTS A LOT OF ΒΒΒ IN SHORT TIME.  
(BTW IF YOU WANT TO PLAY A BIT WITH THE BUG, TRY IT OUT IN CAVE O: DURING CONVERSION, Κ IS SLOWER THAN NORMAL IN THE LOWER HALF OF THE CAVE, AND QUICKER THAN USUAL IN THE TOP HALF OF THE CAVE! REASON: THE LOWER HALF, BELOW THE ΛΛΛ, IS SCANNED TOO RARELY BECAUSE THE CAVESCAN ALWAYS RESTARTS WHEN A Β FALLS THROUGH THE ΛΛΛ.) :D  
  
2. A FEW ΒΒΒ CAN GET LOST DURING CONVERSION IF THE ΛΛΛ CONVERTS MANY ΒΒΒ IN SHORT TIME. (THIS WAS EXPLOITED, FOR EXAMPLE, IN DON PEDRO'S BD5, CAVE I - IF Κ CONVERTS THE ΒΒΒ TOO QUICKLY, HE WON'T GET ALL THE ΑΑΑ!) (REASON: THIS IS A DIRECT RESULT FROM 1. ABOVE. THE NEWLY CONVERTED ΑΑΑ BELOW THE ΛΛΛ ARE SCANNED TOO RARELY, SO THEY CAN'T FALL DOWN QUICKLY ENOUGH TO MAKE SPACE FOR THE NEXT ΒΒΒ TO BE CONVERTED!)  
  
3. THE THIRD EFFECT IS THE ONE WE'RE TALKING ABOUT: IF THERE'S AN Θ IN THE CAVE, AND IF ALL PARTS OF THE Θ ARE BELOW THE ΛΛΛ, THEN THE Θ WILL CONVERT INTO ΑΑΑ AS SOON AS THE ΛΛΛ IS ACTIVATED! (THIS IS BECAUSE THE CAVESCAN RESTARTS BEFORE THE ΘΘΘ WAS SCANNED, SO THE ΘΘΘ HAD NO CHANCE TO GROW, AND THE ENGINE THINKS IT'S TRAPPED!)  
  
| WHILE THE BUG WAS FIXED FOR THE BD2 ENGINE, BD3 WAS AGAIN MADE WITH THE OLD BUGGY BD1 ENGINE, AND THE DEVELOPPERS EXPLOITED THE ΛΛΛ-ΘΘΘ-BUG IN INTERMISSION 1 AND CAVE O. IN BOTH CAVES, Κ HAS TO CONVERT AN ΘΘΘ BY ACTIVATING A ΛΛΛ. SO THIS WAS THE STARTPOINT OF THE "ΛΛΛ STOPS ΘΘΘ" RULE! DON PEDRO AND OTHER BD1 ENGINE HACKERS ALSO MADE CAVES AROUND THIS BUG/ FUNNY FEATURE/ WHATEVER :D  
  
| TBH I'M NOT CERTAIN HOW THIS FEATURE WAS HANDLED IN THE OFFICIAL CONSTRUCTION KIT (PLCK) AND ITS DESCENDANTS (1STB, CLCK ENGINES), BUT IN GDASH AND HERE AT THIS SITE, "MAGIC WALL STOPS AMOEBA" IS AN OPTION WHICH THE CAVE DESIGNER CAN CHOOSE TO SWITCH ON OR OFF FOR EACH CAVE SEPERATELY. THAT'S WHY HERE AT THIS SITE, IN SOME CAVES IT WORKS, IN OTHERS IT DOESN'T. SO, IF YOU HAVE ΘΘΘ AND ΛΛΛ IN THE SAME CAVE, JUST TRY IT OUT - ACTIVATE THE ΛΛΛ AND EXPECT THE UNEXPECTED! :D

# .font: font.value_1
# .autowrap: false
DARKSTOORM                        2023-08-10 21:14
# .font: font.value_2
# .autowrap: true
OH! SO NOW I UNDERSTAND WHY - ALTHOUGH I DON'T KNOW IF IT'S THE SAME IN THE ORIGINAL SOURCE CODE, I READ IN ONE SPECIFICATION DOCUMENT THERE IS A VARIABLE FOR "AT LEAST ONE AMOEBA COULD GROW THIS FRAME", WHICH HANDLES THE "TRAPPED" STATE FOR AMOEBA. SO, IF THE SCAN GETS INTERRUPTED BEFORE ΘΘΘ GETS SCANNED, THIS COUNTER IS 0 AND ΘΘΘ FIGURES AS TRAPPED, SO ON THE NEXT FRAME ΘΘΘ CONVERTS :D  
  
I WAS CURIOUS WHAT THIS "MAGIC WALL BUG" WAS ALL THE TIME!

# .font: font.value_1
# .autowrap: false
NESDORI                           2023-08-11 10:20
# .font: font.value_2
# .autowrap: true
darkstoorm, THAT SAME VARIABLE IS INDEED USED IN THE C64 BD CODE AND THAT'S WHY THE AMOEBA GETS CONVERTED :)  
  
BUT WHY THIS BUG OCCURS?  
  
C64 ASSEMBLY HAS TWO KIND OF UNCONDITIONAL JUMPS, JMP IS DIRECT JUMP AND JSR IS A SUBROUTINE CALL. JSR STORES THE CURRENT PROGRAM COUNTER ONTO THE STACK AND THEN JUMPS TO THE SPECIFIED ADDRESS AND THERE SHOULD BE RTS INSTRUCTION AT THE END OF SUBROUTINE WHICH PULLS THE PROGRAM COUNTER BACK FROM THE STACK JA THEN RETURNS TO THAT ADDRESS, CONTINUING EXECUTION FROM THE POINT WHERE THE JSR WAS EXECUTED.  
  
PLAYING DIFFERENT SOUNDS ARE SUBROUTINES IN BD1. THEY SHOULD THEREFORE BE CALLED WITH JSR. HOWEVER, AT THEN END OF "| FALLS THROUGH A MAGIC WALL" -HANDLING ROUTINE THERE'S A JMP INSTEAD OF JSR TO PLAY "FALLING \" SOUND. NOW THERE'S A WRONG RETURN ADDRESS ON THE STACK AND WHEN RTS IS EXECUTED, THE ADDRESS WHICH IS PULLED IS ACTUALLY A RETURN ADDRESS OF THE ENTIRE SCANNING ROUTINE AND IS SUPPOSED TO BE PULLED AND RETURNED INTO WHEN THE SCANNING IS OVER. NOW THE EXECUTION IS RETURNED THERE AFTER PLAYING THE SOUND WHICH CAUSES THE SCANNING TO END ABRUPTLY.  
  
SO BASICALLY THIS BUG OCCURS BECAUSE JMP IS USED TO PLAY THE SOUND INSTEAD OF JSR.  
  
BUT THERE'S MORE TO THIS BUG THAN THIS. EVEN IF THE JMP IS REPLACED WITH JSR THE | HANDLER WOULD FAIL. THEN THERE WOULD BE NO JMP TO FINISH THE "| THROUGH MAGIC WALL" HANDLER AND CODE EXECUTION WOULD FALL THROUGH TO NEXT ROUTINE WHERE IT'S CHECKED IF THERE'S A ROUNDED OBJECT BELOW THE | SO THE | WOULD FALL LEFT/RIGHT. THE HANDLER WOULD DETERMINE THAT THE MAGIC WALL IS NOT ROUNDED AND PUT A STATIONARY | BACK ON TOP OF IT. SO NOW THERE WOULD BE BOTH A FALLING \ UNDER THE MW AND A STATIONARY | ON TOP OF IT. BUT AT LEAST SCANNING WOULD BE FULLY COMPLETED IN THIS CASE AND THE CODERS WOULD HAVE SPOTTED THAT THERE'S SOMETHING WRONG WITH THE CODE :)  
  
SO I THINK THAT THE CODER THOUGHT OF NOT JUMPING INTO SOUNDS PLAYING ROUTINE BUT INTO SOME OTHER ROUTINE WHICH WOULD END HANDLING THE CURRENT OBJECT AND CONTINUE WITH THE NEXT OBJECT. THIS IS WHAT "\ THROUGH MW" ACTUALLY CORRECTLY DOES. THE HANDLER IS A LITTLE BIT DIFFERENT THERE; THE SOUND IS PLAYED WITH JSR AND THEN THERE'S JMP TO CLEAR THE CURRENT OBJ AND PROCEED SCANNING WITH THE NEXT OBJ. FOR SOME REASON, | HANDLER IS DIFFERENT: THE CLEARING IS DONE WITH SEPARATE ROUTINE AND THEN THERE'S NO JMP TO FINISH THE ROUTINE. THE FINISHING JMP IS A WRONG JUMP TO THE SOUND PLAYING ROUTINE. MAYBE THE HANDLERS WERE DONE BY DIFFERENT CODERS OR THE | HANDLER WAS LATER CHANGED FOR SOME REASON WITH DEVASTATING RESULTS :)

# .font: font.value_1
# .autowrap: false
NESDORI                           2023-08-11 11:33
# .font: font.value_2
# .autowrap: true
ACTUALLY, NOW I HAVE AN EDUCATED GUESS WHAT'S THE FULL STORY WITH THIS BUG:  
  
THERE'S ANOTHER VISUAL BUG WITH "\ THROUGH MW" IN BD1 ENGINE WHERE \ IS CORRECTLY REMOVED FROM THE LOGIC BUFFER BUT THE SCREEN BUFFER IS UPDATED INCORRECTLY AND THE SPACE WHICH IS SUPPOSED TO REMOVE THE \ IS DRAWN ON THE WRONG COORDINATES. THEREFORE THERE'S "GHOST \" ON THE TOP OF MW ON THE SCREEN WHICH ISN'T REALLY THERE WHEN THE THE CAVE IS SCANNED AND ^ CAN'T JUST RUN OVER IT BUT NOT GET AN ADDITIONAL \.  
  
THEY FIXED THIS VISUAL BUG IN "| THROUGH MW" BY DOING SEPARATE CLEARING ROUTINE BUT AT THE SAME TIME INTRODUCED A NEW FATAL ONE. THE NEW ROUTINE OVERWROTE SOME OLD CODE AND THEY JUST FORGOT ABOUT ADDING A NEW JSR CALL TO THE "FALLING \" SOUND ROUTINE. THEY THOUGHT THAT THE SOUND PLAYING ADDRESS LEFT FROM THE OLD CODE IS ACTUALLY THE FINISHING ROUTINE AND THEREFORE JUMPED THERE. THAT WOULD EXPLAIN WHY THE BUG IS THERE :)

# .font: font.value_1
# .autowrap: false
ALTERMAVEN                        2023-08-11 15:22
# .font: font.value_2
# .autowrap: true
"MAGIC WALL STOPS AMOEBA" WAS NOT PRESENT IN BDCK.

# .font: font.value_1
# .autowrap: false
DUSTIN                            2023-08-11 21:50
# .font: font.value_2
# .autowrap: true
THX 4 THE INFO altermaven! :)  
  
nesdori, WHILE I READ YOUR COMMENTS, I HAD A FAMILIAR FEELING BECAUSE I OFTEN FEEL IT WHEN I READ TEXTS FROM PROGRAMMING EXPERTS: ON THE ONE HAND, I (THINK I) UNDERSTAND ENOUGH TO BE INTERESTED AND THINK THIS IS PROBABLY VERY COOL, ON THE OTHER HAND I DON'T UNDERSTAND ENOUGH TO FEEL CONFIDENT TO WRITE AN ANSWER :D

# .font: font.value_1
# .autowrap: false
DARKSTOORM                        2023-08-12 14:45
# .font: font.value_2
# .autowrap: true
THINGS LIKE THIS REALLY MAKE YOU THINK IF THAT WAS "A HAPPY LITTLE ACCIDENT" OR AN INTENDED FEATURE :D   
GLAD TO KNOW WHAT THE ACTUAL STORY MAY BE!