⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bios.html

📁 一个不出名的GBA模拟器
💻 HTML
字号:
<HTML>
<HEAD>
<TITLE>Mappy VM SDK - Interrupts</TITLE>
<META NAME="Author" CONTENT="Michael Noland">
<META NAME="Copyright" CONTENT="(C) 2001-2002 Bottled Light, Inc.">
</HEAD>
<BODY BGCOLOR="#FFFFFF" BACKGROUND="bgtile.jpg">

<A HREF="#swi18">swi #0x18</A>

<P>The runtime debugging library is accessed via a special opcode sequence which is very unlikely to occur in normal code, and will run on hardware with no side-effects. </P>
<P></P>
<P>There are a number of different functions. </P>

<HR><A NAME="#hack00">
<H1>ConsolePrint (r0 = 0x00)</H1>
<P>
<H3>Prototypes:</H3>
void dprint(char * string);
void dprintf(char * string, params...);
</P>


<P>0x00: Write to the console</P>
<P>0x01: Beep</P>
<P>0x02: Pause CPU</P>
<P>0x03: Associate profile ID</P>
<P>0x04: Entering profile ID</P>
<P>0x05: Exiting profile ID</P>
<P>0x08: Open file</P>
<P>0x09: Close file</P>
<P>0x0A: Seek in file</P>
<P>0x0B: Write to file (not currently supported)</P>
<P>0x0C: Read from file</P>
<P>0x0D: Blinkenlights</P>

<HR><A NAME="#swi00">
<H1>SoftReset (swi #0x00)</H1>

<HR><A NAME="#swi01">
<H1>RegisterRamReset (swi #0x01)</H1>

<HR><A NAME="#swi02">
<H1>Halt (swi #0x02)</H1>

<HR><A NAME="#swi03">
<H1>Stop (swi #0x03)</H1>

<HR><A NAME="#swi04">
<H1>IntrWait (swi #0x04)</H1>
<P>Enters low power mode until a specified interrupt occurs.</P>

<HR><A NAME="#swi05">
<H1>VBlankIntrWait (swi #0x05)</H1>
<P>Enters low power mode until VBlank occurs.</P>

<HR><A NAME="#swi06">
<H1>Div (swi #0x06)</H1>
<P>
<H3>Parameters:</H3>
<UL>
<LI>R0 = numerator</LI>
<LI>R1 = denominator</LI>
</UL>
<H3>Results:</H3>
<UL>
<LI>R0 = numerator/denominator</LI>
<LI>R1 = numerator%denominator</LI>
<LI>R2 = abs(numerator/denominator)</LI>
</UL>
</P>

<HR><A NAME="#swi07">
<H1>DivArm (swi #0x07)</H1>

<HR><A NAME="#swi08">
<H1>Sqrt (swi #0x08)</H1>
<P>
<H3>Prototype:</H3>
uint32 Sqrt(uint32 value)
<H3>Parameters:</H3>
<UL>
<LI>R0 = number</LI>
</UL>
<H3>Result:</H3>
<UL>
<LI>R0 = sqrt(value)</LI>
</UL>
</P>


<HR><A NAME="#swi09">
<H1>ArcTan (swi #0x09)</H1>
<P>
<H3>Prototype:</H3>
uint32 ArcTan(uint32 value)
<H3>Parameters:</H3>
<UL>
<LI>R0 = value</LI>
</UL>
<H3>Result:</H3>
<UL>
<LI>R0 = arctan(value)</LI>
</UL>
</P>

<HR><A NAME="#swi0A">
<H1>ArcTan2 (swi #0x0A)</H1>

<HR><A NAME="#swi0B">
<H1>CPUSet (swi #0x0B)</H1>
<P>
<H3>Prototype:</H3>
void CPUSet(void * source, void * dest, uint32 control)
<H3>Parameters:</H3>
<UL>
<LI>R0 = source</LI>
<LI>R1 = dest</LI>
<LI>R2 = control word</LI>
</UL>

  bit26 = 32 or 16 bit transfer
  bits 15 - 0 = number of transfers
</P>

<HR><A NAME="#swi0C">
<H1>CPUFastSet (swi #0x0C)</H1>
<P>
<H3>Prototype:</H3>
void CPUFastSet(void * source, void * dest, uint32 control)
<H3>Parameters:</H3>
<UL>
<LI>R0 = source</LI>
<LI>R1 = dest</LI>
<LI>R2 = control word</LI>
</UL>
</P>

<HR><A NAME="#swi0E">
<H1>BgAffineSet (swi #0x0E)</H1>
<P>
<H3>Prototype</H3>
void BgAffineSet(PBgAffineParams params, PBgAffineResults result, int32 count)
</P>

<H3>Parameters</H3>
<UL>
<LI>R0: PBgAffineParams params</LI>
<LI>R1: PBgAffineResults result</LI>
<LI>R2: int32 count </LI>
</UL>

<H3>Structures</H3>
<PRE>struct {
  int32 cx;         // 20.8 x center of rotation on the texture
  int32 cy;         // 20.8 y center of rotation on the texture
  int16 screen_cx;  // center of rotation on the display
  int16 screen_cy;  // center of rotation on the display
  int16 scale_x;    // 8.8 x scale factor
  int16 scale_y;    // 8.8 y scale factor
  uint16 theta;     // rotation value (0-255)
} *PBgAffineParams, TBgAffineParams;


struct {
  int16 hdx;  // 8.8 horizontal textel per horizontal pixel delta
  int16 vdx;  // 8.8 vertical textel per horizontal pixel delta
  int16 hdy;  // 8.8 horizontal textel per vertical pixel delta
  int16 vdy;  // 8.8 vertical textel per vertical pixel delta
  int32 x;    // 20.8 x initial texture position
  int32 y;    // 20.8 y initial texture position
} *PBgAffineResults, TBgAffineResults;
</PRE>
</P>

<HR><A NAME="#swi0F">
<H1>ObjAffineSet (swi #0x0F)</H1>

<HR><A NAME="#swi10">
<H1>BitUnPack (swi #0x10)</H1>

<HR><A NAME="#swi11">
<H1>DecompressLZSStoWRAM (swi #0x11)</H1>
<P>Input: r0 = source address r1 = dest address </P>

<HR><A NAME="#swi12">
<H1>DecompressLZSStoVRAM (swi #0x12)</H1>
<P>Input: r0 = source address r1 = dest address</P>

<P>
The window is 4096 bytes, the minimum entry length is 3 bytes and the maximum entry length is 18 bytes.
</P>

<HR><A NAME="#swi13">
<H1>DecompressHuffman (swi #0x13)</H1>
<P>
<H3>Prototype:</H3>
void DecompressHuffman(void * source, void * dest)
<H3>Parameters:</H3>
<UL>
<LI>R0 = pointer to the huffman compressed data</LI>
<LI>R1 = pointer to a buffer to place the decompressed data in</LI>
</UL>
</P>

<HR><A NAME="#swi14">
<H1>DecompressRLEtoWRAM (swi #0x14)</H1>
<P>
<H3>Prototype:</H3>
void DecompressRLEtoWRAM(void * source, void * dest)
<H3>Parameters:</H3>
<UL>
<LI>R0 = pointer to the RLE compressed data</LI>
<LI>R1 = pointer to a buffer to place the decompressed data in</LI>
</UL>
</P>

<HR><A NAME="#swi15">
<H1>DecompressRLEtoVRAM (swi #0x15)</H1>
<P>
<H3>Prototype:</H3>
void DecompressRLEtovRAM(void * source, void * dest)
<H3>Parameters:</H3>
<UL>
<LI>R0 = pointer to the RLE compressed data</LI>
<LI>R1 = pointer to a buffer to place the decompressed data in</LI>
</UL>
Notes:
This version buffers decompressed bytes and writes them in halfwords since VRAM is not single-byte addressable.
</P>

<HR><A NAME="#swi16">
<H1>Diff8bitUnFilterWRAM (swi #0x16)</H1>
<P>
</P>

<HR><A NAME="#swi17">
<H1>Diff8bitUnFilterVRAM (swi #0x17)</H1>
<P>
</P>

<HR><A NAME="#swi18">
<H1>Diff16bitUnFilter (swi #0x18)</H1>
<P></P>

<H1>These are not currently implemented in Mappy VM</H1>
<P>SoundBiasChange (swi #0x19)</P>
<P>SoundDriverInit (swi #0x1A)</P>
<P>SoundDriverMode (swi #0x1B)</P>
<P>SoundDriverMain (swi #0x1C)</P>
<P>SoundDriverVSync (swi #0x1D)</P>
<P>SoundChannelClear (swi #0x1E)</P>
<P>MIDIKey2Freq (swi #0x1F)</P>
<P>MusicPlayerOpen (swi #0x20)</P>
<P>MusicPlayerStart (swi #0x21)</P>
<P>MusicPlayerStop (swi #0x22)</P>
<P>MusicPlayerContinue (swi #0x23)</P>
<P>MusicPlayerFadeOut (swi #0x24)</P>
<P>MultiBoot (swi #0x25)</P>
<P>SoundDriverVSyncOff (swi #0x28)</P>
<P>SoundDriverVSyncOn (swi #0x29)</P>

<P>VBADPrint (swi #0xFF)
<STRONG>Warning</STRONG>: <EM>Will not work on hardware.</EM>
</P>

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -