Jump to content
IGNORED

How-to? Iris Screen Wipe - Lode Runner


Recommended Posts

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.

Link to comment
Share on other sites

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

 

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Iamgroot
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Iamgroot
  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...