Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Small snippet to make the AY scream a bit
#5
britlion Wrote:Very nicely done, Na_th_an. That's half the game for a 128!

I was thinking that I could force page swapping on a 128, by coding a routine to do it manually. Then I realized I'd have to call code in other pages by inference, and that would be a pain.

I did wonder if I could get the compiler to do

Code:
org 49152
[code for one page]
org 49152
[code for next page]
org 49152
[code for next page]

And so on. Yes, it would overwrite it - but the location references for calls would be correct in the generated code.

Then of course, compile each page as an item separately, and save out 16K blocks of code, and then load them in, and page flip to load each successive one. Voila. Data in multiple pages...

it's a crazy plan, but it might just work :-)

I've shown that one can manually push the compiler to set up an ISR Mode 2 routine! Remember this? : <!-- m --><a class="postlink" href="http://britlion.googlepages.com/Sprity.z80">http://britlion.googlepages.com/Sprity.z80</a><!-- m -->

I was thinking in something like
Code:
FUNCTION/SUB xxxx AT @label / <number address>
...
END FUNCTION / SUB
the problem with this is some functions might overlap. Most compilers I know aren't able to do that. Also keep in mind that, regardless its name, ZX BASIC aims to be a generic compiler (not only Speccy, but Z80 in the middle term, and architecture generic in the long term). This feature is very Speccy 128K specific and putting things like that in the ZX BASIC syntax might break the compiler on other architectures.

I think it's better to do as suggested: move those things to the low-level asm blocks.

Having said that, the idea of FUNCTION ... INTERRUPT is very common, and it will be implemented.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)