BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
dhandlerlib.c File Reference
#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.

Macro Definition Documentation

◆ DH_DJSR

#define DH_DJSR ( n)
Value:
"jsr 0x80000000+" BL_STR(TOK_debuglib) "+" #n "\n"
ULONG WORD UWORD UWORD border ULONG ULONG struct bb_bitmap *dst void UWORD n
Definition 2dlib.c:2498
#define BL_STR(x)
Definition blitzlib.h:533
#define TOK_debuglib
Definition dhandlerlib.c:112

◆ DH_JSR

#define DH_JSR ( tok)
Value:
"jsr 0x80000000+" BL_STR(tok) "\n"

◆ LIB_VERSION_OFF

#define LIB_VERSION_OFF   20

◆ LVO_CacheClearU

#define LVO_CacheClearU   (-636)

◆ LVO_CreateProc

#define LVO_CreateProc   (-138)

◆ LVO_WaitTOF

#define LVO_WaitTOF   (-270)

◆ TOK_debuglib

#define TOK_debuglib   0xd500

◆ TOK_dosethandler

#define TOK_dosethandler   0xd502

◆ TOK_dostop

#define TOK_dostop   0xd501

◆ TOK_rawstatus

#define TOK_rawstatus   ((LIB_blitzkeyslib << 7) + 2)

Function Documentation

◆ dhandlerlib_codefinit()

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.

◆ dhandlerlib_codeinit()

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.