Page 103 of 106 FirstFirst ... 35393101102103104105 ... LastLast
Results 1,021 to 1,030 of 1058

Thread: Chip 8

  1. #1021
    Moderator smcd's Avatar
    Join Date
    Jun 2004
    Posts
    2,533
    Mentioned
    0 Post(s)
    @marco9999 interesting! I never got around to trying that myself (had same idea, very simple instruction set for a first attempt at translating instructions to native code)


  2. #1022
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    23
    Mentioned
    0 Post(s)
    Any gurus of Chip8 still left over here. My counter on pong is refusiong to go up
    Now... My call font memory address opcode is good as it shows LEVEL 01 correctly on BLITZ

    I think my culprit could be at the fill registers or store in registers from I, but comparing my source to other projects it looks the same

    My next darts are for the BCD opcode FX33

    now... My way of doing is pretty awful basically truncating variables
    Number / 100 stored on an INT type variable should give me the hundredth, (Number - hundredth var ) / 10
    should give me the Dec and the rest is the Unity number

    Am I assuming this wrong? is there a prettier/cleaener way of doing it? haha

  3. #1023
    EmuTalk Member
    Join Date
    Nov 2015
    Posts
    3
    Mentioned
    1 Post(s)
    Hi, truncating values is ok (if it makes sense to do it) - most emulators will do this at some point.

    The BCD formula should look like this, check this first. I noticed that you said for the tens you use (number - hundreds variable). This probably works but try using the modulo operator (%) to get the remainder (see example below), in case you have an error in your code.

    hundreds at address I = number / 100
    tens at address I+1 = number % 100 / 10
    ones at address I+2 = number % 100 % 10 / 1 (<-- omit the divide by 1 if you wish.)

    If you want to get the tens by (number - hundreds variable), the BCD formula should look like this:

    hundreds at address I = number / 100
    tens at address I+1 = (number - hundreds * 100) / 10
    ones at address I+2 = ((number - hundreds * 100) - tens * 10) / 1 (<-- omit the divide by 1 if you wish.)

    From memory, I points to a single byte of data (ie: storing the BCD takes 3 bytes). If I remember correctly, the I value should not be changed after the opcode has run.

    The BCD is then used by the draw sprite opcode (from the wikipedia article):

    "Draws a sprite at coordinate (VX, VY) that has a width of 8 pixels and a height of N pixels. Each row of 8 pixels is read as bit-coded starting from memory location I; I value doesn’t change after the execution of this instruction. As described above, VF is set to 1 if any screen pixels are flipped from set to unset when the sprite is drawn, and to 0 if that doesn’t happen", but since you said you can display level 1 correctly, it shouldn't be this.

    If you cant find the problem in any of these areas, maybe try posting the source code if you can and I'll take a look.

  4. #1024
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    23
    Mentioned
    0 Post(s)
    oh!!! yOU SOLVED IT! ahahha I totally forgot about multiplying back the hundredth and tens variable for calculations. Whooops! Thanks a lot Marco!

  5. #1025
    EmuTalk Member
    Join Date
    Aug 2012
    Posts
    12
    Mentioned
    2 Post(s)
    Hey, guys. I have a interesting project I'm working on that's a continuation of my CHIP-8 emulator. I'll try to have something on github soon.

  6. #1026
    EmuTalk Member
    Join Date
    Aug 2012
    Posts
    12
    Mentioned
    2 Post(s)
    Here we go. One server sided multiplayer chip 8 emulator for NodeJS.
    https://github.com/CyanPrime/Cyan8

    I could use some help with making the code more optimal and better looking. If anyone wants to take a look and give me some ideas, that'd be awesome!

  7. #1027
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    23
    Mentioned
    0 Post(s)
    Cool Idea Cyan. Sadly my current schedule doesn't allow me to participate.

    A little update on my project:

    After a couple rides on the morning train, i've finally implemented some touch buttons, and a rudimentary register debugger. Now my question is... How should i go about advancing one step at a time. Most of my cases control the flow of the program with Pc+=2 or 4 and I can't really figure a way of advancing only one instruction at a given time.

    So far I've tried Hi-jacking the opcode fetching instruction and linking it to a boolean activation of one of my on screen buttons, but that doesn't seem to cut it...
    Sorry, but that's as far as I have went... Morning rides are a bit on the short side and i don't have much time to code (I exclusively code on my phone using C4droid)

    So that's that... Behold Chip4droid running on an overkill One plus 3 phone haha


    Edit** HOHO figured it out I isolated the whole opcode fetcher + decoder method behind an if state to check for a boolean variable controlled by the touch of the button
    //Editing in case anyone ever (unlikely) finds himself in the same spot
    Last edited by ]-[ D X; September 4th, 2016 at 03:43. Reason: Solving + documenting

  8. #1028
    EmuTalk Member
    Join Date
    Jun 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Hi everyone.

    I'm trying to make a chip8 emulator with processing, my first goal is to run MAZE since it's the most simple rom that I found.

    Unfortunetly, I'm stuck with this result.



    As you can see, I get to draw the two sprite well but one of them is draw much more frequently.

    As much as I checked my code, I couldn't find what I did wrong.

    Your help will be appreciated.

    Here's my code : https://github.com/Okarin85/Chip8-Pr...hip8/Chip8.pde

  9. #1029
    EmuTalk Member
    Join Date
    Aug 2016
    Posts
    23
    Mentioned
    0 Post(s)
    thats a pretty simple maze if you ask me haha. i'll take a look

    - - - Updated - - -

    look at your 0x3000 case
    if the condition is met it should skip the next instruction so... pc+=4
    this should be changed anywhere it directs you to skip
    good luck =)
    Last edited by ]-[ D X; June 8th, 2017 at 21:24.

  10. #1030
    EmuTalk Member
    Join Date
    Jun 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Thank you for your quick reply ]-[ D X

    At the end of my switch, I have another pc+=2.

    So if the condition is met, it already increase the pc by 4.

    I tried your solution anyway and got this result.

    Last edited by Okabe; June 8th, 2017 at 22:03.

Page 103 of 106 FirstFirst ... 35393101102103104105 ... 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
  •