summaryrefslogtreecommitdiff
path: root/programs/sub-suite/subeditor.s
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-10-06 08:02:23 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-10-06 08:02:23 -0400
commit8aa8586b03568d3a3d6eba39269a1b79510bc835 (patch)
treeb674ea424fd816fe4219b4423c2e3544b1ff58ce /programs/sub-suite/subeditor.s
parent8c880c339000010260a927c3a0f28f9049b8a0b8 (diff)
- Made the stack pointer 64 bit, rather than 16 bit.
This is to allow for making the stack bigger for anything that needs to change the size of it. - Made the SuB Suite set the stack pointer to the end of the usable RAM, and allow for changing the stack size. In this case, the size of the stack is currently set to 192K, with the end of the heap being just below the stack.
Diffstat (limited to 'programs/sub-suite/subeditor.s')
-rw-r--r--programs/sub-suite/subeditor.s12
1 files changed, 9 insertions, 3 deletions
diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s
index d98d068..addd64a 100644
--- a/programs/sub-suite/subeditor.s
+++ b/programs/sub-suite/subeditor.s
@@ -6,11 +6,19 @@
.org $8000
reset:
cps ; Reset the processor status register.
- ldx.w #$FFFF ; Reset the stack pointer.
+ ldx.d #$2FFFF ; Reset the stack pointer.
txs ;
ldy #0 ; Reset Y.
tyx ; Reset X.
jsr init_heap ; Initialize the heap.
+ inc step ;
+ tax ; Set the stack pointer to the end of RAM.
+ txs ;
+ sec ; Prepare for a non borrowing subtract.
+ sbc.d #STKSIZE ; Subtract the stack size, from the end of RAM.
+ sta.q heapend ; Save the end of the heap.
+ and #0 ; Reset A.
+ tax ; Reset X.
jsr init_tables ; Initialize the main tables.
; jsr test_free ;
jsr clr_scr ; Clear the screen.
@@ -27,8 +35,6 @@ init_heap:
jsr findramend ; Find the end of the heap.
plb.q ; Restore the value in B.
plx.q ; Restore the value in X.
- sta.q heapend ; Save the end of the heap.
- and #0 ; Reset A.
rts ; End of init_heap.