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,512
Trophies
2
Age
41
Location
Niedersachsen
XP
11,247
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
32
Location
Kansas City, Missouri
Website
www.anus.trade
XP
2,523
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
32
Location
Kansas City, Missouri
Website
www.anus.trade
XP
2,523
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
    BigOnYa @ BigOnYa: Ok good chatting, I'm off to the bar, to shoot some pool, nighty night. +1