EDIT:The explanations are better now
- I was wondering how you can get extra RAM when prgramming apps because the free RAM (not used by the OS) is all scattered and not very large. Maybe you could just use $8000 - $9D95 and quit the app with a "reset defaults"? Even better you could swap in an empty ram page at $8000 - $BFFF and swap back at the end (after reading what wikiti says i guess that $40 is the os its ram and $41 can be freely used by an app?)
Another idea was that for 1 page apps you could just swap in your app as a ram page at $8000 - $BFFF? This way you can use smc in an app! I don't know yet if a rom page can be mapped as ram but this can be remedied easily.
A drawback (is it?) is that you can't use B_CALLs so you have to include some routines yourself
- Shuffling a list: have a list with values to shuffle and now go through every element of that list and swap it with another random element
EDIT:The idea preseted here doesn't entirely work (points at the next posts)
- If you use a costum isr try to avoid using the stack, that way you can use SP always during execution, or use the stack to save your values when an interrupt triggers then you can always use exx and ex af, af' don't worry about the speed, your interrupt isn't called so much that you won't notice the speed difference or a combination of both:
Code: Select all
interrupt:
ld (savesp), sp
ld sp, tempstack
; Only save the regs you'll need
push af
push bc
push de
push hl
; The main body
pop hl
pop de
pop bc
pop af
savesp equ $ + 1
ld sp, 0
; Make port 3 and 4 happy here
ei
ret
; Your temp stack, make it large enough
.dw 0,0,0,0
tempstack:
Too bad this techinque won't make ti flash debugger happy (it expects sp-$FFFF to be the stack)
More random ideas are always welcome