Keatah Posted February 22, 2022 Share Posted February 22, 2022 Which version? 1, 2 or 3, have you decided on porting over? Quote Link to comment Share on other sites More sharing options...
ClausB Posted February 22, 2022 Author Share Posted February 22, 2022 2 minutes ago, Keatah said: Which version? 1, 2 or 3, have you decided on porting over? The original 16K cassette one, A2-FS1 VERSION 1#064fc0 on your disk. 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted February 22, 2022 Author Share Posted February 22, 2022 3 hours ago, Wrathchild said: I've disassembled Aviator from the BBC Micro and every now and then go back and try and decipher some more meaning from it. So if anyone fancies collaborating on that then we might see it quicker ? Is this your site? https://aviator.bbcelite.com/ Impressive! 1 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted February 22, 2022 Share Posted February 22, 2022 (edited) 6 hours ago, ClausB said: Is this your site? Nope, another Mark Hadn't seen that, should make life easier I see he's working on REVS to, another title that would be a nice to have on the A8. Edited February 22, 2022 by Wrathchild Quote Link to comment Share on other sites More sharing options...
ClausB Posted February 23, 2022 Author Share Posted February 23, 2022 (edited) Poring over the disassembly. Found the screen clear subroutine. It has to erase all the lines in the upper screen before drawing the next frame. It has to be as fast as possible so that you don't see a blank screen, ideally less than one video frame, or 1/60 sec. Otherwise it would flicker badly. It uses a string of 96 STA adr16,X instructions, one for each display line, looping with X from 39 to 0. That's 96x40 bytes at 4 cycles per byte. With a little overhead that's 17k cycles, almost exactly 1/60 sec. on the Apple. At 3 bytes per instruction that's a big piece of code for a 16K program so they used some tricks. They cut it in half by using self-modifying code. First called with DEX and BPL and then called again with DEX and BMI. That works because of the funny HGR memory map. Then they cut it into quarters and stuffed it into unused display lines in that map (some of those random pixels in the BMP above). Clever! The TRS-80 version has fewer bytes to clear, just 50x14. They found the fastest way to do that was to borrow the stack pointer. PUSH DE writes two bytes in 11 cycles and increments the address automatically. So there are 25 of those one-byte instructions in a row, looped 14 times. It executes in only one eighth the time. Edited February 23, 2022 by ClausB 3 Quote Link to comment Share on other sites More sharing options...
ClausB Posted February 26, 2022 Author Share Posted February 26, 2022 First run! Display is still messy but it actually flies! 9 Quote Link to comment Share on other sites More sharing options...
Gunstar Posted February 26, 2022 Share Posted February 26, 2022 (edited) On 2/13/2022 at 6:09 AM, ClausB said: Typical Apple artifact colors. Screen shots above. After figuring out the 7-bit to 8-bit thing, I would probably convert to mode E so the colors are consistent. The outside view is always monochrome and really just 140 pixels wide (2 bits per pixel). In the end, I never saw much point in hi-res mode for Mercenary, when it ran so much smoother in (possibly mode E) 160x192. So the lines were more jagged looking, they were still just lines. The frame rate easily made up the difference. As a teenager back then with no real knowledge of the Atari's hardware, I wanted everything simulation-wise to be in high-res like the Apple, but after learning how much faster animation can be in Atari's colorful lower resolutions, I understood why. They should have done FS2 in a lower resolution too, and have a decent frame-rate. It's just lines... Edited February 26, 2022 by Gunstar Quote Link to comment Share on other sites More sharing options...
ClausB Posted February 26, 2022 Author Share Posted February 26, 2022 (edited) Fixed the text display and started fixing the HGR. Still some 7-bit things lingering. Edited February 26, 2022 by ClausB 6 Quote Link to comment Share on other sites More sharing options...
ClausB Posted February 27, 2022 Author Share Posted February 27, 2022 Fixed instrument panel: 12 Quote Link to comment Share on other sites More sharing options...
Goochman Posted February 27, 2022 Share Posted February 27, 2022 Looking good ClausB. Not sure when you've finished this if you had any interest in adopting the 2(?) scenery disks that cam eout for the A2 and C64 the Atari didnt? One would imagine the data is the same just the disk format different? 2 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 1, 2022 Author Share Posted March 1, 2022 Not sure at the moment whether I want to get into FS2. I'm hitting a wall with FS1. It's going to be a case of the last 10% taking 90% of the effort. Lines with slope > 1/2 draw OK now, but shallower lines draw too long with gaps. (That's also why there's junk on screen left.) The code is complex, having to deal with that 7-bit thing, and I haven't yet figured it out. 3 1 Quote Link to comment Share on other sites More sharing options...
Tempest Posted March 1, 2022 Share Posted March 1, 2022 The sorcerer can do artifact color? I didn't know that. Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 1, 2022 Author Share Posted March 1, 2022 (edited) No, this is the Apple version modified to run on Atari. You're thinking of the TRS-80 version modified for the Sorcerer. Edited March 1, 2022 by ClausB Quote Link to comment Share on other sites More sharing options...
Tempest Posted March 1, 2022 Share Posted March 1, 2022 9 hours ago, ClausB said: No, this is the Apple version modified to run on Atari. You're thinking of the TRS-80 version modified for the Sorcerer. Oh ok. I was wondering how the heck you did that! Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 5, 2022 Author Share Posted March 5, 2022 Switched to ANTIC mode E, so no more artifact color. Fixed control indicators. Haven't fixed shallow lines yet. 8 Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 6, 2022 Author Share Posted March 6, 2022 Getting close. Think I'm on the right track... 1 4 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 7, 2022 Author Share Posted March 7, 2022 (edited) Well, that train derailed. But this one has arrived! The line drawing routine is an intricate web of code to build the 7-bit bytes before writing them to the screen. Since even and odd bytes are different in the Apple, that code web is quite involved and took me days to decipher and to adjust to Atari's 8-bit bytes. A few details remain to fix, e.g. radar/map display. Edited March 7, 2022 by ClausB 14 Quote Link to comment Share on other sites More sharing options...
reifsnyderb Posted March 7, 2022 Share Posted March 7, 2022 Looking really good! It's surprising they never released this for the Atari. 2 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 7, 2022 Author Share Posted March 7, 2022 (edited) Thanks. I'm not sure they didn't. This from the FS2 manual, page 85: "Large portions of this program were derived from subLOGIC's AT-3DZ graphics package, AT-FS1 flight simulator..., and AT-PB1 pinball." I'm guessing this was a search and replace error and should say A2-FS1. Or maybe they started porting it and shelved it in favor of FS2. Edited March 7, 2022 by ClausB Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 8, 2022 Author Share Posted March 8, 2022 (edited) The shallow line routine has 7 entry points and 7 exit points, one for each pixel position in an even or odd byte. I call it a web because the paths from entry to exit cross, join, and split. My task was to find the 4 paths needed for each pixel position in the Atari and patch JMPs in just the right places to short circuit the web in all 4 paths. It made my head hurt and I had several false starts and partial successes. When I finally found a single patch for all 4 paths, I knew it would be right. It was quite a victory for my aged brain. I want to share it now so you all can help shake out the last bugs. AT-FS1b.COM Edited March 8, 2022 by ClausB 7 5 Quote Link to comment Share on other sites More sharing options...
Keatah Posted March 10, 2022 Share Posted March 10, 2022 Well it seems to have turned out quite nice. Has the "off-grid" anomalies when flying too far away - exactly like the Apple II version. Think it's a great contrast to play these earlier iterations then segue into something like X-Plane. Helps one fully appreciate the progress made throughout the decades. 1 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 10, 2022 Author Share Posted March 10, 2022 (edited) Yes, I tried to change the bare minimum. One thing I came away with was great respect for Apple II game programmers for what they had to work with. Yes, that contrast is why I chose to port the very first version. That and the historical importance. Though I was disappointed that this version lacks the overhead view, which the TRS-80 Version calls RADAR mode. Which emulator did you use? Please try out the Flying Ace mode. Might be bugs there. Someone please try it on real hardware. I've been working on joystick support, in place of the A2 paddle code. Edited March 10, 2022 by ClausB 1 Quote Link to comment Share on other sites More sharing options...
Keatah Posted March 10, 2022 Share Posted March 10, 2022 (edited) I'm strictly emulator-only with Atari 8-bit. I use Altirra. NB I had to select Full Raw Keyboard Scan for the keyboard-mode. added: Raw Keys also works. Edited March 10, 2022 by Keatah 1 Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 10, 2022 Author Share Posted March 10, 2022 Interesting. I'm reading the keyboard without interrupts. It doesn't work well on two older Android emulators but it does on Atari800MacX. Quote Link to comment Share on other sites More sharing options...
ClausB Posted March 10, 2022 Author Share Posted March 10, 2022 3 hours ago, Keatah said: I had to select Full Raw Keyboard Scan for the keyboard-mode. Why isn't that the default mode in Altirra? As a matter of fact, all interrupts are disabled in this port, because the A2 image overwrites all of low memory, so the Atari OS won't work. 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.