Browse Source

Minor cleanup; expand docs.

master
Ben Kurtovic 8 years ago
parent
commit
e6c92fd38b
6 changed files with 32 additions and 6 deletions
  1. +19
    -0
      README.md
  2. +4
    -0
      docs/README
  3. BIN
     
  4. +5
    -4
      src/config.c
  5. +1
    -1
      src/emulator.c
  6. +3
    -1
      src/vdp.c

+ 19
- 0
README.md View File

@@ -4,6 +4,8 @@ crater
**crater** is an emulator for the [Sega Game Gear][game gear], with an included **crater** is an emulator for the [Sega Game Gear][game gear], with an included
[Z80][z80] assembler/disassembler, written in C. [Z80][z80] assembler/disassembler, written in C.


![Tails Adventure (1995)](/docs/tailsadventure.png?raw=true "Tails Adventure (1995)")

[game gear]: https://en.wikipedia.org/wiki/Sega_Game_Gear [game gear]: https://en.wikipedia.org/wiki/Sega_Game_Gear
[z80]: https://en.wikipedia.org/wiki/Zilog_Z80 [z80]: https://en.wikipedia.org/wiki/Zilog_Z80


@@ -82,6 +84,23 @@ the input file, with the extension replaced with `.gg` for `-a` and `.asm` for
`-d`. By default, this will never overwrite the original filename; pass `-d`. By default, this will never overwrite the original filename; pass
`--overwrite` (`-r`) to let crater do so. `--overwrite` (`-r`) to let crater do so.


Status
------

The emulator is almost fully functional, lacking only audio support, a few
uncommon CPU instructions, and some advanced graphics features. Most games are
playable with only minor bugs. Future goals include save states and a more
sophisticated debugging mode.

The assembler is complete. Future goals include more documentation, macros, and
additional directives.

The disassembler works, but can't differentiate between code and data yet, so
it's not very useful.

The testing infrasture is limited. The assembler has decent coverage, other
components minimal.

Credits Credits
------- -------




+ 4
- 0
docs/README View File

@@ -0,0 +1,4 @@
More detailed documentation isn't available yet. All your questions are
answered in the main README.

At the moment, this directory contains supporting content for said README.

BIN
View File


+ 5
- 4
src/config.c View File

@@ -39,10 +39,11 @@ static void print_help(const char *arg1)
" to show more detailed logs, including an emulator trace\n" " to show more detailed logs, including an emulator trace\n"
" -s, --scale <n> scale the game screen by an integer factor\n" " -s, --scale <n> scale the game screen by an integer factor\n"
" (applies to windowed mode only; defaults to 4)\n" " (applies to windowed mode only; defaults to 4)\n"
" -a, --assemble <in> [<out>] convert z80 assembly source code into a\n"
" binary file that can be run by crater\n"
" -d, --disassemble <in> [<out>] convert a binary file into z80 assembly\n"
" source code\n"
" -a, --assemble <in> [<out>]\n"
" convert z80 assembly source code into a binary file that\n"
" can be run by crater\n"
" -d, --disassemble <in> [<out>]\n"
" convert a binary file into z80 assembly source code\n"
" -r, --overwrite allow crater to write assembler output to the same\n" " -r, --overwrite allow crater to write assembler output to the same\n"
" filename as the input\n", " filename as the input\n",
arg1); arg1);


+ 1
- 1
src/emulator.c View File

@@ -42,7 +42,7 @@ static void setup_graphics(bool fullscreen, unsigned scale)
if (fullscreen) if (fullscreen)
flags = SDL_WINDOW_FULLSCREEN_DESKTOP; flags = SDL_WINDOW_FULLSCREEN_DESKTOP;
else else
flags = SDL_WINDOW_BORDERLESS|SDL_WINDOW_RESIZABLE;
flags = SDL_WINDOW_RESIZABLE;


SDL_CreateWindowAndRenderer( SDL_CreateWindowAndRenderer(
scale * GG_SCREEN_WIDTH, scale * GG_SCREEN_HEIGHT, scale * GG_SCREEN_WIDTH, scale * GG_SCREEN_HEIGHT,


+ 3
- 1
src/vdp.c View File

@@ -216,6 +216,8 @@ static void draw_background(VDP *vdp)
bool vflip = tile & 0x0400; bool vflip = tile & 0x0400;
bool hflip = tile & 0x0200; bool hflip = tile & 0x0200;


(void) priority; // TODO

uint8_t vshift = vflip ? (7 - src_row % 8) : (src_row % 8), hshift; uint8_t vshift = vflip ? (7 - src_row % 8) : (src_row % 8), hshift;
uint8_t pixel, index; uint8_t pixel, index;
int16_t dst_col; int16_t dst_col;
@@ -275,7 +277,7 @@ static void draw_sprites(VDP *vdp)
pattern |= (vdp->v_counter - y) >> 3; pattern |= (vdp->v_counter - y) >> 3;
vshift = (vdp->v_counter - y) % 8; vshift = (vdp->v_counter - y) % 8;
} else { } else {
FATAL("TODO: sprite doubling")
// TODO: sprite doubling
} }


uint8_t pixel, index; uint8_t pixel, index;


Loading…
Cancel
Save