News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_AMSDOS

Using separate RSXes in the same program?

Started by AMSDOS, 09:41, 04 March 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AMSDOS

I was wondering if it were possible to do this without Crashing the system, or is incorporating the other RSX routines in with my own the only way?
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

rpalmer

could you elaborate what you are requesting ASMDOS

arnoldemu

Quote from: AMSDOS on 09:41, 04 March 13
I was wondering if it were possible to do this without Crashing the system, or is incorporating the other RSX routines in with my own the only way?
Do you mean using more than one set of "libraries" which install RSX with KL LOG EXT??????

I have had problems before with this.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

AMSDOS



Ok, I've made up some RSXes myself for a little game I'm making (which help produce random numbers), though I'm also using Sean's Sprite Driver. Just wondered if those could work as separate RSX routines or if I'll have to incorporate it as one?
I'm thinking I'll have to incorporate it all together, which means I'll have to dismantle Sean's code and get my routines into it, which means a bit of work.

If KL LOG EXT is &BCD1, then I'm using it in my routine and I'm sure Sean will have it in his Sprite Driver Suite too. Is it known why the system crashes, it just looks as if the Stack Pointer gets overloaded.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

ralferoo

The whole point of the RSX system is so they can coexist with other system extensions. Obviously, you'll want to make sure the routines don't live in the same block in memory, just as you would if you were calling the code directly, but there's no real limit to how many RSX extensions you can have.

arnoldemu

Quote from: AMSDOS on 10:26, 04 March 13

Ok, I've made up some RSXes myself for a little game I'm making (which help produce random numbers), though I'm also using Sean's Sprite Driver. Just wondered if those could work as separate RSX routines or if I'll have to incorporate it as one?
I'm thinking I'll have to incorporate it all together, which means I'll have to dismantle Sean's code and get my routines into it, which means a bit of work.

If KL LOG EXT is &BCD1, then I'm using it in my routine and I'm sure Sean will have it in his Sprite Driver Suite too. Is it known why the system crashes, it just looks as if the Stack Pointer gets overloaded.
These should work seperately, must be a bug in the firmware.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

AMSDOS

Had a look at the firmware guide, I think the problem is I'm calling two separate RSX routines Sean's is at &9C40 and mine is at &8000 and what happens is when I call one or another, the contents of BC changes and because I'm using my routines and Sean's routines nearly at the same time, I'd need to call one routine or another to avoid the crash perhaps? Better to just incorporate it all together I think.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

ralferoo

Quote from: AMSDOS on 10:45, 04 March 13
Had a look at the firmware guide, I think the problem is I'm calling two separate RSX routines Sean's is at &9C40 and mine is at &8000 and what happens is when I call one or another, the contents of BC changes and because I'm using my routines and Sean's routines nearly at the same time, I'd need to call one routine or another to avoid the crash perhaps? Better to just incorporate it all together I think.
Do you mean BC' changes? You should make sure this is restored before returning to BASIC anyway. In fact, if you're changing it, you should make sure interrupts are disabled and that you restore it before calling any firmware routines.

If you just mean BC, then it shouldn't matter if you change it.

AMSDOS

Quote from: ralferoo on 10:50, 04 March 13
Do you mean BC' changes? You should make sure this is restored before returning to BASIC anyway. In fact, if you're changing it, you should make sure interrupts are disabled and that you restore it before calling any firmware routines.

If you just mean BC, then it shouldn't matter if you change it.


I'm Not using the alternative registers (BC') at all.


I just mean I have 1 set of RSX routines at &8000 which I made (called |RANDOMIZE & |RND,value), but I'm using another set of RSX routines which is situation at &9C40 which is Sean's Sprite Driver (|GRAB,x,y,w,h,addr |SDEF,sprite no, addr & |SPRITE,sprite no,x,y), which is all BASIC friendly.


But I think what's happening is because I'm setting up RSXes at &8000 which uses &BCD1 and there are RSXes at &9000 which are also setup with &BCD1, things are getting mixed up when applying the code. :(
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

rpalmer

When setting up RSXs, there is a need to reserve 4 bytes of memory for the RSX handler in basic and is the first 4 bytes of the allocated space for RSX variables. If an RSX has not reserved any space then it will in all probability crash the system.

These 4 bytes form part of the RSX chain which helps BASIC locate RSXs. Therefore there can be any number of user assigned RSXs, so this is required, otherwise all the ROMs like MAXAM, UTOPIA, etc would all fail to work.

The only issue with RSXs is the NAME which has to be unique, so if you assign your RSX with the name "RANDOM" and another with the same name then the second is never found since the first is always used.

AMSDOS

Quote from: rpalmer on 09:58, 05 March 13
When setting up RSXs, there is a need to reserve 4 bytes of memory for the RSX handler in basic and is the first 4 bytes of the allocated space for RSX variables. If an RSX has not reserved any space then it will in all probability crash the system.

These 4 bytes form part of the RSX chain which helps BASIC locate RSXs. Therefore there can be any number of user assigned RSXs, so this is required, otherwise all the ROMs like MAXAM, UTOPIA, etc would all fail to work.

The only issue with RSXs is the NAME which has to be unique, so if you assign your RSX with the name "RANDOM" and another with the same name then the second is never found since the first is always used.


I've started to dismantle Sean's Sprite Driver, I'm a little bit funny posting it here because it's Copyrighted even though it has Public Domain written on it to, though Sean hasn't supplied the Assembly Source code on his page either, it may just be the codes been long lost, though I don't want to try my luck.  :-X


The interesting thing which I noticed from his RSX routine is the program RETurns back to basic at the end of the table which JPs to the routines. Normally I have it after the &BCD1, though it still seems to work there.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Powered by SMFPacks Menu Editor Mod