Page 105 of 106 FirstFirst ... 55595103104105106 LastLast
Results 1,041 to 1,050 of 1054

Thread: Chip 8

  1. #1041
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    25
    Mentioned
    0 Post(s)
    Quote Originally Posted by Okabe View Post
    I didn't know the console wasn't 100% reliable. Thank you for the info

    I've never heard about "dump" before, after a little research with the terms "dump java" on google I see "thread dump" and "head dump" appearing a lot.

    Is that what you're talking about ?

    All the char cast are definitely a pain in the ass but the console of processing specificly told me to do so and won't "compile" if I don't.

    You are right about " V[x] += V[x] + kk;" I should have kept it, my bad :p

    the random() function comes from processing, I tried to include <stdlib,h> but the console give me the error "unexpected token: class"

    I really feel like my problem comes from my misunderstanding of processing.

    Ohh no a dump is just a text file where you log your instructions
    The IDE shouldn't dictate what you do. Type casting (forcing a variable type different that the one you originally declared) shouldn't be an issue.

    Type casting works like this. You say int var = 256;
    if you try to print the value it will be in fact be 256
    now if you cast it (char)var that will produce the ASCII character number 256 (which is an blank space)
    as far as i see that's your problem along with the adding on top. You can get rid of your

    it was dot on the include my bad try wth
    #include <stdlib.h>

  2. #1042
    EmuTalk Member
    Join Date
    Jun 2017
    Posts
    10
    Mentioned
    0 Post(s)
    After more research about the "dump" you were talking about I think I found what that is.

    Is that this ? https://msdn.microsoft.com/en-us/library/d5zhxt22.aspx

  3. #1043
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    25
    Mentioned
    0 Post(s)
    Wait a second! why are you using char for opcode!

  4. #1044
    EmuTalk Member
    Join Date
    Jun 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Including the line "#include <stdlib.h>" gave me the error: unexpexted char: "i"

    Thank you for you explanation about type casting, I tried to change every "char" into "int" and it worked....but it didn't change my problem :p

    But at least, I know that I don't need to use "char" contrarely to what I thought.

  5. #1045
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    25
    Mentioned
    0 Post(s)
    I meant a dump like a log. just logging your println functions.
    Dude i'm concerned about your (char) all over your code are killing your functionality

    it's like declaring something and asking for other thing. that's why typecasting is dangerous. go back to the drawing board cause your code should work without needing it to typecast like that... i'm a little rusty as i'm currenlty working on gameboy, but let me see if i can find the resource doc i used

    - - - Updated - - -

    I mean you don't use (char) nor (int) at all... you just let the compiler work with your declared variable type

    - - - Updated - - -

    http://www.multigesture.net/articles...8-interpreter/ look at the Fetch opcode.
    If you use a char variable for opcode whenever you shift, you should be getting rid of a part of your actual opcode. The only reason you are getting away with it is cause your are type casting hard... like telling the compiler... "Nah dude just use whatever it fits" instead of what you intended. As a side effect it seems you are indeed catching the start of the opcode but not the rest of the content

    1201 a full opcode could be interpreted on your end as 1200 that's why i posted a log of my execution before.
    also the program counter should also be a short variable.

    btw dont use char use unsigned char and unsigned short to tell the compiler you are only allowing positive numbers
    Last edited by ]-[ D X; June 9th, 2017 at 01:27.

  6. #1046
    EmuTalk Member
    Join Date
    Jun 2017
    Posts
    10
    Mentioned
    0 Post(s)
    I don't know how to log my println in a file but I'll check that out.

    I used char for opcode because from what I remember of my research about chip8 emulation, I thought I had to use unsigned type for opcodes otherwise the bit shifting would possibly be more complex and because you could possibly get a value too high (above 255) that wouldn't be recognized by the chip8.

    But I tried to get rid of every char, since you told me that those type casting could be the problem.
    It didn't break my emulator, but it didn't solve the problem neither.

    I made a second folder with my chip8 emaulator without any char.
    https://github.com/Okarin85/Chip8-Pr..._2/Chip8_2.pde

    I couldn't get rid of the int cast at the line 38 because if I do, I get the error : unexpected token: int
    I couldn't get rid of the int cast at the line 75 because the random() function return a float, if I try without casting randomNumber in a int, it gives me the error : The operator & is undefined for the argument type(s) float, int

    If I use a short for the variable pc I got an error at the line 49.
    It says : "cannot convert from int to short"

    It's because at the line 49, I'm setting "pc" to the value of "nnn".
    pc = nnn;

    and the variable nnn can only be an int since it results from the operator "&"
    int n = opcode & 0x000F;

    I think you're right to be concerned about all of those type casting.
    it confuses me a lot but believe me, I didn't came out with all those type casting on my own.
    It's the results of all my attempts to fix the errors that processing is giving me.

    I greatly appreciate the time and the effort you gave to help me with this but I'm done with processing :p
    I going to try to make my emulator with c and sdl.
    Since you did a lot to help me, I'll keep you inform of my progress on this.

    Thank you very much ]-[ D X

  7. #1047
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    25
    Mentioned
    0 Post(s)
    Just for documenting Sake:
    We already solved the issue

    The problem was that he was updating the program counter after the switch, this effectively ruined the program counter for Jump instructions as it was moving the program counter more than once per JUMP

    Summary:

    Dont do this
    switch (opcode) {
    case : 0x0
    break;
    .
    .
    .case n
    break;

    pc += 2; // this will mess your jump instructions and possibly others

    }
    //instead update the counter in their own body

  8. #1048
    EmuTalk Member
    Join Date
    Sep 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Hoi



    I started an Chip8 emulator in VB and it's looking not that bad (no keyboard/sound, but the rest is implemented)
    But tetris has an odd behavior: Instead of moving DOWN my blocks are alternating left to right and the scoring display is f*cked up?!
    See at https://imgur.com/a/JMCkx

    Other games like Pong, Maze etc look ok.

    I read my opcodes atleast twice and they all look ok to me. Any suggestions what might be wrong?

  9. #1049
    EmuTalk Member
    Join Date
    Nov 2017
    Posts
    2
    Mentioned
    0 Post(s)
    Hey guys,

    I just found this thread while googling for "Chip8 frequency" really nice to see such big community experimenting with their emu101.
    I'm currently trying to fix bugs in my code. I've write it in Java + libgdx, it's complete function wise but still many games do glitch on me. Some simple games are playable already like pong or additions problem. But I'm still struggling with a Animal race and Airplanes. Will try to fix it with time and also read on this huge topic.

    If someone would be interested in checking the code it's here https://github.com/kinder112/chip8 should be also quite easy to build and run.

    Also Tetris fails for me similar to person above, probably some common gotcha? Will try to read previous pages maybe I'll find something to help me there

    With regards,
    Pawel
    Last edited by kinder112; November 5th, 2017 at 16:46.

  10. #1050
    Administrator & Programmer Danny's Avatar
    Join Date
    Nov 2005
    Posts
    894
    Mentioned
    18 Post(s)

    Thumbs up My final & best Chip8 Emulator

    I just wrote another Chip8 Emulator to prepare me for the GameBoy

    I started my GameBoy Emulator, but was very rusty, so I did this to shake off the cobwebs.
    Ironically enough, this is my best Chip8 Emulator to date! (I've made a few).

    It offers 100% compatibility with all the games I tested (69). Now on to the challenge of the GameBoy (been waiting for this day for 15 years now...).

    I hope my Emulator is of help to some of you.

    Compatible Games:

    • 15 Puzzle [Roger Ivie],
    • Addition Problems [Paul C. Moews],
    • Airplane,
    • Animal Race [Brian Astle],
    • Astro Dodge [Revival Studios, 2008],
    • Biorhythm [Jef Winsor],
    • Blinky [Hans Christian Egeberg, 1991],
    • Blitz [David Winter],
    • Bowling [Gooitzen van der Wal],
    • Breakout (Brix hack) [David Winter, 1997],
    • Breakout [Carmelo Cortez, 1979],
    • Brick (Brix hack, 1990),
    • Brix [Andreas Gustafsson, 1990],
    • Cave,
    • Coin Flipping [Carmelo Cortez, 1978],
    • Connect 4 [David Winter],
    • Craps [Camerlo Cortez, 1978],
    • Deflection [John Fort],
    • Figures,
    • Filter,
    • Guess [David Winter],
    • Hidden [David Winter, 1996],
    • Hi-Lo [Jef Winsor, 1978],
    • Kaleidoscope [Joseph Weisbecker, 1978],
    • Landing,
    • Lunar Lander (Udo Pernisz, 1979),
    • Mastermind FourRow (Robert Lindley, 1978),
    • Merlin [David Winter],
    • Missile [David Winter],
    • Most Dangerous Game [Peter Maruhnic],
    • Nim [Carmelo Cortez, 1978],
    • Paddles,
    • Pong (1 player),
    • Pong 2 (Pong hack) [David Winter, 1997],
    • Pong [Paul Vervalin, 1990],
    • Programmable Spacefighters [Jef Winsor],
    • Puzzle,
    • Reversi [Philip Baltzer],
    • Rocket [Joseph Weisbecker, 1978],
    • Rocket Launcher,
    • Rocket Launch [Jonas Lindstedt],
    • Rush Hour [Hap, 2006],
    • Russian Roulette [Carmelo Cortez, 1978],
    • Sequence Shoot [Joyce Weisbecker],
    • Shooting Stars [Philip Baltzer, 1978],
    • Slide [Joyce Weisbecker],
    • Soccer,
    • Space Flight,
    • Space Intercept [Joseph Weisbecker, 1978],
    • Space Invaders [David Winter],
    • Spooky Spot [Joseph Weisbecker, 1978],
    • Squash [David Winter],
    • Submarine [Carmelo Cortez, 1978],
    • Sum Fun [Joyce Weisbecker],
    • Syzygy [Roy Trevino, 1990],
    • Tank,
    • Tapeworm [JDR, 1999],
    • Tetris [Fran Dachille, 1991],
    • Tic-Tac-Toe [David Winter],
    • Timebomb,
    • Tron,
    • UFO [Lutz V, 1992],
    • Vers [JMN, 1991],
    • Vertical Brix [Paul Robson, 1996],
    • Wall [David Winter],
    • Wipe Off [Joseph Weisbecker],
    • Worm V4 [RB-Revival Studios, 2007],
    • X-Mirror,
    • ZeroPong [zeroZshadow, 2007],


    Screenshots:













    Source Code:

    The Emulator is written in C++ and uses SDL2 for Input & Windowing and OpenGL for rendering.

    Get it on GitHub
    Proud Administrator Of Emutalk.net

    * I develop software for: iOS, Android, Mac, Linux & Windows.
    * Proficient in C#, C, C++, Objective-C, Java, Swift, Lua. Also know some: PHP.

    Want to help EmuTalk? Want us to relive the glory days of old? Ping me, I would love to hear your ideas


Page 105 of 106 FirstFirst ... 55595103104105106 LastLast

Similar Threads

  1. Nintendo DS specifications leaked
    By Gorxon in forum Gaming
    Replies: 37
    Last Post: June 25th, 2004, 22:16
  2. C&T 69000 video chip
    By Knuckles in forum TechTalk
    Replies: 4
    Last Post: June 16th, 2003, 00:43
  3. Rice's Daedalus 5.0.0 source code
    By Rice in forum 1964
    Replies: 19
    Last Post: June 15th, 2003, 09:39
  4. Replies: 18
    Last Post: December 7th, 2002, 10:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •