Jump to content

Vorticon

Members
  • Content Count

    4,690
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Vorticon


  1. 2 hours ago, JJB said:

    Really appreciate the Fortran education here Vorticon; great demos. It has been a very long time, to have it up and running on this restricted hardware is a treat.

     

    It would be quite useful if it had some string-handling capabilities added. 

    Yeah it's actually pretty impressive to have Fortran for the TI. String handling and file I/O are some of its biggest shortcomings, but the ability to use assembly language support can help compensate for that if needed. It's number crunching abilities on the other hand are outstanding.

    Surprisingly, it was super easy to pick up as a language as I was writing meaningful programs for it within a couple of days, partly because it is a very archaic language with a very limited syntax. No complex structures, records, pointers, linked lists etc... here :)

     

    • Like 1

  2. Here's another little fun demo: Explore the pyramids of Giza in 3D wireframe :) It's quite slow to render as expected, but the 3D engine was entirely written in Fortran 99 with no assembly support. It's still quite rough at the edges with no account made for fringe cases, such as going inside one of the pyramids which causes all sorts of weird stuff to happen.

     

     

     

    I based the 3D engine on the information from this excellent book from 1993. It has very lucid explanations and complete coding examples, albeit in C++, of how to approach 3D rendering. It even includes a floppy disk with all the programs he he...

     

    1629753802_FlightsofFantasy.thumb.jpg.aeb7349360cc6709b34e7a9a5d2d9503.jpg

     

    Attached is the disk image with source code and binaries. The PYRAMID program will run as an EA5 program. The controls are as follows:

     

    E: pitch down

    X: pitch up

    S: rotate left

    D : rotate right

    T: move up

    V: move down

    F: move left

    G: move right

    K: bank left

    L: bank right

    <: move back

    >: move forward

    PYRAMID.dsk

    • Like 7

  3. Since my NanoPEB died, I decided to port the wireless weather station from the TI to the CC40. It was not trivial because it required access to the RS232 at the low level, but luckily the RS232 manual did include example code on how to do this. Obviously the very limited screen real estate makes the display less attractive, but it's still completely functional. Also the footprint will be much smaller and will keep my otherwise idle CC40 computer busy :) [Link to the original 2017 project can be found in the video description]

     

     

     

    For the curious, here's the BASIC code. The resident BASIC in the CC40 is definitely more capable than the standard TI BASIC, minus the graphic functions.

     

    10 REM WIRELESS WEATHER STATION CONTROL PROGRAM
    20 REM CC40 VERSION
    30 REM BY WALID MAALOULI
    40 REM APRIL 2020
    80 REM SETUP RS232 AND SERVICE REQUESTS
    100 CALL GETMEM(17,SRPABADDR)
    110 CALL GETMEM(1,BUFFADDR)
    120 CALL SPLIT(BUFFADDR,MSB,LSB)
    130 CALL SPLIT(SRPABADDR+16,MSB2,LSB2)
    140 CALL POKE(SRPABADDR,0,0,0,MSB2,LSB2,MSB,LSB,0,0,1,0,10,0,0,0,0,20)
    150 CALL POKE(2056,MSB2,LSB2)
    160 CALL POKE(BUFFADDR,5,10)
    170 CALL EXEC(BUFFADDR)
    180 CALL PEEK(256,IOCNTRL)
    190 IOCNTRL=IOCNTRL OR 1
    200 CALL POKE(256,IOCNTRL)
    220 FOR I=1 TO 7:READ D$(I):NEXT I
    230 DATA "SUN","MON","TUE","WED","THU","FRI","SAT"
    290 OPEN #1,"20.B=9600,C=Y,P=N,D=8,E=N,T=W,O=N",INTERNAL,UPDATE,VARIABLE 1
    300 CALL IO(20,8)
    
    310 REM GET TIME AND DAY
    320 PRINT #1,"C"
    325 PAUSE(0.5)
    330 CALL PEEK(SRPABADDR+2,SFLAG)
    340 IF SFLAG=0 THEN 320
    350 CALL PEEK(BUFFADDR,HOUR)
    360 GOSUB 4000:IF SFLAG=0 THEN 320
    390 CALL PEEK(BUFFADDR,MINUTE)
    420 CALL PEEK(BUFFADDR,DOW)
    430 GOSUB 4000:IF SFLAG=0 THEN 320
    435 IF DOW<1 OR DOW>7 THEN GOSUB 4060:GOTO 320
    450 CALL PEEK(BUFFADDR,DAY)
    460 GOSUB 4000:IF SFLAG=0 THEN 320
    480 CALL PEEK(BUFFADDR,MONTH)
    490 GOSUB 4000:IF SFLAG=0 THEN 320
    510 CALL PEEK(BUFFADDR,YEAR)
    520 PRINT D$(DOW);MONTH;"/";DAY;"/";YEAR;"  ";HOUR;":";MINUTE
    530 GOSUB 4060
    
    549 REM GET HUMIDITY
    550 PRINT #1,"H"
    555 PAUSE(0.5)
    560 CALL PEEK(SRPABADDR+2,SFLAG)
    570 IF SFLAG=0 THEN 550
    580 CALL PEEK(BUFFADDR,HUMIDITY):PRINT "HUMIDITY:";HUMIDITY;"%"
    590 GOSUB 4060
    
    600 REM GET TEMPERATURE
    610 PRINT #1,"T"
    615 PAUSE(2)
    620 CALL PEEK(SRPABADDR+2,SFLAG)
    630 IF SFLAG=0 THEN 610
    640 GOSUB 4110:IF SFLAG=0 THEN 610
    650 TEMP=INT(N*9/5+32):PRINT "TEMP:";TEMP;"F"
    660 GOSUB 4060
    
    670 REM GET PRESSURE
    690 PRINT #1,"P"
    700 PAUSE(0.5)
    710 CALL PEEK(SRPABADDR+2,SFLAG)
    720 IF SFLAG=0 THEN 690
    730 GOSUB 4110:IF SFLAG=0 THEN 690
    740 PRESSURE=VAL(SEG$(STR$(N/1000),1,5))
    750 PRINT "PRESSURE:";PRESSURE;"KPA"
    760 GOSUB 4060
    
    770 REM GET WIND SPEED
    780 PRINT #1,"W"
    790 PAUSE(0.5)
    800 CALL PEEK(SRPABADDR+2,SFLAG)
    810 IF SFLAG=0 THEN 780
    820 GOSUB 4110:IF SFLAG=0 THEN 780
    830 WSPEED=N
    840 PRINT "WIND SPEED";WSPEED;"MPH"
    850 GOSUB 4060
    
    860 REM GET WIND DIRECTION
    870 PRINT #1,"D"
    880 PAUSE(0.5)
    890 CALL PEEK(SRPABADDR+2,SFLAG)
    900 IF SFLAG=0 THEN 870
    910 GOSUB 4110:IF SFLAG=0 THEN 870
    920 WDIR=N
    930 PRINT "WIND DIRECTION:";WDIR;"DEG"
    940 GOSUB 4060
    
    950 REM GET RAIN FALL
    960 PRINT #1,"R"
    970 PAUSE(0.5)
    980 CALL PEEK(SRPABADDR+2,SFLAG)
    990 IF SFLAG=0 THEN 960
    1000 GOSUB 4110:IF SFLAG=0 THEN 960
    1010 DRAIN=DRAIN+N
    1020 PRINT "RAIN TODAY:";DRAIN;"INCHES"
    1030 GOSUB 4060
    1040 GOTO 320
    
    3990 REM CHECK FOR INCOMING BYTE
    4000 COUNTER=0
    4010 CALL POKE(SRPABADDR+2,0)
    4020 CALL PEEK(SRPABADDR+2,SFLAG)
    4030 IF SFLAG=0 THEN COUNTER=COUNTER+1 ELSE RETURN
    4040 IF COUNTER>50 THEN RETURN ELSE 4020
    
    4050 REM RESET FILE
    4060 CALL IO(20,9):CLOSE #1:PAUSE(5)
    4070 OPEN #1,"20.B=9600,C=Y,P=N,D=8,E=N,T=W,O=N",UPDATE,VARIABLE 1
    4080 CALL POKE(SRPABADDR+2,0):CALL IO(20,8)
    4090 RETURN
    
    4100 REM RECEIVE STRING ROUTINE
    4110 CALL PEEK(BUFFADDR,LENGTH)
    4115 IF LENGTH>10 THEN GOSUB 4060:RETURN
    4120 FOR I=1 TO LENGTH
    4130 GOSUB 4000:IF SFLAG=0 THEN RETURN
    4140 CALL PEEK(BUFFADDR,D(I))
    4150 NEXT I
    4160 N$=""
    4170 FOR I=1 TO LENGTH:N$=N$&CHR$(D(I)):NEXT I
    4175 IF N$="" THEN GOSUB 4060:RETURN
    4180 N=VAL(N$)
    4190 RETURN
    
    5990 REM SPLIT UNSIGNED 16-BIT VALUE INTO MSB AND LSB
    6000 SUB SPLIT(DATAVAL,MSB,LSB)
    6010 MSB=INT(DATAVAL/256)
    6020 LSB=DATAVAL-MSB*256
    6030 SUBEND

     

    • Like 9

  4. Looks like in you initial set up the system library was not being located in any of the available disk drives. You solved the problem by consolidating all your disks. Obviously this would not work on real hardware unless you have DSDS drives. I tend to keep my libraries on the work disk as it simplifies life.

    • Like 2

  5. Thanks for the suggestions guys. I tried them all and confirmed that all my CF cards are good. I think the problem lies with the NanoPEB itself unfortunately. Now the only use I had for it was to connect a dedicated TI console via a wireless serial connection to my home built weather station on the deck. But fear not, I am running some tests to see if I can use my CC40 computer with the RS232 hexbus peripheral instead! If I can manage to get it to work, that would be an awesome use for that little computer which is otherwise sitting idle on a shelf... :)

    • Like 4

  6. 4 minutes ago, dhe said:

    What buttons (figuratively) need to be pressed to tell classic99 to enable the p-code card?

    None. Just select p-code card from the cartridge menu and use the DSK images for the system. You will probably need to initialize a blank disk from within Pascal  to use as a work disk as well.

    ASM-LNK.DSK COMPILER.DSK EDT-FIL.DSK p-System Program Development.pdf UCSD_p_system_Assembler_Linker_Part_2_Linker.pdf UCSD_p_system_Compiler.pdf UCSD_p_system_Editor_Files_Utilities_Part_1_Editor.pdf UCSD_p_system_Assembler_Linker_Part_1_Assembler.pdf UCSD_p_system_Editor_Files_Utilities_Part_2_Filer.pdf

    • Like 2
    • Thanks 1

  7. On 4/13/2020 at 6:20 AM, dhe said:

    Hi,

    Are you doing this on a  real TI, or an emulator? TurboPascal99 or UCSD?

    I have not had any issues using either MAME or Classic 99 for UCSD Pascal development after Tursi fixed the disk image issues, then transferring to real hardware using HDX. As a matter of fact, it's far better to use an emulator for development for reliability, plus you can use a modern text editor like Notepad++ and then copy and paste into the Pascal editor instead of using the latter for source code development because you are limited to 32 columns at a time in an 80 column field and the editing commands are very clunky at best. It's quite obvious that UCSD Pascal is very teletype-friendly :)

     

    • Like 1

  8. Worth a try.

    Incidentally, I double checked my CF card using TIDir, and I can read the volume list, but I cannot seem to open any volume to view the contents. Is that normal? I quick formatted the card then tried again with similar results. I tried my know working card for my CF7+ and same thing. What do you guys use to prepare the CF card? It's been a long time since I have played with it...


  9. 1 hour ago, INVISIBLE said:

    Well, if you think you'll be getting into Amateur Radio, and you want a great radio, blow your ENTIRE stimulus check on the ICOM 7300!  You can listen now, and get on the air later.

     

    1343405145_IC7300.thumb.jpg.d97b66368b4164d279942e457cfd6096.jpg

     

    << AMAZON LINK >>

     

    Back in the day the JRC NRD-545 really got my attention, but it was way out of my price range.  Now days, SDR's with all the interface activity taking place on the computer's monitor is replacing many of those higher end radios.   And yeah, sadly many of the old favorites have gone off the air.  ☹️

     

    Beautiful machine, but I would rather build a transceiver from a kit even if it's super basic. I don't know if I would need that much technology for a ham hobby even if I did qualify for a stimulus check :) 


  10. Ok a little more fun with Fortran 99. This time I'm really stressing its number crunching abilities by having it render and animate a wire frame 3D cube. The controls are:

     

    K = turn left

    L = turn right

    S = rotate left

    D = rotate right

    E = rotate up

    X = rotate down

    + = enlarge scale

    -  = reduce scale

    < = move toward screen

    > = move away from screen

    Q = quit

     

     

    The rendering speed is a blazing 1 frame every 2 seconds or so using the single precision sine/cosine functions. Obviously there are some optimizations to be had, such as using a look up table for the sine/cosine functions, but honestly even in this current state this is a very respectable rendering speed given what we are working with. I am certainly impressed with the numerical prowess of Fortran 99.

     

    Here's the main program:

    C 3D SHAPE ROTATION PROGRAM
     
          PROGRAM SHAPE3D
     
          REAL SFX, SFY, SFZ, TFX, TFY, TFZ
          REAL XANG, YANG, ZANG, CUBE_W(32)
          INTEGER CUBE_L(32), CUBE_S(16), CUBE_VL(48)
          INTEGER XORG, YORG, VDIST
     
          DATA CUBE_L /-10,-10,10,1, 10,-10,10,1, 10,10,10,1,
         !             -10,10,10,1, -10,-10,-10,1, 10,-10,-10,1,
         !             10,10,-10,1, -10,10,-10,1/
     
          DATA CUBE_VL /1,2,3,4, 3,4,5,6, 5,6,7,8, 7,8,1,2, 9,10,
         !              11,12, 11,12,13,14, 13,14,15,16, 15,16,9,10,
         !              1,2,9,10, 3,4,11,12, 5,6,13,14, 7,8,15,16/
     
          XORG = 125
          YORG = 99
          SFX = 2
          SFY = 2
          SFZ = 2
          TFX = 0
          TFY = 0
          TFZ = 100
          XANG = 1.1
          YANG = 0.6
          ZANG = 0.3
          VDIST = 150
     
          CALL FILES(1)
          CALL SETMOD(4)
          CALL SCREEN(2, 2)
     
          DO WHILE(.TRUE.)
            CALL CLEAR
     
            CALL TRFM(SFX,SFY,SFZ,TFX,TFY,TFZ,XANG,YANG,ZANG,32,16,48,
         !          CUBE_L,CUBE_W,CUBE_S,CUBE_VL,XORG,YORG,VDIST)
     
    10      CALL KEY(0, KEYC, ISTATUS)
            IF (ISTATUS .EQ. 0) GOTO 10
     
            IF (KEYC .EQ. 88) THEN
              XANG = XANG + 0.2
              IF (XANG .GT. 6.2) XANG = 0
            ENDIF
     
            IF (KEYC .EQ. 69) THEN
              XANG = XANG - 0.2
              IF (XANG .LT. 0) XANG = 6.2
            ENDIF
     
            IF (KEYC .EQ. 83) THEN
              YANG = YANG - 0.2
              IF (YANG .LT. 0) YANG = 6.2
            ENDIF
     
            IF (KEYC .EQ. 68) THEN
              YANG = YANG + 0.2
              IF (YANG .GT. 6.2) YANG = 0
            ENDIF
     
            IF (KEYC .EQ. 75) THEN
              ZANG = ZANG - 0.2
              IF (ZANG .LT. 0) ZANG = 6.2
            ENDIF
     
            IF (KEYC .EQ. 76) THEN
              ZANG = ZANG + 0.2
              IF (ZANG .GT. 6.2) ZANG = 0
            ENDIF
     
            IF (KEYC .EQ. 43) THEN
              SFX = SFX + 1
              SFY = SFY + 1
              SFZ = SFZ + 1
            ENDIF
     
            IF (KEYC .EQ. 45) THEN
              SFX = SFX - 1
              SFY = SFY - 1
              SFZ = SFZ - 1
            ENDIF
     
            IF (KEYC .EQ. 60) TFZ = TFZ - 10
     
            IF (KEYC .EQ. 62) TFZ = TFZ + 10
     
            IF (KEYC .EQ. 81) STOP
     
          REPEAT
     
          STOP
          END

    And here's the transformations subroutine:

     

    C 3D VECTOR TRANSFORMATION ROUTINE
     
          SUBROUTINE TRFM(SX,SY,SZ,TX,TY,TZ,AX,AY,AZ,S1,S2,S3,
         !                ARL,ARW,ARS,LIST,XO,YO,VD)
     
          REAL ZROT(4,4), XROT(4,4), YROT(4,4)
          REAL MASTER(4,4), MASTER1(4,4), MASTER2(4,4), MASTER3(4,4)
          REAL SCALE(4,4), TRANS(4,4)
          REAL SX, SY, SZ, TX, TY, TZ, AX, AY, AZ
          INTEGER S1, S2, S3, ARL(S1), ARS(S2), LIST(S3)
          INTEGER VD,XO,YO
          REAL ARW(S1)
     
          SCALE(1,1) = SX
          SCALE(2,2) = SY
          SCALE(3,3) = SZ
          SCALE(4,4) = 1
     
          TRANS(4,1) = TX
          TRANS(4,2) = TY
          TRANS(4,3) = TZ
          TRANS(1,1) = 1
          TRANS(2,2) = 1
          TRANS(3,3) = 1
          TRANS(4,4) = 1
     
          XROT(1,1) = 1
          XROT(2,2) = COS(AX)
          XROT(2,3) = SIN(AX)
          XROT(3,2) = -SIN(AX)
          XROT(3,3) = COS(AX)
          XROT(4,4) = 1
     
          YROT(1,1) = COS(AY)
          YROT(1,3) = -SIN(AY)
          YROT(2,2) = 1
          YROT(3,1) = SIN(AY)
          YROT(3,3) = COS(AY)
          YROT(4,4) = 1
     
          ZROT(1,1) = COS(AZ)
          ZROT(1,2) = SIN(AZ)
          ZROT(2,1) = -SIN(AZ)
          ZROT(2,2) = COS(AZ)
          ZROT(3,3) = 1
          ZROT(4,4) = 1
     
          DO 10 I = 1, 4
            DO 20 J = 1, 4
              MASTER1(I,J) = 0
              DO 30 K = 1, 4
    30          MASTER1(I,J) = MASTER1(I,J) + SCALE(I,K) * TRANS(K,J)
    20      CONTINUE
    10    CONTINUE
     
          DO 40 I = 1, 4
            DO 50 J = 1, 4
              MASTER2(I,J) = 0
              DO 60 K = 1, 4
    60          MASTER2(I,J) = MASTER2(I,J) + XROT(I,K) * MASTER1(K,J)
    50      CONTINUE
    40    CONTINUE
     
          DO 70 I = 1, 4
            DO 80 J = 1, 4
              MASTER3(I,J) = 0
              DO 90 K = 1, 4
    90          MASTER3(I,J) = MASTER3(I,J) + YROT(I,K) * MASTER2(K,J)
    80      CONTINUE
    70    CONTINUE
     
          DO 100 I = 1, 4
            DO 110 J = 1, 4
              MASTER(I,J) = 0
          DO 120 K = 1, 4
    120         MASTER(I,J) = MASTER(I,J) + ZROT(I,K) * MASTER3(K,J)
    110     CONTINUE
    100   CONTINUE
     
          DO 160 I = 1, S1, 4
            ARW(I) = ARL(I) * MASTER(1,1) + ARL(I+1) * MASTER(2,1) +
         !           ARL(I+2) * MASTER(3,1) + MASTER(4,1)
            ARW(I+1) = ARL(I) * MASTER(1,2) + ARL(I+1) * MASTER(2,2) +
         !             ARL(I+2) * MASTER(3,2) + MASTER(4,2)
            ARW(I+2) = ARL(I) * MASTER(1,3) + ARL(I+1) * MASTER(2,3) +
         !             ARL(I+2) * MASTER(3,3) + MASTER(4,3)
            ARW(I+3) = ARL(I) * MASTER(1,4) + ARL(I+1) * MASTER(2,4) +
         !             ARL(I+2) * MASTER(3,4) + MASTER(4,4)
    160   CONTINUE
     
          J = 1
          DO 170 I = 1, S1, 4
            ARS(J) = IFIX(VD * ARW(I) / ARW(I+2))
            ARS(J+1) = IFIX(VD * ARW(I+1) / ARW(I+2))
            J = J + 2
    170   CONTINUE
     
          DO 180 I = 1, S3, 4
            IX1 = LIST(I)
            IY1 = LIST(I+1)
            IX2 = LIST(I+2)
            IY2 = LIST(I+3)
            CALL SETVEC(ARS(IX1) + XO, ARS(IY1) + YO,
         !              ARS(IX2) + XO, ARS(IY2) + YO, 16, 1)
    180   CONTINUE
     
          RETURN
          END

     

    • Like 7

  11. Thanks for input guys. Ham has come a long way from when I first started contemplating it back in the mid-90's at the prodding of a ham colleague! I have been a shortwave listener for several decades, although I'm not nearly as active as I used to be in that domain because the Midwest sucks when it comes to receiving international broadcasts without a massive antenna (good luck getting the wife to let me put up something like that in the backyard :) ) but also mostly because a lot of the interesting stations have either curtailed short wave operations or discontinued them altogether. My radio is the Sony ICF 2010 from when Sony still made quality electronics. Sadly it's been long out of production... I have used it to decode RTTY transmissions initially with my Commodore 128D and more recently using a software solution, but it's been a while. I should go back to that.

     

    http://www.mwcircle.org/mw_rec_2001d.htm

     

     


  12. Is the NanoPEB serviceable at all? Mine finally died after 3 years of 24/7 use. I just get the F18A screen when I power it up. I changed the IDE to CF adapter, the power supply, cleaned the contacts but with no luck. Is anyone able to diagnose and repair them?


  13. That's too bad. But then it's not really the best Pascal version to use anyway and UCSD Pascal already runs perfectly in MAME :)

    Fortran 99 crammed so much in that package that it makes me wonder why WipoSoft was not able (or willing) to come up with a full Pascal implementation. No to mention that bone-headed memory protection scheme...


  14. 1 hour ago, mizapf said:

    I'll have to search through my collection. Maybe you can send me your copy so I can see whether it is really a corruption. I seem to remember that there was a glitch with the loader, which assumed that an unused memory space looks like FF00FF00...

    I don't actually own the original package. I just used the disk images in the pinned Development Resources thread on this forum...

×
×
  • Create New...