News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
T

- My First Safety Overscan Picture -

Started by tastefulmrship, 13:46, 20 August 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tastefulmrship

Hi guys,

Firstly; I am, at least, 25 years behind everyone else when it comes to programming the CPC!
Secondly; I have no discernible artistic talent or imagination.
Thirdly; I am a lamer, not a scener. Though, I love watching demos!

With these points in mind, may I present my first delve into the scary world of overscanned screens.
http://www.filefactory.com/file/cd17f06/n/MODE_1_Overscan_Screen.dsk  I adapted arnoldemu's overscan code from The Unofficial Amstrad WWW Resource, using &01A0-&7FFF for the screen, and, because it's simply brilliant, I used DevilMarkus's wonderful 4 colour signature picture. (Sorry, guys!)


- Files to load;
VIEWSCRN.BIN - This loads the two 17k screens into &01A0 and &4000.
OVERSCAN.BIN - This is the complete screen. Loads at &01A0, length &7F10 and executes at &8000.
The other .BAS files just create the two 17K files from the 4 'corner' screens (TOP-LEFT, TOP-RGHT, BOT-LEFT, BOT-RGHT).


I have some initial questions if I may;

1. Can someone check to make sure this works on real hardware for me? (Not that I'm convinced it even works on an emulator, but...)

2. Is there an easy way to compress the screen? I am thinking of developing a little slide-show and don't really want 50+ disks of 32k files. I initially thought of adapting the ACU screen-squash routine to handle &01A0-&8000 instead of &C000-&FFFF; maybe by loading into &C000 and working from there. Or, is there a compression routine where I could load to &C000 and uncompress to &01A0?

3. Would keeping the code within 64K be wise, or should I consider loading a batch of compressed screens into the upper 64K and switching back to &C000-&FFFF (BANK 3 is it?) before viewing? Or maybe some other way of utilising the extra 64K?

4. Is it easy enough to initialise ASIC and use the CPC+ pallete? I'd like this slide-show to be CPC+ only if possible; the CPC's pallete doesn't lend itself to real-world pictures... unless I make it green-screen only and 'grey-scale' the pics. (Can you say 'run before you can walk'?)


All comments welcome, including concerns and mockery,

Thanks in advance,
- JTMS...


EDIT: Added a little ditty to the screen... for no apparent reason! (Colours by Dreamer/PMC)

Gryzor

Hello mate!

What an excellent first effort - well, most of us are "lamers". I wanna see more!

And yes it works, try looking at it here: http://twitter.com/#!/krakout/status/104925517555310592/photo/1

Axelay

I think it was the ACU screen cruncher I used on the first Star Sabre loading screen.   :)  But I'd recommend checking out the compressors on this page at CPCrulez:


http://cpcrulez.fr/coding_menu-crossdev.htm


Try Exomizer for the best compression, but it's slow to decompress.  Bit Buster if space is not so critical as decompression time.


For unlocking the ASIC palette of the plus check the Wiki programming section.  The plus section contains source for unlocking the ASIC, and the raster example shows changing colours.  I'm afraid I cant remember where I found the plus document that explains how the colours are defined at the moment.  But I think they were two byte RGB values at 4 bits per colour, starting at &6400 by the looks of the raster demo.


tastefulmrship

Quote from: Gryzor on 15:43, 20 August 11
And yes it works, try looking at it here: http://twitter.com/#!/krakout/status/104925517555310592/photo/1


Wow! Someone elses work, copied by me, working on a real CPC! Well, I never thought I'd see the day!
Thanks!

Quote from: Axelay on 16:01, 20 August 11
I think it was the ACU screen cruncher I used on the first Star Sabre loading screen.   :)  But I'd recommend checking out the compressors on this page at CPCrulez:

http://cpcrulez.fr/coding_menu-crossdev.htm

Try Exomizer for the best compression, but it's slow to decompress.  Bit Buster if space is not so critical as decompression time.


For unlocking the ASIC palette of the plus check the Wiki programming section.  The plus section contains source for unlocking the ASIC, and the raster example shows changing colours.  I'm afraid I cant remember where I found the plus document that explains how the colours are defined at the moment.  But I think they were two byte RGB values at 4 bits per colour, starting at &6400 by the looks of the raster demo.

Thanks for info. The best I can get out of those external compressors is 24K (from 32K), so I can rule out using C000-FFFF to store compressed data. Looks like reverting to 3.5" discs is my only real option!

Ah, yes! Got it! The ASIC code and palette definitions! Thanks again! I might see if I can get my PARADROID 90 screen to look like a defectively fat-pixelled Amiga, instead of the red & blue of the standard CPC palette!

... onwards...

Devilmarkus

Much easier is to create this picture with JavaCPC Paint ;)
But well done!

JavaCPC paint already stores the Overscan.SCR as single 32k file.
You simply load it from asm code (Will put one later here) or with a little BASIC routine.
Then, 1 CALL is enough to put this screen on your monitor ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

#5
Well, attachments folder still has the wrong rights, so my attached file expired in dust...
(Also my already posted text)

Once again:
Gryzor wanted a Georgia Salpa screen, so here you go:

I pixeled this SCR with JavaCPC Paint (Overscan mode), took 3 seconds.
Then I coded a little ASM routine to load this SCR and display it.

Assembler source:
        org        #170
        write        direct "a:georgia.bas"
       
        ;;        firmware addresses
        cas_in_open        equ #bc77
        cas_in_direct        equ #bc83
        cas_in_close        equ #bc7a

        ;;        load scr to:
        loadaddress        equ #200

generate_basic_code:
        ;;        10 CALL &180
        db        &0A,&00,&0A,&00,&83,&20,&1C,&80,&01,&00,&00,&00,&00,&00,&00,&00
load_scr:
        ld        b,#0c
        ld        hl,filename

        call        cas_in_open
        ld        hl,loadaddress
        call        cas_in_direct
        call        cas_in_close
show_screen:
        call        &811
wait_key:
        call        &bb18
reset_registers:
        call        &831
        ret


filename:
        db        "georgia .scr"


Yes, true, I save it as .BAS file because I added line 10! (see comment)

The SCR + the assembled .BAS file you can check out here:
http://cpc-live.com/georgia.dsk

And the result is: (Sure, with filter :P )
Spoiler: ShowHide
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Oh wow. My CPC has never looked sexier! Tomorrow I'll turn this into a dsk image and load it up on the real thing...


tastefulmrship

#7
Ok, I've had a little play and here's my initial results;
http://www.filefactory.com/file/cd2a293/n/Georgia_Salpa_OVERSCAN.dsk


I have some questions; (no surprise there!)


1. When loading a screen into JavaCPC PAINT, it appears in the EFFECTMIXER but nothing appears in the PAINT screen. It just has a blue screen. Is this a problem with my PC and lack-of graphics card? (I'm running off VGA drivers as my card is knackered)
This means that the only way I can check the picture is when I've copied it to a .dsk, re-assembled the viewer and tested it.


2. I've tried converting MODE 0 and MODE 2 screens. These default to MODE 1 when viewed using the assembler code you supplied.
Is it a simple change of a 1 to a 0 or 2 in the screen code or will I have to add a MODE 0 command to the BASIC loader?   


generate_basic_code:
;; 10 MODE 0:CALL &180
db &0E,&00,&0A,&00,&AD,&20,&0E,&01,&83,&20,&1C,&80,&01,&00,&00,&00



generate_basic_code:
;; 10 MODE 2:CALL &180
db &0E,&00,&0A,&00,&AD,&20,&10,&01,&83,&20,&1C,&80,&01,&00,&00,&00



3. I haven't had a chance to check the code, but I want to get to a stage where the screen data is in line with the &01A0-&3FFF screen I am used to. I would presume this will just be a simple data-block move to the new memory location? I've tried loading the screen directly to &01A0 and there's a nice big gap in the middle of the screen.
Once I've played, I'll come back to yous'all!


- JTMS...
Learning is fun... especially with nuddy-women pictures! ^_^


EDIT: All my formatting has gone wrong in this post. What's up?

Devilmarkus

Quote from: tastefulmrship on 09:37, 21 August 11
1. When loading a screen into JavaCPC PAINT, it appears in the EFFECTMIXER but nothing appears in the PAINT screen. It just has a blue screen. Is this a problem with my PC and lack-of graphics card? (I'm running off VGA drivers as my card is knackered)
This means that the only way I can check the picture is when I've copied it to a .dsk, re-assembled the viewer and tested it.
Hmmmmmm..... That's strange, really... Make sure, you use default ROM settings... No expansion roms or so.

Quote
2. I've tried converting MODE 0 and MODE 2 screens. These default to MODE 1 when viewed using the assembler code you supplied.
Is it a simple change of a 1 to a 0 or 2 in the screen code or will I have to add a MODE 0 command to the BASIC loader?


generate_basic_code:
;; 10 MODE 0:CALL &180
db &0E,&00,&0A,&00,&AD,&20,&0E,&01,&83,&20,&1C,&80,&01,&00,&00,&00



generate_basic_code:
;; 10 MODE 2:CALL &180
db &0E,&00,&0A,&00,&AD,&20,&10,&01,&83,&20,&1C,&80,&01,&00,&00,&00
 

Screenmode is set in SCR itself, not in the ASM code or Basic loader.
CALL &811 brings the screen with proper palette and screenmode to the CPC screen.
CALL &BB18 then waits for a key
CALL &831 returns to original CRTC register settings.


Point 3.: No idea yet ;) I need to disassemble the SCR code first...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Some really nice piccies there... imagine if such a slideshow was running on a CPC in a store window; especially Georgia would have done the trick ;)

tastefulmrship

1. Ah! It must be my PC, then! I'll get round to ordering a new gfx card one day!


2. Weird. Try this .dsk;
http://www.filefactory.com/file/cd2a6e6/n/JavaCPC_OVERSCAN_Screens_2.dsk

OPENOUT"d"
MEMORY &1FF
LOAD "ANNA-S-0.SCR",&200
CALL &811:CALL &BB18:CALL &834


It seems to default to MODE 1 on my system. Again, it may be a P.I.C.N.I.C. and not your software!


3. I'll play!


Additional question;

4. I've tried creating a CPC+ screen with JavaCPC and can't get it to work. I'll play around with ASIC and the palette as well as POINT 3's relocation of screen data. Get back to you!


Thanks again for your responses;

- JTMS...
Too much pr0n, too little .dsk space! 


EDIT: Yep! Text formatting failed AGAIN on this post. had to re-edit! Annoying!

Devilmarkus

#11
I uploaded a JavaCPC-Update (v 1.0e)
Please use the update function in JavaCPC to download it.
(Menu: Help -> Check for update)

The display method in paint is a bit changed here...

Also important: The "Paint-Panel" just updates, when you move your mouse over it!
This is done because I wanted a better performance...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

tastefulmrship

Here's my desktop with 1.0d. No ROMs loaded.


Devilmarkus

Quote from: tastefulmrship on 10:31, 21 August 11
Here's my desktop with 1.0d. No ROMs loaded.



Can you "doodle" around in paint or is this also not visible?
Please do this:
- Make sure, Java-Console is enabled. (The small DOS-like console window)
- Start Paint
- Convert an image until you get the result seen above
- Use the Send Bug feature: Menu: Help -> Report a bug.
- Fill in your name, email, and a short text (can be nonsense, because I can see the problem here)
- Reply the anti-spam question and send this report.
- I then can check what happens perhaps.


Here's one for Gryzor:

Just google around and you'll find this picture.
I want you to make this as overscan screen ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

tastefulmrship

#14
JavaCPC 1.0e CPC PAINT. A lot better.




I couldn't doodle around the paint window in 1.0d... but in 1.0e it works fine.



Georgia Salpa... in CPC Plus palette... to be converted to overscan screen! Hopefully that'll be today's mission.





One last thing... why does the EFFECTMIXER stay 'on top' of other windows when I swap to another window? The others disappear, but the EFFECTMIXER stays...


tastefulmrship

Quote from: Devilmarkus on 10:36, 21 August 11
Here's one for Gryzor:

Just google around and you'll find this picture.
I want you to make this as overscan screen ;)

http://www.filefactory.com/file/cd2a864/n/Georgia_Salpa_OVERSCAN_2.dsk


GEORGIA.BAS   - The original picture you did before (on the bed)
GEORGIAS.BAS - The football picture above... but looking a little different.



***** PLEASE WAIT FOR CPC+ VERSION! NOW WORKING... *****

Gryzor

For the love of god, why would anyone want to see Georgia in a full football outfit? So many nice pics online...

tastefulmrship

#17
Quote from: Gryzor on 11:28, 21 August 11
For the love of god, why would anyone want to see Georgia in a full football outfit? So many nice pics online...

Good point... ok, here's the original bed picture from earlier... in CPC+ MODE 0
[File Deleted]

GEORGIAB.BAS - This is the bed/lingerie picture and it works.
GEORGIA+.BAS - This is the football picture in CPC+, but doesn't work.

- More playing required! -

Devilmarkus

#18
Great that it works now!
I had an issue with a BufferedImage generated in Display routine.

Why the window stays on top is simple ;)
Because I use "setAlwaysOnTop(true);"
But, if you all don't like that, I'll remove that in the next release...
I personally found it very useful.
(because you can also drag & drop JPG, PNG, BMP, PCX, GIF, TGA into this window)

About your CPC+ conversation:
Sure, it's nice but the palette could be better ;)

Try this:
- Convert the image first
- Lock all INKs
- In Paint-Window you can select each PEN by left click on it.
- When you now pick any colour of the preview image in the EffectMixer, this PEN is overwritten by the selected Colour from the Mixer.
- When done setting the palette, just re-convert it. (With all INKs locked)
- To lock/unlock single PENs just double click on them in the Paint-Window.
- To select a Colour manually, right click on a PEN in Paint-Window and a Color-Chooser pops up (For CPC+ a RGB chooser opens)

But the image I posted was meant especially for Gryzor to create ;)
Why?
Simply: I want him to be more CPC productive ;)

Little hint: "Normal" Paint can also import .SNA files! (You only need to make sure, that the SNA contains a screen with the proper (default) CRTC Register settings!)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

#19
This is just a suggestion:



But I am sure you can achieve much better results ;)

The Colour-reduction algorithm was a very cruel thing to code...
Especially for the CPC+ mode.
So, what has been processed automatically, is not always the best result ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

tastefulmrship

Quote from: Devilmarkus on 12:29, 21 August 11
This is just a suggestion:



But I am sure you can achieve much better results ;)

The Colour-reduction algorithm was a very cruel thing to code...
Especially for the CPC+ mode.
So, what has been processed automatically, is not always the best result ;)

Ah, dang it! I struggled for ages with the DITHER/BRIGHTNESS/CONTRAST sliders to get that as good as I could.
However, I don't want to infringe on someone else's fun; I think I'll leave that for Mr. Gryzor to finalise. ^_^


I'm still struggling to get some of these CPC+ pictures to display in WinAPE. That screen of GeorgiaS on the bed is the only one I've managed to get working so far. Some manual manipulation may be in order for now.
This one's my latest;


Devilmarkus

Strange: You are right!
Plus overscan does not display in WinApe or so...
*grrrrrrrrrrrrrrrrrrrr*
Need to check that...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

Ok, my fault!
For CPC+ Overscan:
Load SCR to &200, CALL &821
The code then waits for key input and returns to normal CRTC registers.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

Yes it was definetively a bug...
I reupped JavaCPC.jar so just run "Update.jar" again. (don't open JavaCPC.exe)
If Update.jar does not startup, use a little .BAT file in the same folder with content:
java -jar update.jar

The bug in detail:
JavaCPC Paint and CPC emulation have a export binary function where I can define start, length and also exec. address.
The source for Overscan export is here:
    public void writeOverscan() {
        try {
            FileDialog filedia = new FileDialog((Frame) new Frame(), "Save overscan SCR", FileDialog.SAVE);
            filedia.setFile("*.SCR");
            filedia.setVisible(true);
            String filename = null;
            filename = filedia.getFile();
            if (filename != null) {
                filename = filedia.getDirectory() + filedia.getFile();
                if (!filename.toLowerCase().endsWith(".scr")) {
                    filename += ".SCR";
                }

                if (plusmode) {
                    jemu.system.cpc.CPC.BIN_Export(filename, 0x200, 0x7CC0, 0x821, true);
                } else {
                    jemu.system.cpc.CPC.BIN_Export(filename, 0x200, 0x7CC0, 0x811, true);
                }
            }

        } catch (Exception e) {
            System.err.println("Save Overscan image failed...");
            return;
        }
    }


The bug was, that I did not check if plusmode was enabled or not and so all SCR were exported with a start address of &811
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

tastefulmrship

#24
Quote from: Devilmarkus on 13:22, 21 August 11
Ok, my fault!
For CPC+ Overscan:
Load SCR to &200, CALL &821
The code then waits for key input and returns to normal CRTC registers.

Updated my loader ASSEM code to CALL &821 instead of CALL &811 for CPC+ screens. Updated .dsk file.
http://www.filefactory.com/file/cd2b3b5/n/Georgia_Salpa_OVERSCAN_2.dsk

All works fine now!...

Powered by SMFPacks Menu Editor Mod