+ case RTGCMD_P2C: {
+ // A0: BoardInfo, A1: BitMap *bm, A2: RenderInfo *r,
+ // D0: SHORT x, D1: SHORT y, D2: SHORT dx, D3: SHORT dy, D4: SHORT w, D5: SHORT h,
+ // D6: UBYTE minterm, D7: UBYTE mask
+ r = (struct P96RenderInfo *)get_mapped_data_pointer_by_address(cfg, M68KR(M68K_REG_A2));
+ struct BitMap *bm = (struct BitMap *)get_mapped_data_pointer_by_address(cfg, M68KR(M68K_REG_A1));
+ if (!r || !bm)
+ break;
+
+ gdebug("iP2C begin\n");
+
+ if (!bm) {
+ printf ("Help! BitMap not in mapped memory.\n");
+ break;
+ } else {
+ gdebug("Data is available in mapped memory.\n");
+ }
+
+ if (realtime_graphics_debug) {
+ printf("bm: %.8X r: %.8X\n", (uint32_t)bm, (uint32_t)r);
+ if (bm)
+ printf("bm pitch: %d\n", be16toh(bm->BytesPerRow));
+ if (r)
+ printf("r pitch: %d\n", be16toh(r->BytesPerRow));
+ }
+
+ uint16_t bmp_pitch = be16toh(bm->BytesPerRow);
+ uint16_t line_pitch = be16toh(r->BytesPerRow);
+ rtg_address_adj[0] = be32toh(r->_p_Memory) - (PIGFX_RTG_BASE + PIGFX_REG_SIZE);
+
+ uint8_t minterm = (uint8_t)M68KR(M68K_REG_D6);
+ cmd_mask = (uint8_t)M68KR(M68K_REG_D7);
+
+ rtg_p2c_ex(M68KR(M68K_REG_D0), M68KR(M68K_REG_D1), M68KR(M68K_REG_D2), M68KR(M68K_REG_D3), M68KR(M68K_REG_D4), M68KR(M68K_REG_D5), minterm, bm, cmd_mask, line_pitch, bmp_pitch);
+ gdebug("iP2C end\n");
+ break;
+ }