mirror of https://git.sr.ht/~rabbits/potato
Progress on memory management
This commit is contained in:
parent
cb5c41ce3f
commit
e8b57d8bde
Binary file not shown.
BIN
etc/ss10x10.chr
BIN
etc/ss10x10.chr
Binary file not shown.
|
@ -276,6 +276,11 @@ c060 3018 0c06 0300 3c0c 0c0c 0c0c 3c00
|
||||||
@menu-chr
|
@menu-chr
|
||||||
ffff ffff ffff ffff ffff ffff ffff ffff
|
ffff ffff ffff ffff ffff ffff ffff ffff
|
||||||
ffff ffff ffff ff00 ffff ffff ffff ffff
|
ffff ffff ffff ff00 ffff ffff ffff ffff
|
||||||
|
@prog-chrs
|
||||||
|
3f3f 3f3f 3f3f 3f3f ffff ffff ffff ffff
|
||||||
|
ffff ffff ffff ffff 3f3f 3f3f 3f3f 3f3f
|
||||||
|
3f3f 3f3f 3f3f 3f3f 3f3f 3f3f 3f3f 3f3f
|
||||||
|
7fbf 7fbf 7fbf 7fbf ffff ffff ffff ffff
|
||||||
|
|
||||||
( blobs )
|
( blobs )
|
||||||
|
|
||||||
|
|
|
@ -306,8 +306,13 @@ JMP2r
|
||||||
@close-win ( -- )
|
@close-win ( -- )
|
||||||
|
|
||||||
.length LDZ ,&continue JCN
|
.length LDZ ,&continue JCN
|
||||||
JMP2r
|
( nothing to close ) JMP2r
|
||||||
&continue
|
&continue
|
||||||
|
|
||||||
|
;get-active-win JSR2
|
||||||
|
( win/mem-ptr ) #000a ADD2 LDA2k SWP2
|
||||||
|
( win/mem-len ) INC2 INC2 LDA2 ;mem-rel JSR2
|
||||||
|
|
||||||
.length LDZk #01 SUB SWP STZ
|
.length LDZk #01 SUB SWP STZ
|
||||||
;sel-desktop JSR2
|
;sel-desktop JSR2
|
||||||
;draw-desktop JSR2
|
;draw-desktop JSR2
|
||||||
|
|
|
@ -143,12 +143,14 @@ JMP2r
|
||||||
|
|
||||||
@draw-memory ( -- )
|
@draw-memory ( -- )
|
||||||
|
|
||||||
|
#01 .Screen/auto DEO
|
||||||
.Screen/x DEI2 ,&x STR2
|
.Screen/x DEI2 ,&x STR2
|
||||||
;vert1-icn .Screen/addr DEO2
|
;vert1-icn .Screen/addr DEO2
|
||||||
#ff00
|
#8000
|
||||||
&loop
|
&loop
|
||||||
#00 OVR [ LIT2 &x $2 ] ADD2 .Screen/x DEO2
|
#00 OVR #10 SFT2 [ LIT2 &x $2 ] ADD2 .Screen/x DEO2
|
||||||
#00 OVR #80 SFT2 ;mem-type JSR2 #05 MUL .Screen/sprite DEO
|
#00 OVR #90 SFT2 ;mem-type JSR2 #00 SWP #40 SFT2 ;prog-chrs ADD2 .Screen/addr DEO2
|
||||||
|
#81 .Screen/sprite DEO
|
||||||
INC GTHk ,&loop JCN
|
INC GTHk ,&loop JCN
|
||||||
POP2
|
POP2
|
||||||
|
|
||||||
|
|
|
@ -61,30 +61,39 @@
|
||||||
;dict/home-ext ;set-dir JSR2
|
;dict/home-ext ;set-dir JSR2
|
||||||
;untrap JSR2
|
;untrap JSR2
|
||||||
|
|
||||||
|
( auto-start with about )
|
||||||
|
;no-name ;app-about #2213 #0120 #0060 ;add-win JSR2
|
||||||
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
( memory operations )
|
( memory operations )
|
||||||
|
|
||||||
@mem-req ( len* -- <addr*> )
|
@mem-req ( len* -- <ptr*> )
|
||||||
|
|
||||||
( TODO: check for space )
|
( ptr ) ;mem .bounds LDZ2 ADD2 BUG2k
|
||||||
.bounds LDZ2 ADD2 .bounds STZ2
|
( update ) SWP2 .bounds LDZ2 ADD2 .bounds STZ2
|
||||||
;mem
|
|
||||||
|
JMP2r
|
||||||
|
|
||||||
|
@mem-rel ( ptr* len* -- )
|
||||||
|
|
||||||
|
( update bound )
|
||||||
|
.bounds LDZ2 OVR2 SUB2 .bounds STZ2
|
||||||
|
|
||||||
|
BUG2 BUG2
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@mem-type ( addr* -- type )
|
@mem-type ( addr* -- type )
|
||||||
|
|
||||||
DUP2 ;mem LTH2 ,&static JCN
|
DUP2 ;mem LTH2 ,&static JCN
|
||||||
DUP2 ;mem .bounds LDZ2 ADD2 LTH2 ,&dynamic JCN
|
( DUP2 ;mem .bounds LDZ2 ADD2 LTH2 ,&dynamic JCN )
|
||||||
|
( free ) POP2 #02
|
||||||
.length LDZ #00 EQU ,&free JCN
|
|
||||||
POP2 #03
|
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
&static POP2 #02 JMP2r
|
&static POP2 #00 JMP2r
|
||||||
&dynamic POP2 #01 JMP2r
|
&dynamic POP2 #01 JMP2r
|
||||||
&free POP2 #01 JMP2r
|
&selected POP2 #02 JMP2r
|
||||||
|
|
||||||
( directory operations )
|
( directory operations )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue