Content-Security-Policy: default-src 'none' Content-Type: text/plain; charset=UTF-8 Content-Length: 74550 Content-Disposition: inline; filename="konamigx.c" Last-Modified: Thu, 28 Mar 2024 11:51:04 GMT Expires: Thu, 28 Mar 2024 11:56:04 GMT ETag: "0bd0ab9b67bfed08a6dd67434ed19768824921aa" /* * video/konamigx.c - Konami GX video hardware (here there be dragons, and achocode) * */ #include "emu.h" #include "video/konamiic.h" #include "video/k053250.h" #include "includes/konamigx.h" #define GX_DEBUG 0 #define VERBOSE 0 /***************************************************************************/ /* */ /* 2nd-Tier GX/MW Graphics Functions */ /* */ /***************************************************************************/ #if GX_DEBUG #define GX_ZBUFW 512 #define GX_ZBUFH 384 #define GX_ZPAGESIZE 0x300000 #define GX_ZBUFSIZE 0x600000 #else #define GX_ZBUFW 576 #define GX_ZBUFH 224 #define GX_ZPAGESIZE (GX_ZBUFW*GX_ZBUFH) #define GX_ZBUFSIZE ((GX_ZBUFW*GX_ZBUFH)*2) #endif static UINT8 *gx_objzbuf, *gx_shdzbuf; static int layer_colorbase[4]; static INT32 gx_tilebanks[8], gx_oldbanks[8]; static int gx_tilemode, gx_rozenable, psac_colorbase, last_psac_colorbase; static int gx_specialrozenable; // type 1 roz, with voxel height-map, rendered from 2 source tilemaps (which include height data) to temp bitmap for further processing static int gx_rushingheroes_hack; static int gx_le2_textcolour_hack; static tilemap_t *gx_psac_tilemap, *gx_psac_tilemap2; static bitmap_t* type3_roz_temp_bitmap; static tilemap_t* gx_psac_tilemap_alt; static int konamigx_has_dual_screen; int konamigx_current_frame; INLINE void set_color_555(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data); static int konamigx_palformat; static bitmap_t* dualscreen_left_tempbitmap; static bitmap_t* dualscreen_right_tempbitmap; /* On Type-1 the K053936 output is rendered to these temporary bitmaps as raw data the 'voxel' effect to give the pixels height is a post-process operation on the output of the K053936 (this can clearly be seen in videos as large chunks of scenary flicker when in the distance due to single pixels in the K053936 output becoming visible / invisible due to drawing precision. -- however, progress on this has stalled as our K053936 doesn't seem to give the right output for post processing, I suspect the game is using some unsupported flipping modes (probably due to the way it's hooked up to the rest of the chips) which is causing entirely the wrong output. -- furthermore machine/konamigx.c (!) contains it's own implementation of the K053936_zoom_draw named K053936GP_zoom_draw ... It really shouldn't do, epsecially not in 'machine', which isn't meant to be video related. */ static bitmap_t *gxtype1_roz_dstbitmap; static bitmap_t *gxtype1_roz_dstbitmap2; static rectangle gxtype1_roz_dstbitmapclip; static void (*game_tile_callback)(running_machine &machine, int layer, int *code, int *color, int *flags); // Localized K053936/ROZ+ #define K053936_MAX_CHIPS 2 static rectangle K053936_cliprect[K053936_MAX_CHIPS] = {{0,0,0,0},{0,0,0,0}}; static int K053936_offset[K053936_MAX_CHIPS][2] = {{0,0},{0,0}}; static int K053936_clip_enabled[K053936_MAX_CHIPS] = {0,0}; void K053936GP_set_offset(int chip, int xoffs, int yoffs) { K053936_offset[chip][0] = xoffs; K053936_offset[chip][1] = yoffs; } void K053936GP_clip_enable(int chip, int status) { K053936_clip_enabled[chip] = status; } void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy) { rectangle *cliprect = &K053936_cliprect[chip]; cliprect->min_x = minx; cliprect->max_x = maxx; cliprect->min_y = miny; cliprect->max_y = maxy; } INLINE void K053936GP_copyroz32clip( running_machine &machine, bitmap_t *dst_bitmap, bitmap_t *src_bitmap, const rectangle *dst_cliprect, const rectangle *src_cliprect, UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy, int tilebpp, int blend, int alpha, int clip, int pixeldouble_output ) { static const int colormask[8]={1,3,7,0xf,0x1f,0x3f,0x7f,0xff}; int cy, cx; int ecx; int src_pitch, incxy, incxx; int src_minx, src_maxx, src_miny, src_maxy, cmask; UINT16 *src_base; size_t src_size; const pen_t *pal_base; int dst_ptr; int dst_size; int dst_base2; int tx, dst_pitch; UINT32 *dst_base; int starty, incyy, startx, incyx, ty, sx, sy; incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx; starty = _starty; startx = _startx; if (src_cliprect && clip) // set source clip range to some extreme values when disabled { src_minx = src_cliprect->min_x; src_maxx = src_cliprect->max_x; src_miny = src_cliprect->min_y; src_maxy = src_cliprect->max_y; } // this simply isn't safe to do! else { src_minx = src_miny = -0x10000; src_maxx = src_maxy = 0x10000; } if (dst_cliprect) // set target clip range { sx = dst_cliprect->min_x; tx = dst_cliprect->max_x - sx + 1; sy = dst_cliprect->min_y; ty = dst_cliprect->max_y - sy + 1; startx += sx * incxx + sy * incyx; starty += sx * incxy + sy * incyy; } else { sx = sy = 0; tx = dst_bitmap->width; ty = dst_bitmap->height; } // adjust entry points and other loop constants dst_pitch = dst_bitmap->rowpixels; dst_base = (UINT32*)dst_bitmap->base; dst_base2 = sy * dst_pitch + sx + tx; ecx = tx = -tx; tilebpp = (tilebpp-1) & 7; pal_base = machine.pens; cmask = colormask[tilebpp]; src_pitch = src_bitmap->rowpixels; src_base = (UINT16 *)src_bitmap->base; src_size = src_bitmap->width * src_bitmap->height; dst_size = dst_bitmap->width * dst_bitmap->height; dst_ptr = 0;//dst_base; cy = starty; cx = startx; if (blend > 0) { dst_base += dst_pitch; // draw blended starty += incyy; startx += incyx; do { do { int srcx = (cx >> 16) & 0x1fff; int srcy = (cy >> 16) & 0x1fff; int pixel; UINT32 offs; offs = srcy * src_pitch + srcx; cx += incxx; cy += incxy; if (offs<0 || offs>=src_size) con
#ifndef __DEBUG_QT_VIEW_H__
#define __DEBUG_QT_VIEW_H__
#include <QtGui/QtGui>
#include "debug/debugvw.h"
class DebuggerView : public QAbstractScrollArea
{
Q_OBJECT
public:
DebuggerView(const debug_view_type& type,
running_machine* machine,
QWidget* parent=NULL);
virtual ~DebuggerView() {}
void paintEvent(QPaintEvent* event);
// Callback to allow MAME to refresh the view
static void debuggerViewUpdate(debug_view& debugView, void* osdPrivate);
// Setters and accessors
void setPreferBottom(bool pb) { m_preferBottom = pb; }
debug_view* view() { return m_view; }
protected:
void keyPressEvent(QKeyEvent* event);
void mousePressEvent(QMouseEvent* event);
private slots:
void verticalScrollSlot(int value);
void horizontalScrollSlot(int value);
private:
bool m_preferBottom;
debug_view* m_view;
running_machine* m_machine;
};
#endif