<commit_before>/*
 * Copyright (c) 2012-2016 <NAME>
 * See LICENSE for details.
 *
 * <NAME> <<EMAIL>>
 */

#include <assert.h>
#include <string.h>

#include <vdp2/scrn.h>
#include <vdp2/vram.h>

#include "vdp-internal.h"

#ifdef DEBUG
static void _debug_check_cell(const struct vdp2_scrn_cell_format *);
#endif /* DEBUG */

static void _cell_plane_calc(const struct vdp2_scrn_cell_format *, uint16_t *,
    uint16_t *);
static uint16_t _cell_pattern_name_control_calc(
    const struct vdp2_scrn_cell_format *);

static void _nbg0_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _nbg1_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _nbg2_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _nbg3_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _rbg0_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);

#ifdef DEBUG
static void _debug_check_bitmap(const struct vdp2_scrn_bitmap_format *);
#endif /* DEBUG */

static void _nbg0_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *);
static void _nbg1_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *);
static void _rbg0_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *);

void
vdp2_scrn_cell_format_set(const struct vdp2_scrn_cell_format *format)
{
#ifdef DEBUG
        _debug_check_cell(format);
#endif /* DEBUG */

        switch (format->scroll_screen) {
        case VDP2_SCRN_NBG0:
                _nbg0_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_NBG1:
                _nbg1_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_NBG2:
                _nbg2_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_NBG3:
                _nbg3_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_RBG0:
                _rbg0_scrn_cell_format_set(format);
               break;
        }
}

void
vdp2_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *format)
{
#ifdef DEBUG
        _debug_check_bitmap(format);
#endif /* DEBUG */

        switch (format->scroll_screen) {
        case VDP2_SCRN_NBG0:
                _nbg0_scrn_bitmap_format_set(format);
                break;
        case VDP2_SCRN_NBG1:
                _nbg1_scrn_bitmap_format_set(format);
                break;
        case VDP2_SCRN_RBG0:
                _rbg0_scrn_bitmap_format_set(format);
                break;<commit_msg>Fix coding style<commit_after>/*
 * Copyright (c) 2012-2016 <NAME>
 * See LICENSE for details.
 *
 * <NAME> <<EMAIL>>
 */

#include <assert.h>
#include <string.h>

#include <vdp2/scrn.h>
#include <vdp2/vram.h>

#include "vdp-internal.h"

#ifdef DEBUG
static void _debug_check_cell(const struct vdp2_scrn_cell_format *);
#endif /* DEBUG */

static void _cell_plane_calc(const struct vdp2_scrn_cell_format *, uint16_t *,
    uint16_t *);
static uint16_t _cell_pattern_name_control_calc(
    const struct vdp2_scrn_cell_format *);

static void _nbg0_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _nbg1_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _nbg2_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _nbg3_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);
static void _rbg0_scrn_cell_format_set(const struct vdp2_scrn_cell_format *);

#ifdef DEBUG
static void _debug_check_bitmap(const struct vdp2_scrn_bitmap_format *);
#endif /* DEBUG */

static void _nbg0_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *);
static void _nbg1_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *);
static void _rbg0_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *);

void
vdp2_scrn_cell_format_set(const struct vdp2_scrn_cell_format *format)
{
#ifdef DEBUG
        _debug_check_cell(format);
#endif /* DEBUG */

        switch (format->scroll_screen) {
        case VDP2_SCRN_NBG0:
                _nbg0_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_NBG1:
                _nbg1_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_NBG2:
                _nbg2_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_NBG3:
                _nbg3_scrn_cell_format_set(format);
                break;
        case VDP2_SCRN_RBG0:
                _rbg0_scrn_cell_format_set(format);
                break;
        }
}

void
vdp2_scrn_bitmap_format_set(const struct vdp2_scrn_bitmap_format *format)
{
#ifdef DEBUG
        _debug_check_bitmap(format);
#endif /* DEBUG */

        switch (format->scroll_screen) {
        case VDP2_SCRN_NBG0:
                _nbg0_scrn_bitmap_format_set(format);
                break;
        case VDP2_SCRN_NBG1:
                _nbg1_scrn_bitmap_format_set(format);
                break;
        case VDP2_SCRN_RBG0:
                _rbg0_scrn_bitmap_format_set(format);
                break;
{'fraction_non_alphanumeric': 0.07523009203681473, 'fraction_numerical': 0.025610244097639057, 'mean_word_length': 3.2508503401360542, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1190656', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1845, 'n_words': 297}