Commit Graph

156 Commits

Author SHA1 Message Date
adelikat be2937fdec Code refactoring of Tools files - no functional changes other than some very tiny speedups and null checks 2013-04-14 23:56:45 +00:00
adelikat cff1ff2940 Removing unused directives from a bunch of files because I was playing around with resharper, but that got boring so not every file 2013-04-14 20:39:19 +00:00
brandman211 0b7f68fcb7 -Fixed the calculation for the O Flag...not messing with that bit-math anymore.
-Set the pending cycles for setting Sr1 to 14934 - 3791 instead of adding it. This working makes NO sense in my opinion, and I'm sure it will break as the number of interrupts increases, but for now, it matches up.

The newest issue is reading PSG registers which have not been set. Cool, expecting this to work without doing anything would be silly, so I've gotten somewhere!
2012-12-17 07:17:18 +00:00
brandman211 7ad002d5ce IntelliHawk:
-Cleanup.
-Added "Total Executed Cycles" to the log.
-By observing the aforementioned data, I realized that the docs probably meant to say 14934 instead of 14394.
--By adjusting this...TITLE SCREEN!
--Still, there are definitely discrepancies with the log that imply that I'm far from done.
-Enabled ANDR and XOR because they were executed during the title sequence, though it's hard to tell if it should at this point.
2012-12-17 04:23:59 +00:00
beirich 2382781627 coleco 'noskip' checkin... tested through M's so far 2012-11-23 05:51:16 +00:00
beirich 5bd29d5d80 2012-11-23 00:38:24 +00:00
zeromus e48f24d266 quick fix for 6502 trace log 2012-11-17 01:31:34 +00:00
goyuken 119d6e8c1c z80gb: remove old disassembler due to license issues 2012-11-07 22:13:57 +00:00
goyuken 3575eb849b z80gb: add new disassembler 2012-11-03 18:17:55 +00:00
goyuken 6ffd71973a 6502: improve tracelog to only disassemble actual opcodes, and also enable it on 2600 2012-11-02 22:27:22 +00:00
zeromus aa161d8910 proper Peek support in NES and 6502X 2012-11-02 19:28:00 +00:00
goyuken 56e4a84f14 make the MOS6502XDouble debug core fully savestate compatible with the other two. if it's desired for debugging, they could be swapped out on the fly now... 2012-10-31 15:08:30 +00:00
zeromus 59664959f1 speed up c# 6502 and enable it instead of cpp one 2012-10-31 01:55:26 +00:00
goyuken 137ffd8081 bleh 2012-10-30 23:23:56 +00:00
goyuken 4272e0ffed MOS6502XDouble: fix loading savestates 2012-10-30 23:20:22 +00:00
goyuken cd2ff4ed63 Add unmanaged version of 6502X core. The core it self is nearly exactly a copy+paste job from the C# one; most things map over exactly. A strange and abusive p/invoke setup is required to realize a performance gain; see code for details. Seems to be worth a bit more than 20% overall speed for me. Core is savestate compatible with managed 6502X. slight modifications to existing API has been made to support the new cpu. also included is a test module that runs both cores together, savestating every cycle to check for sameness. Core should fit in Atari, although that hasn't been done yet. For the moment, tracelog and disassemble are broken, but they'll be back soon. 2012-10-30 23:01:54 +00:00
zeromus 223de0609c finish the attic, move some old junk up there. i think i threw out my back. 2012-10-29 07:56:30 +00:00
beirich 6d4af4968d SMS: support cpu trace logging 2012-10-06 18:09:41 +00:00
beirich ea6e170703 support Trace Logging in PCE 2012-10-01 00:21:25 +00:00
zeromus a45c1f60bc get rid of some warnings 2012-09-22 05:01:04 +00:00
beirich b04189b6b1 gen: rewind is working, savestates are not working [yet]. will fix more tomorrow 2012-09-17 05:48:24 +00:00
brandman211 ae4dfbc00e -Imported .LSMV buttons.
--Haven't done anything with the flags because I don't know what they are supposed to do yet.
--Speedy Gonzales v2 doesn't sync after being converted, but I don't think that's my fault.
-Flags and other data will be parsed soon.
2012-09-12 05:59:09 +00:00
beirich 90d1d12086 gen: fix some vram corruption issues
general: fix some build warnings
2012-09-09 21:15:20 +00:00
brandman211 2a41b8eda7 The EROM / GROM is now expected to be .int or .bin. 2012-09-07 06:36:23 +00:00
brandman211 fd1560177e -Implemented Colored Squares mode. It looks sensible in one of the improperly loaded ROMs that triggers it.
-Masked the Color Stack registers. This prevents the previously mentioned ROM from throwing an ArgumentException in ColorToRGBA.
2012-09-06 08:02:49 +00:00
brandman211 06022c9076 -Added Read/WriteMemory to the STIC so that it can access the RAM it needs to draw the screen.
--Did the same for the PSG because why not.
-Discovered that the Commando HLT happens after the CPU goes idle, so there's no point in further investigating the issue until I emulate that.
-Parsed the BACKTAB cards for the STIC's Draw().
-Attempted to draw the screen using the aforementioned cards.
--I'm only trying to apply color to the foreground.
---Instead of converting the FG color to RGBA, I'm making it all white for now.
--There's clearly some sanity to what's being drawn, so I think each 8x8 card is being drawn in the right place.
--I think the next step is trying to make each individual card draw properly.
--I believe the algorithm for populating the FrameBuffer is VERY inefficient in the way it accesses memory. Will need some suggestions as to how I can rewrite this.
2012-09-06 04:51:17 +00:00
brandman211 1a760096bc -Laid out the groundwork for the video provider.
--VirtualHeight / Width will be useful due to how the scanlines are doubled on TVs, but for now, I will just be drawing to scale.
-Enabled XOR@, SAR, and COMR. Advanced Dungeons & Dragons provided more test cases.
-Noticed that Commando, as well as some other games, triggers a HLT. This should be looked into later.
2012-09-05 04:42:49 +00:00
brandman211 44e03b1923 -Changed the amount of pending cycles to add when the STIC sets SR1.
--This number is fairly arbitrary, and I don't know why it works, but for now, it does.
--The values of INTRM don't match up exactly, but I think this is mostly a logging issue, though I still need to look into this.
-Fixed the Overflow Flag calculation.
--My original formula didn't compare the signs of the operands.
--It always needs to use the original operands, not the 2s complement one.
--As such, a result parameter has been added.
-Fixed the detection of a double swap, shift, and rotate in the related instructions. Ironically, I shifted one too many bits in my detection.
-Masked the result of left shifts and rotates to 0xFFFF so that the flags are calculated properly.
-Made RSWD (un)set the right flags.
-Enabled GSWD, MVI, SARC, CMP@, ADD, SUB@, INCR, RRC, SLR, SLL, RLC, ADDR, SUBR, SLLC, CMPR, and RSWD.
-COMR, NEGR, ADCR, SAR, ANDR, SUB, AND, XOR, and XOR@ remain disabled as I have yet to hit any test cases for them.

At this point, IntelliHawk is executing instructions indefinitely with what seems to be perfect results! I think I'm ready to hook up the screen.
2012-09-04 19:29:02 +00:00
brandman211 e51b79e2fa -Flushed log after interrupt.
-Replaced subtraction with adding the 2s complement in instructions. That way, the Overflow Flag is calculated properly.
-Made it so that the masking of a result to 0xFFFF comes after calculating the Carry and Overflow Flags but before the Sign and Zero Flags.
-The CMPX instructions now use the aforementioned masking to properly calculate the Sign and Zero Flags even though the result doesn't actually get stored.

Thanks to this commit, IntelliHawk executes 1711 instructions properly. Next, it's supposed to take an Interrupt, which is bizarre because INTRM appears to be true at that point. This doesn't seem possible unless I am once again logging at the wrong time, hiding that the INTRM gets set to false before immediately switching back to true after taking the interrupt. Will look into this later.
2012-09-04 07:28:36 +00:00
brandman211 ca8b778a52 -Noted interrupts in the log.
-Added and Interrupted flag to make it so that interrupts only trigger once per falling edge.
-For now, interrupts take 28 cycles.
-Made it so that the STIC tracks Pending / Total Executed Cycles just like the CPU.
-Forwarded the cycles executed in the CPU to the STIC's Execute.
-SR1 is now inverted when there are no pending cycles.
--If SR1 is high, 14394 cycles are added to the pending cycles.
--If SR1 is low, 3791 cycles are added to the pending cycles.
2012-09-04 06:26:08 +00:00
beirich e24f0962fc gen: fix dumb tile priority bug (primarily affects Ghouls n Ghosts, which use the layers backwards from normal) 2012-08-30 04:29:33 +00:00
beirich 8ad3e72ffa Allow easy swapping of active 68000 core the C# core, or Musashi... As we are likely to be swapping between versions rapidly for some period of time. 2012-08-26 14:39:06 +00:00
brandman211 26b1d06b7a -Simplified the CPU / STIC connection.
-Made FrameAdvance handle the pending cycle loop. During each iteration, it runs one instruction and ticks the STIC accordingly.
2012-08-14 03:58:11 +00:00
brandman211 9100232547 -Made connections between the signal pins on the CP1610 and the STIC.
--Not sure why the STIC has any connection to the SST, but the docs on the SST are virtually non-existent from what I could find.
--I took advantage of Func and Action instead of passing bool references to both devices. I think this makes sense.
-Added reset functions for both devices.

My comparison log for INTRM is still weird because it says it is true initially (Expected) and remains as such after the first instruction (A bit odd). I think this happens because the STIC is supposed to "tick" and shift SR1 to false immediately, but the STIC tick happens after the CPU tick, and the CPU tick is where the logging happens. I need to find a better place to put this logging, and I need to implement the STIC ticking for IntelliHawk. I'm not positive how to approach the latter issue as I assume a tick means one instruction execution, and my executions happen in a loop on the CPU, which has no reference to the STIC, so I'm not sure where this fits into the equation.
2012-08-13 08:10:15 +00:00
brandman211 fd6201c703 Implemented what to do on an interrupt. This seems to be logical as it tries to execute a GSWD instruction, but it takes the interrupt too early because I haven't figured out when to turn INTRM on / off. 2012-08-13 03:47:08 +00:00
brandman211 0d20c133a5 -Moved the reset address to the CP1610 and made RegisterSP/PC private.
-Created helper functions for indirect ops; Indirect_Set will be needed for interrupts.
2012-08-06 15:51:35 +00:00
brandman211 a19b76e6cc Added Interruptible and assigned it for every op. 2012-08-05 07:04:03 +00:00
brandman211 e9a8980f0c -Throw exceptions for TCI, SIN, and BEXT.
-Added and logged INTRM, BUSRQ, BUSAK, and MSYNC.
2012-08-05 06:47:00 +00:00
brandman211 b83bb1901d -When neither the cartridge nor hardware responds to a read, it now returns 0xFFFF instead of throwing an exception.
-I will now assume that 0x7000 is not mapped for the sake of continuing on. I will need to implement a mapper system shortly though.
--Did the same thing for 0x4800.
-AND@, MOVR, CMP enabled.
-Made the logging separator generate before an instruction instead of after the register states. This is quite petty, but I don't like the separator at the end of the file.

I hit an infinite loop, and I'm very very certain it's happening because I don't have an interrupt system yet. Time to stop avoiding that!
2012-08-05 05:59:55 +00:00
brandman211 80a0f8f75b -Made Intellicart its own class.
-Separated cartridge logic into a separate ICart named Cartridge.cs.
-Made WriteMemory return a bool to match ICart.Write. It currently returns true if either the cart or the core responded.

TODO: Parse the vanilla Intellivision ROM, which will hopefully include the read / writability of the data segments. adelikat seems to think that I just need to send the bytes to $5000, but I'm not convinced.
2012-07-31 06:54:20 +00:00
brandman211 f66d92f2a5 Started filling the gaps in the Memory Map, getting up to 0x7FFF. Once complete, a lot of TODOs remain, the most important being the actual mapping of the cartridge. 2012-07-30 22:25:00 +00:00
brandman211 8306768c76 Enabled SWAP. Works as expected, but the next instruction is an MVI@ that wants to read from 0x7000, which I think is made available to cartridges. Not sure where to go from here. 2012-07-30 02:34:53 +00:00
brandman211 b1db1b7a69 -Reversed the double byte data bytes. It now works properly.
-Set the D flag to clear one instruction after it's set; SDBD is a prefix instruction.
2012-07-29 00:02:06 +00:00
brandman211 53c0dd5ee0 -Enabled the ops that merely set / clear flags...there's no way I could have messed those up.
-Tested and implemented the MVO op.
-Implemented the other direct ops.

I think my double byte data handling isn't working. Will diagnose.
2012-07-28 17:50:32 +00:00
brandman211 748efbcd20 -Fixed the overflow calculation for ADDR, SUBR, and CMPR.
-Implemented the remaining XXX@ ops.
2012-07-28 17:20:16 +00:00
brandman211 188e5662ca It seems that indirect writes decrement the stack pointer BEFORE reading memory. 2012-07-28 17:06:06 +00:00
brandman211 0d10eee747 -Implemented branching and tested BNEQ. BEXT not implemented.
-Made it so that the indirect ops other than MVO@ decrement R6 when it's the mem address. Indirect write means writing to a register apparently, so maybe the documentation don't contradict itself.
2012-07-28 04:18:13 +00:00
brandman211 4864aaa291 -Enabled and tested DECR.
-Fixed my disassembly of branch; I wasn't thinking in hexadecimal. >_<
-Subtracted 1 from the negated offset when branching in reverse. The next op is "BNEQ $FFFC".
2012-07-27 04:46:44 +00:00
brandman211 4d1f0114c4 R4-R7 now auto-increment for all of the indirect opcodes. My documentation is inconsistent on whether R6 increments or decrements on right, but in any case, my output now matches my source until the DECR, which hasn't been implemented yet. 2012-07-27 04:07:06 +00:00
brandman211 3a56f65c3f Implemented the XXXR opcodes. As of now, I have Jump, MVO@, MVI@, and XORR enabled and tested. There might be an off by one error with MVO@. 2012-07-27 03:33:24 +00:00