Jump to content
IGNORED

How to init bbasic after asm section?


alk0v

Recommended Posts

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

.....

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by alk0v
Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...