Jump to content

danwinslow

Members
  • Posts

    3,023
  • Joined

  • Last visited

Posts posted by danwinslow

  1. The way to say it is:

    In the CC65 Atari library, the Atari "IOCB" construct has been completely abstracted under the C standard 'File Descriptor' concept. It is still possible to use either or both in a program, but mixing the two in the same program can lead to problems.

     

    In my opinion, the memory cost of pulling in a bunch of stdio stuff supporting the file descriptors is too high, and I just wrote a thin utility layer over IOCB's and used that. Where the CC65 stdio library really comes into it's own is for quick utilities and also when cross compiling non-Atari c programs.

  2. I've used a system similar to what's been mentioned above. With CC65, I used the linker config to setup named code banks (bank1, bank2, etc.,) all at $4000, and used segment names to organize code and data into each one, each in it's own file. Then I had a small loader function that would load the banks one by one, flipping banks as necessary. I also had a table of metadata about the bank locations of various functions and data, and a function caller that would change bank as necessary, and call the function. It's much better to organize groups of related functionality so that most of the calls are within the same bank. Even duplicating sets of functions, for instance, utility functions across the banks can help a lot with the switching overhead.

    • Thanks 1
  3. Yeah, casting is a way to tell the compiler 'shut up, I'm doing this on purpose'.

    memcpy is, under the hood, just using the same kind of memory move that you would roll up yourself in machine language. I thought there were separate memory areas for each PMG, so it wouldn't be that they are overwriting each other in actual ram...more likely that you need to look into the way that the color priority works if they do overlap on the screen. Check out documentation around GPRIOR...I'm no expert but I expect it's somethign to do with that.

     

    Never mind, I missed the 'missiles' part in your question. TGB is probably right...you could still use memcpy, but you need to figure out things about what exactly you are moving and when. I think its not about whether you are using specfically memcpy or not, its more about how you are using any memory move capability. YOu didn't give a real full explanation as to what you meant by 'cancelling each other out' so its hard to say.

  4. 1 hour ago, bkumanchik said:

    And is there any way to get rid of this Warning:  Warning: Pointer conversion to 'void *' from 'const unsigned char *' discards qualifiers

    Well, you could maybe use explicit casting, something like something=(void *)yourconstpointer....but really  its just a warning, saying essentially "Hey man, you told me this is const, but I can't protect that const-ness once you make a void * out of it". You could also reconsider making your little char arrays const, in a small program it really shouldn't matter much. Also, I bet there is an option in CC65 to make it be quiet about that particular warning.

  5. 2 hours ago, bfollowell said:

     

    Ok, Atari BASIC is fully supported in Altirra BASIC, which is fully supported in BASIC XL, which is fully supported in BASIC XE. So, for personal use, without the intention to distribute, and not wanting to compile, it sounds like BASIC XE would be the most advanced BASIC on the ATARI 8-bits. Or at least a toss-up between BASIC XE and Turbo BASIC XL.

     

    Also, I had to idea that Turbo BASIC XL was later adapted and became GFA BASIC for the ATARI ST line. Very interesting.

     

    Yep. I wrote a commercial (uh, well sort of) game in that.

  6. I have always used one of these: https://www.atarimax.com/sio2pc/documentation/
    The $34 one, to be precise. But, you need to have a PC physically connected, so I am just mentioning in case the location of your PC changes. You use the provided software to load up ATR files on your PC and then they look like Atari drives to the Atari.

     

    Never mind, should have read entire thread.

  7. 12 hours ago, newTIboyRob said:

    Oh, so that was the main reason I wasn't getting it then... it is because BASIC didn't support it.  I was trying to run those two loops in tandem, definitely how I was thinking... at one point I was close to the Y=X+173 except at that point I had them as string variables trying to add CHR$+1.  Ok, let me play a little in the emulator and see if I can get it. Thanks phaeron!

    To be fair, it's not just BASIC. Nothing I know of would support that loop behavior. Nested loops are...nested.

    • Like 1
    • Thanks 1
  8. 56 minutes ago, Preppie said:

    Thanks for helping wrathchild, but you're talking to a moron and this it going over my head.

     

    The limit of my abilities beyond windows is opening a command prompt, the black screen scares the hell out of me so I shut it immediately lol

     

    I can create the batchfile but where do I save it?  when do I run it? how often and how?

     

    I've download that makefile but after extracting it i'm lost.

     

    I fully understand if you don't want to hold my hand, at least I can run a program now I just need to type cl65 -o test1.xex -t atari test1.c every time and then double click on that beautiful easy to use icon :)

     

     

    Create a file called build.bat in the same folder your code is at. In it, put the command line compile statement that Wrathchild showed you. Then, when you want to compile, just open a commandline, cd to the directory that build.bat is in, and type 'build' (without the quotes). A batch file ('script') is just an automatic way to run a series of commands. You can leave the command line up and then just re-type 'build' when you want to compile again, so that way you don't have to keep 'cd-ing' to your code directory.

  9. You've chosen one of the more complicated tools by using CC65. You seem willing to read and learn, though, so hang in there and we will help. Not even knowing how to run a script on your operating system (which is....Windows?) puts you kind of behind. You'll need these basic skills on both the atari and the PC.

    • Like 1
  10. Yeah, be careful with the plugins, there can be some bad stuff in there sometimes. Well, what I normally do is to just open a terminal session and run my build script from in there. I use the standard C/C++ IntelliSense from Microsoft:

    Name: C/C++
    Id: ms-vscode.cpptools
    Description: C/C++ IntelliSense, debugging, and code browsing.
    Version: 1.17.5
    Publisher: Microsoft
    VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

     

    So, I don't get a lot of fancy integration but I really don't care all that much. Typing 'build.bat' or whatever works fine, and then just typing the batch file to start Altirra with my stuff is quick and easy. You do need to define the CC65 environment variable as mentioned above but usually that comes in with the cC65 install.

    • Like 1
  11. A very long time ago I wrote a little game on my Atari 800 called "Sprackman", in which the hero's main weapon was a deadly green fart, complete with squatting animation and butt-direction controls. I think the enemies were re-cast as little old ladies in wheelchairs...alcohol was involved in the creation of the concept, if I recall correctly, and never got past the initial demo stage.

    • Like 5
×
×
  • Create New...