Compare commits
5
Commits
fe9c5c4781
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31b7403252 | ||
|
|
29ade46a0a | ||
|
|
534ce852f4 | ||
|
|
4ed3b72995 | ||
|
|
8598eab087 |
+2
-2
@@ -234,7 +234,7 @@ static int cpuOnExecute(VB *sim) {
|
|||||||
#define VB_ON_READ VB_DIRECT_READ
|
#define VB_ON_READ VB_DIRECT_READ
|
||||||
#endif
|
#endif
|
||||||
static int cpuRead(VB *sim, uint32_t address, int type, int32_t *value) {
|
static int cpuRead(VB *sim, uint32_t address, int type, int32_t *value) {
|
||||||
uint32_t cycles = 4; /* TODO: Research this */
|
uint32_t cycles = 0; /* TODO: Research this */
|
||||||
|
|
||||||
/* Retrieve the value from the simulation state directly */
|
/* Retrieve the value from the simulation state directly */
|
||||||
busRead(sim, address, type, value);
|
busRead(sim, address, type, value);
|
||||||
@@ -289,7 +289,7 @@ static int cpuReadFetch(VB *sim, int fetch, uint32_t address, int32_t *value) {
|
|||||||
#endif
|
#endif
|
||||||
static int cpuWrite(VB *sim, uint32_t address, int type, int32_t value) {
|
static int cpuWrite(VB *sim, uint32_t address, int type, int32_t value) {
|
||||||
int cancel = 0;
|
int cancel = 0;
|
||||||
uint32_t cycles = 3; /* TODO: Research this */
|
uint32_t cycles = 0; /* TODO: Research this */
|
||||||
|
|
||||||
/* Reset pseudo-halt */
|
/* Reset pseudo-halt */
|
||||||
if (sim->ph.enabled)
|
if (sim->ph.enabled)
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ VBAPI vbOnWrite vbSetWriteCallback(VB *sim, vbOnWrite callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Determine the size of a simulation instance */
|
/* Determine the size of a simulation instance */
|
||||||
VBAPI size_t vbSizeOf() {
|
VBAPI size_t vbSizeOf(void) {
|
||||||
return sizeof (VB);
|
return sizeof (VB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ VBAPI vbOnSamples vbSetSamplesCallback (VB *sim, vbOnSamples callback);
|
|||||||
VBAPI uint32_t vbSetSystemRegister (VB *sim, unsigned index, uint32_t value);
|
VBAPI uint32_t vbSetSystemRegister (VB *sim, unsigned index, uint32_t value);
|
||||||
VBAPI void* vbSetUserData (VB *sim, void *tag);
|
VBAPI void* vbSetUserData (VB *sim, void *tag);
|
||||||
VBAPI vbOnWrite vbSetWriteCallback (VB *sim, vbOnWrite callback);
|
VBAPI vbOnWrite vbSetWriteCallback (VB *sim, vbOnWrite callback);
|
||||||
VBAPI size_t vbSizeOf ();
|
VBAPI size_t vbSizeOf (void);
|
||||||
VBAPI int32_t vbWrite (VB *sim, uint32_t address, int type, int32_t value);
|
VBAPI int32_t vbWrite (VB *sim, uint32_t address, int type, int32_t value);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+22
-16
@@ -41,16 +41,17 @@ static const uint8_t BG_TEMPLATES[][64] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* 8-bit color magnitude by brightness level */
|
/* 8-bit color magnitude by brightness level */
|
||||||
|
/* Generated as BRIGHT8[n] = round((n / 132) ** 1.6 * 255) */
|
||||||
static const uint8_t BRIGHT8[] = {
|
static const uint8_t BRIGHT8[] = {
|
||||||
0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 28,
|
0, 12, 19, 24, 29, 33, 37, 41, 44, 48, 51, 54, 57, 60, 63, 65,
|
||||||
30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 57, 59,
|
68, 71, 73, 76, 78, 81, 83, 86, 88, 90, 92, 95, 97, 99,101,103,
|
||||||
61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90,
|
105,107,109,111,113,115,117,119,121,123,125,127,128,130,132,134,
|
||||||
92, 94, 96, 98,100,102,104,106,108,110,112,113,115,117,119,121,
|
136,137,139,141,142,144,146,148,149,151,153,154,156,157,159,161,
|
||||||
123,125,127,129,131,133,135,137,139,141,142,144,146,148,150,152,
|
162,164,165,167,168,170,172,173,175,176,178,179,181,182,184,185,
|
||||||
154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,183,
|
186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,208,
|
||||||
185,187,189,191,193,195,197,198,200,202,204,206,208,210,212,214,
|
209,210,212,213,214,216,217,218,220,221,222,224,225,226,228,229,
|
||||||
216,218,220,222,224,226,227,229,231,233,235,237,239,241,243,245,
|
230,231,233,234,235,236,238,239,240,242,243,244,245,246,248,249,
|
||||||
247,249,251,253,255
|
250,251,253,254,255
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1004,7 +1005,7 @@ static void vipDrawAffine(VB *sim, World *world) {
|
|||||||
Cell *cell; /* Source cell */
|
Cell *cell; /* Source cell */
|
||||||
uint8_t *col, *row; /* Output pixel */
|
uint8_t *col, *row; /* Output pixel */
|
||||||
uint8_t pixel; /* Character pixel value */
|
uint8_t pixel; /* Character pixel value */
|
||||||
uint8_t *param; /* World parameter memory */
|
uint32_t param; /* World parameter memory */
|
||||||
int32_t px, py; /* Pixel source coordinates */
|
int32_t px, py; /* Pixel source coordinates */
|
||||||
int32_t dx, dy, mp, mx, my; /* Affine parameters */
|
int32_t dx, dy, mp, mx, my; /* Affine parameters */
|
||||||
int32_t wx; /* Base world X coordinate */
|
int32_t wx; /* Base world X coordinate */
|
||||||
@@ -1051,21 +1052,26 @@ static void vipDrawAffine(VB *sim, World *world) {
|
|||||||
wx = x1 - wx;
|
wx = x1 - wx;
|
||||||
|
|
||||||
/* Process all visible rows */
|
/* Process all visible rows */
|
||||||
param = &sim->vip.ram[world->paramBase | (y1 - world->gy) << 4];
|
param = world->paramBase + ((y1 - world->gy) << 4);
|
||||||
row = &sim->vip.shadow[i][x1 * 224 + y1];
|
row = &sim->vip.shadow[i][x1 * 224 + y1];
|
||||||
for (y = y1; y < y2; y++, param += 16, row++) {
|
for (y = y1; y < y2; y++, param += 16, row++) {
|
||||||
|
|
||||||
/* Parse line parameters */
|
/* Parse line parameters */
|
||||||
mx = (int32_t) busReadBuffer(param + 0, VB_S16) << 6;
|
mx = (int32_t) busReadBuffer(&sim->vip.ram[param | 0], VB_S16) << 6;
|
||||||
mp = (int32_t) busReadBuffer(param + 2, VB_S16);
|
mp = (int32_t) busReadBuffer(&sim->vip.ram[param | 2], VB_S16);
|
||||||
my = (int32_t) busReadBuffer(param + 4, VB_S16) << 6;
|
my = (int32_t) busReadBuffer(&sim->vip.ram[param | 4], VB_S16) << 6;
|
||||||
dx = (int32_t) busReadBuffer(param + 6, VB_S16);
|
dx = (int32_t) busReadBuffer(&sim->vip.ram[param | 6], VB_S16);
|
||||||
dy = (int32_t) busReadBuffer(param + 8, VB_S16);
|
dy = (int32_t) busReadBuffer(&sim->vip.ram[param | 8], VB_S16);
|
||||||
|
|
||||||
/* Adjust left-edge parameters */
|
/* Adjust left-edge parameters */
|
||||||
if ((mp < 0) ^ i) {
|
if ((mp < 0) ^ i) {
|
||||||
|
if (mp < 0) {
|
||||||
|
mx += dx * (wx - mp);
|
||||||
|
my += dy * (wx - mp);
|
||||||
|
} else {
|
||||||
mx += dx * (wx + mp);
|
mx += dx * (wx + mp);
|
||||||
my += dy * (wx + mp);
|
my += dy * (wx + mp);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mx += dx * wx;
|
mx += dx * wx;
|
||||||
my += dy * wx;
|
my += dy * wx;
|
||||||
|
|||||||
@@ -548,6 +548,7 @@ static void vsuReset(VB *sim) {
|
|||||||
|
|
||||||
/* Write a typed value to the VSU bus */
|
/* Write a typed value to the VSU bus */
|
||||||
static void vsuWrite(VB*sim,uint32_t address,int type,int32_t value,int debug){
|
static void vsuWrite(VB*sim,uint32_t address,int type,int32_t value,int debug){
|
||||||
|
(void) type;
|
||||||
|
|
||||||
/* Unmapped */
|
/* Unmapped */
|
||||||
if (address & 1)
|
if (address & 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user