senior_falcon Posted April 24 Share Posted April 24 13 hours ago, Vorticon said: When I initially tried it, the computer crashed until I realized the radians conversion was incorrect. So odd you're getting a usable output... Don't know why it would not work for you. I just copied and pasted the code above and it works fine. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted April 24 Share Posted April 24 48 minutes ago, senior_falcon said: Don't know why it would not work for you. I just copied and pasted the code above and it works fine. You mean the pascal code I posted? That has the corrected randians conversion. Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted April 24 Share Posted April 24 (edited) 1 hour ago, Vorticon said: You mean the pascal code I posted? That has the corrected randians conversion. No, the XB/TML code with the error that I posted that you said crashed the computer. Here is the program modified to avoid having to use COS. This is compiled and you can see it is a bit less leisurely.This is running at normal speed, not CPU overdrive. But of course, although it works the same, it is no longer the same program. 100 DIM SINE(11) 110 FOR I=1 TO 11 :: READ SINE(I):: NEXT I 120 CALL SCREEN(2):: PD=1 130 A=0 135 IF PD=1 THEN CALL LINK("PENHUE",3+INT(RND*14),2) 140 FOR I=1 TO 11 150 CALL LINK("PUTPEN",100,120,A) 160 W=A/180*SINE(I) 170 R=9+A/18 180 CALL LINK("PU"):: CALL LINK("FWD",R-W/200) 190 IF PD=1 THEN CALL LINK("PD")ELSE CALL LINK("PE") 195 CALL LINK("FWD",W/100) 200 A=A+3 :: IF A>1453 THEN 230 210 NEXT I :: GOTO 140 230 PD=PD+1 :: PD=PD AND 1 :: GOTO 130 240 DATA 0,51,97,136,164,178,178,164,136,97,51,0 Edited April 24 by senior_falcon 8 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted April 24 Share Posted April 24 Quite impressive I have to say. Your compiler has been a boon to program development in XB on the TI as demonstrated by the sheer number and quality of new games developed with it by the likes of @Retrospect and @Cheung among others. 3 1 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted April 27 Share Posted April 27 Was there a keyboard strip made for the p-system? 1 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted April 27 Author Share Posted April 27 (edited) Yes, there was. It shows that the FCTN-keys 1 to 9 have these definitions: DEL, INS, FLUSH, BREAK, STOP, ALPHA LOCK, SCREEN LEFT, SCREEN RIGHT, LINE DELETE. As you can see there's an ALPHA LOCK key too. It's redundant on the TI 99/4A, but was there to allow both upper and lower case on the 99/4. Since the p-system loads all character definitions from the file OS:SYSTEM.CHARAC at startup, it doesn't care which definitions are in the ROM chips in the console. Edited April 28 by apersson850 5 1 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted April 29 Share Posted April 29 I have a bunch of blank strips, so I'm going to make one 🙂 Aside from the function keys, any control keys were listed on the strip as well? Quote Link to comment Share on other sites More sharing options...
apersson850 Posted April 29 Author Share Posted April 29 No, the control keys used by the p-system according to the default key configuration setup are <ext>, <esc> and <tab>, neither of which are mapped to any number key. 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted April 30 Share Posted April 30 Not bad... 4 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted April 30 Author Share Posted April 30 The left part looks more or less identical to the original. Good artwork! 1 Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted May 1 Share Posted May 1 On 4/29/2024 at 11:59 PM, Vorticon said: Not bad... Here are fully functionl versions of the p-Code strip in both possible /4A formats. . .this is actually one of the harder TI keystrips to find as an original. They turn up once in a while, but nowhere near as often as the other TI-sourced keystrips. 5 1 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 1 Share Posted May 1 Thanks! Looks like I inverted the Del and Ins locations. I'll see if I can get a closer replica made. Quote Link to comment Share on other sites More sharing options...
apersson850 Posted May 1 Author Share Posted May 1 Yes, but I didn't notice that immediately either. They are used when you do an eXchange in the editor. Quote Link to comment Share on other sites More sharing options...
jschultzpedersen Posted May 1 Share Posted May 1 Thanks. This is working well, when printed to thick paper, too. I just had to rescale the print slightly to make an image in Paint, that fits perfectly on the TI99. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 7 Share Posted May 7 I have a set of data (53 character definitions) I'd like to use in a segment procedure. Since Pascal does not have the equivalent of a DATA basic statement, what is the most efficient way of embedding that data into the procedure? I could create an array and explicitly fill each element with the corresponding data, but is there a better way of doing it? Another option is to create a raw data file and read it into a large array with BLOCKREAD, but for that I will have to create an assembly language program to create that raw file using the standard EA and transfer it to a Pascal disk using Pcode Tool. I could leverage Magellan for that last option. That said I would prefer to completely stay within the pcode environment. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 8 Share Posted May 8 I ended up creating a small program to read the values of each character set colors from the keyboard and create a raw data file using BLOCKWRITE which can be easily retrieved using BLOCKREAD. For the hex definitions of the characters, I just imported the data from Magellan into a plain text file and used Pcode Tool to transfer it to a pcode disk. It's labor intensive for sure. Here's the color data entry program as an example : Spoiler program dataentry; type byte = 0..255; dual = record case boolean of true :(val :integer); false:(bytes : packed array[0..1] of byte); end; (* dual *) var i, n, blocks : integer; buffer : packed array[0..511] of byte; chrnum, fcolor, bcolor : dual; outfile : file; begin page(output); i := 0; n := 1; fillchar(buffer, 512, chr(0)); repeat gotoxy(0, 1); writeln('enter char#, fcolor, bcolor # ',n); gotoxy(0, 2); writeln(' '); gotoxy(0, 2); read(chrnum.val, fcolor.val, bcolor.val); buffer[i] := chrnum.bytes[1]; buffer[i + 1] := fcolor.bytes[1]; buffer[i + 2] := bcolor.bytes[1]; i := i + 3; n := succ(n); until i > 68; rewrite(outfile, '#9:colordata.data'); blocks := blockwrite(outfile, buffer, 1); close(outfile, lock); end. 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted May 8 Share Posted May 8 I don't remember a lot of Pascal but... I am wondering if you could declare a type Type chardef array[1..16] of char Then make Const array of type chardef. And initialize the Const array as text strings of hex numbers like BASIC uses, in the source code. They write a function that reads the const array HEX numbers, one at a time, converting each to a byte and writing the byte into VDP RAM. thinkin' out loud. 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 8 Share Posted May 8 UCSD Pascal on the TI has a function to assign a hex definition string to a character called SET_PATTERN, very similar to Basic. What I ended up doing was simply have a text file with the definition strings which could be easily read string by string and assigned to SET_PATTERN. I have a matching file with the character numbers to use with it. But it's by no means a straightforward process compared to a DATA statement. My original question was if there is a way to emulate a DATA statement somehow, and what you suggested is as close as one can get. One of my pet peeves with Pascal. 3 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted May 8 Share Posted May 8 3 hours ago, Vorticon said: UCSD Pascal on the TI has a function to assign a hex definition string to a character called SET_PATTERN, very similar to Basic. What I ended up doing was simply have a text file with the definition strings which could be easily read string by string and assigned to SET_PATTERN. I have a matching file with the character numbers to use with it. But it's by no means a straightforward process compared to a DATA statement. My original question was if there is a way to emulate a DATA statement somehow, and what you suggested is as close as one can get. One of my pet peeves with Pascal. It's that eternal story of protection vs freedom for the programmer. When you think about how simple your requirement is; you simply want to put some random data into a space in memory that you can point to later, it's hard to believe there isn't a simple way. BASIC does it with a DATA statement as does Assembler. Forth uses a comma. Interestingly I went looking to see how to do it in C and there seems to a lot discussion about the best way to make the compiler do your bidding. Seems to be a "feature" of the languages in the Algol family line. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 9 Share Posted May 9 Here's one way to leverage Magellan to get a screen character map as a text file which can be converted to a raw bytes file for quick loading. I imported the text file onto a pcode disk using Pcode Tool then created a program to do the conversion. Is there a more efficient way of doing this? Below is the screen character data text file (graphics mode 32x24): Spoiler 32,32,32,1,2,8,9,16,16,32,24,29,29,29,29,29, 29,29,29,29,29,29,29,29,29,29,29,29,29,29,25,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,30,28,28,28,28,28, 28,28,28,28,28,28,28,28,28,28,28,28,28,28,31,32, 32,32,32,3,4,10,11,17,17,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,1,2,8,9,16,16,32,24,29,29,29,29,29, 29,29,29,29,29,29,29,29,29,29,29,29,29,29,25,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,30,28,28,28,28,28, 28,28,28,28,28,28,28,28,28,28,28,28,28,28,31,32, 32,32,32,1,2,8,9,16,16,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,3,4,10,11,17,17,32,24,29,29,29,29,29, 29,29,29,29,29,29,29,29,29,29,29,29,29,29,25,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,1,2,8,9,16,16,32,26,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,27,32, 32,32,32,3,4,10,11,17,17,32,30,28,28,28,28,28, 28,28,28,28,28,28,28,28,28,28,28,28,28,28,31,32, And here's the conversion program: Spoiler program getscreen; type byte = 0..255; dual = record case boolean of true :(val :integer); false:(bytes : packed array[0..1] of byte); end; (* dual *) var c : char; i, blocks, dnum, digit1, digit2 : integer; cvalue : dual; buffer : packed array[0..511] of byte; outfile : file; screenfile : text; begin reset(screenfile, '#9:screendat.text'); rewrite(outfile, '#9:screendat.data'); fillchar(buffer, 512, chr(0)); dnum := 0; i := 0; while not eof(screenfile) do begin read(screenfile, c); if c in['0','1','2','3','4','5','6','7','8','9',','] then begin if c = ',' then begin if dnum = 2 then cvalue.val := digit1 * 10 + digit2 else cvalue.val := digit1; dnum := 0; buffer[i] := cvalue.bytes[1]; i := succ(i); if i > 511 then begin blocks := blockwrite(outfile, buffer, 1); i := 0; fillchar(buffer, 512, chr(0)); end; end else begin dnum := succ(dnum); if dnum = 1 then digit1 := ord(c) - 48 else digit2 := ord(c) - 48; end; end; end; blocks := blockwrite(outfile, buffer, 1); close(outfile, lock); close(screenfile); end. 1 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted May 9 Author Share Posted May 9 No, there's no really handy way of doing this in Pascal. Some Pascal versions allow you to define variables, including arrays, where you do an assignment of the variable right in the declaration. The equivalent of defining a constant, declaring a variable and in the code assign the constant to the variable, but in one fell swoop. UCSD doesn't. You can define the data in assembly and store it in a PUBLIC variable, but that's also awkward. You can type in the data (if that's the source you have) directly into a file with PATCH, and then read that file. Or do as you did. 4 1 Quote Link to comment Share on other sites More sharing options...
LarryFromBuffalo Posted May 10 Share Posted May 10 Has anyone played with the SOUND UNIT on UCSD PASCAL running on CLASSIC99? I am simply trying to get the sounds to play but cannot seem to get it working. Something simple i am missing? Thanks! Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 10 Share Posted May 10 21 hours ago, LarryFromBuffalo said: Has anyone played with the SOUND UNIT on UCSD PASCAL running on CLASSIC99? I am simply trying to get the sounds to play but cannot seem to get it working. Something simple i am missing? Thanks! I added an SND_VOLUME statement to your program but I still could not hear anything. I don't see anything wrong with that test program otherwise. Incidentally, if you replace PLAY_SND(1) with PLAY_ALL_SND, you do hear some noise, but it does not appear to be related to the notes you set. I'll test it out on real hardware tonight. program soundt; uses sound; var sl : sndlstptr; begin make_snd_list(sl, 200); snd_tone(sl, 220, 4); snd_note(sl, 440, 8); end_snd(sl); snd_volume(sl, 15); set_snd(1, sl); play_all_snd; writeln('hello world!'); end. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 10 Share Posted May 10 Although the p-system allows you to redefine characters between 0 and 31, several of these characters have terminal functions which are retained and thus lead to weird effects when displayed, a fact which betrays the essential nature of the UCSD Pascal system as a terminal-based system even when in graphics mode. This caused me a lot of head scratching before I figured it out. Here is a list of characters you should not redefine (there may be others): 8 [BS] 10 [LF] 12 [FF] 13 [CR] 16 [DLE] 30 [RS] I would advise that unless you are very short on character space, try to avoid characters 1-31 altogether. Incidentally, character 0 is the cursor. This limitation is more than mitigated by the fact that you can redefine all the way to character 255. 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted May 11 Share Posted May 11 12 hours ago, Vorticon said: I added an SND_VOLUME statement to your program but I still could not hear anything. I don't see anything wrong with that test program otherwise. Incidentally, if you replace PLAY_SND(1) with PLAY_ALL_SND, you do hear some noise, but it does not appear to be related to the notes you set. I'll test it out on real hardware tonight. program soundt; uses sound; var sl : sndlstptr; begin make_snd_list(sl, 200); snd_tone(sl, 220, 4); snd_note(sl, 440, 8); end_snd(sl); snd_volume(sl, 15); set_snd(1, sl); play_all_snd; writeln('hello world!'); end. Tried it on real hardware and still no sound. A bit stumped here... EDIT: OK figured it out. SND_VOLUME needs to be inside the sound list and before the notes that you want played. The program below works. I added a SET_SND_TEMPO as well. 3 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.