Thanks for using Compiler Explorer
C++
LLVM IR
MLIR
Cppx
Cppx-Gold
Cppx-Blue
C
OpenCL C
C++ for OpenCL
Rust
D
Erlang
Go
ispc
Haskell
Java
Kotlin
Scala
OCaml
Python
Swift
Pascal
Fortran
Assembly
Analysis
CUDA C++
Zig
Clean
Ada
Nim
Crystal
C++ (Circle)
Ruby
CMake
C#
F#
Visual Basic
Dart
TypeScript Native
Solidity
c source #1
Output
Compile to binary
Execute the code
Intel asm syntax
Demangle identifiers
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Compiler
gcc-10.4.0-elf
gcc-11.2.0b
gcc-11.3.0-elf
gcc-12.2.0-elf
gcc-13.1.0a
gcc-13.2.0-elf
gcc-2.95.3-elf
gcc-4.3.2-elf
gcc-4.9.4-elf
gcc-6.5.0-elf
gcc-6.5.0b
sasc-6.58
vbcc-0.9h
Options
Source code
// Type your code here, or load an example. #include <stdint.h> #define DO_NOT_REORDER() asm volatile("": : :"memory") #define PITCH 768 typedef union { struct { uint32_t p0 : 4; uint32_t p1 : 4; uint32_t p2 : 4; uint32_t p3 : 4; uint32_t p4 : 4; uint32_t p5 : 4; uint32_t p6 : 4; uint32_t p7 : 4; } packed; uint32_t pixels; } packpix_t; extern const uint16_t ddaxskip_i[17]; extern uint32_t scalex; extern uint16_t* current_pc_pal; extern uint32_t* current_fix; void draw_fix_char_m68k(uint32_t tile, uint32_t color, uint16_t *screen) { uint16_t *palbase = (uint32_t *)¤t_pc_pal[color * 16]; uint32_t *gfxdata = (uint32_t*)¤t_fix[tile << 5]; packpix_t pixels0; uint16_t pixel1,pixel2; int32_t y = 8; while(y--) { if((pixels0.pixels = *gfxdata++)) { pixel1 = pixels0.packed.p7; DO_NOT_REORDER(); pixel2 = pixels0.packed.p6; DO_NOT_REORDER(); if(pixel1) screen[0x0] = palbase[pixel1]; pixel1 = pixels0.packed.p5; if(pixel2) screen[0x1] = palbase[pixel2]; pixel2 = pixels0.packed.p4; if(pixel1) screen[0x2] = palbase[pixel1]; pixel1 = pixels0.packed.p3; if(pixel2) screen[0x3] = palbase[pixel2]; pixel2 = pixels0.packed.p2; if(pixel1) screen[0x4] = palbase[pixel1]; pixel1 = pixels0.packed.p1; if(pixel2) screen[0x5] = palbase[pixel2]; pixel2 = pixels0.packed.p0; if(pixel1) screen[0x6] = palbase[pixel1]; if(pixel2) screen[0x7] = palbase[pixel2]; } screen += PITCH / 2; } }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
About the author
Changelog
Version tree