Page 2 of 2

Re: Yet Another Tilemap and Super Scaler Demo

Posted: Wed Sep 07, 2022 2:57 pm
by Tomahomae
Vic wrote:
Wed Sep 07, 2022 7:57 am
Note that if you're planning to use MD planes for drawing font glyphs, you won't be able to use them in your tilemaps.
I don't afraid it - I going to make a grafically (and, maybe, sonically) enhanced ports of my previous projects, with the same source graphics for backgrounds and sprites. The fonts binary files and palettes code will be only unchanged pieces of GFX. So, for tilemaps will be used 32X layers exclusively.

Re: Yet Another Tilemap and Super Scaler Demo

Posted: Thu Sep 08, 2022 11:36 am
by Vic
Then indeed it'd be best to use the string drawing code from D32XR: https://github.com/viciious/d32xr/tree/master/src-md

Re: Yet Another Tilemap and Super Scaler Demo

Posted: Fri Sep 09, 2022 3:57 am
by Tomahomae
Vic wrote:
Thu Sep 08, 2022 11:36 am
Then indeed it'd be best to use the string drawing code from D32XR: https://github.com/viciious/d32xr/tree/master/src-md
You mean font.s and piece of m68k_crt1.s below?

Code: Select all

| load font tile data
        move.w  #0x8F02,(a4)            /* INC = 2 */
        move.l  #0x40000000,(a4)        /* write VRAM address 0 */
        lea     font_data(pc),a0
        move.w  #0x6B*8-1,d2
7:
        move.l  (a0)+,d0                /* font fg mask */
        move.l  d0,d1
        not.l   d1                      /* font bg mask */
        andi.l  #0x11111111,d0          /* set font fg color */
        andi.l  #0x00000000,d1          /* set font bg color */
        or.l    d1,d0
        move.l  d0,(a3)                 /* set tile line */
        dbra    d2,7b

| set the default palette for text
        move.l  #0xC0000000,(a4)        /* write CRAM address 0 */
        move.l  #0x00000CCC,(a3)        /* entry 0 (black) and 1 (lt gray) BGR */
        move.l  #0xC0200000,(a4)        /* write CRAM address 32 */
        move.l  #0x000000A0,(a3)        /* entry 16 (black) BGR and 17 (green) */
        move.l  #0xC0400000,(a4)        /* write CRAM address 64 */
        move.l  #0x0000000A,(a3)        /* entry 32 (black) BGR and 33 (red) */

        move.w  #0x8174,(a4)            /* display on, vblank enabled */

        movem.l (sp)+,d2-d7/a2-a6
        rts

Re: Yet Another Tilemap and Super Scaler Demo

Posted: Fri Sep 09, 2022 4:05 pm
by Vic
Yes, along with put_chr, xvprintf, dbug_queue, etc

Re: Yet Another Tilemap and Super Scaler Demo

Posted: Sat Sep 10, 2022 3:52 am
by Tomahomae
Let's say, my font binary files attached below. Here is a palette data:

Code: Select all

$000,$EEE,$000,$EA0,$46C,$04E,$EEE,$EEE,$02A,$CCC,$68E,$AAC,$EEA,$AAC,$EC2,$EC6
What should I change in the d32xr/src-md/crt0.s text to make load_font refer to the attached files instead of assembly code, and where is the lines responsible for palette data reading?

Re: Yet Another Tilemap and Super Scaler Demo

Posted: Mon Sep 12, 2022 6:48 pm
by Vic
Tomahomae wrote:
Sat Sep 10, 2022 3:52 am
Let's say, my font binary files attached below. Here is a palette data:

Code: Select all

$000,$EEE,$000,$EA0,$46C,$04E,$EEE,$EEE,$02A,$CCC,$68E,$AAC,$EEA,$AAC,$EC2,$EC6
What should I change in the d32xr/src-md/crt0.s text to make load_font refer to the attached files instead of assembly code, and where is the lines responsible for palette data reading?
Sorry, but you gonna have to get yourself acquainted with low-level coding for the MD in order to get your custom features work. Nobody's going to write your code for you.