Changeset 44147


Ignore:
Timestamp:
10/12/19 01:15:36 (4 years ago)
Author:
obi
Message:

update bcm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/bcm.h

    r42165 r44147  
    2424static int ptr;
    2525static bool supportblendingflags = true;
     26static bool accumulateoperations = false;
    2627
    2728#define P(x, y) do { displaylist[ptr++] = x; displaylist[ptr++] = y; } while (0)
     
    8990{
    9091        return supportblendingflags;
     92}
     93
     94int bcm_accel_accumulate()
     95{
     96#ifdef SUPPORT_ACCUMULATED_ACCELERATION_OPERATIONS
     97        accumulateoperations = true;
     98        return 0;
     99#else
     100        return -1;
     101#endif
     102}
     103
     104int bcm_accel_sync()
     105{
     106        int retval = 0;
     107        if (accumulateoperations)
     108        {
     109                if (ptr)
     110                {
     111                        fprintf(stderr, "bcm_accel_sync: ptr %d\n", ptr);
     112
     113                        retval = exec_list();
     114                }
     115                accumulateoperations = false;
     116        }
     117        return retval;
    91118}
    92119
     
    98125                int pal_addr, int flags)
    99126{
     127        if (accumulateoperations)
     128        {
     129                if (((sizeof(displaylist) / sizeof(displaylist[0]) - ptr) / 2) < 40)
     130                {
     131                        fprintf(stderr, "bcm_accel_blit: not enough space to accumulate\n");
     132                        bcm_accel_sync();
     133                        bcm_accel_accumulate();
     134                }
     135        }
     136
    100137        C(0x43); // reset source
    101138        C(0x53); // reset dest
     
    149186        C(0x77);  // do it
    150187
    151         exec_list();
     188        if (!accumulateoperations) exec_list();
    152189}
    153190
     
    157194                unsigned long color)
    158195{
     196        if (accumulateoperations)
     197        {
     198                if (((sizeof(displaylist) / sizeof(displaylist[0]) - ptr) / 2) < 40)
     199                {
     200                        fprintf(stderr, "bcm_accel_fill: not enough space to accumulate\n");
     201                        bcm_accel_sync();
     202                        bcm_accel_accumulate();
     203                }
     204        }
     205
    159206        C(0x43); // reset source
    160207        C(0x53); // reset dest
     
    202249        C(0x77);  // do it
    203250
    204         exec_list();
     251        if (!accumulateoperations) exec_list();
    205252}
    206253
Note: See TracChangeset for help on using the changeset viewer.