Author Topic: 16k CPC Screen Map  (Read 1581 times)

0 Members and 1 Guest are viewing this topic.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.921
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1906
16k CPC Screen Map
« on: 11:45, 02 October 10 »
I found the details I wrote for the 16k screen (all 200 lines of it) - at one stage I wrote one huge basic program which drew the screen literally top to bottom, which was how I ended up with all this information. (Don't ask me how I got all the details - probably trial and error, or just follow the pattern it generates!  ;D ). I've just divided the sections up into groups of 8 lines.
 
Code: [Select]

&C000 -----------------> &C04F
&C800 -----------------> &C84F
&D000 -----------------> &D04F
&D800 -----------------> &D84F
&E000 -----------------> &E04F
&E800 -----------------> &E84F
&F000 -----------------> &F04F
&F800 -----------------> &F84F
 
&C050 -----------------> &C09F
&C850 -----------------> &C89F
&D050 -----------------> &D09F
&D850 -----------------> &D89F
&E050 -----------------> &E09F
&E850 -----------------> &E89F
&F050 -----------------> &F09F
&F850 -----------------> &F89F
 
&C0A0 -----------------> &C0EF
&C8A0 -----------------> &C8EF
&D0A0 -----------------> &D0EF
&D8A0 -----------------> &D8EF
&E0A0 -----------------> &E0EF
&E8A0 -----------------> &E8EF
&F0A0 -----------------> &F0EF
&F8A0 -----------------> &F8EF
 
&C0F0 -----------------> &C13F
&C8F0 -----------------> &C93F
&D0F0 -----------------> &D13F
&D8F0 -----------------> &D93F
&E0F0 -----------------> &E13F
&E8F0 -----------------> &E93F
&F0F0 -----------------> &F13F
&F8F0 -----------------> &F93F
 
&C140 -----------------> &C18F
&C940 -----------------> &C98F
&D140 -----------------> &D18F
&D940 -----------------> &D98F
&E140 -----------------> &E18F
&E940 -----------------> &E98F
&F140 -----------------> &F18F
&F940 -----------------> &F98F
 
&C190 -----------------> &C1DF
&C990 -----------------> &C9DF
&D190 -----------------> &D1DF
&D990 -----------------> &D9DF
&E190 -----------------> &E1DF
&E990 -----------------> &E9DF
&F190 -----------------> &F1DF
&F990 -----------------> &F9DF
 
&C1E0 -----------------> &C22F
&C9E0 -----------------> &CA2F
&D1E0 -----------------> &D22F
&D9E0 -----------------> &DA2F
&E1E0 -----------------> &E22F
&E9E0 -----------------> &EA2F
&F1E0 -----------------> &F22F
&F9E0 -----------------> &FA2F
 
&C230 -----------------> &C27F
&CA30 -----------------> &CA7F
&D230 -----------------> &D27F
&DA30 -----------------> &DA7F
&E230 -----------------> &E27F
&EA30 -----------------> &EA7F
&F230 -----------------> &F27F
&FA30 -----------------> &FA7F
 
&C280 -----------------> &C2CF
&CA80 -----------------> &CACF
&D280 -----------------> &D2CF
&DA80 -----------------> &DACF
&E280 -----------------> &E2CF
&EA80 -----------------> &EACF
&F280 -----------------> &F2CF
&FA80 -----------------> &FACF
 
&C2D0 -----------------> &C31F
&CAD0 -----------------> &CB1F
&D2D0 -----------------> &D31F
&DAD0 -----------------> &DB1F
&E2D0 -----------------> &E31F
&EAD0 -----------------> &EB1F
&F2D0 -----------------> &F31F
&FAD0 -----------------> &FB1F
 
&C320 -----------------> &C36F
&CB20 -----------------> &CB6F
&D320 -----------------> &D36F
&DB20 -----------------> &DB6F
&E320 -----------------> &E36F
&EB20 -----------------> &EB6F
&F320 -----------------> &F36F
&FB20 -----------------> &FB6F
 
&C370 -----------------> &C3BF
&CB70 -----------------> &CBBF
&D370 -----------------> &D3BF
&DB70 -----------------> &DBBF
&E370 -----------------> &E3BF
&EB70 -----------------> &EBBF
&F370 -----------------> &F3BF
&FB70 -----------------> &FBBF
 
&C3C0 -----------------> &C40F
&CBC0 -----------------> &CC0F
&D3C0 -----------------> &D40F
&DBC0 -----------------> &DC0F
&E3C0 -----------------> &E40F
&EBC0 -----------------> &EC0F
&F3C0 -----------------> &F40F
&FBC0 -----------------> &FC0F
 
&C410 -----------------> &C45F
&CC10 -----------------> &CC5F
&D410 -----------------> &D45F
&DC10 -----------------> &DC5F
&E410 -----------------> &E45F
&EC10 -----------------> &EC5F
&F410 -----------------> &F45F
&FC10 -----------------> &FC5F
 
&C460 -----------------> &C4AF
&CC60 -----------------> &CCAF
&D460 -----------------> &D4AF
&DC60 -----------------> &DCAF
&E460 -----------------> &E4AF
&EC60 -----------------> &ECAF
&F460 -----------------> &F4AF
&FC60 -----------------> &FCAF
 
&C4B0 -----------------> &C4FF
&CCB0 -----------------> &CCFF
&D4B0 -----------------> &D4FF
&DCB0 -----------------> &DCFF
&E4B0 -----------------> &E4FF
&ECB0 -----------------> &ECFF
&F4B0 -----------------> &F4FF
&FCB0 -----------------> &FCFF
 
&C500 -----------------> &C54F
&CD00 -----------------> &CD4F
&D500 -----------------> &D54F
&DD00 -----------------> &DD4F
&E500 -----------------> &E54F
&ED00 -----------------> &ED4F
&F500 -----------------> &F54F
&FD00 -----------------> &FD4F
 
&C550 -----------------> &C59F
&CD50 -----------------> &CD9F
&D550 -----------------> &D59F
&DD50 -----------------> &DD9F
&E550 -----------------> &E59F
&ED50 -----------------> &ED9F
&F550 -----------------> &F59F
&FD50 -----------------> &FD9F
 
&C5A0 -----------------> &C5EF
&CDA0 -----------------> &CDEF
&D5A0 -----------------> &D5EF
&DDA0 -----------------> &DDEF
&E5A0 -----------------> &E5EF
&EDA0 -----------------> &EDEF
&F5A0 -----------------> &F5EF
&FDA0 -----------------> &FDEF
 
&C5F0 -----------------> &C63F
&CDF0 -----------------> &CE3F
&D5F0 -----------------> &D63F
&DDF0 -----------------> &DE3F
&E5F0 -----------------> &E63F
&EDF0 -----------------> &EE3F
&F5F0 -----------------> &F63F
&FDF0 -----------------> &FE3F
 
&C640 -----------------> &C68F
&CE40 -----------------> &CE8F
&D640 -----------------> &D68F
&DE40 -----------------> &DE8F
&E640 -----------------> &E68F
&EE40 -----------------> &EE8F
&F640 -----------------> &F68F
&FE40 -----------------> &FE8F
 
&C690 -----------------> &C6DF
&CE90 -----------------> &CEDF
&D690 -----------------> &D6DF
&DE90 -----------------> &DEDF
&E690 -----------------> &E6DF
&EE90 -----------------> &EEDF
&F690 -----------------> &F6DF
&FE90 -----------------> &FEDF
 
&C6E0 -----------------> &C72F
&CEE0 -----------------> &CF2F
&D6E0 -----------------> &D72F
&DEE0 -----------------> &DF2F
&E6E0 -----------------> &E72F
&EEE0 -----------------> &EF2F
&F6E0 -----------------> &F72F
&FEE0 -----------------> &FF2F
 
&C730 -----------------> &C77F
&CF30 -----------------> &CF7F
&D730 -----------------> &D77F
&DF30 -----------------> &DF7F
&E730 -----------------> &E77F
&EF30 -----------------> &EF7F
&F730 -----------------> &F77F
&FF30 -----------------> &FF7F
 
&C780 -----------------> &C7CF
&CF80 -----------------> &CFCF
&D780 -----------------> &D7CF
&DF80 -----------------> &DFCF
&E780 -----------------> &E7CF
&EF80 -----------------> &EFCF
&F780 -----------------> &F7CF
&FF80 -----------------> &FFCF
* 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

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.751
  • Country: gb
    • redbox
  • Liked: 326
  • Likes Given: 267
Re: 16k CPC Screen Map
« Reply #1 on: 12:28, 02 October 10 »
Yes, the CPC screen format (being a 'venetian blind') is a real pain...

But you can calculate the next pixel line down by adding &800 to the current screen address.  If the addition overflows (because the end of the screen memory is &FFFF) you can detect this and add &50 for the next character line down.

Code: [Select]
nextline:   ld a,8          ;add 8 to H (the high byte)
            add a,h         ;which adds &800 to screen address
            ld h,a
            ret nc          ;return if no overflow

            push de         ;otherwise preserve DE
            ld de,&C050
            add hl,de       ;add &C000+&50 to HL
            pop de          ;and get DE back again!
            ret

Offline fano

  • Supporter
  • 6128 Plus
  • *
  • Posts: 835
  • Country: fr
  • Easter Egg Programmer
    • Easter Egg
  • Liked: 278
  • Likes Given: 614
Re: 16k CPC Screen Map
« Reply #2 on: 13:06, 02 October 10 »
Problem is theses methods are good for screen starting at #C000 and for 40 CRTC chars width.
In fact screen addressing is not really difficult as long you have understand how addressing is done.
For 16 bits address , you have 3 groups like this :

You can decompose 16bits address like this : AABBBCCC CCCCCCCCC

C = gives you position byte per byte for width and char per char for height (0-2047)
B = gives you line on char (0-7)
A = gives you memory page (0,#40,#80,#C0)

Note , if you use hardware scrolling with R12&R13 , you'll have to MOD C group by 2048.
A method to deal with that is to have char aligned routines with differents entrypoints corresponding to line offset , this is faster because you don't have to test char jump.

« Last Edit: 13:11, 02 October 10 by fano »
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.921
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1132
  • Likes Given: 1906
Re: 16k CPC Screen Map
« Reply #3 on: 05:25, 03 October 10 »
Unfortunately that's well beyond my comphension!  :(  The only thing I think it may have a relationship to was the Mandelbrot I converted for the CPC. It loads 64Kb of Colour Data (in 16Kb data segments), the reason being I was plotting it to screen in Mode 1 - if it was done in Mode 2 the result would have been 128Kb due to the resolution. Likewise in Mode 0 it would have been 32Kb. Earlier on I was a bit confused because I knew that screen line is &4F bytes across, though I understabd the screen handles everything a bit differently due to the way pixels are handled in colour masks which is different again from Plotting Colour Values.
* 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