Farb Posted January 24, 2012 Share Posted January 24, 2012 I'd like to add XEX/COM support to SIO2Arduino and am unsure of the best way to wrap one so it can boot like a disk? There's very limited space on the device so I can't store much in memory. Any ideas? Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 24, 2012 Share Posted January 24, 2012 Unsure of the best case situation but you're probably looking at 160 bytes minimum, probably more. Fairly sure there's 3 and 4 sector menu binloaders around, I did one based on an existing one and it was 5 although it had some bloat due to extra features like refresh file list and it had blocks that got relocated to minimize the chance of clashing with files it was to load. You could easily enough have a look at the XEX loaders used by APE, Aspeqt and SIO2SD. To get at them (not 100% on this but should be close) : APE - mount a directory as PC-Mirror on D1: then from the Atari read the first several sectors of that drive. Aspeqt - select "boot executable" then do the same. Aspeqt is different from the others in that it loads entire segments as a single record. SIO2SD - mount an XEX on D1: then read the first few sectors from that drive. Games Disk 16a.ATR That image has my 5 sector menu on it. Stuff gets relocated but you should be able to work it out. Stripping it down to the bare essentials would slim it down a lot. Quote Link to comment Share on other sites More sharing options...
fox Posted January 24, 2012 Share Posted January 24, 2012 The loader would fit in one sector. Then put the executable in the next sectors. That's what I did in X-BOOT and X-LOAD: http://ftp.pigwa.net/stuff/collections/atari_forever/PC/X-Asm%202.51/doc/ (source code of loaders is included). I also stripped $FF/$FF (to simplify the loader) and rewrote the run address in the executable (so that the loader doesn't need any EOF detection). Alternatively load the executable directly with special SIO commands as Aspeqt does. This solution is more elegant. Quote Link to comment Share on other sites More sharing options...
kenfused Posted January 25, 2012 Share Posted January 25, 2012 KBoot header (first 3 sectors) Replace LL HH with the low byte and high byte of the executable file size. Append the executable. Pad as desired. 00 03 00 07 14 07 4c 14 07 LL HH 00 00 a9 46 8d c6 02 d0 fe a0 00 a9 6b 91 58 20 d9 07 b0 ee 20 c4 07 ad 7a 08 0d 76 08 d0 e3 a5 80 8d e0 02 a5 81 8d e1 02 a9 00 8d e2 02 8d e3 02 20 eb 07 b0 cc a0 00 91 80 a5 80 c5 82 d0 06 a5 81 c5 83 f0 08 e6 80 d0 02 e6 81 d0 e3 ad 76 08 d0 af ad e2 02 8d 70 07 0d e3 02 f0 0e ad e3 02 8d 71 07 20 ff ff ad 7a 08 d0 13 a9 00 8d e2 02 8d e3 02 20 ae 07 ad 7a 08 d0 03 4c 3c 07 a9 00 85 80 85 81 85 82 85 83 ad e0 02 85 0a 85 0c ad e1 02 85 0b 85 0d a9 01 85 09 a9 00 8d 44 02 6c e0 02 20 eb 07 85 80 20 eb 07 85 81 a5 80 c9 ff d0 10 a5 81 c9 ff d0 0a 20 eb 07 85 80 20 eb 07 85 81 20 eb 07 85 82 20 eb 07 85 83 60 20 eb 07 c9 ff d0 09 20 eb 07 c9 ff d0 02 18 60 38 60 ad 09 07 0d 0a 07 0d 0b 07 f0 79 ac 79 08 10 50 ee 77 08 d0 03 ee 78 08 a9 31 8d 00 03 a9 01 8d 01 03 a9 52 8d 02 03 a9 40 8d 03 03 a9 80 8d 04 03 a9 08 8d 05 03 a9 1f 8d 06 03 a9 80 8d 08 03 a9 00 8d 09 03 ad 77 08 8d 0a 03 ad 78 08 8d 0b 03 20 59 e4 ad 03 03 c9 02 b0 22 a0 00 8c 79 08 b9 80 08 aa ad 09 07 d0 0b ad 0a 07 d0 03 ce 0b 07 ce 0a 07 ce 09 07 ee 79 08 8a 18 60 a0 01 8c 76 08 38 60 a0 01 8c 7a 08 38 60 00 03 00 80 00 00 00 00 00 00 Quote Link to comment Share on other sites More sharing options...
Farb Posted January 25, 2012 Author Share Posted January 25, 2012 Thanks for all your suggestions! I tried both fox's and kenfused's suggestions. I've decided to go with the KBoot header since it was easy to implement and reminds me of when I used to download ATR images from the Internet many years ago and wonder why there was a 'k' in the upper-corner of the screen during the boot Quote Link to comment Share on other sites More sharing options...
fox Posted January 26, 2012 Share Posted January 26, 2012 Replace LL HH with the low byte and high byte of the executable file size. Atari executables longer than 64k are very rare, but do exist. Quote Link to comment Share on other sites More sharing options...
kenfused Posted January 27, 2012 Share Posted January 27, 2012 Atari executables longer than 64k are very rare, but do exist. Doh you are right! I am pretty sure the next byte after the HH (a 00 in the hex dump) holds the next higher byte. There is one more byte after that one but it is not used. Quote Link to comment Share on other sites More sharing options...
Farb Posted January 27, 2012 Author Share Posted January 27, 2012 I am pretty sure the next byte after the HH (a 00 in the hex dump) holds the next higher byte. There is one more byte after that one but it is not used. That's what it looks like: ftp://ftp.pigwa.net/stuff/collections/nir_dary_cds/Tech%2520Info/DOS.HTM 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.