HomeJavaDatapacksIBIS - Peripherals Addon
DatapacksJava

IBIS - Peripherals Addon

by EpicPix · on Modrinth

⬇ Download on Modrinth

This is an addon to the IBIS datapack to add a peripheral api support, which includes enabling in and out instructions.

By default there are two integrated peripheral types: debug and rawlog (more can be added via other datapacks). Only debug is a peripheral for testing, so this will focus on the rawlog peripheral only.

The rawlog peripheral displays data using /tellraw, but flushes only on \n.

Like usual you'll have to create a CPU, but now you can also add a peripheral to the CPU:

You might have to step the cpu a couple times for the message to display.

Hello world code
mov r0, 0xbbbb ; assign r0 to default port used for rawlog
; now write "Hello, world!\n" and send to rawlog (48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 0A in hex)
mov r1, 0x4865 ; characters 'He'
out word r1, r0 ; send r1 to r0
mov r1, 0x6c6c ; characters 'll'
out word r1, r0 ; send r1 to r0
mov r1, 0x6f2c ; characters 'o,'
out word r1, r0 ; send r1 to r0
mov r1, 0x2077 ; characters ' w'
out word r1, r0 ; send r1 to r0
mov r1, 0x6f72 ; characters 'or'
out word r1, r0 ; send r1 to r0
mov r1, 0x6c64 ; characters 'ld'
out word r1, r0 ; send r1 to r0
mov r1, 0x210a ; characters '!\n'
out word r1, r0 ; send r1 to r0

mov r1, 0x8000 ; set r1 to the value of the STOP flag
or r13, r1 ; set STOP flag in flag register

If you want to destroy the peripheral, do function ibis.peripheral:instance/destroy {instance_id:<instance id>}, not any of the functions from other namespaces, because this one actually handles proper deleting of the data, which later calls the correct destroy of the instance.

You can also unlink the peripheral from a cpu using function ibis.peripheral:instance/unlink {instance_id:<instance id>} (or you can link it to another cpu, which will unlink from the previous cpu)

Quick facts

Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more