|
|
Search
|
|||||||
| Home | Register | Downloads | FAQ | Members List | Calendar | Arcade | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
my next emulation project
well i chose space invaders as my next emulation project and i have a lot of the information i need to get started but after i created my decompiler to check what opcodes are being used in the space invaders rom, i immediately came across an issue. besides the mirror of the first 4000 bytes of memory, which even than goes up to what, 8000? the jump that i see immediately at the start makes no sense as it jumps clearly very far outside the memory range of the emulator and could not possibly work, so i was wondering if anyone could point me to a possible reason why it'd do this or maybe tell me what i may have done wrong? i know i decoded the op code right. also here is the first little bit of my decompiled space invaders rom. Code:
0000 : 00 NOP 0001 : 00 NOP 0002 : 00 NOP 0003 : C3 D4 C3 JMP C3D4 0006 : 00 NOP 0007 : 00 NOP 0008 : F5 PUSH PSW 0009 : C5 PUSH BC 000A : D5 PUSH DE 000B : E5 PUSH HL thanks in advance for any help. EDIT: fixed this bug already but decided to update the post. Space Invaders - EmuTalk.net this is where i found the documents i am using for my emulator and it has some other nice information for anyone interested. i would just include the documents but the file size is to big to attach. Last edited by Hatorijr; March 3rd, 2009 at 21:18.. |
|
|
|
| Advertisement | [Remove Advertisement] | ||
|
|
|
|
#3 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
well i got some opcodes coded already, i am doing my space invaders emulator in C# like i did my chip8, of course its not going to be as fast as some c/c++ versions but it will get the job done. if anyone wants any help i can try to help unless its later on when i am finished than i will be sure to help as best i can. |
|
|
|
|
|
#5 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
i already pulled a lot of documents i came across on emutalk which is what i had started reading to get a feel for how things should work, my main issue is effectively detecting when certain flags should be changed lol. i can do just about all of them but the auxiliary carry flag is looking to be a small issue in some cases.
|
|
|
|
|
|
#6 (permalink) |
|
Hackin 'n Slashin
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2007
Location: Corrupt Rapist run South Africa
Posts: 11,327
|
you accidentaly inserted 1 instead of 1? what?
__________________
Intel Core2Quad Q9550 (2.83Ghz stock) | ASUS P5Q | 2x2GB Transcend JetRam DDR2-800 | ASUS ENGTX260\HDTP\896M | Windows Vista Home Premium 64bit SP1 The Champ has retired but may his Legacy live on FOREVER !!!! Get it right fools! The glass is HALF-EMPTY, not half-full!!! !!! WARNING: Emulation requires a brain !!! WARNING: Emulation =/= Piracy !!!
|
|
|
|
|
|
#7 (permalink) |
|
Mobile Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
|
I think he meant 2 instead of 1, Schumi. ;p On some system, opcodes have parameters trailing behind their identifier, thus... length can vary depending on the opcode. The program counter needs to be incremented accordingly or otherwise, you'd start fetching weird stuffs. Not that I know anything about Space Invaders at all... but I do know that that's almost the case with MIDI and Gameboy. Amen. ![]() On another side note, Chip-8 opcodes have a fixed length of 2 bytes regardless... making it almost "too" easy to emulate... (why so conveniently 2 bytes? lol)
__________________
cChip interpreter WIP - current status: Release Candidate LRx Filter RC - current performance rating: 9/10 |
|
|
|
|
|
#8 (permalink) | |
|
Banned
![]() ![]() ![]() ![]() ![]() Join Date: Feb 2007
Location: Lost.
Posts: 1,767
|
Quote:
|
|
|
|
|
|
|
#10 (permalink) | |
|
Mobile Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
|
Quote:
But I decided to halt work due to... well... I just can't get over the fact that I'll need to "legally" own some stuffs to make things work right. Otherwise I'll just be walking down the road that I protest. That's not to say I don't own a GameBoy Advance SP or an old-school Gameboy... but the games... now that's a different story. Relying solely on tech demos may make me overlook something. And I don't like a job half-done. :/But I'd be glad to document the Gameboy's Z80 CPU and the way opcodes are encoded for future reference, since I'm about done with that for now. GBA... hmm... exophase's gpsp is worth checking out. I think the ARM codes in there are among the fastest (if not the fastest) around.
__________________
cChip interpreter WIP - current status: Release Candidate LRx Filter RC - current performance rating: 9/10 |
|
|
|
|
|
|
#11 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
what i did wrong was that see my decompiler just uses a variable i in a giant loop to go through and spit out what the opcodes are and on several that are multibyte, i replaced the i with a 1 and did not catch it(this happened while coding at around 4 am in the morning) and so i got all of those opcodes picking up a byte at the very start which was a c3 byte so all addresses had a c3 at the start of them which messed everything up even though it was still incrementing through memory correctly, it just was picking out the high order byte from the wrong location. but progress report, i have a lot of opcodes coded so far, not worked on input/output yet so nothing shows but so far those i finished appear to work as they are documented to. after this i think i may take a stab at a gameboy emulator .
|
|
|
|
|
|
#12 (permalink) |
|
Mobile Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
|
Holy ****... ![]() Now I get it. Much worse than that. lol That's why you should use something other than a generic i if possible. Something like pc would work... considering that thing is acting as a program counter as it is.
__________________
cChip interpreter WIP - current status: Release Candidate LRx Filter RC - current performance rating: 9/10 |
|
|
|
|
|
#13 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
in my actual cpu class i use pc, the i was just for the giant for statement being used in my decompiler. i have nearly half of the opcodes finished so far, though i know i will have a ton of fun once i get to handling timing and the input and output stuff lol.
|
|
|
|
|
|
#15 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
not to difficult. i am a math wise and most opcodes i have been doing deals with math so its more of a challenge dealing with how to set the flags correctly than anything. but yes it is a big step going from chip 8 to an actual cpu core with a lot more to check for.
|
|
|
|
|
|
#16 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
can someone please explain to me what vblank is? i saw the term used in the gb documents that i have and also mention of it in some of the stuff i have for space invaders, and since this is the first real emulator i will be making, i have no real idea what this really means .
|
|
|
|
|
|
#20 (permalink) |
|
Emu Author
![]() ![]() ![]() Join Date: Dec 2004
Location: North Carolina
Posts: 374
|
i updated the first post with a link on where i got my information. i would have just attached everything but one of the pdf files is huge so i figured since i could not attach them i would at least post the link to them .i fixed some bugs earlier so now i can have the cpu running without crashing for several minutes(thats how long i ran it before i stopped it) now to work on getting correct timing and maybe output but than again i need to put in the last 3 opcodes still lol. btw if anyone is interested, as of right now i have my cpu enclosed in its own class which means it can easily be taken out and ported to another emulator so if anyone would ever like to have a copy of it just ask . of course its not optimized any and needs a lot of condensing but eventually it will be very well optimized.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|