GeorgRottensteiner / C64Studio

C64Studio is a .NET based IDE specializing in game development for the C64 in assembler and BASIC
Other
243 stars 36 forks source link

Graphicscreen editor to show which colors are active in current charblock #82

Open mokdevel opened 1 year ago

mokdevel commented 1 year ago

Tested in WIP (7.3.5)

Second issue which may be related to the above.... The character bitmap (4x8 in MC) is shown under the colors. I can draw in it with mouse. The color selector under it does not have any logic. Pressing a color selects weird colors:

mokdevel commented 1 year ago

Regarding the second issue - it seems to be for the imported image. If I create another graphicscreen and do full copy/paste, the color picker works as expected.

mokdevel commented 1 year ago

Hmm.. there is something with the import. Once I've imported the image (png of a MC c64 image), I do a full copy/paste to another graphicscreen. The image looks as it should be, colors are correct and the c64 color limits are considered. But something is broken with the colors when doing !media.

!media "gfx_ptower_big.graphicscreen",bitmapscreencolor
OR !media "gfx_ptower_big.graphicscreen",color !media "gfx_ptower_big.graphicscreen",screen !media "gfx_ptower_big.graphicscreen",bitmap

In both cases, the color and screen data is incorrect. Bitmap is correct. The colors are switched as I described in the first comment (eg. $1 -> $b)

NOTE: If I start a MC bitmap image from scratch and draw and paint, !media, color pickers etc work correctly.

Update: Tested with .bmp and the same issue.

mokdevel commented 1 year ago

Something to test with.

test.zip

       *= $5800
!media   "test2.graphicscreen",color 
        *= $5c00
!media   "test2.graphicscreen",screen
        *= $6000
!media   "test2.graphicscreen",bitmap

         *= $0801
         !basic

         jmp start

         *= $2800

start
         lda #$00
loop1    lda $5800,x
         sta $d800,x
         lda $5900,x
         sta $d900,x
         lda $5a00,x
         sta $da00,x
         lda $5b00,x
         sta $db00,x
         inx
         bne loop1

         lda #$00
         sta $d020
         sta $d021

         lda #$3b
         sta $d011
         lda #%01111000
         sta $d018
         lda #%11111110
         sta $dd00
         lda #%00011000
         sta $d016

         jmp *
GeorgRottensteiner commented 1 year ago

Thanks, I'm reading it, but this will take a bit to look into.

mokdevel commented 1 year ago

The import works in mysterious ways once it mixes the palette. As mentioned the image may look good, but !media data is weird. Anyway, I was able to convert my image with the 'Directly replace colors'. So my second issue is "sorted". The first one I still would like to have. ;-)

GeorgRottensteiner commented 1 year ago

Just in case/as a workaround, C64Studio may not always preserve the same bit pattern for a color between 8x8 blocks. You can force a certain bit pattern in the second tab.