Mostly cosmetic changes
Update headers year Remove useless /// headers that eat lines for no reasons Fixed build issues because of stupid me doing stupid stuff in prototypes. Added color and mono GPU stub. Also a tad of code cleaning.
This commit is contained in:
161
source/gpu.c
161
source/gpu.c
@@ -1,26 +1,12 @@
|
||||
/*******************************************************************************
|
||||
* NewOswan
|
||||
* gpu.c:
|
||||
*
|
||||
* Based on the original Oswan-unix
|
||||
* Copyright (c) 2014-2021 986-Studio. All rights reserved.
|
||||
* Copyright (c) 2014-2022 986-Studio. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// GPU
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// 7.04.2002: Fixed sprites order
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -35,17 +21,6 @@
|
||||
#include <ws.h>
|
||||
#include <memory.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
extern uint8_t *internalRam;
|
||||
|
||||
enum VideoModes
|
||||
@@ -53,17 +28,6 @@ enum VideoModes
|
||||
DISPLAY_MODE_GRAY = 0, DISPLAY_MODE_2BPP = 4, DISPLAY_MODE_P_4BPP = 7, DISPLAY_MODE_L_4BPP = 6,
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define RGB555(R, G, B) ((((int)(R))<<10)|(((int)(G))<<5)|((int)(B)))
|
||||
|
||||
uint8_t ws_gpu_operatingInColor = 0;
|
||||
@@ -106,17 +70,6 @@ uint8_t *wsc_hflipped_tile_cache;
|
||||
uint8_t *ws_modified_tile;
|
||||
uint8_t *wsc_modified_tile;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_init(void)
|
||||
{
|
||||
ws_tile_cache = (uint8_t *)malloc(1024 * 8 * 8);
|
||||
@@ -138,17 +91,6 @@ void ws_gpu_init(void)
|
||||
memset(wsc_modified_tile, 0x01, 1024);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_done(void)
|
||||
{
|
||||
free(ws_tile_cache);
|
||||
@@ -159,17 +101,6 @@ void ws_gpu_done(void)
|
||||
free(wsc_modified_tile);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_changeVideoMode(uint8_t value)
|
||||
{
|
||||
if (ws_videoMode != (value >> 5))
|
||||
@@ -190,17 +121,6 @@ void ws_gpu_changeVideoMode(uint8_t value)
|
||||
(value & 0x20)?"Packed":"Planar");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_reset(void)
|
||||
{
|
||||
memset(ws_modified_tile, 0x01, 1024);
|
||||
@@ -208,33 +128,11 @@ void ws_gpu_reset(void)
|
||||
ws_gpu_changeVideoMode(0x00);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_clearCache(void)
|
||||
{
|
||||
memset(ws_modified_tile, 0x01, 1024);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
uint8_t *ws_tileCache_getTileRow(uint32_t tileIndex, uint32_t line, uint32_t vFlip, uint32_t hFlip, uint32_t bank)
|
||||
{
|
||||
if (ws_gpu_operatingInColor)
|
||||
@@ -447,17 +345,6 @@ uint8_t *ws_tileCache_getTileRow(uint32_t tileIndex, uint32_t line, uint32_t vFl
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_drawClippedSpriteLine(int16_t *framebuffer, uint16_t scanline, uint32_t x, uint32_t y, uint32_t tileIndex,
|
||||
uint32_t paletteIndex, uint32_t vFlip, uint32_t hFlip, uint32_t clip_x0, uint32_t clip_y0,
|
||||
uint32_t clip_x1, uint32_t clip_y1)
|
||||
@@ -542,17 +429,6 @@ void ws_drawClippedSpriteLine(int16_t *framebuffer, uint16_t scanline, uint32_t
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_renderScanline(int16_t *framebuffer)
|
||||
{
|
||||
|
||||
@@ -1901,17 +1777,6 @@ void ws_gpu_renderScanline(int16_t *framebuffer)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ws_gpu_write_byte(uint32_t offset, uint8_t value)
|
||||
{
|
||||
// ws 4 color tiles
|
||||
@@ -1968,17 +1833,6 @@ void ws_gpu_write_byte(uint32_t offset, uint8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
unsigned int ws_gpu_unknownPort;
|
||||
|
||||
int ws_gpu_port_write(uint32_t port, uint8_t value)
|
||||
@@ -2038,17 +1892,6 @@ int ws_gpu_port_write(uint32_t port, uint8_t value)
|
||||
return ws_gpu_unknownPort;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
uint8_t ws_gpu_port_read(uint8_t port)
|
||||
{
|
||||
switch (port)
|
||||
|
||||
Reference in New Issue
Block a user