some more toolbox routines, small fixes
This commit is contained in:
parent
3c3d2ffd6b
commit
48f181bd32
|
@ -62,7 +62,7 @@
|
|||
[_ [addr] :y] [:idy addr]
|
||||
; can tell ial / idl apart by the mnemonic
|
||||
[:jmp [[addr]]] [:ial addr]
|
||||
[_ [[addr]]] [:idl :addr]
|
||||
[_ [[addr]]] [:idl addr]
|
||||
; can tell iax / idx apart by the mnemonic
|
||||
[:jmp [addr :x]] [:iax addr]
|
||||
[:jsr [addr :x]] [:iax addr]
|
||||
|
|
|
@ -19,10 +19,17 @@
|
|||
(set! UserID (MMStartUp))
|
||||
(IMStartUp)
|
||||
(TextStartUp)
|
||||
(MTStartUp)
|
||||
|
||||
(printnum (& (- 10) 0xff))
|
||||
(printnum (| 10 0x8000))
|
||||
(printnum (^ 0xff00 0x0ff0))
|
||||
(GrafOn)
|
||||
(let (screen 0xe12000 i 0)
|
||||
(while (< i 0x9d00)
|
||||
(word! (+ screen i) (Random))
|
||||
(set! i (+ i 2))))
|
||||
|
||||
(GrafOff)
|
||||
|
||||
(MTShutDown)
|
||||
(TextShutDown)
|
||||
(IMShutDown)
|
||||
(MMShutDown UserID)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
(import-macros {:sss ! : compile} :ssc.macros)
|
||||
(local lume (require :lib.lume))
|
||||
|
||||
#(compile $1
|
||||
#(compile $1 (do
|
||||
(form def-toolbox [
|
||||
(fn [ssc cmd name args return-type]
|
||||
(let [call (fn [ssc ...]
|
||||
|
@ -158,5 +158,253 @@
|
|||
(def-toolbox 0x200c WriteCString ((long cStrPtr)) void) ; ptr cStrPtr
|
||||
(def-toolbox 0x1a0c WriteLine ((long strPtr)) void)
|
||||
(def-toolbox 0x1c0c WriteString ((long strPtr)) void)
|
||||
)
|
||||
|
||||
; Misc toolset
|
||||
(def-toolbox 0x0203 MTStartUp () void)
|
||||
(def-toolbox 0x0303 MTShutDown () void)
|
||||
(def-toolbox 0x0403 MTVersion () word)
|
||||
(def-toolbox 0x0603 MTStatus () word)
|
||||
(def-toolbox 0x0903 WriteBRam ((long bufferPtr)) void)
|
||||
(def-toolbox 0x0a03 ReadBRam ((long bufferPTr)) void)
|
||||
(def-toolbox 0x0b03 WriteBParam (theData paramRefNum) void)
|
||||
(def-toolbox 0x0c03 ReadBParam (paramRefNum) word)
|
||||
(def-toolbox 0x0d03 ReadTimeHex () 4) ; -> bytes: weekDay, null, month, day, curYear, hour, minute, second
|
||||
(def-toolbox 0x0e03 WriteTimeHex (month-day curYear-hour mintue-second) void)
|
||||
(def-toolbox 0x0f03 ReadAsciiTime ((long bufferPtr)) void)
|
||||
(def-toolbox 0x2403 FWEntry (aRegValue xRegValue yRegValue eModeEntryPt) 4) ; words: status, aRegExit, xRegExit, yRegExit
|
||||
(def-toolbox 0x1603 GetAddr (refNum) long)
|
||||
(def-toolbox 0x2503 GetTick () long)
|
||||
(def-toolbox 0x2904 GetIRQEnable () word)
|
||||
(def-toolbox 0x2303 IntSource (srcRefNum) void)
|
||||
(def-toolbox 0x1c03 ClampMouse (xMinCLamp xMaxClamp yMinClamp yMaxClamp) void)
|
||||
(def-toolbox 0x1b03 ClearMouse () void)
|
||||
(def-toolbox 0x1d03 GetMouseClamp () 4) ; words: xMinCLamp, xMaxClamp, yMinClamp, yMaxClamp
|
||||
(def-toolbox 0x1a03 HomeMouse () void)
|
||||
(def-toolbox 0x1803 InitMouse (mouseSlot) void)
|
||||
(def-toolbox 0x1e03 PosMouse (xPos yPos) void)
|
||||
(def-toolbox 0x1704 ReadMouse () 3) ; xPosition, yPosition, byte status, byte mode
|
||||
(def-toolbox 0x1f03 ServeMouse () word)
|
||||
(def-toolbox 0x1903 SetMouse (mouseMode) void)
|
||||
(def-toolbox 0x2a03 SetAbsClamp (xMinClamp xMaxClamp yMinClamp yMaxClamp) void)
|
||||
(def-toolbox 0x2b03 GetAbsClamp () 4) ; xMinClamp xMaxClamp yMinClamp yMaxClamp
|
||||
(def-toolbox 0x2603 PackBytes ((long startHandle) (long sizePtr) (long bufferPtr) bufferSize) word)
|
||||
(def-toolbox 0x2703 UnPackBytes ((long bufferPtr) bufferSize (long startHandle) (long sizePtr)) word)
|
||||
(def-toolbox 0x2803 Munger ((long destPtr) (long destLenPtr) (long targPtr) targLEn (long replPtr) replLen (long padPtr)) word)
|
||||
(def-toolbox 0x1203 SetHeartBeat ((long taskPtr)) void)
|
||||
(def-toolbox 0x1303 DelHeartBeat ((long taskPtr)) void)
|
||||
(def-toolbox 0x1403 ClrHeartBeat () void)
|
||||
(def-toolbox 0x2c03 SysBeep () void)
|
||||
(def-toolbox 0x1503 SysFailMgr (errorCode (long strPtr)) void)
|
||||
(def-toolbox 0x2003 GetNewID (idTag) word)
|
||||
(def-toolbox 0x2103 DeleteID (idTag) void)
|
||||
(def-toolbox 0x2203 StatusID (idTag) void)
|
||||
(def-toolbox 0x1003 SetVector (vectorRefNum (long vectorPtr)) void)
|
||||
(def-toolbox 0x1103 GetVector (vectorRefNum) long)
|
||||
|
||||
; QuickDraw
|
||||
(def-toolbox 0x0204 QDStartUp (dPageAddr masterSCB maxWidth userID) void)
|
||||
(def-toolbox 0x0304 QDShutDown () void)
|
||||
(def-toolbox 0x0404 QDVersion () word)
|
||||
(def-toolbox 0x0604 QDStatus () word)
|
||||
(def-toolbox 0x8004 AddPt ((long srcPtPtr) (long destPtPtr)) void)
|
||||
(def-toolbox 0xac04 CharBounds (theChar (long resultPtr)) void)
|
||||
(def-toolbox 0xa804 CharWidth (theChar) word)
|
||||
(def-toolbox 0x1504 ClearScreen (colorWord) void)
|
||||
(def-toolbox 0x2604 ClipRect ((long rectPtr)) void)
|
||||
(def-toolbox 0xc204 ClosePoly () void)
|
||||
(def-toolbox 0x1a04 ClosePort ((long portPtr)) void)
|
||||
(def-toolbox 0x6e04 CloseReg ((long rgnHandle)) void)
|
||||
(def-toolbox 0x6904 CopyRgn ((long srcRgnHandle) (long dstRgnHandle)) void)
|
||||
(def-toolbox 0xae04 CStringBounds ((long cStringPtr) (long resultPtr)) void)
|
||||
(def-toolbox 0xaa04 CStringWidth ((long cStringPtr)) word)
|
||||
(def-toolbox 0x7304 DiffRgn ((long rgn1Handle) (long rgn2Handle) (long diffRgnHandle)) void)
|
||||
(def-toolbox 0x6804 DisposeRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0xa404 DrawChar (theChar) void)
|
||||
(def-toolbox 0xa604 DrawCString ((long cStringPtr)) void)
|
||||
(def-toolbox 0xa504 DrawString ((long stringPtr)) void)
|
||||
(def-toolbox 0xa704 DrawText ((long textPtr) textLength) void)
|
||||
(def-toolbox 0x7804 EmptyRgn ((long rgnHandle)) word)
|
||||
(def-toolbox 0x8304 EqualPt ((long point1Ptr) (long point2Ptr)) word)
|
||||
(def-toolbox 0x5104 EqualRect ((long rect1Ptr) (long rect2Ptr)) word)
|
||||
(def-toolbox 0x7704 EqualRgn ((long rgn1Handle) (long rgn2Handle)) word)
|
||||
(def-toolbox 0x6404 EraseArc ((long rectPtr) startAngle arcAngle) void)
|
||||
(def-toolbox 0x5a04 EraseOval ((long rectPtr)) void)
|
||||
(def-toolbox 0xbe04 ErasePoly ((long polyHandle)) void)
|
||||
(def-toolbox 0x5504 EraseRect ((long rectPtr)) void)
|
||||
(def-toolbox 0x7b04 EraseRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x5f04 EraseRRect ((long rectPtr) ovalWidth ovalHeight) void)
|
||||
(def-toolbox 0x6604 FillArc ((long rectPtr) startAngle arcAngle (long patternPtr)) void)
|
||||
(def-toolbox 0x5c04 FillOval ((long rectPtr) (long patternPtr)) void)
|
||||
(def-toolbox 0xc004 FillPoly ((long polyHandle) (long patternPtr)) void)
|
||||
(def-toolbox 0x5704 FillRect ((long rectPtr) (long patternPtr)) void)
|
||||
(def-toolbox 0x7d04 FillRgn ((long rgnHandle) (long patternPtr)) void)
|
||||
(def-toolbox 0x6104 FillRRect ((long rectPtr) ovalWidth ovalHeight (long patternPtr)) void)
|
||||
(def-toolbox 0xcc04 ForceBufDims (maxWidth maxFontHeight maxFBRExtent) void)
|
||||
(def-toolbox 0x6204 FrameArc ((long rectPtr) startAngle arcAngle) void)
|
||||
(def-toolbox 0x5804 FrameOval ((long rectPtr)) void)
|
||||
(def-toolbox 0xbc04 FramePoly ((long polyHandle)) void)
|
||||
(def-toolbox 0x5304 FrameRect ((long rectPtr)) void)
|
||||
(def-toolbox 0x7904 FrameRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x5d04 FrameRRect ((long rectPtr) ovalWidth ovalHeight) void)
|
||||
(def-toolbox 0x0904 GetAddress (tableID) long)
|
||||
(def-toolbox 0xb104 GetArcRot () word)
|
||||
(def-toolbox 0xa304 GetBackColor () word)
|
||||
(def-toolbox 0x3504 GetBackPat ((long patternPtr)) void)
|
||||
(def-toolbox 0xd504 GetCharExtra () long)
|
||||
(def-toolbox 0x2504 GetClip ((long rgnHandle)) void)
|
||||
(def-toolbox 0xc704 GetClipHandle () long)
|
||||
(def-toolbox 0x1104 GetColorEntry (tableNumber entryNumber) word)
|
||||
(def-toolbox 0x0f04 GetColorTable (tableNumber (long destTablePtr)) void)
|
||||
(def-toolbox 0x8f04 GetCursorAdr () long)
|
||||
(def-toolbox 0xcf04 GetFGSize () word)
|
||||
(def-toolbox 0x9504 GetFont () long)
|
||||
(def-toolbox 0x9904 GetFontFlags () word)
|
||||
(def-toolbox 0x9704 GetFontGlobals ((long fgRecPtr)) void)
|
||||
(def-toolbox 0xd104 GetFontID () long)
|
||||
(def-toolbox 0x9604 GetFontInfo ((long fontInfoRecPtr)) void)
|
||||
(def-toolbox 0xd904 GetFontLore ((long recordPtr) recordSize) word)
|
||||
(def-toolbox 0xa104 GetForeColor () word)
|
||||
(def-toolbox 0x4504 GetGrafProcs () long)
|
||||
(def-toolbox 0x1704 GetMasterSCB () word)
|
||||
(def-toolbox 0x2904 GetPen () long)
|
||||
(def-toolbox 0x3304 GetPenMask ((long maskPtr)) void)
|
||||
(def-toolbox 0x2f04 GetPenMode () word)
|
||||
(def-toolbox 0x3104 GetPenPat ((long patternPtr)) void)
|
||||
(def-toolbox 0x2d04 GetPenSize ((long pointPtr)) void)
|
||||
(def-toolbox 0x2b04 GetPenState ((long penStatePtr)) void)
|
||||
(def-toolbox 0x3f04 GetPicSave () long)
|
||||
(def-toolbox 0x8804 GetPixel (h v) word)
|
||||
(def-toolbox 0x4304 GetPolySave () long)
|
||||
(def-toolbox 0x1c04 GetPort () long)
|
||||
(def-toolbox 0x1e04 GetPortLoc ((long locInfoPtr)) void)
|
||||
(def-toolbox 0x2004 GetPortRect ((long rectPtr)) void)
|
||||
(def-toolbox 0x4104 GetRgnSave () long)
|
||||
(def-toolbox 0xd804 GetRomFont ((long recordPtr)) void)
|
||||
(def-toolbox 0x1304 GetSCB (scanLine) word)
|
||||
(def-toolbox 0x9f04 GetSpaceExtra () long)
|
||||
(def-toolbox 0x0c04 GetStandardSCB () word)
|
||||
(def-toolbox 0x4904 GetSysField () long)
|
||||
(def-toolbox 0xb304 GetSysFont () long)
|
||||
(def-toolbox 0x9b04 GetTextFace () word)
|
||||
(def-toolbox 0x9d04 GetTextMode () word)
|
||||
(def-toolbox 0xd304 GetTextSize () word)
|
||||
(def-toolbox 0x4704 GetUserField () long)
|
||||
(def-toolbox 0xc904 GetVisHandle () long)
|
||||
(def-toolbox 0xb504 GetVisRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x8504 GlobalToLocal ((long pointPtr)) void)
|
||||
(def-toolbox 0x0b04 GrafOff () void)
|
||||
(def-toolbox 0x0a04 GrafOn () void)
|
||||
(def-toolbox 0x9004 HideCursor () void)
|
||||
(def-toolbox 0x2704 HidePen () void)
|
||||
(def-toolbox 0xd704 InflateTextBuffer (newWidth newHeight) void)
|
||||
(def-toolbox 0x0d04 InitColorTable ((long tablePtr)) void)
|
||||
(def-toolbox 0xca04 InitCursor () void)
|
||||
(def-toolbox 0x1904 InitPort ((long portPtr)) void)
|
||||
(def-toolbox 0x4c04 InsetRect ((long rectPtr) dH dV) void)
|
||||
(def-toolbox 0x7004 InsetRgn ((long rgnHandle) dH dV) void)
|
||||
(def-toolbox 0x6504 InvertArc ((long rectPtr) startAngle arcAngle) void)
|
||||
(def-toolbox 0x5b04 InvertOval ((long rectPtr)) void)
|
||||
(def-toolbox 0xbf04 InvertPoly ((long polyHandle)) void)
|
||||
(def-toolbox 0x5604 InvertRect ((long rectPtr)) void)
|
||||
(def-toolbox 0x7c04 InvertRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x6004 InvertRRect ((long rectPtr) ovalWidth ovalHeight) void)
|
||||
(def-toolbox 0xc304 KillPoly ((long polyHandle)) void)
|
||||
(def-toolbox 0x3d04 Line (dH dV) void)
|
||||
(def-toolbox 0x3c04 LineTo (h v) void)
|
||||
(def-toolbox 0x8404 LocalToGlobal ((long pointPtr)) void)
|
||||
(def-toolbox 0xc504 MapPoly ((long polyHandle) (long srcRectPtr) (long destRectPtr)) void)
|
||||
(def-toolbox 0x8a04 MapPt ((long pointPtr) (long srcRectPtr) (long destRectPtr)) void)
|
||||
(def-toolbox 0x8b04 MapRect ((long rectPtr) (long srcRectPtr) (long destRectPtr)) void)
|
||||
(def-toolbox 0x8c04 MapRgn ((long mapRgnHandle) (long srcRectPtr) (long destRectPtr)) void)
|
||||
(def-toolbox 0x3b04 Move (dH dV) void)
|
||||
(def-toolbox 0x2204 MovePortTo (h v) void)
|
||||
(def-toolbox 0x3a04 MoveTo (h v) void)
|
||||
(def-toolbox 0x6704 NewRgn () long)
|
||||
(def-toolbox 0x5204 NotEmptyRect ((long rectPtr)) word)
|
||||
(def-toolbox 0x9204 ObscureCursor () void)
|
||||
(def-toolbox 0xc404 OffsetPoly ((long polyHandle) dH dV) void)
|
||||
(def-toolbox 0x4b04 OffsetRect ((long rectPtr) dH dV) void)
|
||||
(def-toolbox 0x6f04 OffsetRgn ((long rgnHandle) dH dV) void)
|
||||
(def-toolbox 0xc104 OpenPoly () long)
|
||||
(def-toolbox 0x1804 OpenPort ((long portPtr)) void)
|
||||
(def-toolbox 0x6d04 OpenRgn () void)
|
||||
(def-toolbox 0x6304 PaintArc ((long rectPtr) startAngle arcAngle) void)
|
||||
(def-toolbox 0x5904 PaintOval ((long rectPtr)) void)
|
||||
(def-toolbox 0x7f04 PaintPixels ((long paintParamPtr)) void)
|
||||
(def-toolbox 0xbd04 PaintPoly ((long polyHandle)) void)
|
||||
(def-toolbox 0x5404 PaintRect ((long rectPtr)) void)
|
||||
(def-toolbox 0x7a04 PaintRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x5e04 PaintRRect ((long rectPtr) ovalWidth ovalHeight) void)
|
||||
(def-toolbox 0x3604 PenNormal () void)
|
||||
(def-toolbox 0xd604 PPToPort ((long srcLocPtr) (long srcRectPtr) destX destY transferMode) void)
|
||||
(def-toolbox 0x5004 Pt2Rect ((long point1Ptr) (long point2Ptr) (long rectPtr)) void)
|
||||
(def-toolbox 0x4f04 PtInRect ((long pointPtr) (long rectPtr)) word)
|
||||
(def-toolbox 0x7504 PtInRgn ((long pointPtr) (long rgnHandle)) word)
|
||||
(def-toolbox 0x8604 Random () word)
|
||||
(def-toolbox 0x7604 RectInRgn ((long rectPtr) (long rgnHandle)) word)
|
||||
(def-toolbox 0x6c04 RectRgn ((long rgnHandle) (long rectPtr)) void)
|
||||
(def-toolbox 0xce04 RestoreBufDims ((long sizeInfoPtr)) void)
|
||||
(def-toolbox 0xcd04 SaveBufDims ((long sizeInfoPtr)) void)
|
||||
(def-toolbox 0x8904 ScalePt ((long pointPtr) (long srcRectPtr) (long destRectPtr)) void)
|
||||
(def-toolbox 0x7e04 ScrollRect ((long rectPtr) dH dV (long updateRgnHandle)) void)
|
||||
(def-toolbox 0x4d04 SectRect ((long rect1Ptr) (long rect2Ptr) (long intersectRectPtr)) word)
|
||||
(def-toolbox 0x7104 SectRgn ((long rgn1Handle) (long rgn2Handle) (long destRgnHandle)) void)
|
||||
(def-toolbox 0x1404 SetAllSCBs (newSCB) void)
|
||||
(def-toolbox 0xb004 SetArcRot (arcRotValue) void)
|
||||
(def-toolbox 0xa204 SetBackColor (backColor) void)
|
||||
(def-toolbox 0x3404 SetBackPat ((long patternPtr)) void)
|
||||
(def-toolbox 0xcb04 SetBufDims (maxWidth maxFontHeight maxFBRExtent) void)
|
||||
(def-toolbox 0xd404 SetCharExtra ((long charExtra)) void)
|
||||
(def-toolbox 0x2404 SetClip ((long rgnHandle)) void)
|
||||
(def-toolbox 0xc604 SetClipHandle ((long rgnHandle)) void)
|
||||
(def-toolbox 0x1004 SetColorEntry (tableNumber entryNUmber newColor) void)
|
||||
(def-toolbox 0x0e04 SetColorTable (tableNumber (long srcTablePtr)) void)
|
||||
(def-toolbox 0x8e04 SetCursor ((long cursorPtr)) void)
|
||||
(def-toolbox 0x6a04 SetEmptyRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x9404 SetFont ((long newFontHandle)) void)
|
||||
(def-toolbox 0x9804 SetFontFlags (fontFlags) void)
|
||||
(def-toolbox 0xd004 SetFontID ((long fontID)) void)
|
||||
(def-toolbox 0xa004 SetForeColor (foreColor) void)
|
||||
(def-toolbox 0x4404 SetGrafProcs ((long grafProcsPtr)) void)
|
||||
(def-toolbox 0xb604 SetIntUse (useInt) void)
|
||||
(def-toolbox 0x1604 SetMasterSCB (masterSCB) void)
|
||||
(def-toolbox 0x2304 SetOrigin (h v) void)
|
||||
(def-toolbox 0x3204 SetPenMask ((long maskPtr)) void)
|
||||
(def-toolbox 0x2e04 SetPenMode (penMode) void)
|
||||
(def-toolbox 0x3004 SetPenPat ((long patternPtr)) void)
|
||||
(def-toolbox 0x2c04 SetPenSize (penWidth penHeight) void)
|
||||
(def-toolbox 0x2a04 SetPenState ((long penStatePtr)) void)
|
||||
(def-toolbox 0x3e04 SetPicSave ((long picSaveValue)) void)
|
||||
(def-toolbox 0x1b04 SetPort ((long portPtr)) void)
|
||||
(def-toolbox 0x1d04 SetPortLoc ((long locInfoPtr)) void)
|
||||
(def-toolbox 0x1f04 SetPortRect ((long rectPtr)) void)
|
||||
(def-toolbox 0x2104 SetPortSize (portWidth portHeight) void)
|
||||
(def-toolbox 0x8204 SetPt ((long srcPtPtr) h v) void)
|
||||
(def-toolbox 0x8704 SetRandSeed ((long randomSeed)) void)
|
||||
(def-toolbox 0x4a04 SetRect ((long rectPtr) left top right bottom) void)
|
||||
(def-toolbox 0x6b04 SetRectRgn ((long rgnHandle) left top right bottom) void)
|
||||
(def-toolbox 0x1204 SetSCB (scanLine newSCB) void)
|
||||
(def-toolbox 0x3804 SetSolidBackPat (colorNum) void)
|
||||
(def-toolbox 0x3704 SetSolidPenPat (colorNum) void)
|
||||
(def-toolbox 0x9e04 SetSpaceExtra ((long spaceExtra)) void)
|
||||
(def-toolbox 0x8d04 SetStdProcs ((long stdProcRecPtr)) void)
|
||||
(def-toolbox 0xb204 SetSysFont ((long fontHandle)) void)
|
||||
(def-toolbox 0x9a04 SetTextFace (textFace) void)
|
||||
(def-toolbox 0x9c04 SetTextMode (textMode) void)
|
||||
(def-toolbox 0xd204 SetTextSize (textSize) void)
|
||||
(def-toolbox 0x4604 SetUserFIeld ((long userFieldValue)) void)
|
||||
(def-toolbox 0xc804 SetVisHandle ((long rgnHandle)) void)
|
||||
(def-toolbox 0xb404 SetVisRgn ((long rgnHandle)) void)
|
||||
(def-toolbox 0x9104 ShowCursor () void)
|
||||
(def-toolbox 0x2804 ShowPen () void)
|
||||
(def-toolbox 0x3904 SolidPattern (colorNum (long patternPtr)) void)
|
||||
(def-toolbox 0xad04 StringBounds ((long stringPtr) (long resultPtr)) void)
|
||||
(def-toolbox 0xa904 StringWidth ((long stringPtr)) word)
|
||||
(def-toolbox 0x8104 SubPt ((long srcPtPtr) (long destPtPtr)) void)
|
||||
(def-toolbox 0xaf04 TextBounds ((long textPtr) textLength (long resultPtr)) void)
|
||||
(def-toolbox 0xab04 TextWidth ((long textPtr) textLength) word)
|
||||
(def-toolbox 0x4e04 UnionRect ((long rect1Ptr) (long rect2Ptr) (long unionRectPtr)) void)
|
||||
(def-toolbox 0x7204 UnionRgn ((long rgn1Handle) (long rgn2Handle) (long unionRgnHandle)) void)
|
||||
(def-toolbox 0x7404 XorRgn ((long rgn1Handle) (long rgn2Handle) (long xorRgnHandle)) void)
|
||||
))
|
||||
|
||||
|
|
11
ssc/init.fnl
11
ssc/init.fnl
|
@ -44,6 +44,8 @@
|
|||
|
||||
(set Ssc.LONG_LO :d0x00)
|
||||
(set Ssc.LONG_HI :d0x02)
|
||||
(set Ssc.ADDR_LO :d0x04)
|
||||
(set Ssc.ADDR_HI :d0x06)
|
||||
(set Ssc.TRUE 0xffff)
|
||||
(set Ssc.FALSE 0)
|
||||
|
||||
|
@ -287,7 +289,14 @@
|
|||
[:lda #(hiword ($1:lookup-addr label))] [:sta self.LONG_HI]] :long))
|
||||
; TODO: maybe handle a few different addressing modes here? re-use if the value is already on the stack?
|
||||
; TODO: automatically handle far-ref
|
||||
:word! (lambda [self ref value] [:block (self:push nil (self:expr-word ref) :word) (self:expr-word value) [:ldy 0] [:sta [1 :s] :y] (self:drop)])
|
||||
:word! (lambda [self ref value]
|
||||
(let [(c-addr reftype) (self:expr-poly ref)]
|
||||
(values (match reftype
|
||||
:word [:block c-addr [:sta self.ADDR_LO] (self:expr-word value) [:ldy 0] [:sta [self.ADDR_LO] :y]]
|
||||
:long [:block c-addr [:lda self.LONG_LO] [:sta self.ADDR_LO] [:lda self.LONG_HI] [:sta self.ADDR_HI]
|
||||
(self:expr-word value) [:sta [[self.ADDR_LO]]]]
|
||||
_ (error (.. "Unknown reference type " reftype)))
|
||||
:void)))
|
||||
:long! (lambda [self ref value] [:block (self:push nil (self:expr-word ref) :word)
|
||||
(self:expr-long value) [:ldy 0] [:lda self.LONG_LO] [:sta [1 :s] :y] [:iny] [:iny] [:lda self.LONG_HI] [:sta [1 :s] :y]
|
||||
(self:drop)])
|
||||
|
|
Loading…
Reference in a new issue