Mercurial > repos > blastem
comparison vdp.c @ 322:8e2fa485c0f2
Remove z80_ram reference in SDL renderer to get stateview compiling again. Print out the sprite list in stateview.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 11 May 2013 22:45:05 -0700 |
parents | 789f2f5f2277 |
children | 8c01b4154480 |
comparison
equal
deleted
inserted
replaced
321:146c87616b05 | 322:8e2fa485c0f2 |
---|---|
62 context->linebuf[x] = (context->vdpmem[address] & 0xF) | d->pal_priority; | 62 context->linebuf[x] = (context->vdpmem[address] & 0xF) | d->pal_priority; |
63 } | 63 } |
64 x += dir; | 64 x += dir; |
65 } | 65 } |
66 } | 66 } |
67 } | |
68 | |
69 void vdp_print_sprite_table(vdp_context * context) | |
70 { | |
71 uint16_t sat_address = (context->regs[REG_SAT] & 0x7F) << 9; | |
72 uint16_t current_index = 0; | |
73 uint8_t count = 0; | |
74 do { | |
75 uint16_t address = current_index * 8 + sat_address; | |
76 uint8_t height = ((context->vdpmem[address+2] & 0x3) + 1) * 8; | |
77 uint8_t width = (((context->vdpmem[address+2] >> 2) & 0x3) + 1) * 8; | |
78 int16_t y = ((context->vdpmem[address] & 0x3) << 8 | context->vdpmem[address+1]) & 0x1FF; | |
79 int16_t x = ((context->vdpmem[address+ 2] & 0x3) << 8 | context->vdpmem[address + 3]) & 0x1FF; | |
80 uint16_t link = context->vdpmem[address+3] & 0x7F; | |
81 printf("Sprite %d: X=%d, Y=%d, Width=%u, Height=%u, Link=%u\n", current_index, x, y, width, height, link); | |
82 current_index = link; | |
83 count++; | |
84 } while (current_index != 0 && count < 80); | |
67 } | 85 } |
68 | 86 |
69 void scan_sprite_table(uint32_t line, vdp_context * context) | 87 void scan_sprite_table(uint32_t line, vdp_context * context) |
70 { | 88 { |
71 if (context->sprite_index && context->slot_counter) { | 89 if (context->sprite_index && context->slot_counter) { |