Jump to content

TGB1718

Members
  • Content Count

    1,241
  • Joined

  • Last visited

Community Reputation

627 Excellent

About TGB1718

  • Rank
    Stargunner

Profile Information

  • Gender
    Male
  • Location
    Holbeach, UK
  • Interests
    Astronomy, Science, Computing, Electronics and obviously all things Atari
  • Currently Playing
    World of Warcraft

Recent Profile Visitors

1,255 profile views
  1. If that's the case you will not have much that will work even if you have a floppy device, as you already surmised, a memory upgrade is required
  2. I even played Lunar Lander on a Teletype terminal Circa 1976
  3. i.e. Zork, used on a Marconi System 80 used to carry out in-circuit testing of PCB'S (obviously not 8bit)
  4. can use X or Y, the difference in using which register becomes apparent when using zero page indirect, for this you would only use the Y, i.e. LDY #0 LDA ($CB),Y STA ($CE),Y Using X register LDX #0 ldy #0 LDA ($CB,X) STA ($CD),Y doesn't work the same way, it indexes addresses stored in zero page via the X register to get the effective address, it's good for lookup tables, but obviously there isn't much left of zero page to use, so this instruction is not seen very often.
  5. Have a look at SpartadosX Copy command, it does allow for some attributes to be preserved These switches are available: /B - backup mode /C - confirmation mode /D - do not preserve date and time /I - ask before overwriting a file /K - copy and set attribute '+A' to the original file /M - delete the source file (move) /N - skip existing destination entries /Q - do not print anything (except error messages) /R - dig recursively into subdirectories /S - switch off display during copy /V - summary (number of files and directories copied)
  6. Looks like a real professional job 🤮
  7. That got me thinking, this is between 25% and 35% faster than memcpy for moves of 256 bytes or less, but not as flexible. even small moves are much quicker. C code bit. #include <stdio.h> #include <peekpoke.h> #include <string.h> extern void mcpy(void); extern char size; void main(void) { int i; char *addr=&size-11; // source address in .s module char *dest=&size-8; // dest address in .s module char *num=&size-13; // size to move (X register) in .s module // 500 loop test run to roughly time how long POKEW(19,0); // reset clock for(i=0;i<500;i++) memcpy((char *)0x6000,(char *)0x7000,5); printf("%u %u\n\n",PEEK(19),PEEK(20)); // now 500 loop test run for new code POKEW(19,0); // reset clock again for(i=0;i<500;i++) { POKEW(addr,0x6000); POKEW(dest,0x7000); POKE(num,5); mcpy(); } printf("%u %u",PEEK(19),PEEK(20)); return; } Assembler module ; Export the start of program code .export _mcpy .export _size .proc _mcpy: near .code _mcpy: LDX #0 ; this will change before call LOOP: LDA $1000,X ; same again, will change STA $1000,X ; and this too DEX CPX #255 ; have to do this as doing BNE after DEX will miss one byte BNE LOOP RTS .endproc _size: .byte 0 ; dummy used for offsets
  8. I think you would have to write something yourself to deal with those as they have different attributes, Sparta has the most features I think, but as I said before, I know how to set attributes, but not found a way to see them, AtariDOS, it's the "*" in the filename for a locked file, so fairly easy to detect that, I've not used MyDos, but you may find some info here :- http://www.mathyvannisselroy.nl/mydos.htm
  9. Dec Alpha's, built a ton of those in my days but not done anything like that
  10. Did a bit of checking, I think the answer is that cc65 does not support retrieving file attributes, in C you can use the stat() function. Although cc65 has the header file sys/stat.h it is all but empty, it should at the very least have this:- struct stat { dev_t st_dev; /* ID of device containing file */ ino_t st_ino; /* inode number */ mode_t st_mode; /* protection */ nlink_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of owner */ gid_t st_gid; /* group ID of owner */ dev_t st_rdev; /* device ID (if special file) */ off_t st_size; /* total size, in bytes */ blksize_t st_blksize; /* blocksize for file system I/O */ blkcnt_t st_blocks; /* number of 512B blocks allocated */ time_t st_atime; /* time of last access */ time_t st_mtime; /* time of last modification */ time_t st_ctime; /* time of last status change */ }; So a simple piece of code to use it could be:- int main ( int argc, char *argv[]) { struct stat MyStat; if(argc <= 1) { printf("Usage:= mystat <filename>\n"); exit(1); } if (stat(argv[(argc - 1)], &MyStat) < 0) printf("Error = %s\n", strerror(errno)); else printf( "File Permissions:= %d\n", MyStat.st_mode ); return 0; }
  11. I've found exactly the same thing, if it's VBI code I use assembler modules, too much overhead in the C routines, so they are not so short and quick.
  12. I think the only way is to use direct CIO calls as @danwinslow said, you would need to set the AUX1 byte to 2, in the OPEN then read a character at a time to retrieve the directory listing . Probably easier to do it as an assembler procedure within cc65
  13. If your using Spartados X there's a section on file attributes using the ATR command, reading the attributes doesn't seem to be covered (at least I can't see it). It will also depend on what DOS your using, in Atari DOS's I think you can only lock a file and the way to see that is open the disk directory and look for a "*" in the filename. Here's a quick BASIC program that opens the directory and displays the contents 1 TRAP 100 10 OPEN #1,2,0,"D:*.*" 20 GET #1,A 30 ? CHR$(A); 40 GOTO 20 100 CLOSE #1 READY RUN * DOS SYS 037 * DUP SYS 042 CENT2021M65 009 CENT2021ASM 016 CENT2021OBJ 002 TESTBOOTOBJ 018 CENTNEW M65 016 CENTNEW OBJ 004 CENTNEW ASM 031 * TEMP00 ASM 007 532 FREE SECTORS READY
  14. small example of cc65 code, just checks a file exists :- // gets input filename and checks if it exists int getinfile(void) { int done=0; char ret; FILE *finput; char infile[30]; gets(infile); // dummy to clear buffer of CR do { clearline(0,12); clearline(0,10); printf("Enter Input Filename (RETURN to Abort)"); clearline(0,11); gets(infile); if((strlen(infile)) == 0) // CR so abort return(1); ret = checkfile(); if(strlen(infile) > 30) { clearline(0,12); printf("Filename too long %s",infile); delay(90); } else { finput=fopen(infile,"r"); // check if file exists if(finput == NULL) { clearline(0,12); printf("File does not exist"); delay(90); } else { fclose(finput); done=1; } } }while(!done); return(0); }
×
×
  • Create New...