News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Load images to screen

Started by gilesforrest, 14:51, 04 April 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gilesforrest

Hi all,

Excuse if I'm asking as silly question, but I've been assisted by another user to load some old image files (not sure what format) into screen memory (&C000) to be able to see them in the "Find Graphics" within WinApe. My thread is here: http://www.cpcwiki.eu/forum/technical-support/can-you-crack-the-code/

I can't load them via "LOAD" or "INPUT#9" so have kindly been provided an assembly language snippet to use.

I'm doing the following (without luck):


org    &4000 <-- this sets the starting point for this code
ld hl,Filename  <-- this sets the filename address (defined below)
ld de,&c000
ld b,12  <-- this specifies the length of the filename (12 characters)
call &bc77  <-- this opens the file header
ret nc  <-- this returns/ends the code on the condition the carry flag has been reset ...not sure what this means...needs more research!
ld hl,&c000  <-- this specifies the starting address to load the file contents into (&C000)
call &bc83  <-- this loads the file
call &bc7a   <-- this closes the file 
ret  <-- this ends the code.Filename
defm "MJ-BAD  .BIN"  <-- this defines the variable "Filename" as the 12 character filename "MJ-BAD  .BIN"
I then Assemble with no errors.

And then run the program from Basic, given the starting address is &4000, I try a "CALL &4000"... to which I get a "Ready"...

I was expecting the screen to show the image rather than just give me a "Ready" prompt. It certainly seems to be running the program because if I change the filename it gives a file not found response.

Can anyone assist?

Thanks,

Giles

tastefulmrship

#1
I have already supplied you with the converted binary file. Just load that file with LOAD"<filename>",&C000 to view your MJ-BAD screen.
If you find anymore unknown files, I'm sure someone here will be more than happy to help you out.

EDIT: Try loading WinAPE, pressing F3, copying the code to the editor, press F9, then type CALL &4000 in BASIC.

gilesforrest

Thanks...I'm just trying to learn as I go along and this has sparked some nostalgia in me from my old CPC 6128 days which I'd like to learn more and use better than when I was a teenager!


So managing to recreate what you did seems the first step - although even when I do a load"etc",&c000 on the file you provided I don't get the image so perhaps something is wrong with my emulator/config?


tastefulmrship

#3
Here are all the files in a single .dsk file.
- MJ-BAD.BIN is your original file.
- MJ-BAD.SCR is a CPC-friendly version.
- CONVERTD.BMP is the 320x200 version extracted from WinAPE.
- CONVERTD.SCR is the CPC version.
- WIFF.SCR & WIFF.PAL are the other files you had.

So, LOAD"CONVERTD.SCR",&C000 will view the image on screen!

AMSDOS

Quote from: gilesforrest on 14:51, 04 April 17

I then Assemble with no errors.

And then run the program from Basic, given the starting address is &4000, I try a "CALL &4000"... to which I get a "Ready"...

I was expecting the screen to show the image rather than just give me a "Ready" prompt. It certainly seems to be running the program because if I change the filename it gives a file not found response.

Can anyone assist?

Thanks,

Giles


I'm not totally sure, but it doesn't sound like your file is loading and the program is exiting on the ret nc, see what happens when it has been removed, if the computer crashes then the file wasn't opened successfully and carry is false I think.


With regard to the file naming don't put "MJ-BAD<space><space>.BIN", use the filenames as @SuTeKH/Epyteor has them, so in that case "MJ-BAD.BIN" is 10 Characters not 12, that should then work 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

gilesforrest

Thanks AMSDOS, I have managed to fix the problem!

You were correct that the files were not loading - the problem was I didn't initially have the "Add/Remove AMSDOS headers" checked when dragging my binaries into the disk editor.

Now they load correctly into memory and I can see them in the "Find Graphics" section of WinApe - thanks SuTekH/Epyteor!

What I've subsequently done is this:
So I'm happy I now know what's going on and can have the files as .WIN or .SCR, and more modern formats if I wish!

Another example of my artwork attached - I did these in 1988 when I was 12!

Thanks again for everyone's help.

Giles

Morri

I like your wiff the dragon character.  8)
Did you ever have a game in mind when you created it or did you just enjoy drawing for the fun of it?
Keeping it Kiwi since 1977

gilesforrest

It was just for the fun of it - I've googled Wiff the Dragon and found it was a book I must have owned!


https://www.amazon.co.uk/Wiff-Dragon-Story-board-Woodman/dp/0721406955

mr_lou

Quote from: gilesforrest on 08:19, 07 April 17
It was just for the fun of it - I've googled Wiff the Dragon and found it was a book I must have owned!
https://www.amazon.co.uk/Wiff-Dragon-Story-board-Woodman/dp/0721406955

But you don't remember the book? Even after finding it again?

gilesforrest

Ha, well it was nearly 30 years ago! In fact, in my memory I wrote the book (well, a handwritten paperback version of it) and replied to the above post stating that...and then I thought maybe it wasn't my original idea and googled it and found the book - and subsequently edited my post!



I just looked in the bookshelf near me with a load of old books and look what I found...


The more I think about it, I must of had the book, but also created my own illustrated short story using the same characters (that's probably somewhere in the loft) - and hence did an 8-bit piece of artwork for fun at the same time!

mr_lou

During development of 8-bit Memoirs I've had many memories brought back to life from those days. I was thinking maybe the same had happened (or will happen) to you.  :)

gilesforrest

Having discovered WinApe and all the old Amstrad games available to download my evenings this week have been a flood of nostalgia!!


It's the music that really jolts the synapses the most I think...

mr_lou

Quote from: gilesforrest on 17:10, 07 April 17
Having discovered WinApe and all the old Amstrad games available to download my evenings this week have been a flood of nostalgia!!

It's the music that really jolts the synapses the most I think...

I agree. And especially the music you created yourself - on the CPC - which is what I did.
Lucky to have all the music I created back then. (Soon available as playlists on 8-bit Memoirs - but probably not a whole lot interesting to anyone but myself  ;) )

Powered by SMFPacks Menu Editor Mod