News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_TFM

FutureOS corner

Started by TFM, 05:12, 01 October 10

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

TFM

FutureOS - a living project to show that all man are equal ;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

Dear 6128 Plus users: Here it comes the Cartridge with FutureOS for the 6128 Plus. At the moment only in Geman, but you should be able to pick up our nice language soon  :)  (English version one day if there is enough interrest)  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

Got two guys asking for a Cart in other languages. So if there are at least 5 persons asking for a language, then I will take the time an create it in the desired language... (which is a lot of work).

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

Ok, poll closed... on the way to the pub now...  ;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

Hi there!
You may have recogniced that www . futureos . de now leads to some crap. Thanks to CMO, the greatest company for homepages, they really drive me crazy.

Meanwhile get access to FutureOS at:
FutureOS - The revolutionary UltraOS for the CPC6128 and CPCPlus

I will update you here / edit this post as soon as "www . futureos . de" is online again. I really need a new provider now!
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Gryzor

Huh, it leads to the webmail login page. You're sure you didn't mess up with the server files?

TFM

Quote from: Gryzor on 07:50, 03 July 13
Huh, it leads to the webmail login page. You're sure you didn't mess up with the server files?
No, CMO did that. They moved it to a new server (I guess) and screwed it. And just few weeks ago I had to pay them 10 bucks to redirect FutureOS - The revolutionary UltraOS for the CPC6128 and CPCPlus to Markus site, where all my data is located.
But after complaining they seem also to have a quick service. Now everything works again.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

This is what I came up using Small-C with FIOLIB, the good news it works, the bad news is it's very slow because I'm using Small-C Code for my printing of the Spaceship, so it shows all because I couldn't really integrate the Small-C code to work in with the Inline Assembly - too hard basket. If it were all Assembly then it would make a difference. Are things like the address for PLOT available in FutureOS outside the Small-C environment, like how the Firmware is in CPC OS or are those things connected with FIOLIB?
Initially I had the print starship routine after my Scroll Routine, but it didn't look very good there and it seems to work better where it is now.
* 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

TFM

WoW! That's damn great!

Could you use Mode 1 instead? I mean then you could probably redefine some characters and use the print Routine?

Honestly I have to take a look at the source first, before I can tell in Detail how to Speed up the Display of the space ship. I let you know soon  :) [nb]However probably not before monday, because I have to give a presenation, which remains to be made.[/nb]

Amazing Job!!! You could use it for next years game compo!
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: TFM/FS on 22:08, 20 July 13
WoW! That's damn great!

Could you use Mode 1 instead? I mean then you could probably redefine some characters and use the print Routine?

Honestly I have to take a look at the source first, before I can tell in Detail how to Speed up the Display of the space ship. I let you know soon  :) [nb]However probably not before monday, because I have to give a presenation, which remains to be made.[/nb]

Amazing Job!!! You could use it for next years game compo!

Thanks. The original program was in Mode 0, so I was just trying to get it looking more like that to begin with.

I've had a go at making it work in MODE 1, though that RAMCHAR thing is driving me up the wall. I ditched my original routine which was far from correct and started off by poking RAMCHAR @ B847 with values based on bit values and had no luck with that, in the hand book there's some sort of routine - "LD BC,&7F81 LD A,(RAMCHAR) AND A,&04 OR A,C etc ...", though I think that's for something else, though it seemed to be working better when I had "LD HL,&B847 LD A,whatever LD (HL),A" in front of it, instead of crashing the system, but even that wasn't redefining the characters I wanted, I then discovered by characters weren't being defined properly, so have got that all fixed and working and the last thing I was trying to do was use the Control Char (&01) to base the RAM CHARs between (3800h & 3FFFh), but had no luck there either and I feel like I've been over and over that hand book in those sections and appear to be no closer to redefining anything. Must I redefine every single character from 3800h onwards for this to work, cause my routine only uses 2 characters and I setting them to 3FF0h to 3FFFh, which should be the last 2 characters shouldn't it?

I also made myself a Character set program to show the characters between 32 and 255 and nope none of the other characters have been redefined to my character as well. So I'm not sure what I'm doing wrong with the Control Codes, if it's correct I'm using putchar(1) which is control code 1 which should be setting the RAM based Character Set according to the handbook, though it doesn't look like it's changing from the ROM Based Character Set.  :'(
* 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

TFM

#285
Quote from: AMSDOS on 12:26, 21 July 13
...I ditched my original routine which was far from correct and started off by poking RAMCHAR @ B847 with values based on bit values and had no luck with that, in the hand book there's some sort of routine - "LD BC,&7F81 LD A,(RAMCHAR) AND A,&04 OR A,C etc ..."
Actually something like this should work (it works in assembler), but I have to give it a test in C too:


LD A,(RAMCHAR)
OR A,&04                   ;Set Bit 2 for switching to RAM character set (&3800-&3FFF).
                           ;Means, it switches the lower RAM on when printing.
LD (RAMCHAR),A

The problem may be that you can't easily locate the character set between &3800 and &3FFF when using a C program in the same memory area.  >:(  That's a pitfall - also here I have to investigate.


Quote from: AMSDOS on 12:26, 21 July 13
Must I redefine every single character from 3800h onwards for this to work, cause my routine only uses 2 characters and I setting them to 3FF0h to 3FFFh, which should be the last 2 characters shouldn't it?
Yes, in principle you only need to change addresses between &3FF0 and &3FFF (inclusive) for two characters. But the problem may be that you overwrite your code in this case...

Well, thanks for providing all that interesting findings. Together we will make FIOLIB hopefully better working and usable for your purposes.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: TFM/FS on 21:13, 21 July 13
Actually something like this should work (it works in assembler), but I have to give it a test in C too:


LD A,(RAMCHAR)
OR A,&04                   ;Set Bit 2 for switching to RAM character set (&3800-&3FFF).
                           ;Means, it switches the lower RAM on when printing.
LD (RAMCHAR),A

The problem may be that you can't easily locate the character set between &3800 and &3FFF when using a C program in the same memory area.  >:(  That's a pitfall - also here I have to investigate.

Hmm, I was doing something similar by poking 0B847h with 133 (85h) and had no success. I tried that approach with the "OR", only to get the same result.

I've attached the Source code, so when you've some time, compile that and see if it works for you. You will need to link it to FIOLIB2.OBJ in order for it to work though (which I think I've got in my last Disc Image).

I tried that code posted above in the Winape Assembler in |FDESK mode, though it didn't seem to work either after I was Assembling it to different areas of memory (i.e. 2000h & 8000h), so I'm just wondering if it's something in the Configuration which isn't allowing me to select the RAMCHAR set??

QuoteYes, in principle you only need to change addresses between &3FF0 and &3FFF (inclusive) for two characters. But the problem may be that you overwrite your code in this case...

Well, thanks for providing all that interesting findings. Together we will make FIOLIB hopefully better working and usable for your purposes.  :)

I'm using Inline Assembly to Poke in the data into the area which seems to be working, the charset.c program I made out of the stars.c program, confirms that the data is being poked into the area (using the monitor), so I'm not sure what's happening or why the character set. The CHARSET.C program will compile with FIOLIB though.
* 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

TFM

Well, looks like redefinition of the charset can't be done. Sorry, it occupies the same area than the program.
It could work if you would integrate a complete charset to your program (3800-3FFF) and using control code to switch to RAM charset.
But for displaying your spaceship we could do better by making a specific routine for that. I will go into that more deeply soon.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: TFM/FS on 17:58, 22 July 13
Well, looks like redefinition of the charset can't be done. Sorry, it occupies the same area than the program.
It could work if you would integrate a complete charset to your program (3800-3FFF) and using control code to switch to RAM charset.
But for displaying your spaceship we could do better by making a specific routine for that. I will go into that more deeply soon.

Yeah I tried saving the Charset from BASIC by moving it to &3800->&3FFF & put my image in it's place at &3FF0 onwards and use FOPEN..FCLOSE to load it in that way, though had no luck there either (when I had a look at the monitor, it wasn't even showing up as if it was loaded there), I guess I could try saving the data file by loading it to &3800 and using FutureOS to Save it there - are the file headers different to CPC OS/AMSDOS?

I'm unsure how to do the Control code, I tried it with putchar(1); earlier without luck, in the sequence of order I'm placing the charset into memory before setting the RAMCHAR bit.

I know in the AMSDOS version of Small-C it's possible to move the code around so it doesn't have to be at &0100 necessarily, though I guess if RUNC.64K needs the code to be at 0100h, then that will be an issue.
* 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

TFM

#289
Hi,

FOPEN and FCLOSE put data into the expansion RAM, so there is more main RAM for the program itself.

The control codes only work as part of a string.

I guess I have to add some kind of "display sprite / data on screen" function.

A question, can I add your starship program to my program collection on my homepage? I think it's a good example how to do things.
Thanks again for trying out FIOLIB, this gives me new input and I can make it better and can add new functions. Wonderful to see that actually really somebody did use it :-)

EDIT: About moving RAM. After starting RUNC, the main RAM between 0 and &9900 is free for programs, the problem is IMHO that the C compiler puts some kind of ORG &0100 into the generated source. I never tried to change that by hand. It may or may not work.
However, you can actually use all RST entries since all the RAM under &9900 is for the program only.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: AMSDOS on 09:57, 20 July 13
This is what I came up using Small-C with FIOLIB, the good news it works, the bad news is it's very slow because I'm using Small-C Code for my printing of the Spaceship, so it shows all because I couldn't really integrate the Small-C code to work in with the Inline Assembly - too hard basket. If it were all Assembly then it would make a difference. Are things like the address for PLOT available in FutureOS outside the Small-C environment, like how the Firmware is in CPC OS or are those things connected with FIOLIB?
Initially I had the print starship routine after my Scroll Routine, but it didn't look very good there and it seems to work better where it is now.

Ok, I've managed to update this previous example by incorporating Inline Assembly to draw the spacecraft along with a frame routine (both included within the starscrl.c program), the hardest part was to incorporate the values to be able to get them into the prntship routine by sending the xpos & ypos variables to it. I was hoping to get this done by using Index Registers, though due to the nature in how Small-C generates assembly code, I've had to place pop's to get the relevant variable information and push it back to where it was to prevent stuffing up the stack heap & since Small-C Assembly generated code puts everything into the HL register, that gets poked into the relevant part of memory I setup in my code and the routine does the rest that way. But with the assembly routine in play, things are significantly faster.
* 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

TFM

Oh. Great! That's significantly faster!!!  :)
To be honest, I don't understand how you PUSH and POP all the variables, because I found no docs telling me much more about how Small C stores all that variables. But I will have a closer look soon.

You could change a bit: The spaceship is flickering much, maybe it would look better if you move it directly after the Frame routine. Just an idea, dunno if it will work.

Great job!!!
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: TFM/FS on 16:25, 25 July 13
Oh. Great! That's significantly faster!!!  :)

Yep, so I've tapped into the PEN0 & PLOT routines from the Inline Assembly routine and used Assembly to draw the image, the only limitation there is the thing I'm drawing which specifically points to ADDRCOLOUR, which points to the area the image is in.

QuoteTo be honest, I don't understand how you PUSH and POP all the variables, because I found no docs telling me much more about how Small C stores all that variables. But I will have a closer look soon.

The POPping and PUSHing is not really a preferred option of mine and in other languages would try to resort to Index Registers when passing information from one Language to Another, only because I don't fully understand PUSHing and POPing things on and off the stack and especially in the sequence I used in that program, I would of felt it would flooded the stack and crashed the computer, but no.
What I found when Small-C generates an Assembly Code, before it would call my routine to where I wanted to get my data into, it was placing the data into the HL register & pushing that. I'm not quite sure why I had to POP the stack twice (with BC & DE) to get the right value, but when I did that I got my first value, so I could store that into YPOS I think and then a further POP would give me the XPOS value I think, so then I could store that as well and then undo all that by PUSHing it back into it's original state. 

Quote
You could change a bit: The spaceship is flickering much, maybe it would look better if you move it directly after the Frame routine. Just an idea, dunno if it will work.

Yes, I've already tried a few things with this flicker, and that unfortunately was the best result I could get, I'm thinking perhaps there needs to be some frames around the scroll routine(?) because it's a simple scroll which rolls the screen down 8 pixel lines, maybe that needs some frames around it just to smooth the process, even though it's a rough routine.

Quote
Great job!!!

Thanks. I'm working on another demo program, which uses fiolib along with a routine to display graphic to screen, but the PLOT routine doesn't seem to Overwrite, is it a XOR based plot?
* 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

TFM

The Plot routine can IIRC plot single dots, so it must preserve the remaining bits in the byte where the dot will be set. You find it in the source of RUNC-X16.MAX

Ah...
It uses the OR command, so it adds bits to the byte. This is due to it expects the pixel to be empty. But I probably have to add an AND command to cure that problem.... On the other hand I just think about some nice effects ;-) Ok, will take care in the next update.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

OK, so what I've done with this latest version of the starscroll program is put some frame() routines around the scroll() routines, so it displays more like the original program without as much flicker.

Quote from: TFM/FS on 19:57, 26 July 13
The Plot routine can IIRC plot single dots, so it must preserve the remaining bits in the byte where the dot will be set. You find it in the source of RUNC-X16.MAX

Ah...
It uses the OR command, so it adds bits to the byte. This is due to it expects the pixel to be empty. But I probably have to add an AND command to cure that problem.... On the other hand I just think about some nice effects ;-) Ok, will take care in the next update.

I was wondering if it could be simply an overwriting routine, all the next program has to do is simply a draw/delete/redraw and so on, otherwise I could settle with a XOR Plotting routine.  I had a look at the program source, so I think I know the OR statement you mean in the PLOT0 routine.
* 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

TFM

Can you do a loop like

- loop: FRAME
- clear & redraw space ship
- scroll / plot stars
- goto loop

Ok, sorry, that's kinda oversimplified. Gotta check which part of the program need how much time.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

#296
Quote from: TFM/FS on 19:04, 27 July 13
Can you do a loop like

- loop: FRAME
- clear & redraw space ship
- scroll / plot stars
- goto loop

Ok, sorry, that's kinda oversimplified. Gotta check which part of the program need how much time.

That's kind of how I originally had the program running, which was producing a blinky Spaceship  :D Unfortunately the clearing of the Space Ship works in with the Scroll, so the Scroll is rolling the Ship off the screen.
Maybe what I can do which may improve the program is:

- draw space ship
-loop: plot stars
- calculate next ship position
- frame/scroll
- redraw ship (new position)
- goto loop

Ok I've updated the code so it follows that process although I've have it as:

- frame/scroll
- frame/redraw ship

and you can have a look at the result in "strscrl2.smc", however I've had a look at that program and "starscrl.smc" and to be honest I don't see a lot of difference.
The routine I'm using for the frame flyback, seems to work a bit differently to the Firmware Frame Flyback. Usually with the Firmware one (&BD19), you can stack a couple around what your drawing and it will smooth it out more based on how many are used, though in this example, it doesn't seem to matter.
* 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

TFM

Hi!
Your FRAME routine is perfect, and for sure more quick than that one of the Firmware.

Finally I had now a bit a time to look at FIOLIB2 which contains in addition to FIOLIB the scroll routine. It does a software scroll which - of course - takes more time than a FRAME is long. So there will be some flickering.

Now, how can we solve this problem... two ideas...

1. You could use hardware scrolling (adapt CRTC registers), but it this case you should use the 64*32 characters mode, use S64X32 for that. In this square mode every scan line is 64 bytes in length, so math is kind of easy.
Now, when using hardware scrolling then you have to adapt the addresses of the space-ship and the pixels.

2. I have to adapt / correct the plot routine to be able to also erase dots. In this case you don't scroll the screen at all. The only thing that you do is to plot over the "old" dots a second time with back-ground color, just to erase the old dots. Then you draw the new dots.

The second idea may be a bit better actually. IMHO it would take less effort to do it. Let me take a look at the FIOLIB sources...
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TFM

Hi, here is a new version of the FIOLIB, the update is not too much, well I had only few hours today. Now, what's new?

1. You have a FRAME() function included in the FIOILIB. I guess this routine is in general interest, so I added it.

2. The PLOT() function for MODE 0 was corrected. Now it plots the dot in the right color even when another dot is underneath it. Further it can also delete dots by using under ground color with PEN0(0).

However I haven't had time to test it. Please report any problems.


Looking forward to a super quick star scroller :-)[nb]No need for scrolling any longer. Just draw point and in the next frame erase old dots and draw new dots.[/nb]
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Quote from: TFM/FS on 23:52, 28 July 13
Hi, here is a new version of the FIOLIB, the update is not too much, well I had only few hours today. Now, what's new?

1. You have a FRAME() function included in the FIOILIB. I guess this routine is in general interest, so I added it.

2. The PLOT() function for MODE 0 was corrected. Now it plots the dot in the right color even when another dot is underneath it. Further it can also delete dots by using under ground color with PEN0(0).

However I haven't had time to test it. Please report any problems.


Looking forward to a super quick star scroller :-)[nb]No need for scrolling any longer. Just draw point and in the next frame erase old dots and draw new dots.[/nb]

It would probably just be some colour switching starscape to make it look like some stars are moving.
* 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