Page 7 of 9 FirstFirst ... 56789 LastLast
Results 61 to 70 of 84

Thread: Space Invaders

  1. #61
    Moderator Remote's Avatar
    Join Date
    Jan 2002
    Location
    Stockholm
    Posts
    2,284
    Mentioned
    1 Post(s)
    Still waiting for a well written tutorial on the subject
    MCMLXXXIII

  2. #62
    EmuTalk Member TRS's Avatar
    Join Date
    Jan 2002
    Location
    Emmen
    Posts
    67
    Mentioned
    0 Post(s)
    I wouldn't recommend using the OnPaint-event for graphical output. Sure it can be done, I did so in my first version of a NES-emulator, but since emulating these 'simple' system will most likely leave you with loose pixels being generated, no objects. The only way I could think of was to generate a bitmap and render this on screen. It works, but is slow as hell.

    You'd be better of start reading XNA. This will give you all you need to render simple systems and eventually maybe more advanced systems and is way simpler to learn and more natural in combination with C# then DirectX or OpenGlide.
    DubbingIssaMuss

  3. #63
    EmuTalk Member
    Join Date
    May 2013
    Posts
    5
    Mentioned
    0 Post(s)
    I have used XNA for a long time, and yes, it is a lot easier to use. But I'm trying to make it in pure C# (if possible) as a challenge. OnPaint is ridiculously slow, I know, but for SI I don't think that would be a big problem, right ? Thanks for the answer, but I'm still waiting for some instructions regarding drawing on the screen.

  4. #64
    EmuTalk Member TRS's Avatar
    Join Date
    Jan 2002
    Location
    Emmen
    Posts
    67
    Mentioned
    0 Post(s)
    What kind of instructions are you looking for? Like I said in my previous post, generate a bitmap and render it on screen.

    If you need a full code example, do a little google search and you should have tons of examples .

    [EDIT]
    What is pure C# in your opinion? XNA is nothing more then an extension on the .Net framework so it still would be pure c# imho.
    [/EDIT]
    Last edited by TRS; May 21st, 2013 at 18:40.
    DubbingIssaMuss

  5. #65
    EmuTalk Member
    Join Date
    May 2013
    Posts
    5
    Mentioned
    0 Post(s)
    TRS, thanks for the reply, I managed to get it working. Now I'm having another head scratching problem. Until the game gets to the attract mode (demo play ?) it runs just fine, draws everything without a problem. But as I've seen in another emulator, the screen is cleared (mid part only) and then the demo starts. Mine is not clearing and it overlaps images and then crashes. Debbuging I've seen that my code runs until the address 0x1421 (which is a return). But my pop is returning a strange value (0x23f0 if I'm not mistaken) It seems to me that it is pushing but not popping some value.

    From CA:

    Code:
    1400: 00              NOP                         ; Time/size pad to match CPL in EraseShiftedSprite
    1401: CD 74 14        CALL    CnvtPixNumber       ; Convert pixel number to coord and shift
    1404: 00              NOP                         ; Time/size pad to match CPL in EraseShiftedSprite
    1405: C5              PUSH    BC                  ; Hold count
    1406: E5              PUSH    HL                  ; Hold start coordinate
    1407: 1A              LD      A,(DE)              ; Get the picture bits
    1408: D3 04           OUT     ($04),A             ; Store in shift register
    140A: DB 03           IN      A,($03)             ; Read the shifted pixels
    140C: B6              OR      (HL)                ; OR them onto the screen
    140D: 77              LD      (HL),A              ; Store them back to screen
    140E: 23              INC     HL                  ; Next colummn on screen
    140F: 13              INC     DE                  ; Next in picture
    1410: AF              XOR     A                   ; Shift over ...
    1411: D3 04           OUT     ($04),A             ; ... to next byte in register (shift in 0)
    1413: DB 03           IN      A,($03)             ; Read the shifted pixels
    1415: B6              OR      (HL)                ; OR them onto the screen
    1416: 77              LD      (HL),A              ; Store them back to screen
    1417: E1              POP     HL                  ; Restore starting coordinate
    1418: 01 20 00        LD      BC,$0020            ; Add 32 ...
    141B: 09              ADD     HL,BC               ; ... to coordinate (move to next row)
    141C: C1              POP     BC                  ; Restore count
    141D: 05              DEC     B                   ; All done?
    141E: C2 05 14        JP      NZ,$1405            ; No ... go do all rows
    1421: C9              RET                         ; Done
    Some parts of the code:

    Code:
    private void POP(ref ushort reg)
            {
                reg = ReadWord(SP.Value);
                SP.Value += 2;
                cycles += 10;
            }
    
            private void PUSH(ushort reg)
            {
                SP.Value -= 2;
                WriteWord((ushort)(SP.Value), reg);
                cycles += 11;
            }
            private void CALL()
            {
                PUSH((ushort)(PC.Value + 2));
                PC.Value = ReadWord(PC.Value);
                cycles += 6;
            }
           private void RET()
            {
                POP(ref PC.Value);
            }
    I'm not pretty of what's happening, I think it might be somewhere around those codes.

    Thanks for the help

  6. #66
    EmuTalk Member
    Join Date
    Sep 2004
    Posts
    57
    Mentioned
    0 Post(s)
    I made a Space Invaders emulator with C++:

    * 8080 CPU emulation
    * 8080 disassembler
    * using GDI for display,
    * windows API for keyboard
    * windows API for sound
    * compile with CodeBlock + mingw

    Current progress:



    * 8080 CPU 100%
    * GFX 100%
    * AUDIO 100%
    * INPUT 100%




    Emulator binary and source code download:
    Last edited by suanyuan; October 14th, 2013 at 14:45.

  7. #67
    Moderator Remote's Avatar
    Join Date
    Jan 2002
    Location
    Stockholm
    Posts
    2,284
    Mentioned
    1 Post(s)
    Are you working on a tutorial?
    MCMLXXXIII

  8. #68
    Administrator & Programmer Danny's Avatar
    Join Date
    Nov 2005
    Posts
    878
    Mentioned
    14 Post(s)
    Wow, last post was a while ago now!

    I have just started my Space Invaders emulator, after completing the Chip8 emulator (will add in SChip support when I feel like it).
    I'll update as I progress (or get stuck )
    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

  9. #69
    Does Chip8 need effects?! shutterbug2000's Avatar
    Join Date
    Nov 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quote Originally Posted by Zack View Post
    Wow, last post was a while ago now!

    I have just started my Space Invaders emulator, after completing the Chip8 emulator (will add in SChip support when I feel like it).
    I'll update as I progress (or get stuck )
    Going to make a Space Invaders emulator for android, using LibGDX. I'll be posting here as well .

  10. #70
    Administrator & Programmer Danny's Avatar
    Join Date
    Nov 2005
    Posts
    878
    Mentioned
    14 Post(s)
    Quote Originally Posted by shutterbug2000 View Post
    Going to make a Space Invaders emulator for android, using LibGDX. I'll be posting here as well .
    Let me know if you find any good docs on the cpu instructions.

    Hap's doc in the first post is good, as is this one: http://www.emulator101.com.s3-websit...080-by-opcode/
    They are a little vague on how one should set the flags though i feel?
    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 7 of 9 FirstFirst ... 56789 LastLast

Similar Threads

  1. help with space channel 5
    By Tails Prower in forum Chankast
    Replies: 2
    Last Post: October 30th, 2004, 11:41
  2. how to manage for the memory space?
    By swings in forum Chankast
    Replies: 4
    Last Post: July 8th, 2004, 12:49
  3. Bug found in Space Station Silicon Valley [E]
    By -Shadow- in forum General Nintendo 64 Emulation Discussion
    Replies: 0
    Last Post: May 22nd, 2004, 13:14
  4. Backfacing culling in ****geneous space?
    By Orkin in forum Emulator Programming
    Replies: 6
    Last Post: January 12th, 2004, 09:36

Posting Permissions

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