Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

158 Neutral

About MaximZhao

  • Rank
  1. MaximZhao

    64KB RAM and a CHIP-8/SCHIP interpreter

    I can't help thinking piggy-backing or sandwiching the second SRAM chip might have been easier...
  2. MaximZhao

    Z80 BBC BASIC - Emulated on Windows

    So could it be ported to Sega 8-bit hardware? Sega BASIC is rather rubbish compared to the godly BBC Basic. I spent many an hour messing around in there on my Z88.
  3. MaximZhao

    SC-3000 keyboard and a final release

    As I understand it, the SF-7000 is fairly simple - just a flat 64KB RAM (optionally overlaid by the 8KB BIOS/IPL) and a floppy disk controller attached to another PPI chip. It's the same FDC used in the original IBM PC and a few other systems, I worked from this datasheet in my IPL disassembly: http://www.smspower.org/dev/docs/nec-upd765a.zip but you can implement a much reduced subset because you don't have to worry about multiple drives, disk formats, timing, DMA or error conditions. Other stuff like the parallel port can go unemulated just as easily as the SC-3000's COM port and tape input. I ought to publish that disassembly sometime soon, it was what made me report all those Brass bugs :)
  4. MaximZhao

    Fun with IThumbnailProvider

    Of course, with a LOT more code in the thumbnailer you can reconstruct much of the screenshot anyway (building it from the VDP RAM/registers). I did that years ago: http://www.smspower.org/maxim/forumstuff/shellext.jpg http://www.smspower.org/maxim/forumstuff/mekashellext002.zip using the old-fashioned XP-compatible IExtractImage interface. It's broken now thanks to Meka's non-backwards-compatible savestates.
  5. MaximZhao

    Turning Japanese

    One of Excellent Dizzy Collection versions (I think the SMS one) resets when you choose one of the games because it's incomplete; the other (GG version) works OK, I think. The crux of the matter, however, is that you've not noticed that the Codemasters mapper actually supports paging in all 3 slots, with no fixed initial 1KB - to load one of the games it swaps out the code throughout the address space, and then jumps to $0000, hence the resetting behaviour you're seeing. The paging register for $0000-$3fff is at $0000, $4000-$7fff at $4000, and the one you already have for $8000-$bfff at $8000. The three games in EDC were originally going to be released separately, hence why they weren't written in a way that would let them share code. The mapper is wired to the /RESET line on the cartridge port so it can reset itself to a sane state, so there's no need for a fixed region. The "Korean" mapper is a frame-2-only version of the Codemasters mapper, which is nice because you already wrote that. The Japanese SMS and Mark III actually don't implement the output capability for TR and TH at all, so what gets read back from them is undefined (depends on what's plugged in and what it's doing, whether you gets 1s or 0s). Since the controller ports are active-low, it's more likely it'd read back 1s than 0s. It doesn't really make any difference to your implementation.
  6. MaximZhao

    New Z80 emulator

    ZEXALL works by self-modifying code that is operating on data in a small chunk of memory. After every iteration (or maybe every outer iteration) it dumps the registers to RAM and passes it all into a CRC32 routine. At the end it compares the cumulative result to a stored "correct" value. Thus, it will always complete a test before showing an error. Thus, there are a few options for debugging through it more quickly: 1. Replace CRC32 with a faster checksum. Adler32 might be a good option, if you can think of a good way to avoid overflowing 16 bits. 2. Figure out where in RAM the CRC is stored and try stepping through in large chunks of cycles (eg. 1 frame = 59736 cycles) alongside another emulator, until the CRCs differ; then do it again and only step through n-1 frames. Rather dependent on trusting the two emulators to execute exactly the same number of cycles and to have correct instruction timing. 3. Get a faster computer :) Others have reported success by simply restricting the test range to effectively binary search for the first point of failure, although I admit that's not the easiest thing to do. Do you have ZEXALL compiling under Brass yet?
  7. MaximZhao

    New Z80 emulator

    I seem to remember Psycho Fox has an unusual VBlank handler that just sets a flag and exits; that may be related to the speed problems. If you can figure out the ZEXALL test bitmasks, and can run a modified version on hardware, you can use that to narrow down your search to the failing opcodes. Or, you might try running alongside another emulator (that supports debugging) and trying to step through (maybe a frame at a time) until the running CRC differs.
  8. MaximZhao

    Sega: Enter the Pies

    Well, it works on a real system :) I have no idea why it'd fail to word-wrap 1 line out of a thousand - the whole screen's made using them and so's the text you get when you press D.
  9. MaximZhao

    Sega: Enter the Pies

    It's been a while since I ran it on hardware, I'll have to give it a try. Looking through the source, it's running off my WTF-laden "graphics.inc" so it's not that surprising... ...although all it's really doing is setting the VRAM write address to somewhere further on when if finds a LF, so it's odd that it misses this one. It seems to work OK in Kega and Dega, the two emulators I have to hand here.
  10. MaximZhao

    Sega: Enter the Pies

    Thanks :) http://www.smspower.org/dev/docs/officials/ There's your SMS docs, for what they're worth. A goldmine of info on the sketchily-emulated peripherals, some info on the dev hardware's ports that has no bearing on emulating anything, and not much else - for example, the closest it'll get you to the clock speed is "3.58MHz", with no mention of PAL/NTSC.
  11. MaximZhao

    Sega: Enter the Pies

    The PAL SMS runs at 3546893Hz, give or take; NTSC is 3579545, but most people round it off a bit (MAME tends to use 3579540, I think) since that level of accuracy a few orders of magnitude less than the crystal's tolerance anyway. Both run at exactly 228 cycles per scanline, which works out as a screen refresh rate of 59.92Hz for NTSC and 49.7Hz for PAL - a tad less than spec but close enough. The differences are due to the need to have the master clock running at a multiple of the TV standard's colour subcarrier frequency, by the way. Polling the VCounter will return you the same value multiple times at ~3.5MHz clock speeds too - the polling loop would be about 20 cycles long and as already mentioned, the scanline only increments every 228 cycles. As for the sound synchronisation issues - I've heard from other emulator authors that the best thing you can do is tie everything to the sound card's clock, as is commonly done for media playback; otherwise you'll always get some "drift" between clocks causing the sound to break up. Thus, a sound card running at 44200Hz (say) will make the video speed up by the same 0.22% which sounds better than having your audio ring buffer overtake itself every 441 seconds.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!