void naomi_m1_board::enc_fill() { while(buffer_actual_size < BUFFER_SIZE && !stream_ended) { switch(lookb(3)) { // 00+2 - 0000+esc case 0: case 1: { skipb(2); int addr = getb(2); if(addr) wb(dict[addr]); else wb(getb(8)); break; } // 010+2 case 2: skipb(3); wb(dict[getb(2)+4]); break; // 011+3 case 3: skipb(3); wb(dict[getb(3)+8]); break; // 10+5 case 4: case 5: skipb(2); wb(dict[getb(5)+16]); break; // 11+6 case 6: case 7: { skipb(2); int addr = getb(6)+48; if(addr == 111) stream_ended = true; else wb(dict[addr]); break; } } } while(buffer_actual_size < BUFFER_SIZE) buffer[buffer_actual_size++] = 0; }
inline UINT32 naomi_m1_board::getb(int bits) { UINT32 res = lookb(bits); skipb(bits); return res; }