RetroCoder Posted October 13, 2021 Share Posted October 13, 2021 I've got a decompressor routine that I use in my code and located it at $2000. Now I want to pack my xex file blocks and was wondering if I can move the decompressor to the tape buffer area @ $3FD - $4FF? Is it safe for all DOS versions? If not seen many programs use that space, so having a decompressor located there would be great. Extra benefit is that the code is exactly $103 bytes. Maybe even a general packer could be written. Quote Link to comment Share on other sites More sharing options...
kenjennings Posted October 13, 2021 Share Posted October 13, 2021 According to Mapping the Atari if you're not using the Cassette, FP package, or BASIC, looks like memory is free from $3FD through $6FF. Quote Link to comment Share on other sites More sharing options...
baktra Posted October 13, 2021 Share Posted October 13, 2021 The cassette buffer will not be used by normal Atari DOSes (DOS 2 family), as they do not want to interfere with the "C:" device. I wouldn't be so sure for SpartaDOS like systems and also for those tiny "DOSes" that do not do anything else than load one binary file (MicroDOS, PicoDOS, PicoBoot). There is never a guarantee. You would need to consult docs of the respective DOSes. I believe a better option would be to decide with what DOSes you want your program to work with. And then choose the location for the depacker accordingly. It is no shame to support only subset of DOSes on this platform. 3 Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted October 13, 2021 Share Posted October 13, 2021 If this area is used only as temporary, then likely ok, though there is of course a hand full of software whose authors had the same idea. (-: For example, DDT (the Mac/65 debugger) uses this area for its temporaries. The most reliable and portable way would be to allocate space directly above MEMLO and relocate your code into this area. That's the "official" way. 1 Quote Link to comment Share on other sites More sharing options...
kenames99 Posted October 13, 2021 Share Posted October 13, 2021 spartados 3.2d and 3.2c do not use that area. 3.2p, al 3.3 versions, and all current realdos versions do use that area. Ken 2 Quote Link to comment Share on other sites More sharing options...
RetroCoder Posted October 13, 2021 Author Share Posted October 13, 2021 Currently my packer asks for a location of a safe space and then locates the de-packer and the compressed data there. Once a piece is compressed into the right location the next file block is loaded into the safe space etc. Works quite well if you know your program does not use a specific memory area. Not writing a general purpose packer, but hoping to have one flexible enough for various programs. The other advantage I have is that my level data is compressed and the same de-packer is already used in the game, so loading it at its final location as the first block in a file and then using it to unpack the rest of the program is a bonus Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 13, 2021 Share Posted October 13, 2021 The cassette buffer only extends to $047F. $0480-$06FF is considered user program memory (Atari OS Manual, section 4), with the caveat that the floating-point package can use part of it if used by the program. Thus, if you're concerned about conflicts with C:, only half of this memory is affected. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 13, 2021 Share Posted October 13, 2021 $580-$5FF is generally used as the input buffer for Basic (usually E: input) and can actually overflow into page 6. But the usage is temporary and you'd generally not have E: input going on during a load/compress operation. 1 Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted October 14, 2021 Share Posted October 14, 2021 Think if you are packing a ML program and it does not use/require Basic, then you can use pages 4, 5 and 6 safely. I am using pages 4 and 5 for Superpacker/Exomizer buffer and depacker since several years now without any problems. The only time when I cannot use that area is when the (unpacked) ML program itself makes use of these memory pages. 1 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 14, 2021 Share Posted October 14, 2021 Is it safe to use these areas with my cc65 programs? I've been wanting to use some Low Memory areas with my cc65/Atari 8 programs. Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted October 14, 2021 Share Posted October 14, 2021 Oh no, not again. Look, have you now understood how a binary load file works? This area is likely too small for compiled programs, and it is not generally safe to use, in particular to programs that using parts of the Os services. These are tape and printer buffers, and conversion buffers for the math pack functions. In general, 0x1f00 and up is a good place for user programs, and not this area. 3 Quote Link to comment Share on other sites More sharing options...
sanny Posted October 14, 2021 Share Posted October 14, 2021 As I said before, the simplest way to use this memory area in cc65 is by calling _heapadd() [https://cc65.github.io/doc/funcref.html#ss3.5] so it becomes malloc()-able. To automatically load something there from the EXE file you need to add a load chunk. 1 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 14, 2021 Share Posted October 14, 2021 Can I load data into these areas from the main program? That's what I'm doing on the CBM versions of my memory enhancements. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted October 14, 2021 Share Posted October 14, 2021 Please take this back to your other thread... of course you can, as you have been told multiple times 1 1 Quote Link to comment Share on other sites More sharing options...
sanny Posted October 14, 2021 Share Posted October 14, 2021 1 hour ago, Harry Potter said: That's what I'm doing on the CBM versions of my memory enhancements. I'm wondering how you do that. Can you explain? Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 14, 2021 Share Posted October 14, 2021 I simply write the files in the config files with the starting address then use cbm_load() to load them into memory at the beginning of the main() function. Quote Link to comment Share on other sites More sharing options...
sanny Posted October 14, 2021 Share Posted October 14, 2021 Hmm. So you have code to explicitly load these areas. You can do the same on Atari, where is the problem? (Atari could do better by loading it automatically from DOS, but you seem to have problems implementing that...) Quote Link to comment Share on other sites More sharing options...
+Stephen Posted October 15, 2021 Share Posted October 15, 2021 Relax and put away your tin-foil hat. Commodore didn't destroy the free world. This 7-year old playground mentality shit needs to stop. 1 2 Quote Link to comment Share on other sites More sharing options...
miker Posted October 15, 2021 Share Posted October 15, 2021 @Harry Potter https://atariage.com/forums/forum/172-commodore-8-bit-computers/ - Commodore subforum I don't believe Dumbledore hasn't told you... 1 Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted October 15, 2021 Share Posted October 15, 2021 12 hours ago, Kyle22 said: Harry, why do you talk about Commie shit here? Because he was requested to do so. Only dull people won't share and learn from principles applied in a similar field elsewhere... 1 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.