News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

cpctelera : bild.png 160x200 for background mode 0

Started by funkheld, 09:07, 16 January 21

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

funkheld

Hi good afternoon.
i want to upload a picture in png 160x200.how can you put that in sprites for cpctelera?

greeting


SRS

Just like described in the manual, I guess ? Hint : "Graphics Autoconversion"

funkheld

I do not understand.
if I am already in mode 0 with a width of more than 65 bytes, the program aborts with cpct_drawSprite.

greeting

freemac

A full screen picture take 0x4000 of memory.
So that is the size of your sprites here.
But your program start by default at 0x4000, hurting then start of 0x8000 witch contain the sp stack, crash.
Just start your program at 0x0138, just after the 0x0000-0x0138 area witch contains interrupt instruction, crash.

cfg/build_config.mk :
Z80CODELOC := 0x0138

make clean
make


btw cpct_drawCharM0 is using lower ROM 0x0000-0x4000, so this cpct_drawCharM0 function will no run anymore.

freemac

>bild.png 160x200 for background mode 0

If it is just for a background picture, you can use ConvImgCPC, and create a ".SRC" file
And use a basic script :
load"bli.scr", &c000

10 load"!bli.scr", &C000
20 run"!toto.bin"


Picture at 0xC000 is erased after run"toto.bin", it seems that run"!toto.bin" does not erase 0xC000 area.

funkheld


funkheld

#6
goes wonderful. now i play with cpctelera and do not want to load the picture into the program code, but rather reload it from disk with a command from cpctelera like in basic.

there is still no asm code for cpctelera to load something like this from disk.I think it's a shame.


greeting

SpDizzy

In fact there is. And as usual, well documented. Take a look at cpct_miniload(). Development branch 1.5
https://www.dropbox.com/s/2dzgzddve3olilv/Screenshot_20210117-171204.png

funkheld

Hi, Thank You.
where can I please load cpctelera 1.5 to test?

thanks.

SpDizzy


funkheld

hello thanks for the tip cpctelera 1.5

but the load only affects a cassette and not a disk .... hm ...
why do you actually go back 20 years with the system?

greeting

SpDizzy

Quote from: funkheld on 22:47, 17 January 21
but the load only affects a cassette and not a disk .... hm ...
why do you actually go back 20 years with the system?

greeting


Sorry, I didn't carefully read your post.
That's the scheme I used to work with, 64 kb, tape deck only. Same as in my childhood when the 464 arrives home back in 80's.  ;)

funkheld

thanks, the hint with the new cpctelera 1.5 is great.
I installed cpctelera 1.5 and it works fin.


greeting







SpDizzy

I guess you will enjoy CPCtelera 1.5. Much more powerfull than previous one, and continuosly updated with new funcionalities.

As for loading from .dsk, still on development on 1.5 branch as i know, but this may be the workflow:

- Reenable firmware (in case you have previously disabled it on your CPCtelera project)
- Enable all ROMS
- Call your Load/Save routine
- Disable firmware by re-setting your own ISR routine (if your project requires it)

Take a look at this thread, with complete info and sample usage:
https://www.cpcwiki.eu/forum/programming/save-file-without-firmware/

funkheld

#14
hello thanks for info the load.


how could you first rewrite it in an inline asm.
before it gets into the cpctelera, a lot of time will pass.

greeting


freemac

#15
arnoldemu has post firmware.zip that seems CPCTelera safe  8)

I just analyse here, I'll take a try tomorrow  ;)

Perhaps cpct_loadBinaryFile.s does run fine with its dedicated firmware.h (rename firmware.h as floppy.h with only disk function inside ?), I don't know if it is ok.

If not,
firmware.h => floppy.h
// File
u16 cpct_loadBinaryFile(const char *fileName, void *loadAddr);


cpct_loadBinaryFile.s => floppy.c
Do replace _cpct_loadBinaryFile:: by "u16 cpct_loadBinaryFile(const char *fileName, void *loadAddr) {"
And then pass all code before _cpct_loadBinaryFile after the cpct_loadBinaryFile function ret.

u16 cpct_loadBinaryFile(const char *fileName, void *loadAddr) {
__asm
... ;; asm function content
jp fin
... ;; internal function like get_str_length or cpct_err
ret
... ;; internal function like get_str_length or cpct_err
ret
... ;; "global" constants like cas_in_open and cas_in_direct and cas_in_close
fin:
__endasm;
}

ronaldo

#16
Quote from: funkheld on 15:13, 17 January 21
there is still no asm code for cpctelera to load something like this from disk.I think it's a shame.

Always showing your best ways to make friends. You still don't understand 1% of how CPCtelera tools or routines work, but you think it's a shame it does not have something to load from disk. Pretty reasonable attitude towards developers, that always deserve to be locked out inside a hole programming whatever others think, and be treated without mercy. I sometimes feel that if my hole is too big I'm not pressed enough to be productive.

CPCtelera has several different functions to draw sprites. cpct_drawSprite clearly states in its documentation that cannot draw sprites wider than 64 bytes, and that is for optimization reasons. However, you may easily draw 2 40-byte-wide sprites to draw a complete 80-bytes-wide screen. You can also use other drawSprite functions without that limitation (like cpct_drawSpriteBlended using de LDI blend mode, which only produces a copy, a normal drawSprite).

However, for such a big sprite, the best options are loading it directly into video memory or having it compressed and directly decompress it into video memory. Selecting between these two options depends on the needs of your application.

I explain all the details on how to convert, compress, include into your binary and then decompress and image into video memory, in this youtube video

And, of course, for loading files from disk you just have to call the firmware. Using firmware is normally the best way to load files from disk, as it will be compatible with all systems like M4 cards and Gotek disk drives. Having a set of specific low-level assembly  functions for this would only be compatible with real hardware disk-drives and emulators.

freemac

Quote from: funkheld on 22:47, 17 January 21
but the load only affects a cassette and not a disk .... hm ...
why do you actually go back 20 years with the system?
No 6128 in Spain. For historical reason. A lot of 464 developers until end of Amstrad, they are strong in 64k.

funkheld

the cpc464 has been expanded a lot with a disk drive, even in spain. therefore my question to create a loading program for disk programs.

greeting





funkheld


here was the question for a 2016 disk loader.a demo was also created with the request to use it in cpctelera.greeting

https://www.cpcwiki.eu/forum/programming/save-file-without-firmware/

freemac


funkheld

#21

Hello, thanks for your help. works wonderfully.
ConvImg make the pictures.

how can you start the program from 0x8000 please.I need the memory from 0x4000 - 0x7fff for other data.


Thanks.
greeting

SRS

Quote from: ronaldo on 16:42, 18 January 21
Always showing your best ways to make friends. You still don't understand 1% of how CPCtelera tools or routines work, but you think it's a shame it does not have something to load from disk. Pretty reasonable attitude towards developers, that always deserve to be locked out inside a hole programming whatever others think, and be treated without mercy. I sometimes feel that if my hole is too big I'm not pressed enough to be productive.
SRS cometh to aid. Do program a full memory range using MALLOC - for storing data and runable code both - usable wirh cpctelera and firmware until next sunday.

That's enough pressure to be more productive ?  :laugh: And how the heck can you afford your own hole to stay at ?



funkheld

#23
malloc has no function with load-disk.

Quote
ronaldo, you should have a meeting with other participants.I believe that things are addressed that are used / needed by the users of the cpctelera.There are enough graphics commands to play, now the cpc / disk data is missing.

SpDizzy

#24
As a CPCtelera user, I may ask you:

Are you really pushing developers to satisfy your needs whlist asking an elemental thing about how to change program starting address? Is that true?

Honestly, you didnt understood anything.
Please, make use of the free framework if you want, but don't push developers to satisfy your needs on demand and criticize any bit of what was made for the community.
I may suggest you to canalise your effort on learning (yes this also includes reading available documentation, that's a shame you may think!), instead of pushing others to make the hard work for you. That way you are wasting your options of acquire new programming habilities.

Quote from: funkheld on 22:41, 19 January 21ronaldo, you should have a meeting with other participants.I believe that things are addressed that are used / needed by the users of the cpctelera.There are enough graphics commands to play, now the cpc / disk data is missing.
About participants, you may take a look at the authors / contributors / testers of the framework:

https://lronaldo.github.io/cpctelera/files/authors-txt.html#Authors

CPCtelera is not a 'one person' project. Some many people behind the scenes, many of them, if not all, present on this community.

Again and again, you are pushing so far on the community with your behaviour, as others has told you more than once.

But you are lucky, CPCtelera is an open source framework you can help improve with your effort, make some pull requests or sending issues, directly from it's github page.
Moreover, ronaldo, the person you mentioned, is not just and eminence on z80 processor, but a really good person, still giving you support despite your bad attitude and your lack of respect.

Come on change your mood, help making CPCtelera better.



Powered by SMFPacks Menu Editor Mod