From: falcovorbis <fal...@us...> - 2024-09-28 01:09:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 9726ac31349d72eb0af754f473799a398e1ab69a (commit) via 1da9acd4c88143627615d28dd72d2453f8ade567 (commit) from 411641379d6ebd2f5c77a0c72b56473bfe27c37d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9726ac31349d72eb0af754f473799a398e1ab69a Author: Twada <166...@us...> Date: Sat Sep 28 10:08:58 2024 +0900 Helper functions and examples for modifier volumes and Z clipping (#675) * Initial commit * romdisk fix * modified: Makefile modified: example.c * modified: pvr_zclip.c modified: pvr_zclip.h * modified: example.c modified: pvr_zclip.c * Apply suggestions from code review Co-authored-by: Falco Girgis <gyr...@gm...> * modified: example.c * Update examples/dreamcast/pvr/modifier_volume_zclip/example.c Co-authored-by: Falco Girgis <gyr...@gm...> --------- Co-authored-by: Twada2004 <Twa...@us...> Co-authored-by: Falco Girgis <gyr...@gm...> Co-authored-by: Donald Haase <qu...@ya...> commit 1da9acd4c88143627615d28dd72d2453f8ade567 Author: Cole Hall <col...@gm...> Date: Fri Sep 27 07:55:12 2024 +0100 Fix license link in README.md (#776) ----------------------------------------------------------------------- Summary of changes: README.md | 2 +- .../modifier_volume_zclip}/Makefile | 6 +- .../dreamcast/pvr/modifier_volume_zclip/example.c | 306 +++++++++ .../pvr/modifier_volume_zclip/pvr_zclip.c | 747 +++++++++++++++++++++ .../pvr/modifier_volume_zclip/pvr_zclip.h | 20 + .../pvr/modifier_volume_zclip/romdisk/blocks.png | Bin 0 -> 86075 bytes 6 files changed, 1077 insertions(+), 4 deletions(-) copy examples/dreamcast/{cpp/modplug_test => pvr/modifier_volume_zclip}/Makefile (75%) create mode 100644 examples/dreamcast/pvr/modifier_volume_zclip/example.c create mode 100644 examples/dreamcast/pvr/modifier_volume_zclip/pvr_zclip.c create mode 100644 examples/dreamcast/pvr/modifier_volume_zclip/pvr_zclip.h create mode 100644 examples/dreamcast/pvr/modifier_volume_zclip/romdisk/blocks.png diff --git a/README.md b/README.md index c0f154f5..10618ec6 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ A beginner's guide to development for the Sega Dreamcast along with detailed ins # Licensing KallistiOS itself is licensed under the BSD-like **KOS License**. **Attribution is not optional**. Additionally, this distribution contains code licensed under various free software licenses. -See [LICENSE.md](doc/LICENSE.md) for more information on licensing, as well as [LICENSE.KOS](doc/LICENSE.KOS) for the actual **KOS License** text. +See [LICENSE.md](doc/LICENSE.md) for more information on licensing, as well as [LICENSE.KOS](doc/license/LICENSE.KOS) for the actual **KOS License** text. # Examples Once you've set up the environment and are ready to begin developing, a good place to start learning is the examples directory, which provides demos for the various KOS APIs and for interacting with the Dreamcast's hardware. Examples include: diff --git a/examples/dreamcast/cpp/modplug_test/Makefile b/examples/dreamcast/pvr/modifier_volume_zclip/Makefile similarity index 75% copy from examples/dreamcast/cpp/modplug_test/Makefile copy to examples/dreamcast/pvr/modifier_volume_zclip/Makefile index bb417eb7..49e7e523 100644 --- a/examples/dreamcast/cpp/modplug_test/Makefile +++ b/examples/dreamcast/pvr/modifier_volume_zclip/Makefile @@ -1,5 +1,5 @@ TARGET = example.elf -OBJS = example.o romdisk.o +OBJS = example.o pvr_zclip.o romdisk.o KOS_ROMDISK_DIR = romdisk all: rm-elf $(TARGET) @@ -7,13 +7,13 @@ all: rm-elf $(TARGET) include $(KOS_BASE)/Makefile.rules clean: rm-elf - -rm -f $(OBJS) + -rm -f $(OBJS) rm-elf: -rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) - kos-c++ -o $(TARGET) $(OBJS) -lmodplug + kos-cc -o $(TARGET) $(OBJS) -lpng -lz run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/pvr/modifier_volume_zclip/example.c b/examples/dreamcast/pvr/modifier_volume_zclip/example.c new file mode 100644 index 00000000..564137bc --- /dev/null +++ b/examples/dreamcast/pvr/modifier_volume_zclip/example.c @@ -0,0 +1,306 @@ +/* + * KallistiOS ##version## + * + * examples/dreamcast/pvr/modifier_volume_zclip/example.c + * Copyright (C) 2024 Twada + * + * This example demonstrates how to perform Z-clipping on modifier volumes. + * + * by Twada + */ +#include <kos.h> +#include <png/png.h> +#include <zlib/zlib.h> +#include "pvr_zclip.h" + +/* textures */ +static pvr_ptr_t box_tex; + +static void mul_screen(float width, float height) +{ + matrix_t d = { + {1.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 1.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 1.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, 1.0f}}; + d[0][0] = width * 0.5f; + d[1][1] = -height * 0.5f; + d[3][0] = width * 0.5f; + d[3][1] = height * 0.5f; + mat_apply(&d); +} + +static void mul_projection(float fov, float aspect, float znear) +{ + matrix_t d = { + {1.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 1.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 1.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, 1.0f}}; + float s = 1.0f / ftan(fov * 0.5f); + d[0][0] = s / aspect; + d[1][1] = s; + d[2][2] = 0.0f; + d[2][3] = -1.0f; + d[3][2] = znear; + d[3][3] = 0.0f; + mat_apply(&d); +} + +static void draw_modifier(matrix_t *pvm) +{ + pvr_modifier_vol_t vol[12] = { + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0}, + }; + float vert[8][3] = { + {-1.0f, -1.0f, 1.0f}, + {-1.0f, -1.0f, -1.0f}, + {1.0f, -1.0f, 1.0f}, + {1.0f, -1.0f, -1.0f}, + {-1.0f, 1.0f, 1.0f}, + {-1.0f, 1.0f, -1.0f}, + {1.0f, 1.0f, 1.0f}, + {1.0f, 1.0f, -1.0f}, + }; + float transform[8][3]; + int index[12][3] = { + {1, 0, 3}, /* Bottom */ + {0, 3, 2}, + {4, 5, 6}, /* Top */ + {5, 6, 7}, + {0, 4, 2}, /* Front */ + {4, 2, 6}, + {2, 6, 3}, /* Right */ + {6, 3, 7}, + {3, 7, 1}, /* Back */ + {7, 1, 5}, + {1, 5, 0}, /* Left */ + {5, 0, 4}}; + pvr_mod_hdr_t hdr; + static float ry = 0.0f; + /* Vertex transform */ + ry += 0.01; + mat_identity(); + mat_apply(pvm); + mat_translate(-1.0f, 0.25f, 1.0f); + mat_rotate(0.0f, ry, 0.0f); + mat_scale(2.0f, 2.0f, 2.0f); + for (int i = 0; i < 8; i++) + { + transform[i][0] = vert[i][0]; + transform[i][1] = vert[i][1]; + transform[i][2] = vert[i][2]; + mat_trans_single3(transform[i][0], transform[i][1], transform[i][2]); + } + /* Face set */ + for (int i = 0; i < 12; i++) + { + vol[i].ax = transform[index[i][0]][0]; + vol[i].ay = transform[index[i][0]][1]; + vol[i].az = transform[index[i][0]][2]; + vol[i].bx = transform[index[i][1]][0]; + vol[i].by = transform[index[i][1]][1]; + vol[i].bz = transform[index[i][1]][2]; + vol[i].cx = transform[index[i][2]][0]; + vol[i].cy = transform[index[i][2]][1]; + vol[i].cz = transform[index[i][2]][2]; + } + pvr_mod_compile(&hdr, PVR_LIST_OP_MOD, PVR_MODIFIER_INCLUDE_LAST_POLY, PVR_CULLING_SMALL); + hdr.cmd |= (1 << 6); /* Last poly */ + pvr_modifier_commit_zclip(&hdr, vol, 12); +} + +static void draw_box(matrix_t *pvm) +{ + pvr_vertex_t poly[18] = { + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0xffffffff, 0x00000000}, + }; + float vert[8][3] = { + {-1.0f, -1.0f, 1.0f}, + {-1.0f, -1.0f, -1.0f}, + {1.0f, -1.0f, 1.0f}, + {1.0f, -1.0f, -1.0f}, + {-1.0f, 1.0f, 1.0f}, + {-1.0f, 1.0f, -1.0f}, + {1.0f, 1.0f, 1.0f}, + {1.0f, 1.0f, -1.0f}, + }; + float transform[8][3]; + int index[18] = { + 1, 0, 3, -2, + 4, 5, 6, -7, + 0, 4, 2, 6, 3, 7, 1, 5, 0, -4}; + pvr_poly_cxt_t cxt; + pvr_poly_hdr_t hdr; + /* Vertex transform */ + mat_identity(); + mat_apply(pvm); + mat_translate(1.0f, 2.0f, -1.0f); + mat_scale(2.0f, 2.0f, 2.0f); + for (int i = 0; i < 8; i++) + { + transform[i][0] = vert[i][0]; + transform[i][1] = vert[i][1]; + transform[i][2] = vert[i][2]; + mat_trans_single3(transform[i][0], transform[i][1], transform[i][2]); + } + /* Face set */ + for (int i = 0; i < 18; i++) + { + int idx = index[i]; + if (idx < 0) + { + poly[i].flags = PVR_CMD_VERTEX_EOL; + idx = -idx; + } + else + { + poly[i].flags = PVR_CMD_VERTEX; + } + poly[i].x = transform[idx][0]; + poly[i].y = transform[idx][1]; + poly[i].z = transform[idx][2]; + } + pvr_poly_cxt_txr(&cxt, PVR_LIST_OP_POLY, PVR_TXRFMT_RGB565, 256, 256, box_tex, PVR_FILTER_BILINEAR); + pvr_poly_compile(&hdr, &cxt); + hdr.cmd |= (1 << 7); /* PVR_MODIFIER_CHEAP_SHADOW */ + pvr_prim(&hdr, sizeof(hdr)); + pvr_vertex_commit_zclip(poly, 18); +} + +static void draw_plane(matrix_t *pvm) +{ + pvr_poly_cxt_t cxt; + pvr_poly_hdr_t hdr; + pvr_vertex_t poly[4] = { + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0xffff0000, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0xff00ff00, 0x00000000}, + {PVR_CMD_VERTEX, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0xff0000ff, 0x00000000}, + {PVR_CMD_VERTEX_EOL, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0xffffffff, 0x00000000}, + }; + float vert[4][3] = { + {-5.0f, 0.0f, 5.0f}, + {-5.0f, 0.0f, -5.0f}, + {5.0f, 0.0f, 5.0f}, + {5.0f, 0.0f, -5.0f}}; + int i; + mat_identity(); + mat_apply(pvm); + for (i = 0; i < 4; i++) + { + poly[i].x = vert[i][0]; + poly[i].y = vert[i][1]; + poly[i].z = vert[i][2]; + mat_trans_single3(poly[i].x, poly[i].y, poly[i].z); + } + pvr_poly_cxt_col(&cxt, PVR_LIST_OP_POLY); + pvr_poly_compile(&hdr, &cxt); + hdr.cmd |= (1 << 7); /* PVR_MODIFIER_CHEAP_SHADOW */ + pvr_prim(&hdr, sizeof(hdr)); + pvr_vertex_commit_zclip(poly, 4); +} + +int main(int argc, char* argv[]) +{ + pvr_init_params_t params = { + /* Enable opaque and translucent polygons with size 16 */ + .opb_sizes = {PVR_BINSIZE_16, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0, PVR_BINSIZE_0}, + .vertex_buf_size = 512 * 1024, /* Vertex buffer size 512K */ + .dma_enabled = 0, /* No DMA */ + .fsaa_enabled = 0, /* No FSAA */ + .autosort_disabled = 0, /* Translucent Autosort enabled. */ + .opb_overflow_count = 3 /* Extra OPBs */ + }; + matrix_t cam_pvm; + point_t cam_pos = {0.0f, 0.0f, 1.0f, 1.0f}; + point_t cam_tar = {0.0f, 0.0f, 0.0f, 1.0f}; + point_t cam_up = {0.0f, 1.0f, 0.0f, 1.0f}; + int done = 0; + float dy = 0.0f; + float dis = 5.0f; + float high = 2.0f; + + /* init kos */ + pvr_init(¶ms); + pvr_set_bg_color(0, 0.5f, 1.0f); + /* Enable cheap shadow */ + pvr_set_shadow_scale(1, 0.5f); + + /* init plane */ + box_tex = pvr_mem_malloc(256 * 256 * 2); + png_to_texture("/rd/blocks.png", box_tex, PNG_NO_ALPHA); + + /* keep drawing frames until start is pressed */ + while (!done) + { + maple_device_t *dev = maple_enum_type(0, MAPLE_FUNC_CONTROLLER); + if (dev) + { + + cont_state_t *st = (cont_state_t *)maple_dev_status(dev); + dy += (float)st->joyx * (0.1f / 127.0f); + high -= (float)st->joyy * (0.25f / 127.0f); + if (st->rtrig) + dis -= (float)st->rtrig * 0.001f; + if (st->ltrig) + dis += (float)st->ltrig * 0.001f; + cam_pos.x = fsin(dy) * dis; + cam_pos.y = high; + cam_pos.z = fcos(dy) * dis; + + if (st->buttons & CONT_START) + done = 1; + } + /* set camera */ + mat_identity(); + mul_screen(640.0f, 480.0f); + mul_projection((3.14159265f / 3.0f), (640.0f / 480.0f), 0.125f); + mat_lookat(&cam_pos, &cam_tar, &cam_up); + mat_store(&cam_pvm); + + pvr_wait_ready(); + pvr_scene_begin(); + + pvr_list_begin(PVR_LIST_OP_POLY); + draw_plane(&cam_pvm); + draw_box(&cam_pvm); + pvr_list_finish(); + + pvr_list_begin(PVR_LIST_OP_MOD); + draw_modifier(&cam_pvm); + pvr_list_finish(); + + pvr_scene_finish(); + } + pvr_mem_free(box_tex); + + return 0; +} diff --git a/examples/dreamcast/pvr/modifier_volume_zclip/pvr_zclip.c b/examples/dreamcast/pvr/modifier_volume_zclip/pvr_zclip.c new file mode 100644 index 00000000..796ede85 --- /dev/null +++ b/examples/dreamcast/pvr/modifier_volume_zclip/pvr_zclip.c @@ -0,0 +1,747 @@ +#include "pvr_zclip.h" + +static void vert_commit(pvr_vertex_t *dest, pvr_vertex_t *src, int eos) +{ + asm volatile( + "fschg\n\t" + "add #14, %[e]\n\t" + "fmov @%[s]+, dr0\n\t" + "shld %[shift], %[e]\n\t" + "fmov @%[s]+, dr2\n\t" + "lds %[e], fpul\n\t" + "fmov @%[s]+, dr4\n\t" + "add #32, %[d]\n\t" + "fmov @%[s]+, dr6\n\t" + "fsts fpul, fr0\n\t" + "fmov dr6,@-%[d]\n\t" + "fmov dr4,@-%[d]\n\t" + "fmov dr2,@-%[d]\n\t" + "fmov dr0,@-%[d]\n\t" + "pref @%[d]\n\t" + "fschg\n" + : [d] "+&r"(dest), [s] "+&r"(src), [e] "+r"(eos) + : [shift] "r"(28) + : "fpul", "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7"); +} + +static void inter_vert_commit(pvr_vertex_t *dest, pvr_vertex_t *inside, pvr_vertex_t *outside, int eos) +{ + unsigned int in_rb; + unsigned int in_ag; + unsigned int out_rb; + unsigned int out_ag; + asm volatile( + "fschg\n\t" + + "fmov.d @%[i]+, dr2\n\t" + "fmov.d @%[i]+, dr4\n\t" + "fmov.d @%[o]+, dr6\n\t" + "fmov.d @%[o]+, dr8\n\t" + + "fcmp/gt fr5, fr9\n\t" + "add #32, %[d]\n\t" + "fmul fr5, fr5\n\t" + "mov #28, %[rb0]\n\t" + "fsrra fr5\n\t" + "add #14, %[e]\n\t" + "fmul fr9, fr9\n\t" + "shld %[rb0], %[e]\n\t" + "fsrra fr9\n\t" + "lds %[e], fpul\n\t" + "bt/s 1f\n\t" + "fsts fpul, fr2\n\t" + "fneg fr9\n\t" + "1:\n\t" + + "fmul fr5, fr3\n\t" + "fmul fr5, fr4\n\t" + "fmul fr9, fr7\n\t" + "fmul fr9, fr8\n\t" + + "fneg fr9\n\t" + "fadd fr5, fr9\n\t" + "fldi1 fr0\n\t" + "fmul fr9, fr9\n\t" + "fneg fr0\n\t" + "fsrra fr9\n\t" + "fadd fr5, fr0\n\t" + "fmul fr9, fr0\n\t" + + "fsub fr3, fr7\n\t" + "fsub fr4, fr8\n\t" + "fmac fr0, fr7, fr3\n\t" + "fmac fr0, fr8, fr4\n\t" + "fldi1 fr5\n\t" + + "fmov.d @%[i]+, dr6\n\t" + "fmov.d @%[o]+, dr8\n\t" + "fsub fr6, fr8\n\t" + "fsub fr7, fr9\n\t" + "fmac fr0, fr8, fr6\n\t" + "fmac fr0, fr9, fr7\n\t" + + "mov #-1, %[e]\n\t" + "extu.b %[e], %[e]\n\t" + "lds %[e], fpul\n\t" + "float fpul, fr1\n\t" + "fmul fr0, fr1\n\t" + "ftrc fr1, fpul\n\t" + "sts fpul, %[e]\n\t" + + "mov.l @(4, %[i]), %[rb0]\n\t" + "mov %[rb0], %[ag0]\n\t" + "and %[m], %[rb0]\n\t" + "shlr8 %[ag0]\n\t" + "mov.l @(4, %[o]), %[rb1]\n\t" + "and %[m], %[ag0]\n\t" + "mov %[rb1], %[ag1]\n\t" + "and %[m], %[rb1]\n\t" + "shlr8 %[ag1]\n\t" + "and %[m], %[ag1]\n\t" + + "sub %[ag0], %[ag1]\n\t" + "mul.l %[e], %[ag1]\n\t" + "sub %[rb0], %[rb1]\n\t" + "sts macl, %[ag1]\n\t" + "shlr8 %[ag1]\n\t" + "add %[ag1], %[ag0]\n\t" + "mul.l %[e], %[rb1]\n\t" + "and %[m], %[ag0]\n\t" + "shll8 %[ag0]\n\t" + "sts macl, %[rb1]\n\t" + "shlr8 %[rb1]\n\t" + "add %[rb1], %[rb0]\n\t" + "and %[m], %[rb0]\n\t" + "or %[ag0], %[rb0]\n" + "mov.l %[rb0], @-%[d]\n\t" + + "mov.l @%[i], %[rb0]\n\t" + "mov %[rb0], %[ag0]\n\t" + "and %[m], %[rb0]\n\t" + "shlr8 %[ag0]\n\t" + "mov.l @%[o], %[rb1]\n\t" + "and %[m], %[ag0]\n\t" + "mov %[rb1], %[ag1]\n\t" + "and %[m], %[rb1]\n\t" + "shlr8 %[ag1]\n\t" + "and %[m], %[ag1]\n\t" + + "sub %[ag0], %[ag1]\n\t" + "mul.l %[e], %[ag1]\n\t" + "sub %[rb0], %[rb1]\n\t" + "sts macl, %[ag1]\n\t" + "shlr8 %[ag1]\n\t" + "add %[ag1], %[ag0]\n\t" + "mul.l %[e], %[rb1]\n\t" + "and %[m], %[ag0]\n\t" + "shll8 %[ag0]\n\t" + "sts macl, %[rb1]\n\t" ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |