Harry Potter Posted January 1, 2023 Share Posted January 1, 2023 Hi! Over the past few days, I've been debugging and optimizing my AdvSkelVic65 program. Now, it has a version for an 8k or 16k Atari8 cartridge, and a 32k version is planned. Currently, the Atari cartridge version has an issue with scrolling: at first, the screen moves slightly, then the screen clears. You can find the program at c65 additions - Manage /game at SourceForge.net. It uses AtaSimpleIO for the Atari version. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted January 1, 2023 Share Posted January 1, 2023 4 hours ago, Harry Potter said: Hi! Over the past few days, I've been debugging and optimizing my AdvSkelVic65 program. Now, it has a version for an 8k or 16k Atari8 cartridge, and a 32k version is planned. Currently, the Atari cartridge version has an issue with scrolling: at first, the screen moves slightly, then the screen clears. You can find the program at c65 additions - Manage /game at SourceForge.net. It uses AtaSimpleIO for the Atari version. You programmed this right? Also, if you are changing the pointers to the display list maybe you are changing the high byte instead of the low byte. I'm not 100% though. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 1, 2023 Author Share Posted January 1, 2023 AFAIK, neither AtaSimpleIO nor the text adventure code uses the display list. AtaSimpleIO accesses the ROM print function, though. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted January 1, 2023 Share Posted January 1, 2023 4 hours ago, Harry Potter said: AFAIK, neither AtaSimpleIO nor the text adventure code uses the display list. AtaSimpleIO accesses the ROM print function, though. Unfortunately I can't help you then. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 1, 2023 Author Share Posted January 1, 2023 I just tried AdvSkel65 for the Atari, and it works. It is also the higher-end version, so you're not missing out on much. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 1, 2023 Author Share Posted January 1, 2023 Maybe the source code will help. You can find the latest published version of AdvSkelVic65 at c65 additions - Manage /game at SourceForge.net. Quote Link to comment Share on other sites More sharing options...
+David_P Posted January 2, 2023 Share Posted January 2, 2023 5 hours ago, Harry Potter said: AFAIK, neither AtaSimpleIO nor the text adventure code uses the display list. AtaSimpleIO accesses the ROM print function, though. Certain vectors in the OS ROM are not supported, and changed between the various iterations of the OS. This could be a case of using a function whose location changed between the 400/800 and XL OS ROMs. Quote Link to comment Share on other sites More sharing options...
xzpecter Posted January 2, 2023 Share Posted January 2, 2023 If a character # 125 is sent to the "S:" device, then the screen will be cleared. Perhaps this is happening somewhere in the text output. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 2, 2023 Author Share Posted January 2, 2023 xzpecter: I don't believe I'm using Character #125, as I have no need to. David_P: The only time I need to use the ROMs other than for loading the stubs--which aren't being loaded in the Atari8 cartridge version--is to print text. Also, the high-end version works properly. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted January 2, 2023 Share Posted January 2, 2023 I wish you'd learn to diagnose these things yourself. In Altirra set a breakpoint for when a blank char is written to a specific screen location you know will be cleared. Then trace back the calls from that in the history 2 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted January 2, 2023 Share Posted January 2, 2023 47 minutes ago, Wrathchild said: I wish you'd learn to diagnose these things yourself. 👍 That's part of the fun @Harry Potter I'm no expert using Altirra debugger, but I can trace programs and monitor memory etc. It's just so powerful, just get to learn how to do it, it's worth taking some time out and playing with it. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 2, 2023 Author Share Posted January 2, 2023 If it helps, I attached the code responsible for printing to the scree. ata_printc.s Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted January 2, 2023 Share Posted January 2, 2023 Looks like your code is jumping into ROM, as said before by @David_P this is not really a good thing to do unless it's one of the known vectors that doesn't change between OS versions. It's really not a good practice. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 2, 2023 Author Share Posted January 2, 2023 Okay. How do I print to the screen in a reliable way? Same with reading from the keyboard? BTW, the program works but not 100%, and the high-end version works properly. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted January 2, 2023 Share Posted January 2, 2023 1 hour ago, Harry Potter said: How do I print to the screen in a reliable way? That's not a question with a straight forward answer as so much context is missing. "LDA #value / STA someByteInScreenMem" is a legitimate answer, e.g. if you control the screen. If you want to use the "S:" device, are you assuming it's already open (via the OS) or will you close and open it yourself? We repeatedly point you at tomes such as De Re Atari and Mapping the Atari, and there will be many articles in the likes or Page 6, Antic, Analog magazines... Please take the time and effort to do homework before asking people to do it for you. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted January 2, 2023 Share Posted January 2, 2023 You can also have a pointer to where your “cursor” is in screen memory so you can write to the pointer, move the pointer, and continue as normal. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted January 2, 2023 Share Posted January 2, 2023 2 hours ago, Ecernosoft said: You can also have a pointer to where your “cursor” is in screen memory so you can write to the pointer, move the pointer, and continue as normal. Just have to remember that "putting" bytes directly to screen will require some conversion from ASCII characters, I did something like this in a disk copy utility where I put the current sector number on screen. Not the most elegant code, but I did write this in the 80's, but it works. Takes the current sector number from DAUX1 and DAUX2 using known FP calls in ROM to convert the number to INT then ASCII. move the result to a buffer while converting from ASCII, as it's always numbers, just subtract $20. The put to screen at the known location. LOOP200 LDA DAUX1 STA $D4 LDA DAUX2 STA $D5 JSR $D9AA ; INT to FP JSR $D8E6 ; FP to ASCII LDA #0 LDX #6 XXX STA BUFFER2,X DEX BNE XXX LDY #0 LDX #0 L500 LDA ($F3),Y ; pointer to ASCII text from FP BMI BUFOUT SEC SBC #$20 STA BUFFER2,X INY INX JMP L500 BUFOUT AND #$7F SEC SBC #$20 STA BUFFER2,X LDX #0 LDY #22 LOP LDA BUFFER2,X STA ($58),Y ; points to start of screen + Y register INY INX CPY #26 BNE LOP 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted January 2, 2023 Share Posted January 2, 2023 4 hours ago, Harry Potter said: Okay. How do I print to the screen in a reliable way? As your using cc65, why not use include conio.h then use the function gotoxy(x,y) to place the cursor where you want to print. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted January 2, 2023 Share Posted January 2, 2023 4 hours ago, TGB1718 said: As your using cc65, why not use include conio.h then use the function gotoxy(x,y) to place the cursor where you want to print. Just a noob question: What is a .h file? Just asking. Not like I'm going to use CC65 though. And if I ever did I'd just use 8bitworkshop's built in CC65. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted January 2, 2023 Share Posted January 2, 2023 (edited) C uses header files where you put things like function prototypes/definitions etc. It saves having everything in your main code for example if you put this at the top of your program, it will give you access to all the standard functions defined in the header file, the actual code for those functions are in libraries which are linked in during compilation #include <stdio.h> int main(void) { code goes here } There are loads of libraries that come with C In my response to Harry, you use the header conio.h which defines the function gotoxy(x,y) Edited January 2, 2023 by TGB1718 1 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 3, 2023 Author Share Posted January 3, 2023 I want to use AtaSimpleIO, as it is more efficient than the C standard and console I/O libraries. I also don't need gotoxy() for this version of my text adventure codes, as I don't need to relocate the cursor. My other text adventure code works, though, and it also uses AtaSimpleIO. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted January 3, 2023 Share Posted January 3, 2023 23 hours ago, Wrathchild said: We repeatedly point you at tomes such as De Re Atari and Mapping the Atari, and there will be many articles in the likes or Page 6, Antic, Analog magazines... Please take the time and effort to do homework before asking people to do it for you. Why would he do that when we always wind up doing it for him? Besides, he really just wants a little attention I think. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted January 3, 2023 Share Posted January 3, 2023 I know, I'm suckered in, but decided to do this just for fun. @Harry Potter attached is some MADS source, have a look, it's only a demo, but the code that does the business is small and could easily be improved on. Easy to include into a cc65 program as assembler routines. Bear in mind though MADS is nice in that if you put ASCII strings in double quotes it produces the string in Atari Screen format not ASCII. scratch.xex scratch.asm Quote Link to comment Share on other sites More sharing options...
danwinslow Posted January 3, 2023 Share Posted January 3, 2023 18 hours ago, Ecernosoft said: Just a noob question: What is a .h file? Just asking. Not like I'm going to use CC65 though. And if I ever did I'd just use 8bitworkshop's built in CC65. A .h file is a 'specification' file for the C language, also known as a 'header' file. You put definitions of things in there so that other modules can see/call them. So, for instance, a foobar.h file might have: void foo(int bar); in it. Then, if another C language file includes that .h file, it can see and call the foo() function. Note that there must be a matching foobar.c file with a matching function 'body': void foo(int bar) { //some code.... } The 'body' is signified by the open and close braces and the code between them. This is called separation of specification (.h) and implementation (.c). 1 Quote Link to comment Share on other sites More sharing options...
danwinslow Posted January 3, 2023 Share Posted January 3, 2023 3 minutes ago, TGB1718 said: I know, I'm suckered in, but decided to do this just for fun. @Harry Potter attached is some MADS source, have a look, it's only a demo, but the code that does the business is small and could easily be improved on. Easy to include into a cc65 program as assembler routines. Bear in mind though MADS is nice in that if you put ASCII strings in double quotes it produces the string in Atari Screen format not ASCII. scratch.xex 274 B · 0 downloads scratch.asm 2.32 kB · 0 downloads Yep, doesn't hurt, could provide anybody some info, so why not. It gets old though in OP's case. 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.