Jump to content
IGNORED

keypress, loading map with xbios, in madPascal crashes


Recommended Posts

i am running from one problem into the next and would need help-- again...

 

i can now load maps using xbios, and my main program looks basically like this

 


procedure loadMap();
begin;
  scrname[1] := char($41+currentMap);
  fntname[1] := char($41+currentMap);
  xbunAPL (fntname, Pointer(CHARSET_ADDRESS));
  xbunAPL (scrname, Pointer(TXT_ADDRESS));
end;


begin
  asm;
    jsr xbios.xBIOS_SET_DEFAULT_DEVICE
  end;
  SystemOff;
  currentMap := 0;
  loadMap();

  // some init stuff

  paintPlayer(0);
  Poke($D20E, 0); // turn off all IRQs
  repeat;
    asm;
    loop:
            lda skctl        ; ANY KEY
            and #$04
            bne loop
            lda kbcode
            sta ch
    end;
    MoveCurrentPlayer(ch);
    loadMap();
    Poke($D20E, 0); // turn off all IRQs again
  until false;
end;

 

this works-- if i press the key to move only after loading has clearly finished.

if i press the keys too fast, seemingly during xbios loading (in the background?),

it somehow crashes. not sure where and especially not why.

 

so i am sure i am missing something 'small', because i do not understand atari.

 

can anyone help me out again?

 

 

Link to comment
Share on other sites

xIRQEN          equ xBIOS+$3e8 ; User IRQ (1 byte)

 

can be configured via the xB header, file or used as desired after program startup.

  • Like 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...