Commits

crcx  committed b8e340f Draft

start moving parable/memory' into slices'

  • Participants
  • Parent commits b4cf079

Comments (0)

Files changed (2)

File library/parable/memory.rx

-( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
-( Parable Memory Manager                                                      )
-( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
-( Copyright [c] 2012, Charles Childers                                        )
-( License: ISC                                                                )
-( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
-
-chain: parable/memory'
-  create map
-    1024 allot
-
-  create slices
-    1024 128 * allot
-
-  variable give
-
-  : toSlice  ( n-a )
-    128 * slices + ;
-
-  : findUnusedSlice ( -n )
-    0 &give !
-    #0 1000 [ #1 + dup map + @ #0 == [ dup &give ! ] ifTrue ] times drop &give @ ;
-
-  : markUsed  ( n-n )
-    [ map + on ] sip ;
-
-  : request  ( -n )
-    findUnusedSlice markUsed ;
-
-  : release  ( n- )
-    map + off ;
-
-  : fetch  ( slice offset - value )
-    [ toSlice ] dip + @ ;
-
-  : store  ( value slice offset - )
-    [ toSlice ] dip + ! ;
-
-  : copy   ( source dest - )
-    [ toSlice ] bi@ 128 copy ;
-
-;chain
-
-doc{
-===============
-parable/memory'
-===============
-
-
---------
-Overview
---------
-This is intended to provide Parable style memory access in Retro.
-
--------
-Loading
--------
-The following should suffice:
-
-::
-
-  needs parable/memory'
-}doc

File library/slices.rx

+( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
+( Parable Memory Manager                                                      )
+( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
+( Copyright [c] 2012, Charles Childers                                        )
+( License: ISC                                                                )
+( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
+
+chain: parable/memory'
+  create map
+    1024 allot
+
+  create slices
+    1024 128 * allot
+
+  variable give
+
+  : toSlice  ( n-a )
+    128 * slices + ;
+
+  : findUnusedSlice ( -n )
+    0 &give !
+    #0 1000 [ #1 + dup map + @ #0 == [ dup &give ! ] ifTrue ] times drop &give @ ;
+
+  : markUsed  ( n-n )
+    [ map + on ] sip ;
+
+  : request  ( -n )
+    findUnusedSlice markUsed ;
+
+  : release  ( n- )
+    map + off ;
+
+  : fetch  ( slice offset - value )
+    [ toSlice ] dip + @ ;
+
+  : store  ( value slice offset - )
+    [ toSlice ] dip + ! ;
+
+  : copy   ( source dest - )
+    [ toSlice ] bi@ 128 copy ;
+
+;chain
+
+doc{
+===============
+parable/memory'
+===============
+
+
+--------
+Overview
+--------
+This is intended to provide Parable style memory access in Retro.
+
+-------
+Loading
+-------
+The following should suffice:
+
+::
+
+  needs parable/memory'
+}doc