alk0v Posted October 21, 2020 Share Posted October 21, 2020 Hi. I tried to add full-screen 32x40 assymmetric playfield logo and few seconds delay as intro to my game. I inserted it as assembly section before main program in the BAtari Basic. It start from clear RAM and TIA and works fine. After delay i continue my program using bbasic, but it does not work. If i'm not clear ram and tia, bbasic section works fine, but my full screen logo does not works. Is it possible to add some init after asm section for start bbasic part of code? asm Reset ; Clear RAM and all TIA registers ldx #$FF lda #0 Clear sta $0,x dex ;cpx #$80 bne Clear ldx #0 ;rem logo timer stx $80 ;rem store in cell 80 StartOfFrame ldx $80 inx ... ldx $80 cpx #100 beq EndOfLogo jmp StartOfFrame EndOfLogo end Here is start of bbasic part, but it does not work if i clean memory and registers. playfield: ................................ ................................ ....XXXX...............XXXX..... ....X.....................X..... ....X.....................X..... ....X.....................X..... ....X.....................X..... ....XXXX...............XXXX..... ................................ ................................ ................................ end ..... Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 21, 2020 Share Posted October 21, 2020 Just copy the lines of code between the Reset and StartOfFrame to below EndOfLogo, and change this new section of code to reference "Clear2" rather than "Clear". Alternatively you could try to selectively clear your memory and registers, based on what you actually used in your logo code, but the clear routines is so short it's probably not worth the effort. Quote Link to comment Share on other sites More sharing options...
alk0v Posted October 21, 2020 Author Share Posted October 21, 2020 (edited) I checked result assembler code, generated by bbasic. In the start of code bbasic created lot of initializations. My assembler code in bas placed in the start of bas-file, but in resulting asm file it placed in the section game after all initializations. And my first lines in the assembler code clear all memory (Clear loop). After this my code that draw assymetric playfield logo works fine. If i start bas file from StartOfFrame, it works incorrect. When i move Clear section after EndOfLogo, rest of bbasic code does not works, because it clear all initializations, as i understand. I needs some initialization bbasic command that return memory and TIA registers to state compatable with bbasic. Edited October 21, 2020 by alk0v Quote Link to comment Share on other sites More sharing options...
RevEng Posted October 21, 2020 Share Posted October 21, 2020 I see... yeah, after clearing memory and registers, the rest of the bB startup.asm code sets up the scorepointers, etc. There shouldn't be a reason you need to wipe all of memory for each screen or section of assembly code you run. So I'd skip the general memory clear routine in your logo assembly - that way you can avoid touching memory that bB needs (like the score pointers) and you can restore/clear only the registers and memory you did happen to use in your logo routine. 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.