TheDevil'sCompass Posted March 7, 2022 Share Posted March 7, 2022 Does anyone know how the iris screen wipe/reveal between levels in Lode Runner is done? I'd like to do something similar on the Sega Genesis using SecondBasic. My 6502 assembly is beyond rusty at this point so diving into the source code wouldn't help me much. An Applesoft example would be great (even if it's slow as molasses) or even a good explanation as to what is going on would be appreciated. I feel like I'm missing something simple since the wipe works at a pretty decent clip on a relatively slow machine. It seems to me that it is drawing a ring at ever increasing steps until the screen is filled as opposed to redrawing an ever increasing filled circle. I just haven't been able to wrap my head around the mechanics of how it is accomplished. Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Iamgroot Posted March 7, 2022 Share Posted March 7, 2022 Can't remember if I came across an Applesoft version, but here is an assembly version. Just load your picture at $4000. Do an HGR to clear and display hi-res page #1, then CALL 24576 6000:A9 08 85 FC A9 0C 85 FD A9 14 85 FE A9 12 85 FF 6010:A9 40 85 E6 A9 53 A0 00 A2 85 20 11 F4 20 B5 60 6020:A6 FC 20 D5 F4 20 B5 60 CA D0 F7 A5 FC A8 69 08 6030:85 FC E6 E5 A4 E5 C4 FE F0 0A 90 08 C5 E5 88 E6 6040:FE 4C 68 60 20 B5 60 A5 26 48 A5 27 48 20 04 F5 6050:20 B5 60 20 04 F5 20 B5 60 20 04 F5 20 B5 60 68 6060:85 27 68 85 26 4C 32 60 A6 FD 20 04 F5 20 CC 60 6070:20 B5 60 CA D0 F4 A5 FD 18 69 08 85 FD C6 E5 A4 6080:E5 30 06 C4 FF F0 0A B0 08 E6 E5 C8 C6 FF 4C 20 6090:60 20 B5 60 A5 26 48 A5 27 48 20 D5 F4 20 B5 60 60A0:20 D5 F4 20 B5 60 20 D5 F4 20 B5 60 68 85 27 68 60B0:85 26 4C 7D 60 A4 E5 B1 26 48 38 A5 27 E9 20 85 60C0:27 68 91 26 A5 27 18 69 20 85 27 60 A5 26 C9 50 60D0:D0 08 A5 27 C9 42 D0 02 68 68 60 00 1 Quote Link to comment Share on other sites More sharing options...
Iamgroot Posted March 7, 2022 Share Posted March 7, 2022 Just realized the code I posted does a couple of things differently. It rotates clockwise and it uncovers the screen in a square pattern and not a circular. To do a circular pattern requires a lot of math, beyond Applesoft's capabilities as it requires XOR'ing with a mask of the screen. Probably the easiest way to get the code is to find a cracked copy and locate the routine on the disk. 1 Quote Link to comment Share on other sites More sharing options...
TheDevil'sCompass Posted March 7, 2022 Author Share Posted March 7, 2022 2 hours ago, Iamgroot said: Just realized the code I posted does a couple of things differently. It rotates clockwise and it uncovers the screen in a square pattern and not a circular. To do a circular pattern requires a lot of math, beyond Applesoft's capabilities as it requires XOR'ing with a mask of the screen. Probably the easiest way to get the code is to find a cracked copy and locate the routine on the disk. Thanks. I'll check out the code you sent. I figured it was copying the image from HGR2 to HGR. It's the circular part that's throwing me for some reason. Although I may have figured out another way of doing it on the Sega Genesis. I may have to brute force this do the reveal as a precalculated circle using 8x8 tiles instead of per pixel. Not quite what I wanted, but it may work. Quote Link to comment Share on other sites More sharing options...
Iamgroot Posted March 7, 2022 Share Posted March 7, 2022 (edited) Here you go. Just BLOAD any hi-res screen to $4000 and RUN the program. Very slow. Needs at least 7 Mhz, but best at wide open in an emulator. Just copy/paste all below into any emulator. CALL-151 0300:A9 60 85 05 A0 00 84 04 84 06 84 08 A9 40 85 07 0310:A2 20 86 09 B1 06 91 31 04 28 10 02 09 80 91 08 0320:88 D0 F1 E6 05 E6 07 E6 09 CA D0 E8 60 00 00 60 0330:A9 60 4C EA F3 00 00 00 3D0G BSAVE AND.MASK,A$300,L$38 NEW 5 DIM A(32): PRINT CHR$ (17): PRINT CHR$ (4)"BLOAD AND.MASK" 10 CALL 816: HGR : HOME : HCOLOR= 3: POKE 49234,0: POKE 230,96 15 XD = 20:YD = 5.6:C = 15.91:X = 140:Y = 86:PI = 3.14:P2 = PI * 2 17 FOR Z = 1 TO 17:XD = XD + 10:YD = YD + 7 30 FOR I = 1 TO 32:A(I) = 3.125:A(I) = (A(I) / C) + A(I - 1): NEXT 65 FOR I = 16 TO 9 STEP - 1: FOR J = A(I - 1) TO A(I) STEP P2 / 647: GOSUB 90: NEXT : CALL 768: NEXT 70 FOR I = 8 TO 1 STEP - 1: FOR J = A(I - 1) TO A(I) STEP P2 / 647: GOSUB 90: NEXT : CALL 768: NEXT 75 FOR I = 32 TO 25 STEP - 1: FOR J = A(I - 1) TO A(I) STEP P2 / 647: GOSUB 90: NEXT : CALL 768: NEXT 80 FOR I = 24 TO 17 STEP - 1: FOR J = A(I - 1) TO A(I) STEP P2 / 647: GOSUB 90: NEXT : CALL 768: NEXT 85 NEXT : POKE 790,145: CALL 768: POKE 230,32: END 90 M = XD * COS (J) + X:N = YD * SIN (J) + Y 92 IF M > 279 THEN M = 279 94 IF M < 0 THEN M = 0 96 IF N > 191 THEN N = 191 98 IF N < 0 THEN N = 0 100 HPLOT X,Y TO M,N 110 RETURN SAVE IRIS Edited March 7, 2022 by Iamgroot 1 Quote Link to comment Share on other sites More sharing options...
TheDevil'sCompass Posted March 7, 2022 Author Share Posted March 7, 2022 I appreciate the code, but it doesn't appear to be working. As soon as the CALL 768 is executed the entire image is copied from $4000 to $2000. I think I've found a way to make it work for my application though. I really do appreciate the help. It's made me think about the problem a different way which got me over my stumbling block. Quote Link to comment Share on other sites More sharing options...
Iamgroot Posted March 7, 2022 Share Posted March 7, 2022 (edited) Shoot, and can't even edit it. Here is the corrected code. 0300:A9 60 85 05 A0 00 84 04 84 06 84 08 A9 40 85 07 0310:A2 20 86 09 B1 06 08 31 04 28 10 02 09 80 91 08 0320:88 D0 F1 E6 05 E6 07 E6 09 CA D0 E8 60 00 00 60 0330:A9 60 4C EA F3 00 00 00 and change line #85 to 85 NEXT : POKE 791,145: CALL 768: POKE 230,32: END Edited March 7, 2022 by Iamgroot 1 Quote Link to comment Share on other sites More sharing options...
TheDevil'sCompass Posted March 8, 2022 Author Share Posted March 8, 2022 Works great! That's exactly what I was looking for. Thanks! Quote Link to comment Share on other sites More sharing options...
Iamgroot Posted March 8, 2022 Share Posted March 8, 2022 With the AND.MASK routine, you can create any mask and do the same. A star, triangle, outline of the USA, polka dots, anything your imagination can dream up. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.