gekido_ken Posted August 12, 2019 Share Posted August 12, 2019 (edited) Hi guys! I recently started an old project for TI99, TI-L.E.M. a conversion of the original game developed by Philsan for ATARI VCS. Recently I managed to develop a pseudo-random lunar soil generation system and an algorithm that identifies the ideal moon landing point. I also managed to compress the intro image, but I noticed that in this case I can't use the access to the VDP registers to turn off the video signal during the construction of the graphic and turn it back on at the end of it. https://youtu.be/bjuCckI7v80 The form in which the system normally works is this: REM DRAW MAP(S) 1420 CALL CLEAR 1423 CALL LOAD(14864,128) 1425 CALL LINK("SCREEN",-1391) 1430 RESTORE 900 1440 READ W,H,SC::CALL SCREEN(SC)::CALL CLEAR 1450 FOR Y=1 TO H 1460 FOR X=1 TO W 1470 READ CP::CALL VCHAR(Y,X,CP) 1480 NEXT X 1490 NEXT Y 1495 CALL LINK("SCREEN",-1327) 1500 CALL KEY(0,K,S)::IF S=0 THEN 1500 1510 END While in this form it does not work: 50 CALL LINK("SCRN2") 70 CALL LOAD(14864,128) 80 CALL LINK("SCREEN",-1391) 100 restore 30000 110 read a$ :: if a$="" then 2600 :: call link("CWRITE",a$) :: goto 110 120 CALL LINK("SCREEN",-1327) Ok master friends, someone can help me? Thanks Edited August 12, 2019 by gekido_ken 3 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 12, 2019 Share Posted August 12, 2019 I can't see why that wouldn't work. Remember that the CALL LOAD(14864,128) should only be there when running in XB256. It should not be there in the compiled program. Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted August 12, 2019 Share Posted August 12, 2019 Missing ELSE in 110 after 2600. Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 12, 2019 Author Share Posted August 12, 2019 1 hour ago, FarmerPotato said: Missing ELSE in 110 after 2600. ELSE isn't supported on XB256 Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 12, 2019 Author Share Posted August 12, 2019 1 hour ago, senior_falcon said: I can't see why that wouldn't work. Remember that the CALL LOAD(14864,128) should only be there when running in XB256. It should not be there in the compiled program. I'm using XB256 in ISABELLA Package Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 12, 2019 Share Posted August 12, 2019 1 hour ago, gekido_ken said: ELSE isn't supported on XB256 You may be confusing XB256 with the compiler. IF THEN ELSE works exactly the same in XB256 as it does in XB. That's because XB256 is Extended BASIC with some assembly subroutines. At one time compiled code only supported TI BASIC style IF THEN ELSE. That is no longer the case and ISABELLA6 should run those statements just like in XB. In any case, ELSE is optional in line 110 in both XB256 and compiled code. Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 12, 2019 Author Share Posted August 12, 2019 (edited) 3 hours ago, senior_falcon said: You may be confusing XB256 with the compiler. IF THEN ELSE works exactly the same in XB256 as it does in XB. That's because XB256 is Extended BASIC with some assembly subroutines. At one time compiled code only supported TI BASIC style IF THEN ELSE. That is no longer the case and ISABELLA6 should run those statements just like in XB. In any case, ELSE is optional in line 110 in both XB256 and compiled code. As I wrote in the topic, the game will eventually be compiled. However, the compression procedure is done with XB 256 by adding the line CALL COMPRESS (1) after the section that redefines the screen. Edited August 12, 2019 by gekido_ken Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 13, 2019 Share Posted August 13, 2019 This works as it should: 10 CALL LINK("SCRN2"):: RESTORE 30001 12 CALL SCREEN(2) 15 CALL LOAD(14864,128):: CALL LINK("SCREEN",-1391) 20 READ A$ :: IF A$="" THEN 30 :: CALL LINK("CWRITE",A$):: GOTO 20 30 CALL KEY(0,K,S):: IF S<1 THEN 30 40 CALL LINK("SCREEN",-1327) 50 GOTO 50 Line 12 turns the screen color black. If you omit this the screen is the default dark blue color. Line 15 blanks the screen and it stays the color set by 12. Line 20 loads the screen image but it remains invisible. Line 30 waits for you to press a key Line 40 makes the screen visible. 1 1 Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 13, 2019 Author Share Posted August 13, 2019 7 hours ago, senior_falcon said: This works as it should: 10 CALL LINK("SCRN2"):: RESTORE 30001 12 CALL SCREEN(2) 15 CALL LOAD(14864,128):: CALL LINK("SCREEN",-1391) 20 READ A$ :: IF A$="" THEN 30 :: CALL LINK("CWRITE",A$):: GOTO 20 30 CALL KEY(0,K,S):: IF S<1 THEN 30 40 CALL LINK("SCREEN",-1327) 50 GOTO 50 Line 12 turns the screen color black. If you omit this the screen is the default dark blue color. Line 15 blanks the screen and it stays the color set by 12. Line 20 loads the screen image but it remains invisible. Line 30 waits for you to press a key Line 40 makes the screen visible. Thanks, Senior, I'll try and report here. But now I've another one problem. The compiled file go in crash, it show after some glitch the intro but in crash system and some color and char glitch, with random sprite too. Doesn't the compiler work with compress data in xb256? Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 13, 2019 Author Share Posted August 13, 2019 OK, Senior, your routine works on XB 256, but remain the compiler problem. Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 13, 2019 Share Posted August 13, 2019 (edited) 1 hour ago, gekido_ken said: OK, Senior, your routine works on XB 256, but remain the compiler problem. My test program works fine, whether in XB256 or compiled. Many people have used compressed data in a compiled program. Nightstalker is one good example of this. Be sure the CALL LOAD(14864,128) is not there in the compiled version. This will cause problems if you have a large program and put the runtime routines in low memory. (Edit) Remember that RESTORE must be to a DATA statement. In XB you can RESTORE to a comment and it works fine but the compiler cannot handle that. Edited August 13, 2019 by senior_falcon Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 13, 2019 Author Share Posted August 13, 2019 (edited) 2 hours ago, senior_falcon said: My test program works fine, whether in XB256 or compiled. Many people have used compressed data in a compiled program. Nightstalker is one good example of this. Be sure the CALL LOAD(14864,128) is not there in the compiled version. This will cause problems if you have a large program and put the runtime routines in low memory. (Edit) Remember that RESTORE must be to a DATA statement. In XB you can RESTORE to a comment and it works fine but the compiler cannot handle that. Spoiler 5 CALL LINK("SCRN2") 10 RESTORE 30001 15 CALL SCREEN(2) 17 CALL LOAD(14864,128) :: CALL LINK("SCREEN",-1391) 20 READ A$ :: IF A$="" THEN 100 :: CALL LINK("CWRITE",A$) :: GOTO 20 100 DATA -3,16,2,-2,15,6,-1,16,2,0,6,2,1,15,2,2,2,5,3,6,5,4,16,2 110 DATA 5,15,2,6,16,2,7,16,2,8,15,2,9,15,2,10,15,2,11,15,2,12,2,15 120 DATA 13,2,15,14,2,15,15,16,15,16,15,2,17,16,2,18,15,2,19,16,2,20,2,15 130 DATA 21,15,2,22,15,2,23,15,2,24,15,2,25,2,15 2490 CALL LINK("SCRN2") 2500 RESTORE 100 :: FOR C=1 TO 29 :: READ CS,CF,CB :: CALL LINK("COLOR2",CS,CF,CB) :: NEXT C 2550 CALL LINK("SCREEN",-1327) 2600 CALL KEY(0,K,S) :: IF S=0 THEN 2600 2610 CALL CLEAR 3000 CALL CLEAR :: CALL LINK("SCRN2") :: CALL MAGNIFY(3) 3100 CALL LINK("SCREEN",2) :: CALL LINK("CHSET2") 3500 DATA 32,"00000000000000000000001F386F52E50000000000000000000000F81CF64AA7" 3510 DATA 36,"01035331761F3F7F7F7F3E000B000000C0E0E0C018FCFCFCFCF8B000C0000000" 3520 DATA 40,"01025221461F384B5C77240000000000E030B0E018F48C14A4F8300000000000" 3530 DATA 44,"000000000000000000000003AD06000000000000000000000000000080000000" 3540 DATA 48,"000000000000000000000000010000000000000000000000000000C0B5600000" 3550 DATA 52,"000102030100020000000000000000000040A0A04040A0800080000000000000" 3560 DATA 56,"0044004400444400FFFF0066000000000022002200222200FFFF003600000000" 3600 RESTORE 3500 :: FOR S=1 TO 7 :: READ CHS,PS$ :: CALL CHAR(CHS,PS$) :: NEXT S 4000 DATA 1,11,1,2,16,1,3,10,2,4,10,2,5,10,2,6,10,2,7,10,2,8,7,2 4010 DATA 9,15,2 5000 DATA 32,"0000000000000000",33,"0010101010100010",34,"0028282800000000",35,"0028287C287C2828" 5010 DATA 36,"0038545038145438",37,"00AAAAAAAAAAAA00",38,"0020505020544834",39,"0008081000000000" 5020 DATA 40,"000000FFEF48D5A2",41,"000000FFF712AB45",42,"000028107C102800",43,"000010107C101000" 5030 DATA 44,"0000000000301020",45,"000000007C000000",46,"0000000000001000",47,"0000040000000000" 5040 DATA 48,"00384C4C54646438",49,"0010101000101010",50,"0038440438404478",51,"0038040418040438" 5050 DATA 52,"0044444438040404",53,"0038404038040438",54,"0038404038444438",55,"0038040400040404" 5060 DATA 56,"0038444438444438",57,"0038444438040438",58,"0000303000303000",59,"0000303000301020" 5070 DATA 60,"0008102040201008",61,"0000007C007C0000",62,"0020100804081020",63,"0038440408100010" 5080 DATA 64,"00384444387C82AA",65,"0038444438444444",66,"0078444478444478",67,"0038404000404038" 5090 DATA 68,"0078444400444478",69,"0038404038404038",70,"0038404038404040",71,"0038404018444438" 5100 DATA 72,"0044444438444444",73,"0010101000101010",74,"0004040400444438",75,"0044485020504844" 5110 DATA 76,"004040400040403C",77,"00446C5410444444",78,"00444464104C4444",79,"0038444400444438" 5120 DATA 80,"0038444438404040",81,"0038444444544834",82,"0038444438504844",83,"0038444038044438" 5130 DATA 84,"007C001010001010",85,"0044444400444438",86,"0044444400442810",87,"0044444410545428" 5140 DATA 88,"0044442800284444",89,"0044442800101010",90,"007804081020403C",91,"0000010000000000" 5150 DATA 92,"0000EE00FF000000",93,"000000000000FF99",94,"0038383838383838",95,"0000800000000000" 5160 DATA 96,"0000201008000000",97,"9275EE7FEFFFDFFF",98,"34FFFF7F3EFF7DFF",99,"2A7EF7BFFEFF7FFF" 5170 DATA 100,"ABFD7FFEFFDFFEFF",101,"C47F52FFFFBFFFFB",102,"00000080C060FCAF",103,"0000000103063FF5" 6490 CALL LINK("SCRN2") 6500 RESTORE 4000 :: FOR C=1 TO 9 :: READ CS,CF,CB :: CALL LINK("COLOR2",CS,CF,CB) :: NEXT C 6510 RESTORE 5000 :: FOR C=1 TO 72 :: READ CN,CC$ :: CALL LINK("CHAR2",CN,CC$) :: NEXT C 6600 CALL LINK("SCREEN",2) 7010 CALL LINK("DISPLY",1,1,CHR$(94)&"<UNIT>"&CHR$(94)&" <SCORE> "&CHR$(94)&" <FUEL> "&CHR$(94)) 7020 CALL LINK("DISPLY",3,1,CHR$(94)&"@=> 3 "&CHR$(94)&" <0000000> "&CHR$(94)&"%%%%%%%%"&CHR$(94)) 7100 DIM LEV$(4) 7150 LEV$(0)="123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456" 7160 LEV$(1)=" gdebf gadf gbdf gaedf gbdf gf " 7170 LEV$(2)=" gbef gbbbebcfgaefgeabaedfgedf gabfgdbfgdbeafgbf gbfgaf gf gbdeabdedbadfgabf gdbaebdabef" 7180 LEV$(3)="dbebadbaedbabdbaedbababedbadbabaebdabdbaebdbaebeadbabedabdbabaebdaebdbaebdbaebdaebddbabdeabdbbda" 7190 LEV$(4)="deaebdbeadbaebbdbeabdabebdaebdabebabedbaebdaebdbaebdabebdbaebdabbdaebdbadbebabdababdabdadbeaeabb" 7500 SCORE=0 :: GRV=2 :: PWR=3 8000 RANDOMIZE 8005 FOR V=1 TO 16 :: CALL LINK("IRND",14,YSTR,31,XSTR,2,STR) :: CALL HCHAR(YSTR+4,XSTR+1,46+STR) :: NEXT V 8010 CALL LINK("IRND",63,VMAP) 8050 FOR V=0 TO 3 8100 CALL LINK("DISPLY",21+V,1,SEG$(LEV$(1+V),VMAP+1,32)) :: NEXT V 8105 CALL LINK("DISPLY",10,10,STR$(VMAP)) 8400 YPLT=18 8500 CALL LINK("IRND",30,XPLT) 8510 CALL GCHAR(YPLT,XPLT+1,CH) :: CALL LINK("DISPLY",10,14,STR$(YPLT)) :: CALL LINK("DISPLY",10,17,STR$(XPLT)) :: IF CH<>32 THEN 8512 :: GOTO 8515 8512 IF CH>=97 AND CH<=101 THEN 8520 :: GOTO 8400 8515 YPLT=YPLT+1 :: IF YPLT>23 THEN 8400 :: GOTO 8510 8520 CALL GCHAR(YPLT,XPLT+2,CH) :: CALL GCHAR(YPLT-1,XPLT+2,CH1) :: IF CH1>101 THEN 8400 :: IF CH>=97 AND CH<=101 THEN 8540 8530 GOTO 8400 8540 CALL SPRITE(#1,56,7,(YPLT-2)*8,(XPLT*8)+1) 9000 CALL KEY(0,K,S) :: IF S=0 THEN 9000 10000 CALL LINK("IRND",255,XLEM) :: YLEM=33 10050 CALL SPRITE(#3,36,16,YLEM,XLEM,#2,40,15,YLEM,XLEM,#4,32,15,YLEM,XLEM) 10200 CALL JOYST(1,X,Y) 10250 YMOV=YMOV+(GRV/2)-(Y/2) :: XMOV=XMOV+(X/2) :: CALL MOTION(#3,YMOV,XMOV,#2,YMOV,XMOV,#4,YMOV,XMOV) :: CALL POSITION(#3,YLEM,XLEM) 10260 DISPLAY AT(15,7):YLEM,XLEM :: CALL LOCATE(#2,YLEM,XLEM,#4,YLEM,XLEM) 10270 GOTO 10200 30000 !40000 30001 DATA " 30002 DATA "(ˆ`ùúûüýþ‰`™š›œžŸ¨©ª«„`¢£¤i¥i¦§``€•`ÿ i …`„` ¬®¯°±²³´…`¸¹º»¼½¾¿Š` ™šr…`‡`€Ž`€`ÀÁÂÃÄÅÆÇ¡``€”` !"#$%&'‹`È``ɇ`ÀÊËÌÍÎÏÐÑÒ¡" 30003 DATA "„`€`()*+,ƒ`-./0„`€1Š`"ÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçè23456789:;<=ƒiéii>@ƒi@A@¨iéŠié†iéƒiéé…ié‰ié¢i?BCDEFGi" 30005 !41000 30006 DATA " 30007 DATA "#ƒ 30008 DATA "‡† 30009 DATA "Ä+) 30010 DATA "h 30011 DATA "ÏÞü 30012 DATA "îòúÀààÈȘ8ð @" 30014 DATA " 30015 DATA "¢à › 30016 DATA "hƒƒƒ€ƒ@… 30017 DATA "+⬃ 30018 DATA "" Ok Senior, I haven't got it! This is compressed source in XB256 I put here the file to load with classic99 TI-LEM Edited August 13, 2019 by gekido_ken Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 13, 2019 Share Posted August 13, 2019 Line 20 reads compressed data statements until it comes to a null string. Starting at line 30001, the first one I see is in line 30018. I suspect that the comment in line 30005 in among the DATA statements is the source of your problems. Try taking that out and see if it runs properly. 1 Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 13, 2019 Author Share Posted August 13, 2019 1 hour ago, senior_falcon said: Line 20 reads compressed data statements until it comes to a null string. Starting at line 30001, the first one I see is in line 30018. I suspect that the comment in line 30005 in among the DATA statements is the source of your problems. Try taking that out and see if it runs properly. Make it!......no works...... ;( Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 14, 2019 Share Posted August 14, 2019 You cannot GOTO a DATA statement. 20 READ A$ :: IF A$="" THEN 100 :: CALL LINK("CWRITE",A$) :: GOTO 20 100 DATA -3,16,2,-2,15,6,-1,16,2,0,6,2,1,15,2,2,2,5,3,6,5,4,16,2 130 DATA 21,15,2,22,15,2,23,15,2,24,15,2,25,2,15 2490 CALL LINK("SCRN2") Line 20 should be IF A$="" THEN 2490 With that change the XB256 and compiled versions behave the same. 2 1 Quote Link to comment Share on other sites More sharing options...
gekido_ken Posted August 14, 2019 Author Share Posted August 14, 2019 18 minutes ago, senior_falcon said: You cannot GOTO a DATA statement. 20 READ A$ :: IF A$="" THEN 100 :: CALL LINK("CWRITE",A$) :: GOTO 20 100 DATA -3,16,2,-2,15,6,-1,16,2,0,6,2,1,15,2,2,2,5,3,6,5,4,16,2 130 DATA 21,15,2,22,15,2,23,15,2,24,15,2,25,2,15 2490 CALL LINK("SCRN2") Line 20 should be IF A$="" THEN 2490 With that change the XB256 and compiled versions behave the same. Ok, I'm a donkey !!? .... and blind !! Everything works now! You were very kind and patient !!! Thank you so much! Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted August 14, 2019 Share Posted August 14, 2019 Glad to help! These things can be hard to find - here it is easy to overlook because it is THEN 100 without an explicit GOTO. 00 DATA -3,16,2,-2,15,6,-1,16,2,0,6,2,1,15,2,2,2,5,3,6,5,4,16,2 110 DATA 5,15,2,6,16,2,7,16,2,8,15,2,9,15,2,10,15,2,11,15,2,12,2,15 120 DATA 13,2,15,14,2,15,15,16,15,16,15,2,17,16,2,18,15,2,19,16,2,20,2,15 130 DATA 21,15,2,22,15,2,23,15,2,24,15,2,25,2,15 2490 CALL LINK("SCRN2") 2500 RESTORE 100 :: FOR C=1 TO 29 :: READ CS,CF,CB :: CALL LINK("COLOR2",CS,CF,CB) :: NEXT C The above can be saved as a compressed data statement and loaded using the same loop that loads the screen. Of course, you would only want to do this if the colors are finalized. If you do this there is really no reason to blank the screen - creating the title screen is almost instantaneous. 2 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.