News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Recent posts

#91
A
Programming / Re: Newbie assembler CPC quest...
Last post by arnoldemu - 13:20, 05 July 25
If you want to change modes the firmware friendly way is to setup a fast ticker interrupt (see the relevant sections in the soft 968 documentation on cpcwiki), and to to use MC SET MODE to set the mode without clearing the screen and MC SET INKS to change the palette in each section. This would give the same results McArti0 posted.

The thing to be aware of doing this is the firmware may draw as if it was in the mode set at the time of SCR SET MODE but it seems Soft968 might have the answer:

Soft968 says: 'On V1.1 firmware all that is necessary is to patch a RET instruction into the first byte of the SCR MODE CLEAR indirection. On V1.0 firmware this would result in all the inks being set to the background colour!' but if you are changing inks anyway this last point doesn't matter.

Then use SCR SET MODE, put text/draw lines, and then SCR SET MODE for another area of the screen might work. :)
#92
Fuzix is limited to 1MB as well.
I am planning to introduce a new memory allocation system in SymbOS, that is using the RAM behind the first 1MB only for storing data (not for code), but it's already really not easy to fill the whole first 1MB.
#93
avatar_McArti0
Programming / Re: Newbie assembler CPC quest...
Last post by McArti0 - 13:13, 05 July 25
https://www.cpcwiki.eu/imgs/e/e1/The_Amstrad_CPC_Firmware_Guide.txt

     6128  ł 464  ł Size ł Comments on the memory locations
    ÄÄÄÄÄÄĹÄÄÄÄÄÄÄĹÄÄÄÄÄÄĹÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    &B7D4 ł &B1D9 ł 1+16 ł Border and Pens' First Inks (as hardware numbers):
          ł       ł      ł 
    &B7D4 ł &B1D9 ł 1    ł hw &04 = sw 1    (blue)            border
    &B7D5 ł &B1DA ł 1    ł hw &04 = sw 1    (blue)            pen 0
    &B7D6 ł &B1DB ł 1    ł hw &0A = sw 24  (bright yellow)  pen 1
    &B7D7 ł &B1DC ł 1    ł hw &13 = sw 20  (bright cyan)    pen 2
    &B7D8 ł &B1DD ł 1    ł hw &0C = sw 6    (bright red)      pen 3
    &B7D9 ł &B1DE ł 1    ł hw &0B = sw 26  (bright white)    pen 4
    &B7DA ł &B1DF ł 1    ł hw &14 = sw 0    (black)          pen 5
    &B7DB ł &B1E0 ł 1    ł hw &15 = sw 2    (bright blue)    pen 6
    &B7DC ł &B1E1 ł 1    ł hw &0D = sw 8    (bright magenta)  pen 7
    &B7DD ł &B1E2 ł 1    ł hw &06 = sw 10  (cyan)            pen 8
    &B7DE ł &B1E3 ł 1    ł hw &1E = sw 12  (yellow)          pen 9
    &B7DF ł &B1E4 ł 1    ł hw &1F = sw 14  (pale blue)      pen 10
    &B7E0 ł &B1E5 ł 1    ł hw &07 = sw 16  (pink)            pen 11
    &B7E1 ł &B1E6 ł 1    ł hw &12 = sw 18  (bright green)    pen 12
    &B7E2 ł &B1E7 ł 1    ł hw &19 = sw 22  (pale green)      pen 13
    &B7E3 ł &B1E8 ł 1    ł hw &04 = sw 1    (blue)            pen 14
    &B7E4 ł &B1E9 ł 1    ł hw &17 = sw 11  (sky blue)        pen 15
    ÄÄÄÄÄÄĹÄÄÄÄÄÄÄĹÄÄÄÄÄÄĹÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
    &B7E5 ł &B1EA ł 1+16 ł Border and Pens' Second Inks (as hardware numbers):
          ł       ł      ł 
    &B7E5 ł &B1EA ł 1    ł hw &04 = sw 1    (blue)            border
    &B7E6 ł &B1EB ł 1    ł hw &04 = sw 1    (blue)            pen 0
    &B7E7 ł &B1EC ł 1    ł hw &0A = sw 24  (bright yellow)  pen 1
    &B7E8 ł &B1ED ł 1    ł hw &13 = sw 20  (bright cyan)    pen 2
    &B7E9 ł &B1EE ł 1    ł hw &0C = sw 6    (bright red)      pen 3
    &B7EA ł &B1FF ł 1    ł hw &0B = sw 26  (bright white)    pen 4
    &B7EB ł &B1F0 ł 1    ł hw &14 = sw 0    (black)          pen 5
    &B7EC ł &B1F1 ł 1    ł hw &15 = sw 2    (bright blue)    pen 6
    &B7ED ł &B1F2 ł 1    ł hw &0D = sw 8    (bright magenta)  pen 7
    &B7EE ł &B1F3 ł 1    ł hw &06 = sw 10  (cyan)            pen 8
    &B7EF ł &B1F4 ł 1    ł hw &1E = sw 12  (yellow)          pen 9
    &B7F0 ł &B1F5 ł 1    ł hw &1F = sw 14  (pale blue)      pen 10
    &B7F1 ł &B1F6 ł 1    ł hw &07 = sw 16  (pink)            pen 11
    &B7F2 ł &B1F7 ł 1    ł hw &12 = sw 18  (bright green)    pen 12
    &B7F3 ł &B1F8 ł 1    ł hw &19 = sw 22  (pale green)      pen 13
    &B7F4 ł &B1F9 ł 1    ł hw &04 = sw 1    (bright yellow)  pen 14
    &B7F5 ł &B1FA ł 1    ł hw &17 = sw 11  (pink)            pen 15
#94
A
Programming / Re: Newbie assembler CPC quest...
Last post by arnoldemu - 13:08, 05 July 25
https://www.cpcwiki.eu/imgs/e/ef/S968ap05.pdf

This lists the default colours.

You can always change them with SCR SET INK and SCR SET BORDER as you have done already.
#95
avatar_andymccall
Programming / Re: Newbie assembler CPC quest...
Last post by andymccall - 13:07, 05 July 25
Quote from: ZorrO on 00:05, 05 July 25@andymccall - I have no idea where you got the numbers for the colors you listed.

And as for the width of the text, you can use a narrow font, like this:
https://www.cpcwiki.eu/forum/programming/basic-programming-tips/msg117620/#msg117620

Yes, I still didn't understand it really.  I think I can make do with &BC2C  SCR INK ENCODE for my project, but what I might do afterwards is put together an small program that uses &BC2C  SCR INK ENCODE and outputs the encoded colours to the screen so I can see what they are and how they change.
#96
avatar_andymccall
Programming / Re: Newbie assembler CPC quest...
Last post by andymccall - 13:05, 05 July 25
Quote from: andycadley on 07:47, 05 July 25You're over complicating things. Since you're using the firmware to do the drawing, you might as well let it deal with the complexity of byte encoding too.

100 &BC2C  SCR INK ENCODE
Action: Converts a PEN to provide a mask which, if applied to a screen byte, will convert all of the pixels in the byte to the appropriate PEN
      Entry:  A contains a PEN number
      Exit:  A contains the encoded value of  the PEN, the flags are corrupt, and all other registers are preserved

      Notes:  The mask returned is  different  in  each of the screen modes


So all you need is something like:

LD A,(current_pen)
CALL SCR_INK_ENCODE

Okay, this was useful! (Not saying the other posts weren't - I've learned a lot from my mistakes!).  I think this is more like what I should be doing:

; Is this now correct?

    ; Set the pen
    ld      a, 2                ; Select Pen 2
    call    #BB90               ; Call TXT SET PEN

    ; Set the pen ink
    ld      a, 2                ; Use pen 2
    ld      b, 10               ; Set Ink 2 to be the color
    ld      c, b                ; Copy same color to c to ensure a solid, non-flashing color
    call    #BC32               ; Call SCR SET INK

    ; Convert to code suitable for mode 0
    ld      a, 2                ; Use the current value of Pen 2
    call    #BC2C               ; Call SCR INK ENCODE

    ; Copy the converted color code left in a to c
    ld      c, a                ; Color of rectangle
    ld      hl, screen_base     ; Start of screen memory
    ld      d, 10               ; Width of the rectangle, accounting for double width
    ld      e, 120              ; Height of the rectangle
    call    #BC47               ; Call the graphics function to draw the rectangle

Is this better?

If it is, one renaming question I do have is about the colours.  The pallet here: https://www.cpcwiki.eu/index.php/CPC_Palette lists all the colours available, but how do I know which colours from that pallet are part of the default 16 when I switch to mode 0? (I'm hoping that question hasn't just triggered a load of seasoned developers and shown I *still* don't know what I'm doing!)

I'm going to try the interrupt technique to see if I can get the menu written using mode 1.  I'll create a new project and write double width text at the top, and normal text at the bottom.  If I can do this, I'll try and incorporate it to my project.

One thing this little project has shown me is how much quality of life the neo-retro systems like the Agon Light, Neo6502 and Commander X16 have added to them.  Even though those systems are supposed to be "retro" systems, there's still a lot of stuff their firmware, API's and systems give you that you simply don't have on the original retro systems.

I'm having fun (if being fun can be defined as constantly confused nad frustrated!) learning the CPC so far, and I'd have *loved* to have seen a world where developers knew how to take 100% advantage of the CPC on the day it was launched - and it being launched a year earlier.  I think it would have really changed the industry, with C64 and Spectrum owners looking on in envy.  It's a shame it tended to get the Spectrum's poorly ported hand-me-downs.  It amazes me that I had this system 30 years ago, and I never new the power it had.

Thank you!
#97
avatar_Rabs
Amstrad CPC hardware / Re: Which chip for internal ro...
Last post by Rabs - 12:42, 05 July 25
Quote from: orzel on 12:24, 05 July 25
Quote from: Rabs on 07:41, 05 July 25There is a 28c256 to 27c256 adapter on github, see aDIPters. May be suitable as a 23256 replacement.

Thanks for the link, might give it a try. It's nicely done.
I may give it a try myself, but generally I don't mind using the EPROMs as I have a UV EPROM Eraser.

The PCB is available on PCBWay, see 28C256 to 27C256 and I can see the 28C256 SOIC in stock on DigiKey, see AT28C256-15SU
#98
avatar_orzel
Amstrad CPC hardware / Re: Which chip for internal ro...
Last post by orzel - 12:24, 05 July 25
Quote from: Rabs on 07:41, 05 July 25There is a 28c256 to 27c256 adapter on github, see aDIPters. May be suitable as a 23256 replacement.
So basically, "no".
There's really not much difference between 28c256 and 27c256 pinouts... I wonder if they did it on purpose.

Thanks for the link, might give it a try. It's nicely done.
#99
A
Programming / Re: Crash on a conversion from...
Last post by arnoldemu - 12:06, 05 July 25
Hi iXien,
The crack you are using doesn't use just files because it reads the data from sectors on the disk and the sectors are not data format.

Could you adapt the crack from Black Mission which just uses files?
#100
avatar_iXien
Emulators / Re: Amstrad CPC on the DS
Last post by iXien - 10:04, 05 July 25
@wavemotion-dave , I made some tests.

  • Puzzle Bobble : Working in its DSK version. But the CPR conversion created to work on any Plus machine and on 464/664 with a cartridge adapter crash after the Crazy Piri logo.
  • Robocop : All original version crash, the version used to patch the game in CPR/nokeyboard crashes too, another cracked version in DSK works.

About the savestate freeze, no more problem since friday. I'll keep you informed if I have this problem again  ;)  
 
Powered by SMFPacks Menu Editor Mod