diff options
| author | 2008-01-17 06:06:37 +0000 | |
|---|---|---|
| committer | 2008-01-17 06:06:37 +0000 | |
| commit | 7de11b58a912b7fab4302ed0b5a358662b92d18f (patch) | |
| tree | 393033bec69f4549fe942f4b63128db22a599f06 | |
| parent | 5fceb8502c905776f2846ab3a67e1f0fd85f63e9 (diff) | |
Fixed crosshairs for eggventr/lethalj.
| -rw-r--r-- | src/mame/video/lethalj.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c index bd98eda84f8..275c6dbd5c3 100644 --- a/src/mame/video/lethalj.c +++ b/src/mame/video/lethalj.c @@ -33,10 +33,12 @@ static UINT8 blank_palette; * *************************************/ -INLINE void get_crosshair_xy(int player, int *x, int *y) +INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y) { - *x = ((readinputport(2 + player * 2) & 0xff) * Machine->screen[0].width) / 255; - *y = ((readinputport(3 + player * 2) & 0xff) * Machine->screen[0].height) / 255; + int width = machine->screen[0].visarea.max_x + 1 - machine->screen[0].visarea.min_x; + int height = machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y; + *x = ((readinputport(2 + player * 2) & 0xff) * width) / 255; + *y = ((readinputport(3 + player * 2) & 0xff) * height) / 255; } @@ -57,14 +59,14 @@ READ16_HANDLER( lethalj_gun_r ) case 4: case 5: /* latch the crosshair position */ - get_crosshair_xy(offset - 4, &beamx, &beamy); + get_crosshair_xy(Machine, offset - 4, &beamx, &beamy); gunx = beamx; guny = beamy; blank_palette = 1; break; case 6: - result = gunx/2; + result = gunx / 2; break; case 7: |
