Jump to content

TomXP411

Super Administrators
  • Posts

    1181
  • Joined

  • Last visited

  • Days Won

    101

TomXP411 last won the day on November 30

TomXP411 had the most liked content!

5 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TomXP411's Achievements

Proficient

Proficient (10/14)

Problem Solver Rare Conversation Starter Reacting Well Dedicated Very Popular Rare

Recent Badges

1.1k

Reputation

19

Community Answers

  1. You're right, it won't run on 38. The LOCATE command is the culprit.
  2. Finally, a PETSCII block version based on the PC version. This version uses the block characters (shift D,F,C,V) and changes the background color as needed to layer the different colors of the bird... 10 SCREEN 1 20 COLOR 1,0: CLS 30 READ N 40 IF N=-1 THEN 300 : REM SWITCH TO PLOTTING INDIVIDUAL BITS 50 READ CF,CB,S 55 REM PRINT "\X13N=";STR$(N);",CF="STR$(CF);",CB="STR$(CB); 56 REM PRINT ", S=";STR$(S);" " 60 COLOR CF,CB 70 FOR I=1 TO N 80 READ Y,B,E : LOCATE Y,B 90 IF S=1 THEN PRINT "\XAC";:B=B+1:E=E-1 100 IF S=2 THEN PRINT "\XBC";:B=B+1:E=E-1 110 REM PRINT"\X13\X11Y=";STR$(Y);",B="STR$(B);", E=";STR$(E);" " 120 FOR X=B TO E 130 LOCATE Y,X 140 PRINT "\X12 \X92"; 150 NEXT X 160 IF S=1 THEN PRINT "\XBB"; 170 IF S=2 THEN PRINT "\XBE"; 180 NEXT I 185 REM GET A$:IF A$="" THEN 185 190 GOTO 30 300 READ Y: IF Y=-1 THEN 900 310 READ X,CF,CB,C 320 REM PRINT"\X13Y=";STR$(Y);",X=";STR$(X);",CF="STR$(CF);",CB=";STR$(CB);" " 330 LOCATE Y,X 340 COLOR CF,CB:PRINT CHR$(C); 350 GOTO 300 900 LOCATE 23,30 910 COLOR 3,0 920 PRINT " HAPPY THANKSGIVING! " 930 GET A$:IF A$="" THEN 930 940 COLOR 1,0 1000 DATA 14,8,0,1 : REM COUNT, FG, BG, STYLE (0=VERTICAL, 1=OUT, 2=IN) 1010 DATA 1,33,38, 1,42,47, 2,30,50, 3,29,51, 4,28,52, 5,25,55, 6,24,56 1020 DATA 7,23,57, 8,21,59, 9,20,60, 10,19,61, 11,18,62, 12,18,62, 13,17,63 1030 DATA 5,8,0,2 1040 DATA 14,16,64, 15,16,64, 16,17,63, 17,18,62, 18,21,59 1100 DATA 14,9,8,1 1120 DATA 3,35,45, 4,34,46, 5,32,48, 6,32,48, 7,29,51, 8,28,52, 9,26,54 1130 DATA 10,25,55, 11,24,56, 12,23,57, 13,23,57, 14,23,57, 15,23,57, 16,24,56 1200 DATA 11,7,9,1 1210 DATA 4,38,42, 5,37,43, 6,37,43, 7,37,43, 8,36,44, 9,34,46, 10,32,48 1220 DATA 11,31,49, 12,29,50, 13,28,52, 14,26,54 1230 DATA 4,7,9,2 1240 DATA 15,25,29, 15,51,55, 16,25,28, 16,52,55 1250 DATA 1,7,9,0, 15,31,49 1260 DATA 1,7,9,2, 16,31,49 1270 DATA 1,7,8,2, 17,32,48 1300 DATA -1 1310 DATA 5,39,1,7,215, 5,40,1,7,0, 5,41,1,7,215 1320 DATA 6,40,11,7,218 1330 DATA 7,40,2,7,194, 8,40,2,7,194, 9,40,2,7,194 1340 DATA 18,36,11,8,194, 18,44,11,8,194 1350 DATA 19,36,11,0,194, 19,44,11,0,194 1360 DATA 20,36,11,0,194, 20,44,11,0,194 1370 DATA 21,36,11,0,194, 21,44,11,0,194 1380 DATA 21,35,11,0,206, 21,37,11,0,205, 21,43,11,0,206, 21,45,11,0,205 1400 DATA -1,-1
  3. And here it is in color... I've also corrected the bottom of the turkey, where the body seems to skip a few lines... 10 SCREEN 1 20 COLOR 1,0: CLS 30 READ N 40 IF N=-1 THEN 140 : REM SWITCH TO PLOTTING INDIVIDUAL BITS 50 READ CL,C 55 REM PRINT"\X13N=";STR$(N);",CL="STR$(CL);", C=";STR$(C);" " 60 FOR I=1 TO N 70 READ Y,B,E 75 REM PRINT"\X13\X11Y=";STR$(Y);",B="STR$(B);", C=";STR$(E);" " 80 FOR X=B TO E 90 LOCATE Y,X 100 COLOR CL:PRINT CHR$(C); 120 NEXT X,I 130 GOTO 30 140 READ Y: IF Y=-1 THEN 200 150 READ X,CL,C 165 REM PRINT"\X13Y=";STR$(Y);",X=";STR$(X);",CL="STR$(CL);",C=";STR$(C);"\XA0 " 170 LOCATE Y,X 180 COLOR CL:PRINT CHR$(C); 190 GOTO 140 200 LOCATE 23,31 210 COLOR 3 220 PRINT "HAPPY THANKSGIVING!" 230 GET A$:IF A$="" THEN 200 240 COLOR 1,6 250 SCREEN 0 1000 DATA 19,8,40 1010 DATA 1,33,38, 1,42,47, 2,30,50, 3,29,51, 4,28,52, 5,25,55, 6,24,56 1020 DATA 7,23,57, 8,21,59, 9,20,60, 10,19,61, 11,18,62, 12,18,62, 13,17,63 1030 DATA 14,16,64, 15,16,64, 16,17,63, 17,18,62, 18,21,59 1100 DATA 14,9,117 1120 DATA 3,35,45, 4,34,46, 5,32,48, 6,32,48, 7,29,51, 8,28,52, 9,26,54 1130 DATA 10,25,55, 11,24,56, 12,23,57, 13,23,57, 14,23,57, 15,23,57, 16,24,56 1200 DATA 18,7,73 1210 DATA 4,38,42, 5,37,43, 6,37,43, 7,37,43, 8,36,44, 9,34,46, 10,32,48 1220 DATA 11,31,49, 12,30,50, 13,28,52, 14,27,55 1230 DATA 15,25,29, 15,32,48, 15,51,55, 16,25,28, 16,33,47, 16,52,55 1240 DATA 17,34,46 1300 DATA -1 1310 DATA 5,39,1,215, 5,40,1,0, 5,41,1,215 1320 DATA 7,40,2,194, 8,40,2,194, 9,40,2,194 1330 DATA 18,36,11,88, 18,44,11,88 1340 DATA 19,36,11,88, 19,44,11,88 1350 DATA 20,36,11,88, 20,44,11,88 1360 DATA 21,35,11,88, 21,37,11,88, 21,43,11,88, 21,45,11,88 1400 DATA -1,-1
  4. Just for fun, here's a port of the IBM PC version - with bugs fixed. The version printed has a bug in the DATA statements. In line 1080, the 22 needs to be changed to 18. I made some other changes, too: The end condition was... weird. It ends when the X position is 45. If you're going to use a magic number to end a data statement, make sure it's a clear terminator, not something that's a valid data item. So I changed the program to look for -1 in the Y position. Since the last part of the program looks for triplets, you actually need to enter -1,-1,-1 to end the DATA set. I also added an end loop that terminates when the user presses a key (lines 200-230). I like that better than an infinite loop that requires the STOP key. It's worth noting that this version looks... pretty sad with no color. I'm going to do a second version with some added color, then I'll do a third version with PETSCII block art and color. 10 SCREEN 1 20 COLOR 1,0 30 READ N,C 40 IF N=999 THEN 130 50 FOR I=1 TO N 60 READ Y,B,E 70 FOR X=B TO E 80 LOCATE Y,X 90 PRINT CHR$(C) 100 REM PRINT"\X13";STR$(N);",";STR$(I);"\XA0 " 110 NEXT X,I 120 GOTO 30 130 READ Y,X,C 140 IF Y=-1 THEN 200 150 LOCATE Y,X 160 PRINT CHR$(C); 170 GOTO 130 200 LOCATE 27,31 210 PRINT "HAPPY THANKSGIVING!" 230 GET A$:IF A$="" THEN 200 1000 DATA 19,40,1,33,38,1,42,47,2,30,50,3,29 1010 DATA 51,4,28,52,5,25,55,6,24,56,7,23,57 1020 DATA 8,21,59,9,20,60,10,19,61,11,18,62 1030 DATA 12,18,62,13,17,63,14,16,64,15,16,64 1040 DATA 16,17,63,17,18,62,18,21,59,14,117,3 1050 DATA 35,45,4,34,46,5,32,48,6,32,48,7,29 1060 DATA 51,8,28,52,9,26,54,10,25,55,11,24 1070 DATA 56,12,23,57,13,23,57,14,23,57,15,23 1080 DATA 57,16,24,56,18,73,4,38,42,5,37,43,6 1090 DATA 37,43,7,37,43,8,36,44,9,34,46,10,32 1100 DATA 48,11,31,49,12,30,50,13,28,52,14,27 1120 DATA 55,19,25,29,19,32,48,19,51,55,20,25 1130 DATA 28,20,33,47,20,52,55,21,34,46,999 1140 DATA 999,5,39,111,5,40,0,5,41,111,6,40 1150 DATA 94,7,40,94,8,40,94,9,40,94,22,36,88 1160 DATA 22,44,88,23,36,88,23,44,88,24,35,88 1170 DATA 24,37,88,24,43,88,24,45,88 1180 DATA -1,-1,-1
  5. I think @kelli217 has got the right answer, here. Naming the program AUTOBOOT.X16 will start it up automatically, and then you can leave out the -PRG argument. Another way to do it is to extract just the initial PRG file and run that using the command line parameter. Even better, your initial program could be a dummy program that just loads and runs the main program on the SD card. A while back, I wrote a little menu demo to show how to do a clean load (rather than a chained load) from BASIC. That might help.
  6. You might be right... however, it looks like there are two different versions of the turkey. One uses ASCII characters, and the other seems to use 1/4 character blocks. If I was porting this, I'd probably build both versions, since the Commander can easily handle both of them - and look good doing it.
  7. There is no "transfer of blocks not needed." The Seek command moves the file read pointer to the correct location in the file, and the next read happens from that location. This is all in the documentation, if you care to read it. We've also talked about it here, multiple times. I even wrote a how-to post on how to seek from inside a BASIC program, which Desertfish quoted above.
  8. Actually, 0 is specifically for the LOAD command, 1 is for the SAVE command, and 3-14 are for reading/writing sequential files. This is actually spelled out in the VIC-1541 manual. Since CMDR-DOS is based on CBM-DOS, the team hasn't documented all the stuff that's already documented in the Commodore manuals.
  9. No. That's not how Commodore disk access works, and it never has been. There's a perfectly accessible method of doing so already, by sending a command on the command channel. The whole design of Commodore's disk system is for the disk drive to handle the complex side of the operation, and for the computer itself to just provide a dumb communication channel, so aside from the basic I/O commands (LOAD, SAVE, OPEN, PRINT#, INPUT#, GET), there is no need or expectation of things like record handling for REL files, seeking in sequential files, or things on the printers, like changing fonts or printing bitmapped graphics. That's why the command channel exists - to allow the I/O device to handle those things on its own, without needing a command for everything on the host system. If you need a "Seek" command in BASIC, you can implement it as a subroutine. If you need a SEEK command in machine language, you an implement it as a subroutine. If you need a seek command in C or Pascal... you can implement it as subroutines. There's no need to add device-specific commands to the KERNAL or BASIC, since once you start down that path, it never ends.
  10. When you print the quote symbol, it activates "control character mode", where cursor movements, colors, and so on, are printed in reverse text like you see above. The fix for this is to print a second quote, then DEL it, or you can print a return (don't put the comma at the end) and use LOCATE to position the cursor each time through the loop. DEL should be 20, so you can try something like this... PRINT CHR$(X+Y);CHR$(X+Y);CHR$(20), Here's a complete program that uses this: 10 CLS 20 C=32 30 FOR Y=1 TO 16 40 FOR X=1 TO 70 STEP 8 60 IF C<100 THEN PRINT" "; 70 PRINT C;CHR$(C);CHR$(C);CHR$(20);" "; 80 C=C+1:IF C>127 THEN END 90 NEXT X 100 PRINT 110 NEXT Y And here's a program that uses LOCATE: 10 CLS 20 C=32 30 FOR Y=1 TO 16 40 FOR X=1 TO 70 STEP 8 50 LOCATE Y,X 60 IF C<100 THEN PRINT" "; 70 PRINT C;CHR$(C); 80 C=C+1:IF C>127 THEN PRINT:END 90 NEXT X,Y
  11. Yup. The correct answer is "Don't do that." Because the addresses change with each build of the ROMs. If you feel you must do that, you'll have to look through the "SYM" files for the CHANNL symbol to get the correct value, then update that value for each version of the ROM. As you can imagine, that's an exercise in frustration. It's better to, as you suggested, use the OPEN and INPUT# commands if you don't want the question mark.
  12. Nope. There is a special file type on CBM DOS known as the "REL" file. This allows you to specify a record size and seek to specific records within a file. It's super awkward, and it would have made more sense just to implement a byte position command at the beginning, but trust computer engineers to make things more complicated than needed, for no real reason but that they can.
  13. So it looks like you'll have to do this explicitly in your code. In the end, it comes down to using the Seek (or "Position") DOS command, then reading data one byte at a time and saving it where you want in memory.
  14. Just like anything else.. you start with a search engine and look for "interactive fiction" or "z-machine" games. And yes - they are Copyrighted. All computer code is Copyrighted by default. However, like any other type of computer programs, some people give away their IF games for free, and others charge for it. There's quite a large community of Interactive Fiction developers out there - you just have to go take a look for it.
  15. Z-Machine interpreters are available for the 6502, but I only know about a couple of generic ones (as opposed to ones bundled with things like Zork.) I haven't heard of anyone implementing one for Commander yet, but you can look at projects like Zeugma, The Å-machine, or Ozmoo as a starting point. And no, you can't run CP/M on the Commander X16. You can make an operating system similar to CP/M, but there are a lot of differences between the 8080 and 6502 CPU that mean any port of CP/M is going to take a lot of liberties with how things work... and even if you did create a CP/M port for 6502, it's not going to run 8080 or Z80 CP/M software. It would require any application software to also be ported similarly. If you're going to go to all the effort to convert a piece of software to 6502, it makes more sense to simply port it to KERNAL, rather than trying to make it run on CP/M.
×
×
  • Create New...

Important Information

Please review our Terms of Use