fix ram dimension and window width

This commit is contained in:
Roberto Zandona 2008-08-15 17:47:32 +00:00
parent d8e8dffe4b
commit 6bb2a0e698
3 changed files with 32 additions and 30 deletions

View File

@ -238,29 +238,29 @@ static VIDEO_UPDATE(adp)
b = ((HD63484_reg[0xcc/2] & 0x000f) << 16) + HD63484_reg[0xce/2];
if (input_code_pressed(KEYCODE_Q)) b = 0x060 * 280 * 1;
if (input_code_pressed(KEYCODE_W)) b = 0x060 * 280 * 2;
if (input_code_pressed(KEYCODE_E)) b = 0x060 * 280 * 3;
if (input_code_pressed(KEYCODE_R)) b = 0x060 * 280 * 4;
if (input_code_pressed(KEYCODE_T)) b = 0x060 * 280 * 5;
if (input_code_pressed(KEYCODE_Y)) b = 0x060 * 280 * 6;
if (input_code_pressed(KEYCODE_U)) b = 0x060 * 280 * 7;
if (input_code_pressed(KEYCODE_I)) b = 0x060 * 280 * 8;
if (input_code_pressed(KEYCODE_A)) b = 0x060 * 280 * 9;
if (input_code_pressed(KEYCODE_S)) b = 0x060 * 280 * 10;
if (input_code_pressed(KEYCODE_D)) b = 0x060 * 280 * 11;
if (input_code_pressed(KEYCODE_F)) b = 0x060 * 280 * 12;
if (input_code_pressed(KEYCODE_G)) b = 0x060 * 280 * 13;
if (input_code_pressed(KEYCODE_H)) b = 0x060 * 280 * 14;
if (input_code_pressed(KEYCODE_J)) b = 0x060 * 280 * 15;
if (input_code_pressed(KEYCODE_K)) b = 0x060 * 280 * 16;
if (input_code_pressed(KEYCODE_Z)) b = 0x060 * 280 * 17;
if (input_code_pressed(KEYCODE_X)) b = 0x060 * 280 * 18;
if (input_code_pressed(KEYCODE_C)) b = 0x060 * 280 * 19;
if (input_code_pressed(KEYCODE_V)) b = 0x060 * 280 * 20;
if (input_code_pressed(KEYCODE_B)) b = 0x060 * 280 * 21;
if (input_code_pressed(KEYCODE_N)) b = 0x060 * 280 * 22;
if (input_code_pressed(KEYCODE_M)) b = 0x060 * 280 * 23;
if (input_code_pressed(KEYCODE_M)) b = 0;
if (input_code_pressed(KEYCODE_Q)) b += 0x060 * 280 * 1;
if (input_code_pressed(KEYCODE_W)) b += 0x060 * 280 * 2;
if (input_code_pressed(KEYCODE_E)) b += 0x060 * 280 * 3;
if (input_code_pressed(KEYCODE_R)) b += 0x060 * 280 * 4;
if (input_code_pressed(KEYCODE_T)) b += 0x060 * 280 * 5;
if (input_code_pressed(KEYCODE_Y)) b += 0x060 * 280 * 6;
if (input_code_pressed(KEYCODE_U)) b += 0x060 * 280 * 7;
if (input_code_pressed(KEYCODE_I)) b += 0x060 * 280 * 8;
if (input_code_pressed(KEYCODE_A)) b += 0x060 * 280 * 9;
if (input_code_pressed(KEYCODE_S)) b += 0x060 * 280 * 10;
if (input_code_pressed(KEYCODE_D)) b += 0x060 * 280 * 11;
if (input_code_pressed(KEYCODE_F)) b += 0x060 * 280 * 12;
if (input_code_pressed(KEYCODE_G)) b += 0x060 * 280 * 13;
if (input_code_pressed(KEYCODE_H)) b += 0x060 * 280 * 14;
if (input_code_pressed(KEYCODE_J)) b += 0x060 * 280 * 15;
if (input_code_pressed(KEYCODE_K)) b += 0x060 * 280 * 16;
if (input_code_pressed(KEYCODE_Z)) b += 0x060 * 280 * 17;
if (input_code_pressed(KEYCODE_X)) b += 0x060 * 280 * 18;
if (input_code_pressed(KEYCODE_C)) b += 0x060 * 280 * 19;
if (input_code_pressed(KEYCODE_V)) b += 0x060 * 280 * 20;
if (input_code_pressed(KEYCODE_B)) b += 0x060 * 280 * 21;
if (input_code_pressed(KEYCODE_N)) b += 0x060 * 280 * 22;
for (y = 0;y < 280;y++)
{
@ -274,13 +274,13 @@ static VIDEO_UPDATE(adp)
b++;
}
}
if (!input_code_pressed(KEYCODE_O))
if ((HD63484_reg[0x06/2] & 0x0300) == 0x0300)
{
int sy = (HD63484_reg[0x94/2] & 0x0fff) - (HD63484_reg[0x88/2] >> 8);
int h = HD63484_reg[0x96/2] & 0x0fff;
int sx = ((HD63484_reg[0x92/2] >> 8) - (HD63484_reg[0x84/2] >> 8)) * 4;
int w = (HD63484_reg[0x92/2] & 0xff) * 4;
int sx = ((HD63484_reg[0x92/2] >> 8) - (HD63484_reg[0x84/2] >> 8)) * 2 * 2;
int w = (HD63484_reg[0x92/2] & 0xff) * 2;
if (sx < 0) sx = 0; // not sure about this (shangha2 title screen)
b = (((HD63484_reg[0xdc/2] & 0x000f) << 16) + HD63484_reg[0xde/2]);
@ -290,7 +290,7 @@ static VIDEO_UPDATE(adp)
for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4)
{
b &= (HD63484_RAM_SIZE - 1);
if (x <= w && x + sx >= 0 && x + sx < (HD63484_reg[0xca/2] & 0x0fff) * 2)
if (x <= w && x + sx >= 0 && x + sx < (HD63484_reg[0xca/2] & 0x0fff) * 4)
{
*BITMAP_ADDR16(bitmap, y, x + sx ) = (HD63484_ram[b] & 0x000f);
*BITMAP_ADDR16(bitmap, y, x + sx + 1) = (HD63484_ram[b] & 0x00f0) >> 4;

View File

@ -17,7 +17,7 @@ static int get_pixel(int x,int y);
/* decoding of long commands. Commands can be up to 64KB long... but Shanghai */
/* doesn't reach that length. */
#define FIFO_LENGTH 65536
#define FIFO_LENGTH 256
static int fifo_counter;
static UINT16 fifo[FIFO_LENGTH];
@ -71,7 +71,8 @@ static const char *const instruction_name[64] =
void HD63484_start(void)
{
fifo_counter = 0;
HD63484_ram = auto_malloc(HD63484_RAM_SIZE);
HD63484_ram = auto_malloc(HD63484_RAM_SIZE * sizeof(UINT16));
memset(HD63484_ram,0,HD63484_RAM_SIZE);
}
@ -868,6 +869,7 @@ logerror("unsupported register\n");
{
logerror("unsupported command\n");
popmessage("unsupported command %s (%04x)",instruction_name[fifo[0]>>10],fifo[0]);
printf("unsupported command %s (%04x)\n",instruction_name[fifo[0]>>10],fifo[0]);
}
fifo_counter = 0;

View File

@ -1,4 +1,4 @@
#define HD63484_RAM_SIZE 0x80000
#define HD63484_RAM_SIZE 0x100000
extern UINT16 *HD63484_ram;
extern UINT16 HD63484_reg[256/2];