Hacking WIP Swip8 - A simple CHIP8 Switch emu

josala97

New Member
OP
Newbie
Joined
Feb 21, 2018
Messages
4
Trophies
0
Age
27
Location
Badajoz, España
XP
111
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.
 

sarkwalvein

There's hope for a Xenosaga port.
Member
Joined
Jun 29, 2007
Messages
8,515
Trophies
2
Age
41
Location
Niedersachsen
XP
11,269
Country
Germany
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

punderino

aka Big-PeePee Swinger
Member
Joined
Jan 5, 2016
Messages
1,247
Trophies
0
Age
33
Location
Kansas City, Missouri
Website
www.anus.trade
XP
2,545
Country
United States
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?
 

SimonMKWii

Professional Idiot
Member
Joined
Nov 18, 2017
Messages
666
Trophies
0
Location
Melbourne, Victoria
XP
2,760
Country
Australia
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

josala97

New Member
OP
Newbie
Joined
Feb 21, 2018
Messages
4
Trophies
0
Age
27
Location
Badajoz, España
XP
111
Country
Spain
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

punderino

aka Big-PeePee Swinger
Member
Joined
Jan 5, 2016
Messages
1,247
Trophies
0
Age
33
Location
Kansas City, Missouri
Website
www.anus.trade
XP
2,545
Country
United States
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

  • swip8.zip
    39 KB · Views: 181
  • Like
Reactions: Masterwin

Masterwin

Well-Known Member
Member
Joined
Jan 7, 2016
Messages
382
Trophies
0
XP
603
Country
Spain
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
 

nightking

Well-Known Member
Newcomer
Joined
Jul 17, 2008
Messages
55
Trophies
0
XP
352
Country
United States
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.
 

josala97

New Member
OP
Newbie
Joined
Feb 21, 2018
Messages
4
Trophies
0
Age
27
Location
Badajoz, España
XP
111
Country
Spain
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

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    +1
  • BakerMan @ BakerMan:
    fellas
  • BakerMan @ BakerMan:
    would you rather have a 9-5 desk job with poor pay or work for an intergalactic space militia with no guarantee of being paid?
  • BakerMan @ BakerMan:
    basically, normal boring job or halo and/or helldivers irl
    BakerMan @ BakerMan: basically, normal boring job or halo and/or helldivers irl