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

#include <vdp2.h>
#include <smpc.h>
#include <smpc/peripheral.h>
#include <arp.h>
#include <cpu/intc.h>

#include <cons/vdp2.h>

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

static struct cons cons;

static void
local_arp_cb(arp_callback_t *arp_cb)
{
        char *buf;

        buf = (char *)malloc(1024);
        assert(buf != NULL);

        (void)sprintf(buf, "Callback\n"
            "ptr: %p\n"
            "len: 0x%04X\n"
            "function: 0x%02X\n\n",
            arp_cb->ptr,
            arp_cb->len,
            arp_cb->function);

        cons_write(&cons, buf);

        free(buf);
}

int
main(void)
{
        uint16_t blcs_color[] = {
                0x9C00
        };

        vdp2_init();
        vdp2_tvmd_blcs_set(/* lcclmd = */ false, VRAM_ADDR_4MBIT(3, 0x1FFFE),
            blcs_color, 0);

        smpc_init();

        cons_vdp2_init(&cons);
        cons_write(&cons, "\n[1;44m     *** ARP Communication test ***     [m\n\n");

        /* Register callback */
        arp_function_callback(&local_arp_cb);<commit_msg>Check if the transfer is executable<commit_after>/*
 * Copyright (c) 2012 <NAME>
 * See LICENSE for details.
 *
 * <NAME> <<EMAIL>>
 */

#include <vdp2.h>
#include <smpc.h>
#include <smpc/peripheral.h>
#include <arp.h>
#include <cpu/intc.h>

#include <cons/vdp2.h>

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

static struct cons cons;

static void
local_arp_cb(arp_callback_t *arp_cb)
{
        char *buf;

        buf = (char *)malloc(1024);
        assert(buf != NULL);

        (void)sprintf(buf, "Callback\n"
            "ptr: %p\n"
            "len: 0x%04X\n"
            "function: 0x%02X\n"
            "execute: %s\n\n",
            arp_cb->ptr,
            arp_cb->len,
            arp_cb->function,
            (arp_cb->exec ? "yes" : "no"));

        cons_write(&cons, buf);

        free(buf);
}

int
main(void)
{
        uint16_t blcs_color[] = {
                0x9C00
        };

        vdp2_init();
        vdp2_tvmd_blcs_set(/* lcclmd = */ false, VRAM_ADDR_4MBIT(3, 0x1FFFE),
            blcs_color, 0);

        smpc_init();

        cons_vdp2_init(&cons);
        cons_write(&cons, "\n[1;44m     *** ARP Communication test ***     [m\n\n");

        /* Register callback */
        arp_function_callback(&local_arp_cb);
{'fraction_non_alphanumeric': 0.15996751928542427, 'fraction_numerical': 0.02679658952496955, 'mean_word_length': 2.083854818523154, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 38, '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': '5143736', 'n_tokens_mistral': 999, 'n_tokens_neox': 931, 'n_words': 177}