|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
#include "blitzlib.h"Macros | |
| #define | TOK_debuglib 0xd500 |
| #define | TOK_dostop 0xd501 |
| #define | TOK_dosethandler 0xd502 |
| #define | TOK_rawstatus ((LIB_blitzkeyslib << 7) + 2) |
| #define | DH_JSR(tok) |
| #define | DH_DJSR(n) |
| #define | LVO_CreateProc (-138) |
| #define | LVO_WaitTOF (-270) |
| #define | LVO_CacheClearU (-636) |
| #define | LIB_VERSION_OFF 20 |
Functions | |
| void | dhandlerlib_codeinit (void) |
| Library init (assembler below): starts the debugger program as the process "Blitz ][ Debug Proc". | |
| void | dhandlerlib_codefinit (void) |
| Library finit (assembler below): ends the debugger process. | |
| #define DH_DJSR | ( | n | ) |
| #define DH_JSR | ( | tok | ) |
| #define LIB_VERSION_OFF 20 |
| #define LVO_CacheClearU (-636) |
| #define LVO_CreateProc (-138) |
| #define LVO_WaitTOF (-270) |
| #define TOK_debuglib 0xd500 |
| #define TOK_dosethandler 0xd502 |
| #define TOK_dostop 0xd501 |
| #define TOK_rawstatus ((LIB_blitzkeyslib << 7) + 2) |
| void dhandlerlib_codefinit | ( | void | ) |
Library finit (assembler below): ends the debugger process.
Removes the vertical blank server, calls the debugger's cleanup handler (handler table +20), waits until the process has returned (taskdone) and frees the segment. BUG(orig) (#410): the segment is freed while the process still has to execute its last RTS in it.
In: a6 = dos, d6 = graphics.
| void dhandlerlib_codeinit | ( | void | ) |
Library init (assembler below): starts the debugger program as the process "Blitz ][ Debug Proc".
Copies the code template mystart..mystart_f (memlib globalloc, not checked), patches it with ltable and progadd and starts it with CreateProc; waits (WaitTOF) until the debugger has called l2 (dosethandler), then installs the Ctrl-LAlt-C check as vertical blank server (intlib SetInt, level 5). Nothing happens without a debugger program (d0 = 0); waits for ever if it never calls l2. Fixed (#409): the caches are flushed (exec CacheClearU, V37 or newer) between the copy and CreateProc; the original started the copied code without a flush.
In: d0 = BPTR of the debugger program loaded by the editor (0: none), a6 = dos, d6 = graphics.