-PICO_INTERNAL void gfx_cd_update(void)
-{
- int V_Dot = _rot_comp.Reg_64 & 0xff;
- int jobs;
-
- dprintf("gfx_cd_update, Reg_64 = %04x", _rot_comp.Reg_64);
-
- if (!V_Dot)
- {
- gfx_completed();
- return;
- }
-
- jobs = _rot_comp.Float_Part >> 16;
-
- if (!jobs)
- {
- _rot_comp.Float_Part += _rot_comp.Draw_Speed;
- return;
- }
-
- _rot_comp.Float_Part &= 0xffff;
- _rot_comp.Float_Part += _rot_comp.Draw_Speed;
-
- if (PicoOpt & POPT_EN_MCD_GFX)
- {
- unsigned int func = _rot_comp.Function;
- unsigned int H_Dot = _rot_comp.Reg_62 & 0x1ff;
- unsigned short *stamp_base = (unsigned short *) (Pico_mcd->word_ram2M + _rot_comp.Stamp_Map_Adr);
-
- while (jobs--)
- {
- gfx_do(func, stamp_base, H_Dot); // jmp [Jmp_Adr]:
-
- V_Dot--; // dec byte [V_Dot]
- if (V_Dot == 0)
- {
- // GFX_Completed:
- gfx_completed();
- return;
- }
- }
- }
- else
- {
- if (jobs >= V_Dot)
- {
- gfx_completed();
- return;
- }
- V_Dot -= jobs;
- }
-
- _rot_comp.Reg_64 = V_Dot;
-}
-
-
-PICO_INTERNAL_ASM unsigned int gfx_cd_read(unsigned int a)
-{
- unsigned int d = 0;
-
- switch (a) {
- case 0x58: d = _rot_comp.Reg_58; break;
- case 0x5A: d = _rot_comp.Reg_5A; break;
- case 0x5C: d = _rot_comp.Reg_5C; break;
- case 0x5E: d = _rot_comp.Reg_5E; break;
- case 0x60: d = _rot_comp.Reg_60; break;
- case 0x62: d = _rot_comp.Reg_62; break;
- case 0x64: d = _rot_comp.Reg_64; break;
- case 0x66: break;
- default: dprintf("gfx_cd_read FIXME: unexpected address: %02x", a); break;
- }
-
- dprintf("gfx_cd_read(%02x) = %04x", a, d);
-
- return d;
-}
-