Optimizing Line Count in TI BASIC: Type-in Fun with the TI-99/4A

  Рет қаралды 36,512

8-Bit Show And Tell

8-Bit Show And Tell

Күн бұрын

Пікірлер: 229
@AndyHewco
@AndyHewco 3 жыл бұрын
The error on the GOTO line was because you'd typed GOT0 with a zero instead of an O. It's so subtle but the number 0 has rounded corners and the letter O is square. I can appreciate a zero with a cross through it on other computers all the more, but I do remember thinking the font on the TI-99 looking pretty cool. Another great video, I love old computer books and especially ones with type-in's. Much of my early days on a Vic 20 was typing in from books and magazines to try to learn as much as I could and hoping to find something special. It is a shame that a book like this would have BASIC code that is so confusing. As a beginner you would look at that and wonder or think it is the right way to do it. The reality is the author was probably just learning too and making these kind of mistakes. Just pinoneering days I guess.
@8_Bit
@8_Bit 3 жыл бұрын
Aha, you're right about the zero!! It's really obvious now that I rewatch. Bizarre that I'd do that. Yes about the author probably still learning, and the other thing is having 101 programs in a single book, many of them repeatedly ported between systems, with probably tight deadlines and/or low pay, is just moving on to the next program as soon as one works with little regard for whether it's actually good code.
@AndyHewco
@AndyHewco 3 жыл бұрын
I can imagine they'd be pressured to publish as soon as possible. That one Christmas I had my computer, my best mate had a TI-99/4a. I remember it had some great games but I don't remember its BASIC that well and certainly not the one statement per line nor the IF THEN limiations. I think that would do my nut in!
@joshhiner729
@joshhiner729 3 жыл бұрын
I think the author could also be attempting the balance between readability and simplicity. As you simplify many times you start using advanced features or math that are scary for new users to see and definitely hard to understand. The program IS huge difficult spaghetti code though which is hard to read. Its very… literal/spelled out though which may also be why the author wrote it as such. Just an idea.
@eugenetswong
@eugenetswong 2 жыл бұрын
@@joshhiner729 Good thinking!
@ronb6182
@ronb6182 Жыл бұрын
I'm glad some computers will take a zero and make it an O we have come a long way in word processing even misspelled words get corrected automatically and my phone went overboard with that feature I have to go back a put the original text because it changes the word and it can be a pain to un- correct to the word I wanted to write even 8 bit in another sentence was 8 but when the correction took place. Sometimes we have to take the bad with the good. 73
@oleimann
@oleimann 3 жыл бұрын
You can add a couple of lines to turning the standing (current) location into a hollow square (char 129, "FF818181818181FF"), putting the plotting of the hollow square before the key-get, and filled when key pressed (before the changes), then returning to the hollow plot after the location updates. Lines used: clear,char128,char129,r=1,c=1,plot129,getkey, if(nokey):back-to-getkey, plot128,r-adjust,c-adjust, back-to-plot129: 12 lines with proper r,c init. Drawing lines when you know where your "cursor" is works much easier as a tool :)
@merykjenkins3274
@merykjenkins3274 3 жыл бұрын
Oh the joys of cross referencing a book of basic programs not designed for your computer against the user manual to find the correct syntax. I think I learned as much from that as from writing my own programs. That was some amazing optimisation Robin!
@superscatboy
@superscatboy 3 жыл бұрын
Although unintended, it *was* a great way to learn. I had a ZX Spectrum at home, and the two programming books my school library had were for BBC BASIC. It was an experience converting all those listings! Thankfully, the ZX BASIC manual was so excellent that even a clueless 11 year old could get there in the end :)
@IndianapolisGerry
@IndianapolisGerry 3 жыл бұрын
I learned more in the 1980's by typing in code that I have in classes I have spent thousands of dollars for.
@haroldlane4647
@haroldlane4647 3 жыл бұрын
Same here! I was buying Commodore mags but only had a Timex Sinclair 1000 that I had cobbled together from 2 surplus units (2/$18). Great times…
@jessefinnegan1719
@jessefinnegan1719 3 жыл бұрын
Sadly this was why I never learned anything as a kid. I didn't have a book telling me the syntax for the code I was typing in (Our computers where always given to us second hand). So when it would invariably contain an error, I had no idea what I did wrong.
@anjinmiura6708
@anjinmiura6708 3 жыл бұрын
OMFG! The complex R=R-()/C=C-() is awesome. I was totally able to follow along but I'll have to admit I wouldn't have thought of doing it that way.
@Reginoid
@Reginoid 3 жыл бұрын
omg, I used to do that boolean formula trick too when I was a kid. you need abs() when it matters, and combining with on X goto or on x gosub can further shrink the line count. I love it, show off :P. I had an old Advanced BASIC instructor who refused to believe that my code would run until I showed her that it did, lol, good times.
@robertsmith9807
@robertsmith9807 3 жыл бұрын
This was my first computer. Love it!
@sourcecode6467
@sourcecode6467 2 жыл бұрын
I'd be lying if I said I wasn't slightly jealous
@michaelkramer5199
@michaelkramer5199 2 жыл бұрын
Also my first computer. I had it and used it from probably 1979 to 1993, even after I had a 286. He's brought back a lot of memories in shortening up the code. I remember using boolean logic statements like that for keyboard control and replacing sections of spaghetti code like that in programs from BASIC programs books of games for navigating mazes or flying your sprite around the screen. Great memories!
@config2000
@config2000 3 жыл бұрын
I do enjoy learning little tricks in how to reduce code. I use code reduction tricks in modern-day languages where they support such evaluations. For instance moving a player left/right via cursors. My shortcut code trick is: dx=-keydown.left+keydown.right which in some languages equates to -1 for left, 0 = no movement, and 1 for right.
@AngusArthur
@AngusArthur 3 жыл бұрын
Figuring out bits of logic like you show is such a pleasure. Not that I code much or have often been clever enough see the chance to use it. When it works I find the sums fun to look at. So much work in so little space.
@MyChannel-vm6dw
@MyChannel-vm6dw 3 жыл бұрын
LOVE the TI 994a stuff....keep it coming. Very interesting computer and very little youtube content and I simply LOVE they way you approach these computers in interesting and different ways.
@davidgari3240
@davidgari3240 3 жыл бұрын
I'm impressed by the astonishing number and quality of the Old Guys' comments, and as an OG myself involved with all manner of software on microcomputers from the PDP-8, Altair, IMSAI, et al. - also impressed with your Vulcan logic. Awsome to the max!
@visitandolosclasicos
@visitandolosclasicos 3 жыл бұрын
"The Texas Instruments TI 99 / 2 (in-house named "Ground Squirrel") was intended to compete in a lower price range than the TI 99/4A (i.e. in the same range that the Sinclair Spectrum). But when the price war with Commodore forced TI to slash the price of a 99/4A to that level, there was no market for the 99/2 anymore. Therefore, this prototype never made it to the shelves of the computer shops." - old-computer museum
@lidarman2
@lidarman2 3 жыл бұрын
Love the optimization tricks. Nice work. I remember when I was learning to program the ZX81, I saw some boolean math tricks on programs I typed in. I was so puzzled, I figure them out and starting using them to make my Dungeon program fit in 16k. That's the early 80s for you, hobby computers and dungeons and dragons.
@blatherskite3009
@blatherskite3009 2 жыл бұрын
True. Learning BASIC and playing D&D really seemed to go together in that early-80s era. I recall a section in the Dungeon Master's Guide explaining to DMs how they should interpret player's commands given to undead creatures under their control absolutely literally, e.g. a command to "attack anyone who enters this room" would also apply to the player themselves unless they explicitly stated "except me." That communicated something profound to me about the nature of programming computers, i.e. that coding is all about spelling out to the computer exactly what you want it to do in 100% watertight language with nothing assumed or taken for granted - because it has no "intelligence" with which to interpret the intent of your commands; it just dumbly follows the strict letter of the instructions you gave it. If it fails to do what you want it to do then that's on you, because it means there's some error or omission in the way you worded the task. BASICally (haha) the realisation that computers were a lot like D&D skeleton guards was what made coding "click" with me :)
@eugenetswong
@eugenetswong 2 жыл бұрын
Your new version of R is a good way of checking for the joystick usage in the left-right and the up-down directions. I got this tip from a magazine article for the joystick check, which sped up the action. The amazing thing is the new code looks so intimidating to beginner and intermediate programmers, but once they know its intent, it is much easier to understand, because it can be understood at a glance. Your untangling might speed up the code in many instances for Atari, because each goto forces Atari to start at the beginning of the code and search for the destination line number; but you probably knew this.
@galier2
@galier2 3 жыл бұрын
Time to get TI Extended BASIC. Then you can avoid the goto spaghetti as then/else can be followed by statement. Also multiple statements per line (separator is 2 colons :: not 1 : but don't be afraid, it is encoded just as one token in memory). Sprites, named subroutines, call peek and call poke (if you have memory extension) are then bonus.
@arcadeshopper
@arcadeshopper 3 жыл бұрын
If you type a line number then hit up you go into line editing mode up and down arrow moves between lines up and down in the program
@The-Great-Gonzo
@The-Great-Gonzo 2 жыл бұрын
All these early computers had their advantages and disadvantages. I enjoy tinkering with all these computers. I am one that did grow up with the TI 99/4a so it has a special place in my heart. Plus it was a major upgrade for me from my 2600.
@NeilRoy
@NeilRoy 3 жыл бұрын
That has to be the most GOTO's I have ever seen in a program, wow.
@Jburton561
@Jburton561 Жыл бұрын
I used to be a TI user. A little tip when writing a program, start with NUM 10 enter. And then it’ll start with the number 10 and every time you hit enter it will start with the next number by tens so 20 then 30 etc.
@echandler
@echandler 2 жыл бұрын
Nice trip down memory lane. These tricks were common on the Apple 2 in Applesoft Basic. Using a boolean in an arithmetic expression can eliminate the need for some IFs and GOTOs, as well simplifying some defined functions. Be aware that sometimes TRUE is represented as -1 instead of the expected 1 in some environments.
@00Skyfox
@00Skyfox 3 жыл бұрын
I remember taking "computer class" in the 3rd grade back in '83. They had a large broom closet set up with 5 or 6 of these TI-99 computers. All I remember of it was that I was sitting next to a girl I thought was really pretty, so clearly I didn't pay much attention to the class. That was around the time we got our VIC-20, followed by a C64, so I learned a great deal more about Commodore BASIC than TI-99 BASIC.
@gklinger
@gklinger 3 жыл бұрын
"In short, this is here to help you keep from getting zapped while you're computing." There's an electrical short joke in there somewhere but I'll be darned if I can find it.
@StephenCameron
@StephenCameron 3 жыл бұрын
One trick I remember for TI BASIC when typing in programs for other computers: TI BASIC didn't have AND or OR operators in IF statements which made typing in programs for other BASICs that did have these operators a giant pain, but, you could use multiplication (*) and addition (+) in place of them, respectively, because TRUE is 1 and False is 0. TI extended basic did have AND and OR, iirc. I see the video covers this around 38:00
@PoignantPirate
@PoignantPirate 3 жыл бұрын
I can see where the excess GOTO lines at 370, 380, 390 could be useful for mentally separating the code into sections similar to functions or variables while you're writing it. Especially 370 and 390, they're *currently* jumping back to the same code, but if the logic for the sections jumping to 370 or 390 had diverged, it would be easier to edit that one line VS needing to go through and replace every other or every third instance of GOTO 50 throughout the proceeding sections to point at a new line.
@TrebleWing
@TrebleWing 3 жыл бұрын
Never knew basic had those nifty (comparisons) like you showed. That is a very clever little trick!
@BoxOfFeet
@BoxOfFeet 3 жыл бұрын
This is awesome. I don't do much programming on my 99/4A. But I do use my TI-74 Basicalc quite a bit. That uses TI BASIC. Well, mostly. It only has one line of text, so no graphical functions. But I just checked, and it can use the boolean comparisons you were showing. Reducing program size is always welcome there. It has 8K onboard, and I have an 8K cart for it, but I have several programs I use for work and have filled those both up.
@JustWasted3HoursHere
@JustWasted3HoursHere 3 жыл бұрын
Yes, very strange that the TI did not come with a backspace key. But I guess one could get used to it after a while.
@arcadeshopper
@arcadeshopper 3 жыл бұрын
There was zero chance of getting an electrical shock from the aluminum case first off because it is lacquered and therefore you're not really touching aluminum and then secondly because it is not attached to the computer in any way except for through the plastic part of the case. The only part where you could theoretically get an electrical shock was one of the ground points or the expansion slot. However, you had to have a bad electrical issue in your house to even get a fault. The issue was something that they only could reproduce in a lab and all that pigtail does is add a fuse. So if you start drawing too much electricity it blows the fuse
@MakersEase
@MakersEase 3 жыл бұрын
My first computer was the TI 99/4a... I did so much basic programming on it. I so wanted the extended basic cartridge......
@mal2ksc
@mal2ksc 3 жыл бұрын
I still do plenty of Boolean logic that looks just like this, except it's in a spreadsheet, where TRUE is equal to 1 rather than -1. For example, figuring out a D&D character's spellcasting equivalent level (for multiclassing) using just one formula and one cell to do it. It's less convoluted and less prone to breakage than nested *if()* statements.
@kojsbarv
@kojsbarv 2 жыл бұрын
Great vid, and liked the music in the end
@Nightshft42
@Nightshft42 2 жыл бұрын
I grew up with a C64. And before owning a floppy, which came later (as it did cost as much as the computer itself) it all was about tapes or typing programs in. Loading from tape was an adventure as you hoped there'd be no read error. And typing in games was an adventure as you hoped you'd find all of your §$%& typing errors =P I'm not keen about typing in basic listings again, but I love how you show these books! I still have Michael Crichtons "electronic life" which is a nice read too.
@AtariForeva
@AtariForeva Жыл бұрын
This is a really nice TI, I just got mine for CAN $20 with joysticks and all, picking it up tomorrow.
@sammy61187
@sammy61187 3 жыл бұрын
Awesome video coding has alwaya seemed so complex but watching your videos im starting to understand
@CanadianRetroThings
@CanadianRetroThings 3 жыл бұрын
The TRS-80 Model 12/16 were business machines that were the replacement for the model 2.
@CrystalTikal
@CrystalTikal 3 жыл бұрын
Two things: 1. When I first saw the title, I thought this was about the graphing calculators. 2. I have a Choose Your Own Adventure book with all the CYOA segments in code called MicroAdventures: Space Attack! that includes code for the TI 99/4A. I got it from a book trade at my middle school in 2009.
@8_Bit
@8_Bit 3 жыл бұрын
Apparently the calculator language is called TI-BASIC and the computer language is TI BASIC. Not much difference! I've now got the complete MicroAdventure series, they're great. They really had to adapt the code for the TI-99/4a the most, and ended up dropping it from the last few books in the series.
@PeBoVision
@PeBoVision 3 жыл бұрын
I cut my teeth on TI-Basic...specifically typing in magazine listings. As soon as I caught on to how things worked, I started optimizing those listing. (Essential when you only have 16k or 48k to work with.) This videos brought back so many of those memories.
@themadatheist1976
@themadatheist1976 3 жыл бұрын
Family had the 4a, including the the voice box and massive expansion box with disk drive and a variety of expansion cards inside. Had that book at 2:42 and tried to type that game on the front cover into the system but never finished.
@cairsahrstjoseph996
@cairsahrstjoseph996 3 жыл бұрын
I'm glad God saw fit to have these computers created.
@rog2224
@rog2224 3 жыл бұрын
One of the great gotchas on the TI was hitting Func - + rather than P Rshift -0 or Rshift-+. Usually down to fatigue in the small hours (while doped on benadryl, since it was the summer 0f 83) could make your typing sloppy. Huge program, lots of CHAR lines, and suddenly you're back at the beep and the splash screen.
@Dedicatedtolivinginthepast
@Dedicatedtolivinginthepast 2 жыл бұрын
You are really good at this modern art stuff!
@hugovangalen
@hugovangalen 3 жыл бұрын
Don't know if anyone mentioned it, but the "fixed" version also properly plots the block at 1,1.
@domramsey
@domramsey 3 жыл бұрын
The TI-CC40 was a portable computer with a built-in single line display. I think it was such an abject failure that you can still find them New Old Stock in unopened boxes.
@MrWaalkman
@MrWaalkman 3 жыл бұрын
Exactly how I got mine. :)
@jcrouzzo
@jcrouzzo 3 жыл бұрын
I am amazed nobody else commented on what beautiful handwriting Greg Pettigrew has. I wish mine looked like that!
@Nostrum84
@Nostrum84 3 жыл бұрын
The shorter code version is shorter for sure, but it definitely runs slower now :) compare 27:52 and 39:49
@JustWasted3HoursHere
@JustWasted3HoursHere 3 жыл бұрын
That boolean replacement code is clever, though it does run noticeably slower. The TI runs 3 times faster than the Commodore 64 at 3 mhz and has a 16 bit processor, but it almost always seems to run slower such as in this BASIC example due to the inefficiency of the TMS9900 processor in comparison to the C64's 6510 (or even just a run-of-the-mill 6502).
@arcadeshopper
@arcadeshopper 3 жыл бұрын
It has nothing to do with the processor it has to do with the fact that TI basic is double interpreted from basic to GPL to assembly language. This slows down the computer immensely. Versions of extended basic and cortex basic show the speed of the computer and assembly language of course run circles around all of that.
@JustWasted3HoursHere
@JustWasted3HoursHere 3 жыл бұрын
@@arcadeshopper The TMS9900 processor is not as efficient as the 65xx series. Whereas the 65xx line can do most operations in a few cycles, the TMS9900 takes 8-12 cycles on average, negating any clockspeed advantage it might have had. Even their non-BASIC games run very slowly,* so that BASIC->GPL->machine code does not fully explain the slowness. * Apparently, although the processor is 16 bits, only the system ROM and 256 bytes of scratchpad RAM can use the 16 bit bus, massively hampering the performance of the overall system. Also, TI kept the 99/4a as a mostly closed system for a very long time. If they had opened it up from the beginning perhaps third party developers could have discovered new ways to speed it up.
@arcadeshopper
@arcadeshopper 3 жыл бұрын
@@JustWasted3HoursHere on the 4/a it gets 3 times as many instructions per second, and can do math and other functions in those instructions that the 65xx can't. So the 65xx has to use more instructions to do the same work as the 9900 can do with less. also part of the slow down on the 4/a is the 16 bit cpu is multiplexed into an 8 bit buss.. so fun
@catgirlQueer
@catgirlQueer 3 жыл бұрын
@@arcadeshopper the 6502 can punch *well* above its speed class, it's incredibly efficient with its bus access, almost every cycle is a memory cycle, sure, it doesn't have hardware multiply, but software multiply on the 6502 is sometimes only marginally slower clock-for-clock when compared to hardware multiply
@arcadeshopper
@arcadeshopper 3 жыл бұрын
​@@catgirlQueer Cool, however this diverges from the topic of why TI basic is slow
@StevenIngram
@StevenIngram 3 жыл бұрын
Thanks for pointing to your 10 line adventure. I'm going to check that out. :)
@TomaszWiszkowski
@TomaszWiszkowski 3 жыл бұрын
Ahhh the beauty of optimization.. You are absolutely right Robin. I am just not sure all these kids (myself back then included) would be able to reason about this code just the same way.. heck, even today some of the optimizations i come across require a lot of brain gymnastics and it's so hard to make changes.. Your middle solution was pretty well balanced though! That was a lot of fun to watch!
@NotMarkKnopfler
@NotMarkKnopfler 3 жыл бұрын
That TI looks like it rolled off the production line just yesterday. Always was a beautiful looking machine and still is.
@LeftoverBeefcake
@LeftoverBeefcake 3 жыл бұрын
Been working on my little graphics transmitting and display project and getting reacquainted with the C64's BASIC, and after seeing this video, I'm quite glad to continue using the C64's BASIC. Although I do have a GOSUB that RETURNs to a GOTO... :)
@RonHelton
@RonHelton 3 жыл бұрын
Dictionary entry: Computer guru: see Robin ; )
@paulwratt
@paulwratt 3 жыл бұрын
The CALL word() is a "built-in" BASIC language extension, as found in MSX-BASIC. If you write a memory dump program you will come across the BASIC keywords, which may have +/-128 in either the 1st, 3rd, or last character, with a 2 byte JMP value where the actual routine starts. The CALL routine doues a table look on _word_ , which will be "outside" the BASIC-ROM (but still within the ROM boundary because thats the default for a TI99/4A), and again it will have an associated 2 byte JMP value. The CALL routine may setup some registers or locations to map to the (0,X,Y) values before it JMP's to the extension _or_ that setup may happen in the extension - I am going off memory of a paper dump listing I did of a SVI-728 at the beginning of the 1st Iraq invasion - the JMP values may be before _or_ after the keywords, I cant remember verbaitum.
@prozacgodretro
@prozacgodretro 3 жыл бұрын
Okay well I'm glad that you pointed out the safety recall. I just recently got a ti-99, it was really confused about the super glued electrical cord. I almost cut it off thinking it was just stupid, like someone hacked it on there for some reason.
@endymallorn
@endymallorn 9 ай бұрын
The funny thing is, I use that same kind of Boolean logic in my spreadsheet formulas today, and any time I do, people get astounded at how quickly I can pull huge amounts of data into a single formula and output a coherent answer.
@MatroxMillennium
@MatroxMillennium 3 жыл бұрын
The models 12 and 16 are the successors to the TRS-80 Model II, since it was really a much different setup from the rest of the TRS-80 line.
@joshhiner729
@joshhiner729 3 жыл бұрын
Great episode. Your final simplification example was awesome. As a child I remember using my friends ti99/4a. I remember the program listing being incredibly slow as your video shows. I also felt the machine as a whole seemed slow in games and other operations. I understand there were technical shortcuts taken by TI but never really understood just why a basic program listing etc was so slow. Well I guess we can assume its due to the unfortunate technical shortcuts in hardware but does anyone know if it is otherwise due to a poorly converted basic environment? Maybe a poorly optimized kernel? The specs of the unit otherwise dont appear to be that slow on paper.
@eugenetswong
@eugenetswong 2 жыл бұрын
It's been 8 months, and nobord answered yet. 1 reason is that looping for some/all computers was done by starting at the beginning of the code and going from line to line until the destination was found. Therefore speed ups are done by going to the end of the code, and back to the beginning. 10 goto 32010 20 print x 30 print y 40 goto 20 32010 x=1; y=2 32020 goto 20
@CRCO1975
@CRCO1975 2 жыл бұрын
In most home computers, BASIC was implemented as a machine language program. Slower than machine language, but generally acceptable. In the TI 99/4A, TI BASIC is implemented in a language called GPL (Graphics Programming Language). GPL is an interpreted language written in TMS 9900 machine language. Thus TI BASIC tokens are first interpreted into GPL, and then the GPL interpreter performs the machine language. TI Extended BASIC converts some of the GPL routines to machine language and runs noticeably faster. There are newer versions of Extended BASIC that are even faster.
@eugenetswong
@eugenetswong 2 жыл бұрын
@@CRCO1975 thank you sharing that info with everybody.
@yjk_ch
@yjk_ch 3 жыл бұрын
I believe these kinds of tricks are still used today when programming GPU shaders, because GPUs are really bad at branching, so branches are replaced with arithmetic operations whenever possible.
@0LoneTech
@0LoneTech 2 жыл бұрын
That is correct, although to be precise GPUs are often terrible at divergence, not branching itself. CPUs are often even worse at branching, and make immense efforts to compensate with mechanisms like speculative execution and branch prediction.
@lennartbenschop656
@lennartbenschop656 3 жыл бұрын
The ZX81 let you sketch with 64x48 'pixels', the PLOT command took care to draw the appropriate block graphics characters for you. Doing any kind high-res line drawing gets really, really, really tough on the TI 99/4A in BASIC (and slow). You can dynamically change the bit patterns of the 8x8 character cells and you have 128 distinct characters to use (32-159). You could do pixel-level function plots if you really wanted.
@SuperVorticon
@SuperVorticon 3 жыл бұрын
That actually has been done. The main limitation is the number of available characters to use for redefinition (96 were available in TI Basic) , so full screen bitmaps are out of the question, but . And as you said, it is painfully slow...
@tabachanker8716
@tabachanker8716 3 жыл бұрын
I have a possible explanation for the weird condition inversions. That may be because the programmer was used to program in 6502 assembler. On that cpu, you can't branch on a condition more than 128 bytes ahead (or backward). The way to bypass this is to do this weird condition inversion so that the conditional branch just jumps over the next instruction (the real branch but without a condition, those can go almost everywhere in the code). I think the original programmer may have learnt to always do this kind of branching inversion, just to not have to bother with that particularity. Then, there are the multiple gotos in a row which scream to me: programmer that only do local jumps. The only jump allowed to go out of a section of code, is at the end of the section. All the jumps inside that section that want to exit the section have to use that last jump.
@stevethepocket
@stevethepocket 3 жыл бұрын
Whoa. I never noticed that. What a weird limitation; you can only jump to an absolute address and you can only branch to a relative one.
@johndododoe1411
@johndododoe1411 3 жыл бұрын
Same limitation on the x86 family we still use for everything.
@stevethepocket
@stevethepocket 3 жыл бұрын
@@johndododoe1411 Truly we live in a cuckoo clock.
@0LoneTech
@0LoneTech 2 жыл бұрын
I find myself once again appreciating the AVR's Skip instructions, eliminating so many branches. It's a conditional single instruction inhibit, with no need to flush the pipeline.
@Gooberslot
@Gooberslot 3 жыл бұрын
Your super optimized for length version does seem slower though.
@IndianapolisGerry
@IndianapolisGerry 3 жыл бұрын
Just watching the typing in of the finial code (25:22) -- I'm realizing that TI Basic is actually a good primer for Assembler...code arranged into blocks.... I can't remember, even though this was my second computer (after a Spectrum) - was there a gosub routine? I think that came with extended....
@MichaelDoornbos
@MichaelDoornbos 3 жыл бұрын
Interesting how many of these programs made it into a lot of books for the various machines of the day. I recognize many of those from other books. I'm not generally a fan of mail call videos, but Robin going though books hooks me every time. "Pedantic nerds..."
@8_Bit
@8_Bit 3 жыл бұрын
There's quite a few mail call videos in the pipeline, for better or worse, but they're all things I'm interested in and I won't focus too much on the mail part beyond making sure the sender is properly acknowledged. I think I'm a pedantic nerd towards pedantic nerds. I'm not sure if that's a higher calling or not. Actually...
@stevethepocket
@stevethepocket 3 жыл бұрын
8:30 Looks like somebody tore out a page there. Or was that one of those magazine subscription offer cards? I don't think I've ever seen one of those in a book with a lot of pages and real glue binding; it's usually small booklets bound with staples, where you can pull both halves out and there's nothing left inside.
@pikadroo
@pikadroo 3 жыл бұрын
It's almost as if the person writing the book was just figuring it out as they went along and as long as the final code worked, that is what they printed in the book.
@AlexEvans1
@AlexEvans1 3 жыл бұрын
I don't know about a long time. My copy of the TI Editor Assembler manual claims copyright 1981.
@LanceHall
@LanceHall 9 ай бұрын
The lack of a backspace key is baffling. I wonder if there is a hardware and/or grom hack that could create a backspace function. Is there an unused key code that could be used? On the keyboard there is that little empty spot in the upper right they could accept an additonal key or button.
@charleskozak4102
@charleskozak4102 3 жыл бұрын
Yeah, I remember the frustration typing in programs. My thing was trying to get programs for other machines to run on my TI. So many memories...learning Algebra and Trig functions before I even knew what kind of math I was even looking at...40 years ago, that was. C64 felt like an upgrade. The games were better, at least.
@15bits
@15bits 3 жыл бұрын
This was satisfying to watch.
@spartonberry
@spartonberry Жыл бұрын
8:02 I have to wonder how many critical business decisions were solved by a TI 99/4A. :D
@wlorenz65
@wlorenz65 3 жыл бұрын
You could get rid of the -(R=0) term if you use HCHAR(R+1) instead and make some changes to the border checks, but it may confuse other programmers who are reading your code.
@seannewton8386
@seannewton8386 3 жыл бұрын
The TRS-80 Model 16 was the Z-80/68000 dual processor computer that could run TRS-XENIX
@UltimateSeduction
@UltimateSeduction 3 жыл бұрын
Cool, does me remember programming gw-basic a long time ago.
@arcadeshopper
@arcadeshopper 3 жыл бұрын
Backspace is function s with the arrow is on the keyboard and then del deletes the characters the right
@pleasedontwatchthese9593
@pleasedontwatchthese9593 3 жыл бұрын
Its impressive that these computers still work
@JustWasted3HoursHere
@JustWasted3HoursHere 3 жыл бұрын
With all those Goto statements jumping the code around, that "Drawing Sketches" program is the epitome of "spaghetti code"! I'm guessing that TI-BASIC doesn't have Gosub (and Gosub routines)?
@szr8
@szr8 3 жыл бұрын
Hard to believe that BASIC on my TI-86 is more advanced than BASIC on the TI-99.
@TheStuffMade
@TheStuffMade 3 жыл бұрын
Interesting. The original version of the BASIC program looks like someone took an assembly program and translated it into BASIC.
@superscatboy
@superscatboy 3 жыл бұрын
Even in assembly all those grouped goto/jumps are stylistically horrendous lol
@TheStuffMade
@TheStuffMade 3 жыл бұрын
@@superscatboy I think it's not unusual to have assembly code looking like that when doing a number of comparisons. Think of the if-comparison-jumps as branches and the goto statements as jumps (some might have been return statements in the original assembly code), then it makes sense since branches are limited to 128 bytes forwards and 127 bytes backwards in the TMS9900 CPU.
@kobe3576
@kobe3576 3 жыл бұрын
At 6:19 these Casio and Panasonic might refer to some pocket computers-calculators manufactured by these brands and that also had BASIC built it. Strangely they don't mention Sharp even when there were a lot of fantastic pocket computers by that company running BASIC as well. 🤔
@kobe3576
@kobe3576 3 жыл бұрын
Sorry, it was my mistake. Yes they mention Sharp. 🙏
@0LoneTech
@0LoneTech 2 жыл бұрын
Stranger still, I tried to contact Sharp in the 90s regarding one of their pocket computers and they claimed it never existed.
@RockyBMusic
@RockyBMusic 3 жыл бұрын
Nice, was the Author of the Listing payed by Lines? btw. this is how i mostly use boolean algebra in Excel Sheets;-) You are not able to use "TRUE" or "FALSE" within a calculation, but if you use for Example in C1.. =(A1="TEST")*(B1="TEST2")*1 so it is possible to use this in a Formula
@-Steven-
@-Steven- 2 жыл бұрын
Ahhh boolean logic was what the zx spectrum lived for, you could use it on everything, strings, calculated goto and gosub, plot, draw, circle statements in fact anywhere you could use a variable, and because the character line limit on the speccy was 65535 you could technically write a whole program in just 1 line as long as you were an expert in boolean logic. the one problem there though is the spectrum would get slower and slower as the single line got bigger, sometimes almost coming to a crawling stop, plus when you pressed enter to add the line to memory it could take a while to accept it as the speccy does syntax checking on the line before accepting it which cut down massively on typing errors as it wouldn't accept the line until you fixed the errors first. one thing though thanks to the weird basic in the zx spectrum all variables have to be defined before you use them or you get a 'Variable not found error' unlike most other basics it doesn't automatically define them if not found.
@cmdlp4178
@cmdlp4178 3 жыл бұрын
I can see where a sequence of gotos could make sence: When it is used as a jump table in combination with a computed goto. But not all basic dialects support that.
@8_Bit
@8_Bit 3 жыл бұрын
Yes, Commodore BASIC does have the ON X GOTO 100,200,300 that can be very useful. I don't think TI BASIC has it.
@0LoneTech
@0LoneTech 2 жыл бұрын
Fun fact, GCC (the GNU compiler collection) supports computed gotos in C. The switch statement was also designed for that use.
@jerryspann8713
@jerryspann8713 3 жыл бұрын
TI Games! I had that book growing up. Excellent book. Would like to find a copy. Who is the author and publisher?
@what-uc
@what-uc 3 жыл бұрын
The very specific measurement in feet and inches is a windup, right?
@naysmith5272
@naysmith5272 3 жыл бұрын
the Maze Generator programs looks interesting,
@slucas601
@slucas601 3 жыл бұрын
Does the TI games book from Compute! say 29 games on the front cover and then say 14 + 16 games on the back cover? Oversight or "off by one" error?
@TomStorey96
@TomStorey96 3 жыл бұрын
That's a fine example of branchless programming!
@magnustveten492
@magnustveten492 3 жыл бұрын
Was yelling at my iPad but did not help, at 21:09 you wrote got0 not goto, can see on the keyboard you typed 0 not o :)
@RonJohn63
@RonJohn63 3 жыл бұрын
TI BASIC's minimalist flow control reminds me of assembly.
@johndododoe1411
@johndododoe1411 3 жыл бұрын
And I've seen that silly goto pattern in compiler generated assembly.
@RonJohn63
@RonJohn63 3 жыл бұрын
@@johndododoe1411 because "branch unconditional" and "branch conditional" are the *only looping structures* that CPUs have. HLL loop constructs are built from this.
@johndododoe1411
@johndododoe1411 3 жыл бұрын
@@RonJohn63 I mean goto a goto instruction, as a professional, I am fully aware of the machine code limitations and techniques, including optimal implementation of HLL concepts and working with limited range jump instructions.
@evansdm2008
@evansdm2008 3 жыл бұрын
I suspect you don’t need 2 variables. 1 variable indicating total number of chars from top left. You can div / mod to get row / column. That boundary check expression would also be a single line if TI basic if can handle it
@eugenetswong
@eugenetswong 2 жыл бұрын
Can you give me an example of this?
@kespeth2
@kespeth2 3 жыл бұрын
Ah, the version of BASIC where the command to load wasn't LOAD, but OLD.
@lennartbenschop656
@lennartbenschop656 3 жыл бұрын
The OLD command was on the original mainframe versions of BASIC too. It's quite logical. NEW let you start a new program, OLD loaded up an old program.
@kespeth2
@kespeth2 3 жыл бұрын
@@lennartbenschop656 So Commodore was the one who changed it to LOAD and it caught on with all future computers except the TI-44A?
@lennartbenschop656
@lennartbenschop656 3 жыл бұрын
@@kespeth2 I would say: it was Microsoft and most others followed them/
@fumthings
@fumthings 3 жыл бұрын
short answer, you can do no more than send to a line number with an "if" statement, but you can nest just about any logic in a math statement.
@warmCabin
@warmCabin 2 жыл бұрын
28:13 You drawing the American flag?
@huntabadday2663
@huntabadday2663 3 жыл бұрын
The transformer failure were the computers attacking back for people mashing the keys too hard
@spartonberry
@spartonberry Жыл бұрын
I'm sadly not familiar enough to have a definite answer but my understanding is that while Commodore 64 could run cartridge-based games, floppy disk and cassette were much more common formats for software distribution. I'd guess the MSX line is closer to being a video game console because software, and especially game software, was much more commonly distributed on cartridges (I can only speak for emulation, but it seems that cartridge software on MSX was also self-booting, giving it more of a feeling of a hybrid of computer and game console.)
@8_Bit
@8_Bit Жыл бұрын
The VIC-20 and Commodore 64 each had hundreds of games on cartridge, and they were also self-booting, so it was pretty much the same as the MSX. But it's true that game developers for the C64 mostly transitioned to cassette and disk because it was cheaper than cartridge, and also allowed more capacity for more complex games and/or more levels. I know MSX titles were released on cassette and disk (more cassettes for the original MSX, and more disks for the MSX2) but cartridge releases continued as well; I believe this was mostly just in Japan and it probably had to do with the MSX more directly competing with game consoles throughout its life.
@carlwalmsley9497
@carlwalmsley9497 3 жыл бұрын
Great video Robin, although I dread to think what you would do with my code!
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR 2 жыл бұрын
why could they not do select case mid$(inkey$,1,1) case R: INCR C,1: break case L: DECR C,1: break case D: INCR R,1: break case U: DECR R,1: break end select
@RixtronixLAB
@RixtronixLAB 3 жыл бұрын
Nice video, keep it up, thanks :)
@ozanozdemir5515
@ozanozdemir5515 3 жыл бұрын
Good work but i am not sure which code is efficient..
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR 3 жыл бұрын
Does the TI-99/4A have inline Assembler.
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR 3 жыл бұрын
if that PC had came with 512KB of RAM it might have been the best computer out, come to think of it if it had used the TI-990 it would have had floating point built in and would have made for the fastest computer for the domestic market.
@tomlake2732
@tomlake2732 3 жыл бұрын
TI BASIC allows AND and OR but you use * for AND and + for OR. 100 IF A>100 + B=3 THEN 500 is the same as IF A>100 OR B=3 THEN 500 in some dialects.
@CutieHoney
@CutieHoney 3 жыл бұрын
I've seen development like this in C#. Where the developer doesn't take the time to understand the whole program rather than just "fix" whatever the current issue is.
TI-99/4A Cassette Fun: TI BASIC Tutorials and Games
51:02
8-Bit Show And Tell
Рет қаралды 21 М.
Commodore DAC-612 from 1969: Inside and Out
27:06
8-Bit Show And Tell
Рет қаралды 57 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 184 М.
Re-typing My 1983 Game Programming Inspiration
20:11
8-Bit Show And Tell
Рет қаралды 20 М.
TI-99/4A - Powering Up and Diagnostics (Part 1)
28:28
Noel's Retro Lab
Рет қаралды 32 М.
Party Like It's TI-99
18:25
Vintage Geek
Рет қаралды 20 М.
Where Does Bad Code Come From?
42:21
Molly Rocket
Рет қаралды 209 М.
What is the Smallest Possible .EXE?
17:04
Inkbox
Рет қаралды 572 М.
What was Coding like 40 years ago?
29:05
The Coding Train
Рет қаралды 1,8 МЛН
The Super Rare TI-99/4 Lives!
23:18
Usagi Electric
Рет қаралды 44 М.
TI-99/4A BASIC Performance, Games and Comparison to Other 8 Bit Systems
25:33
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,7 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН