Hacking WIP Swip8 - A simple CHIP8 Switch emu

  • Thread starter Thread starter josala97
  • Start date Start date
  • Views Views 5,107
  • Replies Replies 14
  • Likes Likes 9

josala97

New Member
Newbie
Joined
Feb 21, 2018
Messages
4
Reaction score
12
Trophies
0
Age
29
Location
Badajoz, España
XP
131
Country
Spain
Hi, i'm currently developing a chip8 emu for switch, i dont have any switch on 3.0.0 to try this out, so if someone wants to give it a try, it would be highly apreciated.

Actually, it has just PONG rom support but this is the first step i will attempt on Switch emu, if I'm able to make this fully working, i will attempt to port a GB/GBC emu as my next project.

Seems that i can post links because im a newfag, so you can download it from my git, who is currently on my signature or in my git: jgallardst/swip8

First homebrew attempt since i developed some things in DS Systems, feedback highly appreciated.
 
Well done on the emulator, but please don't use terms like "newfag". That shit should be left to rot in the depths of 4chan.
Let it rot in those the depth of the wooden barrels of 4chan, were it will age well and come back as the finest selection of memes, ready for dégustation.

fc,550x550,white.jpg

Talking about programming memes, won't somebody implement a very well compressed bad apple variant for Nintendo Switch? :wink: :wink: <- Yes, that is a suggestion.
 
  • Like
Reactions: PaBo
Hi, i'm currently developing a chip8 emu for switch, i dont have any switch on 3.0.0 to try this out, so if someone wants to give it a try, it would be highly apreciated.

Actually, it has just PONG rom support but this is the first step i will attempt on Switch emu, if I'm able to make this fully working, i will attempt to port a GB/GBC emu as my next project.

Seems that i can post links because im a newfag, so you can download it from my git, who is currently on my signature or in my git: jgallardst/swip8

First homebrew attempt since i developed some things in DS Systems, feedback highly appreciated.
Could you include a precompiled version?
 
Code:
void DRWVxVyn(){
#ifdef LOG
    printf("DRWVxVyn \n");
#endif
    c.V[0xF] = 0;
    for(int i = 0; i < n(c.opcode); i++){
        for(int j = 0; j < 8; j++){
            if((c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] + ((c.memory[c.I+i] & (0x01 << (7-j))) >> (7-j))) > 1)
            {
                c.V[0xF] = 1;
                c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] = 0;
            }
            else if((c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] + ((c.memory[c.I+i] & (0x01 << (7-j))) >> (7-j))) == 1)
            {
                c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] = 1;
            }
            else if((c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] + ((c.memory[c.I+i] & (0x01 << (7-j))) >> (7-j))) == 0)
            {
                c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] = 0;
            }
        }
    }
    c.draw = 1;
    c.PC += 2;
}

Ouch. The code's pretty good, but some sections need a serious cleanup!
This specific subroutine, for example, contains quite a bit of redundant code.
 
Last edited by SimonMKWii,
  • Like
Reactions: TiMeBoMb4u2
Could you include a precompiled version?

Precompiled version is available on git, but, sadly, i cant still post links

Code:
void DRWVxVyn(){
#ifdef LOG
    printf("DRWVxVyn \n");
#endif
    c.V[0xF] = 0;
    for(int i = 0; i < n(c.opcode); i++){
        for(int j = 0; j < 8; j++){
            if((c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] + ((c.memory[c.I+i] & (0x01 << (7-j))) >> (7-j))) > 1)
            {
                c.V[0xF] = 1;
                c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] = 0;
            }
            else if((c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] + ((c.memory[c.I+i] & (0x01 << (7-j))) >> (7-j))) == 1)
            {
                c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] = 1;
            }
            else if((c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] + ((c.memory[c.I+i] & (0x01 << (7-j))) >> (7-j))) == 0)
            {
                c.gfx[(c.V[x(c.opcode)]+j)%64][c.V[y(c.opcode)]+i] = 0;
            }
        }
    }
    c.draw = 1;
    c.PC += 2;
}

Ouch. The code's pretty good, but some sections need a serious cleanup!
This specific subroutine, for example, contains quite a bit of redundant code.

I will refactor and cleanup the code ASAP, but i will try to make it fully functional first. Regards.
 
  • Like
Reactions: Masterwin
Precompiled version is available on git, but, sadly, i cant still post links



I will refactor and cleanup the code ASAP, but i will try to make it fully functional first. Regards.
I wasn't able to find a precompiled one on the git. You can quote this text in your OP if you want. I'm attaching the .nro

--------------------- MERGED ---------------------------

Also. 3 times in a row I've just crashed with 2162-0002
 

Attachments

  • Like
Reactions: Masterwin
I wasn't able to find a precompiled one on the git. You can quote this text in your OP if you want. I'm attaching the .nro

--------------------- MERGED ---------------------------

Also. 3 times in a row I've just crashed with 2162-0002

No work for me 2162-0002
 
Hi, i'm currently developing a chip8 emu for switch, i dont have any switch on 3.0.0 to try this out, so if someone wants to give it a try, it would be highly apreciated.

Actually, it has just PONG rom support but this is the first step i will attempt on Switch emu, if I'm able to make this fully working, i will attempt to port a GB/GBC emu as my next project.

Seems that i can post links because im a newfag, so you can download it from my git, who is currently on my signature or in my git: jgallardst/swip8

First homebrew attempt since i developed some things in DS Systems, feedback highly appreciated.

Good job at attempting to create a homebrew. Just understand people will judge you based on your attitude wherever you post online. Try to avoid to any foul languages and people will respect you.

Kudos on your work! Keep it coming.
 
I wasn't able to find a precompiled one on the git. You can quote this text in your OP if you want. I'm attaching the .nro

--------------------- MERGED ---------------------------

Also. 3 times in a row I've just crashed with 2162-0002

Is something related with the framebuffer and also rom loader is still bad, i'm working on it and will try to fix it ASAP.
 

Site & Scene News

Popular threads in this forum