Next Generation Emulation banner
441 - 460 of 486 Posts

· Code it the hard way :P
Joined
·
1,344 Posts


:)

I want to make a test unit some day:

- Test Math results / Binary Coded Decimal
- Test 0xF Flag on AND, OR, XOR, ADD, SUB, Collision
- Test syscalls
- Test Save/Load RPL flags
- Test Call / Jump
- Test for Vertical Wrap hack (Blitz was created on machines that didn't support vertical wrap)
- Test for normal wrapping
- Test fonts
- Super Chip8 tests
- maybe mega chip tests?


Note about hybrid games: They are special chip8 programs containing native runtime code. Some are really whole native programs that doesn't use the chip8 interpreter at all (I wouldn't call them chip8 programs or hybrid :p). The normal [real] hybrids just use syscalls to call native CDP1802 code inside the rom itself which help chip8 games access any part of memory such as the video buffer, chip8 registers, stack memory, chip8 interpreter work memory. Also can read the cdp1802 register for some info such as pointers, PCs, and interrupt info. I also think its illegal in chip8 programming to have programs call code outside the rom such as interpreter code or the HW rom.
 

· Registered
Joined
·
11 Posts
confusion over SHR instruction

hi guys,

I am following cowgod's chip 8 documentation to code up my emulator in java and i am having problem understanding the following instruction

8xy6 - SHR Vx {, Vy}
Set Vx = Vx SHR 1.

If the least-significant bit of Vx is 1, then VF is set to 1, otherwise 0. Then Vx is divided by 2.

It says to shift by 1, if so, what is the use of y in the instruction 8xy6. Can anyone clarify that for me? Appreciate your help!:thumb:
 

· Registered
Joined
·
11 Posts
Thanks! refraction,

I have another question. I am implementing the draw function. According to the specs, when writing new pixels the pixels are xored. That would mean if in a position there is a pixel written and if i write 0 then the pixel wont get cleared. Is that correct? I was assuming the sprite bits in the memory is what will be written in the screen.
 

· Sober coder
Joined
·
472 Posts
Yeah: (old ^ new = ...)
0 ^ 0 = 0
1 ^ 1 = 0
1 ^ 0 = 1
0 ^ 1 = 1

So basically, two set pixels cancel each other out.
 

· Registered
Joined
·
2 Posts
Hello I'm new here and have been recently working on programming a chip-8 emulator in c++. I have split the code into three parts, chip8.h, chip8.cpp, and main.cpp. I have finished chip8.h and am working on chip8.cpp however have one question:
What memory location is 'NN' or 'NNN' referring to? Sorry if this is in the wrong section.

Thanks
Stefonzo
 

· PCSX2 Coder
Joined
·
11,343 Posts
Hello I'm new here and have been recently working on programming a chip-8 emulator in c++. I have split the code into three parts, chip8.h, chip8.cpp, and main.cpp. I have finished chip8.h and am working on chip8.cpp however have one question:
What memory location is 'NN' or 'NNN' referring to? Sorry if this is in the wrong section.

Thanks
Stefonzo

NN literally refers to 2 numbers and 3 for NNN. So NN can be any number from 0x00 up to 0xFF and NNN can be anything from 0x000 up to 0xFFF
 

· Registered
Joined
·
92 Posts
Just wanted post my dynarec chip8 emulator that I wrote in the past. Thought it might be helpful for people who wants to learn how write a dynarec cpu. I created this just for learning purpose, to teach myself about dynarec so the code isn't perfect.

And no input and sound emulation, so it just shows the first screen. :p
Link: http://www.pradsprojects.com/downloads/Chip 8 dynarec.7z
 

· Registered
Joined
·
92 Posts
I didnt look into it yet, but does it handle self-modifying code? And how did you assign the registers?
And it would be great if you would post it also over at emutalk, it looks very promising!
Nah it doesn't handle self modifying codes. I didn't want to make the code too complicated that it would scare people away. lol :p
 

· PCSX2 Coder
Joined
·
11,343 Posts
Nah it doesn't handle self modifying codes. I didn't want to make the code too complicated that it would scare people away. lol :p
It doesn't make it too much more complicated. In the recompiling code area, keep an array of memory and when you "read" a bit of memory for the opcode, write to this second array the block start address of that recompiled code, then when you do a write to memory, you can check that array to see if it has a value (you can even have a .isRecd bool on it if you want just incase 0 is the address written to :p) and if it has an address, clear that address in the recompiler cache so it needs to be recompiled.

its more complicated to explain than implement >.< lol. This is what i did on my chip16 emu anyways :)
 

· Registered
Joined
·
92 Posts
It doesn't make it too much more complicated. In the recompiling code area, keep an array of memory and when you "read" a bit of memory for the opcode, write to this second array the block start address of that recompiled code, then when you do a write to memory, you can check that array to see if it has a value (you can even have a .isRecd bool on it if you want just incase 0 is the address written to :p) and if it has an address, clear that address in the recompiler cache so it needs to be recompiled.

its more complicated to explain than implement >.< lol. This is what i did on my chip16 emu anyways :)
Yeah that makes sense. I can use that in my current emu project. Thanks! :)
 

· クロスエクス
Joined
·
4,890 Posts
Because I had to give it a try too mostly to learn about video and sound output...
After quite some work, then after a ton of more work to actually get some pictures I got this!



Just to see I was reading the sprite bytes wrong and how it hangs right there... :dead:



Now that looks more decent.
Also, it requires a D3D11 GPU. :p

#EDIT: Ooops, forgot... timers.

#EDIT2: Yay! With a thousand FPS points! :x3:



#EDIT3: Superrrr!

 

· クロスエクス
Joined
·
4,890 Posts
Question! I gotta go, so I'll post this before that. I still haven't read the entire thread though, sorry if this has been answered.

I was checking this demo/test...


I previously simply scaled whether super8 stuff was enabled or not. If enabled, display works like at 128x64 otherwise 64x32. Buuuut! This demo calls 0x00FE on startup and at the end scrolls down 1. But, the scrolling function works at 128x64 even with Super8 disabled. It also let me know that n=0 with Super8 disabled is still a big sprite (8x16).

So ma'question is, in the MegaChip, when this super/scroll functions are used, do they work at SuperChip resolution or MegaChip resolution? :dead:
 

· Premium Member
Joined
·
5,284 Posts
Um? What is Super8? You mean Super Chip?
And for MegaChip do you mean new extension (2007) or SuperChip?

There are three different virtual machines:
Chip8 (Original)
SuperChip (Extension)
MegaChip (Extension, but the author did not bother to release official emulator for 5 years, ignore it).
 

· クロスエクス
Joined
·
4,890 Posts
My apologies for the terms used. When I used "super8" and "Super8" though I thought to refer to the SuperChip from the first post, I actually just refer to 0x00FE and 0x00FF of said SuperChip. When I mentioned MegaChip, I meant as the MEGAChip mentioned in the first post.

I'll refrain from making such confusing and silly questions, my apologies again.
 
441 - 460 of 486 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top