Jump to content
IGNORED

RESEQ2?


GratedTopping

Recommended Posts

I was wondering if someone could help with this program from the July 1989 "MICROpendium". Jerry Stern was the author of "RESEQ2", a better way to resequence a program. You can use it to choose increments of different sizes in different parts of a program. Also, when a program is resequenced, even if there is a point where no line number existed, you'll still get the GOTO 32767 statement...but at the end of the new line, you'll see a a remark stating where the line that was being referenced to is located. "REFERENCE 340 TO 350", for example.

 

Anyway, this part doesn't work for me. I get a, for example, "REFERENCE 340 to 64352" (or some impossible line number). Does anybody know what it happening or have a correct/properly-working "RESEQ2"?

 

As for this included version, it is mine but is majorly the same; I've only modified it's appearance, not actual important code:

 

- a little change in some word in the layout

- included more characters to be accept in the ACCEPT AT statments

- added the part where it clears the screen and tells you to NEW and then OLD DSK#.progname; originally, it just stopped

 

I've checked my listing against that in the magazine and nothing of importance was different. As well, I used the unmodified program from the original "MICROpendium" disk (through the emulator) and the problem still exists. Looking at the 6 or so issues after that issue, I found no fix for the program.

 

I'd love to get it working, as it surely would be a useful utility!

RESEQ2.zip

Edited by GratedTopping
Link to comment
Share on other sites

I don't have it... but I'll tell you how I do my advanced resequencing... maybe this will help (assuming you don't already do this)... All you need is Classic99 and a text editor.

 

*Open 2 text documents, one containing your program and a new blank one.

 

Let's say I have a program that looks like this

 

100 CALL CLEAR
110 CALL SCREEN(7)
120 CALL CHAR(96,"6453fA537B435f78")
130 CALL CHAR(100,"insert hex here")
140 CALL CHAR(104,"insert hex here")
150 DISPLAY AT(1,1):CHR$(96);
160 DISPLAY AT(4,5):CHR$(100);
170 DISPLAY AT(8,9):CHR$(104);

 

Let's say I want lines 100 and 110 to remain as 100 and 110, but that I want my CALL CHARs to be 1000-. Then let's say I want the display parts to be at 10000-.

 

 

Using the paste function in Classic99, I basically copy the CALL CHARs and paste them in, then do a:

 

>RES 1000,10

>LIST "CLIP"

 

Then paste into the new document.

 

Then I'd copy the DISPLAY lines and paste them into classic99...then,

>RES 10000,10

>LIST "CLIP"

 

Then paste into the new document.

 

Boom.... Then you can paste the whole thing into Classic99 and:

 

>SAVE "DSK1.FINALCODE"

 

Sounds like more work than necessary, but it is super fast and I resequenced my entire Beryl Reichardt demo this way in under 2 minutes... Here's a part of that program after my resequencing was complete: Notice I start with 100, but my subs are at 2000,3000, and 10000 respectively.

 

 

 

100 REM    LINK UP TO LOAD DATA INTO MEMORY
110 CALL LDAT

120 REM       SET UP SCREEN AND BORDER FOR EXPLORATION
130 CALL CLEAR
140 CALL SCREEN(2)
150 CALL HCHAR(9,1,101,32) :: CALL HCHAR(24,1,101,32) :: CALL VCHAR(9,1,97,16) :: CALL VCHAR(9,32,97,16)
160 CALL HCHAR(9,1,98) :: CALL HCHAR(9,32,100) :: CALL HCHAR(24,1,99) :: CALL HCHAR(24,32,96)

170 REM       DESIGNATE MAP AND CHARACTER START POINT
180 MX=1 :: MY=1
190 PX=18 :: PY=8
200 CALL CHAR(42,"193DD9FFD91924C3") :: CALL COLOR(2,15,1)

210 REM       Beginning of main game loop
220 CALL SETMAP(MX,MY)

230 REM       CHARACTER ON SCREEN
240 DISPLAY AT(PX,PY):CHR$(42);

250 REM       KEYBOARD SCAN
260 CALL KEY(0,K,S) :: IF S=0 THEN 260

270 REM   must add 2 to each X and Y to compensate for the DISPLAY/GCHAR offset
280 IF K=69 THEN CALL GCHAR(PX-1,PY+2,Q) :: IF Q>104 THEN 260 ELSE PX=PX-1 :: GOTO 330
290 IF K=83 THEN CALL GCHAR(PX,PY+1,Q) :: IF Q>104 THEN 260 ELSE PY=PY-1 :: GOTO 330
300 IF K=68 THEN CALL GCHAR(PX,PY+3,Q) :: IF Q>104 THEN 260 ELSE PY=PY+1 :: GOTO 330
310 IF K=88 THEN CALL GCHAR(PX+1,PY+2,Q) :: IF Q>104 THEN 260 ELSE PX=PX+1 :: GOTO 330

314 REM THIS IS THE "EXAMINE" SUB
315 IF K=32 THEN GOSUB 2000
320 GOTO 260


330 REM       this determines the boundaries onscreen and sets the map to be drawn by assembly routine
340 REM       PX, PY are the current player's position on the screen
350 REM       MX, MY are the designations for which map will be drawn
360 IF PX<11 THEN PX=22 :: MY=MY-1 :: GOTO 400
370 IF PX>22 THEN PX=11 :: MY=MY+1 :: GOTO 400
380 IF PY<1 THEN PY=28 :: MX=MX-1 :: GOTO 400
390 IF PY>28 THEN PY=1 :: MX=MX+1 :: GOTO 400
400 IF MX<1 THEN MX=1 ELSE IF MX>2 THEN MX=2
410 IF MY<1 THEN MY=1 ELSE IF MY>6 THEN MY=6
420 GOTO 220


2000 REM "EXAMINE"
2010 DISPLAY AT(1,1):"WHICH DIRECTION?";
2015 CALL KEY(0,K,S) :: IF S=0 THEN 2015
2020 IF K=69 THEN CALL GCHAR(PX-1,PY+2,Q):: IF Q=115 THEN GOTO 3000 ELSE DISPLAY AT(1,1):"                "; :: RETURN
2030 IF K=83 THEN CALL GCHAR(PX,PY+1,Q):: IF Q=115 THEN GOTO 3000 ELSE DISPLAY AT(1,1):"                "; :: RETURN
2040 IF K=68 THEN CALL GCHAR(PX,PY+3,Q):: IF Q=115 THEN GOTO 3000 ELSE DISPLAY AT(1,1):"                "; :: RETURN
2050 IF K=88 THEN CALL GCHAR(PX+1,PY+2,Q):: IF Q=115 THEN GOTO 3000 ELSE DISPLAY AT(1,1):"                "; :: RETURN
2055 GOTO 2015
3000 DISPLAY AT(1,1):"YOU FOUND A BROADSWORD";"ADD TO INVENTORY? (Y/N)";
3010 CALL KEY(0,K,S) :: IF S=0 THEN 3010
3015 IF K=89 THEN DISPLAY AT(1,1):"                      ";"                       ";:: RETURN
3020 IF K=78 THEN DISPLAY AT(1,1):"                      ";"                       ";:: RETURN
3030 GOTO 3010

9000 REM       **END MAIN GAME LOOP**



9500 REM       **SUB TO CALL THE ASSEMBLY ROUTINE TO LOAD MAP INTO MEMORY**
10000 SUB LDAT
10010 CALL INIT
10020 CALL LOAD("DSK1.NEWFORO")
10030 SUBEND


10040 REM       **SUB TO DRAW THE MAP ONSCREEN**
10050 SUB SETMAP(MX,MY)
10060 X=MX :: Y=MY
10070 IF ADR<>0 THEN 10100
10080 CALL PEEK(16382,P,Q)
10090 ADR=P*256+Q+2
10100 Y=Y-1 :: MAP=Y*2+X
10110 IF MAP<1 OR MAP>12 THEN SUBEXIT
10120 CALL LOAD(ADR,0,MAP)
10130 CALL LINK("DRAW")
10140 SUBEND

 

 

Edited by Opry99er
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...