Z64

Hacking => Programming => Topic started by: xdaniel on September 24, 2010, 10:46:39 PM

Title: Random junk
Post by: xdaniel on September 24, 2010, 10:46:39 PM
(http://imgur.com/gXAys.png)

Breakout in 64x32 (magnified) pixels! Guess what "system" this is.
Title: Re: Random junk
Post by: spinout on September 24, 2010, 11:23:37 PM
Chip-8?
Title: Re: Random junk
Post by: xdaniel on September 24, 2010, 11:37:13 PM
Yeah - and to clarify, the interpreter is my work, the Breakout clone sadly isn't. Should've mentioned that before, huh?

Whatever. Anyway, the program's the result of two or so hours of total, plain boredom. It uses SDL and SDL_ttf and is compatible with standard Chip-8 images, plus it supports two of the HP-48 opcodes (Fx75, Fx85). Might be putting together a GUI for it, might be adding SCHIP etc. support, will also pack up the source and post it one of these days.
Title: Re: Random junk
Post by: Arcaith on September 25, 2010, 06:17:23 AM
Oh lordy :D How many projects do you have now? You're as bad as I am XD Must be the name 'Daniel' or something XD
Title: Re: Random junk
Post by: SirTopHat on September 25, 2010, 03:32:49 PM
I've tried making a chip-8 emulator a few times but I just have no idea what to do, really.
Title: Re: Random junk
Post by: xdaniel on September 25, 2010, 04:17:10 PM
Arcaith: I don't even wanna count the projects :P  There's at least OZMAV2 and its libraries (libMISAKA, libbadRDP), the SF64 Toolkit, Azunyan-8 (this program) and probably a translation of Digimon D-Project for WonderSwan. And besides those, I messed with some other random SDL projects (a modification of a particle system example, a Jump'n Run engine, a RPG engine), Neo Azuria (the Pokemon Gen 1 map viewer), and most likely more random crap...

SirTopHat: Maybe this site helps: http://www.codeslinger.co.uk/ - (semi-)tutorials about coding emulators, with the Chip-8 and Game Boy ones being pretty interesting. I referenced the latter myself when I was coding my (rather crappy) GB emulator.

EDIT:
(http://imgur.com/HvP9c.png)(http://imgur.com/haujt.png)(http://imgur.com/SnTRX.png)(http://imgur.com/00g5y.png)(http://imgur.com/nECrB.png)

Nice, huh? But now: to bed. 5:18am. Wonderful -.-
Title: Re: Random junk
Post by: xdaniel on September 26, 2010, 01:08:13 PM
Cross-posting from EmuTalk (http://www.emutalk.net/showthread.php?p=435360#post435360):



(http://imgur.com/6fpA7.png)(http://imgur.com/d3wXO.png)
(http://imgur.com/FNsLD.png)(http://imgur.com/py6b2.png)

- Written in C, using SDL, SDL_ttf and SDL_gfx
- Appears to be compatible with every regular Chip-8 game I've thrown at it

Download (Win32 binary): http://code.google.com/p/ozmav/downloads/detail?name=Azunyan8_v1.rar (http://code.google.com/p/ozmav/downloads/detail?name=Azunyan8_v1.rar)

Usage is simple; if the interpreter is started without any command line arguments, you get a file selection dialog (see screenshot 1) which allows you to open a Chip-8 program. In-game, you can press F11 to have a look at the remaining controls, while pressing F12 shows the about box and ESC exits the program. Here's hoping I didn't forget anything...



Source will be going up on the SVN sooner or later, also still gotta check if it builds under Linux...
Title: Re: Random junk
Post by: xdaniel on September 29, 2010, 04:29:50 PM
http://www.youtube.com/watch?v=53fKVEq5uRk

Showcasing the brand new disassembler - not that anyone would want to hack a Chip-8 ROM or whatever :P
Title: Re: Random junk
Post by: xdaniel on October 25, 2010, 07:09:57 PM
v3, Win32 build: http://code.google.com/p/ozmav/downloads/detail?name=Azunyan8_v3.rar

Also, source has been committed to the usual SVN, including - gasp - preliminary Wii support! It currently requires a USB keyboard for actually playing games (you can return to the loader with the Wiimote's Home button, tho), it has some sound problems in the form of a constant buzzing noise, and it's really not optimized for Wii usage at all at the moment (tiny font and all that) - basically, it works, but don't expect it to be pretty.


EDIT:
(http://imgur.com/BC1VH.png)

r205 (http://code.google.com/p/ozmav/source/detail?r=205): Overhauled Azunyan-8's GUI and window sizing code, now has a fixed window size of 640x480, less awkward zooming and a second, bigger font used for some primary GUI elements, which also works wonder for Wii support - all this makes the GUI much more usable on that system. Still no actual Chip-8 input without USB keyboard there, tho.
Title: Re: Random junk
Post by: xdaniel on November 27, 2010, 11:12:36 PM
Okay, let's see what other random junk there is...

The latest piece of junk, which worked properly for the first time less than half an hour ago - a really simple LiveJournal client (C#, .NET Compact Framework v1-something) for M$' Pocket PC 2002, the ancient OS running on my bought-for-cheap-at-flea-market, battery-recently-replaced, waiting-for-PCMCIA-expansion-pack-coming-from-USA PDA, a Compaq iPAQ 3850:

(http://i.imgur.com/I0bTO.png)

Next, a kind of NES tile/nametable viewer - more or less just an experiment in SDL coding and trying to understand the NES PPU in preparation to writing a NES emulator (which I won't do, ex. exactly because of the PPU):

(http://i.imgur.com/VgF9n.png)
Title: Re: Random junk
Post by: SirTopHat on November 28, 2010, 12:07:34 AM
Thought I'd replied to this already.
I've had that site bookmarked for a long time, I'm going to write the emulator some day.
Title: Re: Random junk
Post by: xdaniel on November 28, 2010, 01:33:28 AM
Character encodings, codepages and the like suck. Spent 45 minutes trying to get ITLJ to properly post certain special characters to LJ - our German umlauts, for instance, ???????. It works now, the code sucks, but what the hell...

EDIT:

(http://i.imgur.com/0hu4Y.png)

...unsent drafts can now be saved on exit and are restorable on restart. Why am I working on this anyway? And especially at this time of the day? I'm a moron, huh~?

EDIT 2:

Added a program icon and put together an installer CAB archive (copying stuff to Programs, making a Start Menu entry and all) - now it looks like a real Pocket PC application!

...now to wait for the aforementioned PCMCIA expansion, so that I can actually use this "on the road" (like at flea markets or wherever) :P
Title: Re: Random junk
Post by: xdaniel on December 12, 2010, 02:58:45 AM
Starter Pokemon:

Name: Charmander (Charmander) (m)
Level: 5
HP: 19/19

OT: Kenta (ID: 32154)

Nature: Naughty

Attack:      12 (+)
Defense:     10 ( )
Sp.Attack:   11 ( )
Sp.Defense:  9 (-)
Speed:       11 ( )

Experience:  135 EXP (Group: Medium Slow)
To Next Lvl: 44 EXP
------------------------------------------------------------------------------

---------- pkdTestBattle(100) ----------
Now starting debug training; pushing Pokemon to level 100...

---------- Battle 1 ----------
Charmander, Level 5 VS Wild Bulbasaur, Level 6

Bulbasaur's turn:
Bulbasaur used DoubleSlap!
Charmander took 3 damage!
Bulbasaur -> HP: 23/23
Charmander -> HP: 16/19

Charmander's turn:
Charmander used Fire Punch!
Bulbasaur took 25 damage!
Bulbasaur fainted!
Charmander gained 54 EXP!
Charmander's level increased to 6!
~~~~~~~~~~~~~~~~~~~~
Attack:      14 (+)
Defense:     11 ( )
Sp.Attack:   12 ( )
Sp.Defense:  10 (-)
Speed:       13 ( )

Experience:  189 EXP (Group: Medium Slow)
To Next Lvl: 47 EXP
~~~~~~~~~~~~~~~~~~~~

---------- Battle 2 ----------


[...etc...]

---------- Debug training finished! ----------

Name: Charmander (Charmander) (m)
Level: 100
HP: 202/202

OT: Kenta (ID: 32154)

Nature: Naughty

Attack:      151 (+)
Defense:     121 ( )
Sp.Attack:   127 ( )
Sp.Defense:  101 (-)
Speed:       144 ( )

Experience:  1060131 EXP (Group: Medium Slow)
To Next Lvl: 9999999 EXP
------------------------------------------------------------------------------


Correct movesets are nonexistent - or, well, actually most moves are, just like most Pokemon, etc. The battle system's also not covering any damage modifiers outside of more simple things like STAB and type advantages, also PP depletion, and in turn Struggle when out of usable attacks aren't implemented, etc., but what's there should be accurate - experience calculation certainly is, that much I know.

And all logic so far is thanks to: http://bulbapedia.bulbagarden.net/wiki/Category:Game_mechanics
Title: Re: Random junk
Post by: Mallos31 on December 14, 2010, 04:36:01 AM
Ya know? I've been working on a pokemon game for a while now. Using the same things from Bulbapedia. Mine's still text based as well, but I'm working on figuring out how to use sprites and maps and the like. I seriously wish I could figure it out. I've got a good battle engine, the function for text, and a FF1-Style Pokemon Center. LOL
Title: Re: Random junk
Post by: xdaniel on January 06, 2011, 03:15:34 AM
01:09 am:

(http://i.imgur.com/JGwFG.png)

01:42 am:

(http://i.imgur.com/GQ1Y5.png)

04:06 am:

(http://i.imgur.com/0NJwC.png)

Good night. Game is the first Kunio-kun for GB, btw. You might know Kunio from River City Ransom or Nintendo World Cup for NES. Randomly looked at this (actually not all that good) game some four years back, hacked together a pretty bad level editor in VB6, now redoing it in C#, maybe even with stuff like enemy placement or something if I can find the data. Shouldn't be too difficult - if it's in any kinda sensical format - because the ROM's a mere 128KB in size.

C# feels like a weird little hybrid of C++ and VB... which is not a bad thing even, besides that it's officially of course M$ .NET Windows-only :P  I'm still way more at home with good old C, tho.

EDIT: Oh yeah, also messed with Azunyan-8's Wii support a bit yesterday, improved some stuff and got it halfway ready for input via Wiimote and Nunchuk.
Title: Re: Random junk
Post by: Marshall on January 06, 2011, 06:53:19 AM
...besides that it's officially of course M$ .NET Windows-only :P
No (http://"http://www.mono-project.com/").
Title: Re: Random junk
Post by: xdaniel on January 06, 2011, 12:34:36 PM
...besides that it's officially of course M$ .NET Windows-only :P
No (http://"http://www.mono-project.com/").
Emphasis on officially; it's not an official Microsoft project, is it?
Title: Re: Random junk
Post by: Marshall on January 06, 2011, 03:07:52 PM
...besides that it's officially of course M$ .NET Windows-only :P
No (http://"http://www.mono-project.com/").
Emphasis on officially; it's not an official Microsoft project, is it?
No it is not, but C# is not as closed and proprietary as you make it out to be, and Mono features a very feature complete implementation of it, as well as most of the .NET libraries (except for some Windows GUI stuff). Microsoft obviously wants people to use their programming language.
Title: Re: Random junk
Post by: xdaniel on January 06, 2011, 03:30:23 PM
Okay, sorry that I've been wrong. It's just that despite Mono, I (and probably others) still have the general notion of the whole thing being proprietary and all, because of how it originated at Microsoft... Reading up on it, tho, C# has apparently even been approved as ex. an ISO standard later on, so all the more reason to get rid of that notion.
Title: Re: Random junk
Post by: Marshall on January 06, 2011, 04:56:09 PM
Okay, sorry that I've been wrong. It's just that despite Mono, I (and probably others) still have the general notion of the whole thing being proprietary and all, because of how it originated at Microsoft... Reading up on it, tho, C# has apparently even been approved as ex. an ISO standard later on, so all the more reason to get rid of that notion.
Yes  :)

Start writing everything in C# where possible - you will find yourself with less headaches, and your (impressive) productivity will double. Plus it's easier on the newbies around here, who aren't too interested in learning what is basically a high level assembly language (C).
Title: Re: Random junk
Post by: xdaniel on January 08, 2011, 05:18:10 AM
(http://i.imgur.com/REiVw.png)

C# really is nice, yeah. The GUI so far would've probably taken ages with anything else, besides maybe VB.

Also, 06:16 am. Bedtime.

And also, that game's horribly unorganized internally :P
Title: Re: Random junk
Post by: xdaniel on January 11, 2011, 03:17:16 AM
(http://i.imgur.com/oBj4x.png)

Kunio's internals suck. So here's this little Mega Man GB thingy... No editing yet, but hopefully more or less trivial to implement.



EDIT: http://www.romhacking.net/forum/index.php/topic,12022.0.html
Title: Re: Random junk
Post by: xdaniel on January 27, 2011, 04:20:31 PM
http://magicstone.de/dzd/random/wily/WilysToolbox-v051.rar

(http://magicstone.de/dzd/random/wily/screenshot050.png)

Also, quoting myself quoting myself:

Quote
Bumping this because of v0.5.1 being released a few days ago, see first post, and a few new screenshots of features not yet public. Hope that's okay.

Quote
(http://i.imgur.com/Lf987.png)

Here's what the disabled menu entry "Show structure" is supposed to show once it's done - a representation of the current level in tree form. It's not yet showing objects, doesn't allow editing (not sure if I'll even implement that) and has a few bugs, so it's still a while off.

(http://i.imgur.com/2bcGAl.jpg) (http://imgur.com/2bcGA)

Block editor is nearly done, although the UI isn't exactly pretty and it still has some visual bugs.

Also interesting is the level-specific ASM code, which is responsible for things like conveyor belts or insta-kill spikes. It's pretty easy to make blocks with custom behaviours that way, as long as you know your way around GBZ80 assembler somewhat - like a block that, when stepping onto it, turns Mega Man invincible for a few seconds, by manually setting the invincibility counter in RAM that's used after being hit by an enemy.
Title: Re: Random junk
Post by: marshallh on January 28, 2011, 06:44:47 AM
Spent the past day slaving away trying to create something similar with MFC / VC++.

What a bitch. If only the c# ide wasn't so danged slow.
Title: Re: Random junk
Post by: xdaniel on January 28, 2011, 10:51:19 AM
Yeah, the VC# IDE is pretty awful in that regard. Especially the startup and loading a project takes ages, compared to ex. CodeBlocks and loading in the files of OZMAV2 plus libraries; editing, etc. isn't all that much better, either. Hell, the auto-correction/-completion tends to kick in after I've already fixed the offending line.
Title: Re: Random junk
Post by: xdaniel on February 27, 2011, 11:32:01 PM
(http://i.imgur.com/tWtpc.png)

Kinda felt like "righting the wrongs" I've done with my previous GB emulator, dunno how far I'll take this, tho. Can load ROMs and can execute approximately... five opcodes - thus the CPU core is even less than very, very incomplete; it doesn't even increase the PC correctly, as you can see with the LD opcode at 0x20D. Nevermind LCDC, timer, MBCx, input or sound emulation...

EDIT:
Log started 02.03.2011 00:57:59
0x0100: 00     - NOP                  | AF:01B0 BC:0013 DE:00D8 HL:014D | Z-HC
0x0101: C35001 - JP 0x0150            | AF:01B0 BC:0013 DE:00D8 HL:014D | Z-HC
0x0150: C30C02 - JP 0x020C            | AF:01B0 BC:0013 DE:00D8 HL:014D | Z-HC
0x020C: AF     - XOR A                | AF:0080 BC:0013 DE:00D8 HL:014D | Z---
0x020D: 21FFDF - LD HL, 0xDFFF        | AF:0080 BC:0013 DE:00D8 HL:DFFF | Z---
0x0210: 0E10   - LD C, 0x10           | AF:0080 BC:0010 DE:00D8 HL:DFFF | Z---
0x0212: 0600   - LD B, 0x00           | AF:0080 BC:0010 DE:00D8 HL:DFFF | Z---
0x0214: 32     - LDD (HL), A          | AF:0080 BC:0010 DE:00D8 HL:DFFE | Z---
0x0215: 05     - DEC B                | AF:0060 BC:FF10 DE:00D8 HL:DFFE | -NH-
0x0216: 20FC   - JR NZ, 0xFC          | AF:0060 BC:FF10 DE:00D8 HL:DFFE | -NH-
0x0214: 32     - LDD (HL), A          | AF:0060 BC:FF10 DE:00D8 HL:DFFD | -NH-
0x0215: 05     - DEC B                | AF:0040 BC:FE10 DE:00D8 HL:DFFD | -N--
0x0216: 20FC   - JR NZ, 0xFC          | AF:0040 BC:FE10 DE:00D8 HL:DFFD | -N--
0x0214: 32     - LDD (HL), A          | AF:0040 BC:FE10 DE:00D8 HL:DFFC | -N--
0x0215: 05     - DEC B                | AF:0040 BC:FD10 DE:00D8 HL:DFFC | -N--
0x0216: 20FC   - JR NZ, 0xFC          | AF:0040 BC:FD10 DE:00D8 HL:DFFC | -N--
0x0214: 32     - LDD (HL), A          | AF:0040 BC:FD10 DE:00D8 HL:DFFB | -N--
... ... ...


Well, among some other things, the CPU core's pretty much done, so Tetris runs long enough to shuffle tiles and the tilemap for the copyrights into RAM and the VBLANK interrupt is being fired periodically... so next up is probably more LCDC emulation and actual video output.
Title: Re: Random junk
Post by: xdaniel on March 02, 2011, 08:37:27 PM
(http://i.imgur.com/ZlQwH.png)

Game dies a horrible death shortly afterwards, tho...

EDIT: A few minor bugfixes, mainly in the CPU core, later...

(http://i.imgur.com/PjUz9.png)(http://i.imgur.com/s6NG5.png)(http://i.imgur.com/SQ7pl.png)(http://i.imgur.com/OQCkx.png)

Sprites and input aren't done yet, so nothing further to show here for now... Japanese version because I was under the impression that the western versions used a different MBC chip, which they don't; they also use the MBC1 and also run as far as this.

EDIT 2: Here we do have a case of MBC chip differences between versions:

(http://i.imgur.com/ixb64.png)(http://i.imgur.com/szZgr.png)

Japanese is MBC1, western versions are MBC3 I believe.

EDIT 3: Pokemon Red JPN, Kirby's Dreamland, Tetris and Super Mario Land:

(http://i.imgur.com/MuHZo.png)(http://i.imgur.com/cmQXi.png)(http://i.imgur.com/oD2lB.png)(http://i.imgur.com/sRBv8.png)(http://i.imgur.com/iNucy.png)

Bugs: Countless, what I know of is ex. missing sprite-to-sprite priority (my code seems broken), sprites and windows tend to flicker slightly, MBC1 external RAM handling probably broken (saving isn't in yet, but ex. Zelda doesn't even create a savegame), no FPS limit in place so everything runs too fast, etc., etc.

EDIT 4: MBC1 external RAM working now, forgot one call to the MBC1 memory writing function...

(http://i.imgur.com/K58iU.png)(http://i.imgur.com/e5ZBt.png)(http://i.imgur.com/JBw5A.png)

Screenshots 2 and 3 demonstrate some of the bugs I mentioned, namely the slight sprite/window flickering (see at the item selection cursor) and sprite-to-sprite priority (the boy standing on top of Link's head).
Title: Re: Random junk
Post by: Arcaith on March 04, 2011, 05:12:45 AM
Still, looking pretty impressive, dude :D

Got one question though; why is the window so big compared to the display area? Debug stuff that you've hidden?
Title: Re: Random junk
Post by: xdaniel on March 04, 2011, 05:10:44 PM
Nope, just hadn't worked on the GUI all that much before, so it looked more or less like crap :P

Here's some more recent screenshots:

(http://i.imgur.com/MRd3C.png)(http://i.imgur.com/qdgf5.png)(http://i.imgur.com/MF0sG.png)(http://i.imgur.com/v4Dhv.png)
Title: Re: Random junk
Post by: xdaniel on March 15, 2011, 03:24:33 AM
Random screenshots, from different days, blah:

(http://i.imgur.com/H7myM.png)(http://i.imgur.com/SJAsT.png)
(http://i.imgur.com/BY4hf.png)
(http://i.imgur.com/b5IoW.png)
Title: Re: Random junk
Post by: xdaniel on March 28, 2011, 06:18:01 PM
(http://i.imgur.com/qKQgm.png)(http://i.imgur.com/86VO9.png)(http://i.imgur.com/pouYH.png)(http://i.imgur.com/mhRSO.png)(http://i.imgur.com/V6cZl.png)

Pokemon Gold, Pokemon Crystal (GBC only), Tetris DX, Pocket Puyo Puyo 4 (GBC only) and R-Type DX.

Compatibility is kinda hit and miss - especially for GBC games -, some GUI-related things like the FPS limit and counter are iffy, etc., etc. Still, first release coming soon, tomorrow or something probably.

It's gone pretty far since this here, I suppose:

(http://i.imgur.com/ZlQwH.png)

EDIT:

And it's even better now, with some fixes to GBC-specific features (WRAM bank switching and CPU speed changes):

(http://i.imgur.com/Z2Rup.png)(http://i.imgur.com/RGq6r.png)(http://i.imgur.com/yiCp6.png)(http://i.imgur.com/bIvKN.png)(http://i.imgur.com/QgHGt.png)(http://i.imgur.com/kv7gN.png)

Super Mario Bros. Deluxe (GBC only), Zelda: Link's Awakening DX, GBC Promo Demo (GBC only), Pocket Bomberman, Mega Man Xtreme and Tales of Phantasia: Narikiri Dungeon.

EDIT 2:

Got the program to create a horrible screeching noise - which is good, because now that I'm actually capable of playing sound I can look into sound emulation again :)
Title: Re: Random junk
Post by: Arcaith on March 29, 2011, 11:33:12 AM
Love the name, and the progress is looking great :D
Title: Re: Random junk
Post by: xdaniel on March 29, 2011, 07:24:10 PM
SharpBoy v0.1 is out - http://magicstone.de/dzd/sharpboy/

No sound so far, tho - got some very quiet noise out that did resemble channel 1 somewhat, but that's nowhere near actual sound output yet.
Title: Re: Random junk
Post by: Mallos31 on March 29, 2011, 10:08:01 PM
Ran into a problem straight off.
Fatal error in initialization!
REGDB_E_CLASSNOTREG: Class not registered (-2147221164)
Void Throw[T](System.Object, System.Object)
Title: Re: Random junk
Post by: xdaniel on March 29, 2011, 10:28:15 PM
Uhm... only thing I can imagine is that you're missing the .NET Framework, or at least the current version of it:

Microsoft .NET Framework 4 (Standalone Installer): http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7

EDIT: And/or maybe the SlimDX End User Runtime: http://slimdx.org/download.php <- "Install .NET 4.0"
Title: Re: Random junk
Post by: xdaniel on March 30, 2011, 04:08:54 PM
Right, so there were two problems with that build. For one, it does need the SlimDX runtimes (all apps using that appear to -.-), and second, the not yet really working sound code seems to have problems as well, which caused crashes even with the SlimDX runtimes.

New release v0.1a out at the SharpBoy site.
Title: Re: Random junk
Post by: xdaniel on April 05, 2011, 05:56:15 PM
SharpBoy v0.2 - http://magicstone.de/dzd/sharpboy/

(http://i.imgur.com/ddvFT.png)(http://i.imgur.com/mDwSz.png)(http://i.imgur.com/8xY1C.png)

- GBC DMA emulation fixed, transfer length wasn't being calculated correctly; fixes incorrect and missing graphics in some games
- LCDC emulation improved, fixes flickering and slowdown in certain games and demos
- MBC5 ROM bank select fixed; many more Game Boy Color games now start and/or run further
- Timing of screen drawing improved, which results in less graphical glitches with ex. flickering sprites for pseudo-transparency
- Temporary hack added to allow the Zelda: Oracle games to boot correctly, coupled with the above fixes they now go in-game
- DMG and CGB bootstrap ROMs now supported; have to be named DMG_ROM.bin and CGB_ROM.bin and enabled via the menu
- Manual system type selection implemented, emulator can now be forced to run in GB or GBC mode (not complete yet)
- Controls can be changed via the GUI
- Other minor GUI and usability improvements (ex. path to last ROM image run is saved to config.xml)
Title: Re: Random junk
Post by: marshallh on April 09, 2011, 06:18:59 AM
crazy job.

"I'm bored, time to write a gameboy emulator"

Props!
Title: Re: Random junk
Post by: xdaniel on May 24, 2011, 03:37:30 PM
Had already released v0.3 two weeks ago, but hadn't posted about it here: http://magicstone.de/dzd/sharpboy/

v0.3 (May 11th 2011)

And also, there's v0.4 in the pipeline, to be released soon:


(http://i.imgur.com/HGyYj.png)(http://i.imgur.com/TYIfs.png)

Also, just as a preliminary note or whatever, both SharpBoy and SayakaGL partially run via Mono, both having certain deal-breaking issues (SharpBoy's menu doesn't appear, both tend to crash when using their GUIs).

EDIT:

(http://i.imgur.com/PEse1.png)(http://i.imgur.com/RAqqf.png)(http://i.imgur.com/YzaAS.png)

Proper MBC7 emulation including tilt sensor, thanks to GEST's implementation of that MBC.
Title: Re: Random junk
Post by: xdaniel on May 28, 2011, 09:22:48 PM
http://www.youtube.com/watch?v=adA7FzOenWE
Title: Re: Random junk
Post by: Mallos31 on May 28, 2011, 11:00:07 PM
This is kinda big jump from "well, it's not crashing anymore" to "let's play gameboy games with the wiimote"
Title: Re: Random junk
Post by: xdaniel on May 29, 2011, 01:45:15 AM
Well, I've been working on the whole thing for 3 months now, putting way too much time into the project than I probably should have...

Also, more status update stuff; the MBC5's Rumble feature (used in ex. Pokemon Pinball) is now emulated if you're using a Wiimote, and the Wiimote's battery status is shown via its 4 LEDs (> 0%, > 25%, > 50%, >75%) as well as in the control settings dialog.
Title: Re: Random junk
Post by: marshallh on May 29, 2011, 02:31:05 AM
Works great here. Only thing that had problems was 20y/Snorpung


edit: How do you find half-carry flag (H) when doing ops? I just see if low nibble was 0x0 or 0xF before the op. Dunno if that works for all cases!
Title: Re: Random junk
Post by: xdaniel on May 30, 2011, 08:40:21 AM
I have to say, I ended up more or less copying the logic for the carry and half-carry flags for certain ops from VBA, mainly for Add/Adc, Sub/Sbc and Daa. Especially C and H made me rage when I was writing the core; they were often set correctly in most cases, but one or two games would freak out and die.

And yeah, 20y has some problems... Missing some mid-scanline effects ala Prehistorik Man (but here modifying SCY, not BGP, I guess) in at least the first part, which I can't seem to get right, and those missing scanlines in the second part...



EDIT: SharpBoy v0.4 released - http://magicstone.de/dzd/sharpboy/
Title: Re: Random junk
Post by: xdaniel on June 28, 2011, 08:47:42 PM
(http://i.imgur.com/ryUjL.png)

Gotta stress that this is NOT aimed to be something like SayakaGL, thus a fully-featured level editor, etc. This was born from two things: 1) the desire to make Sayaka's Ucode simulator more portable and more complete than it currently is (not started integrating it here yet, tho :P), and 2) MariOZMAV is a bug-ridden mess that was still based on the original OZMAV, so I'll try to make a more modern base upon which - most likely - someone else can try and build something on.

EDIT:
(http://i.imgur.com/f4qdm.png)

See? Was already distracted by something else... that is, being a dirty cheater!
Title: Re: Random junk
Post by: xdaniel on October 22, 2011, 08:45:46 PM
(http://i.imgur.com/giVaF.png)

...bah, forget it. I know next to nothing about you, besides your CPU by now, so I think this won't work out.
Title: Re: Random junk
Post by: Mallos31 on October 23, 2011, 10:44:22 PM
I used to have documentation for every assembly command that it used, and all of the graphics calls and everything... it's not that bad. I just didn't understand it because I barely understand assembly.
Title: Re: Random junk
Post by: xdaniel on October 24, 2011, 10:52:01 AM
(http://i.imgur.com/uEGLz.png)

Playable, but the status bar flickers at times. And it's not even all to my credit, seeing how most of the graphics code comes from another emulator...
Title: Re: Random junk
Post by: marshallh on October 26, 2011, 03:57:33 AM
Cool. SMB relies on sprite 0 hit for that, IIRC
Title: Re: Random junk
Post by: xdaniel on November 14, 2011, 04:16:13 PM
Sooo, in another case of getting bored and/or frustrated with something - namely the NES emulator and ex. sprite 0 hits, CPU<->PPU timing and mappers -, I ended up starting something else. A PC Engine / TurboGrafx-16 emulator, to be exact. Put my NES 6502 core in and started to add the additional instructions the HuC6280 has (65C02 plus some PCE-specific ones; memory transfer), got basic support for the system's memory mapping in plus other basic functionality, and got to a point where Alien Crush runs until it goes into an infinite loop - I assume it waits for an interrupt to happen, probably VBlank, but the only one that's supported right now is the Timer (and I'm not sure if it works right) and there's next to nothing... well, actually nothing at all of the video chipset emulated.

Ever wanted to see nothing being emulated? Look no further!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PCE.HuC
{
    public class HuC6270
    {
        PCEngine System;

        byte[] Registers = new byte[20];

        public HuC6270(PCEngine _System)
        {
            System = _System;
        }

        public void Reset()
        {
            //
        }

        public void Execute(int Line)
        {
            //
        }
    }
}


So, yeah.

EDIT: Let's see... There's still more as-of-yet-unimplemented opcodes - several different kinds of memory transfer instructions, for example -, and the VDC/VCE combo is also more difficult to understand and emulate than I thought... Yet I don't think I've came across anything comparable to the annoyances of the NES yet.

Anyway, I've met my first set goal with this: getting a game to shuffle tiles and tilemap data into VRAM. That's something of a common goal for all the emulation projects I try my hand at, I guess, since Tetris first started doing exactly that in my first proper GB emulator (GBME) a few years back.

(http://i.imgur.com/CVSAs.png)

Seeing how the game doesn't crash with either an invalid or unimplemented opcode error, I guess it's still waiting for a response from some other unimplemented/not correctly working part of the system... Next'll probably be trying to get something onto the screen.

EDIT 2: Getting something onto the screen now, although it's mostly trash, and the rendering code is quite awful. And seeing how BG rendering is technically disabled at this point (so it's not supposed to display anything, I just forced it to do so), I presume the game really is stuck in an infinite loop, waiting for something, an IRQ or whatever, probably.

(http://i.imgur.com/7LlfH.png)

EDIT 3: Yeeeeaaahhh... Note to myself: Make sure that newly added instructions have their number of bytes and cycles count added to the OpLength and OpCycle arrays. No length results in an infinite loop, as the PC is never increased. Duh. Gotta add a check for missing opcode lengths...

EDIT 4: Some added and fixed opcodes later...

(http://i.imgur.com/0o2oQ.png)(http://i.imgur.com/MiZeJ.png)(http://i.imgur.com/26Wew.png)

The dots' palette-cycling on Alien Crush's title screen works, but that's about all I can say about the game - it crashes with an invalid opcode shortly after pressing Run to go to the menu, or after fading the title screen out when mashing the buttons to try and enter the game proper before said invalid opcode occures. China Warrior appears to run, but my Awful Rendering Code? is glitchy, doesn't do sprites yet, and so on.
Title: Re: Random junk
Post by: xdaniel on November 17, 2011, 01:44:19 AM
More progress: More opcodes have been fixed - some had really stupid bugs in them, like masking off too much of an address -, more of them have been implemented, and the VDC emulation has been improved somewhat, probably most prominently the resolution switching as seen with the R-Type screenshot.

And in turn, there's more reason for screenshots:

(http://i.imgur.com/Fv4dI.png)(http://i.imgur.com/L3ekT.png)(http://i.imgur.com/J4pcU.png)(http://i.imgur.com/O5VWx.png)(http://i.imgur.com/S5vCg.png)(http://i.imgur.com/FYGI3.png)

Alien Crush: Working; unplayable because of missing sprite emulation
PC Genjin: Appears to hang when going in-game
R-Type: Strange glitches, credits keep counting up, doesn't go in-game, demo mode shows glitched graphics
Space Harrier: Title screen glitched, but appears to be working
Super Star Soldier: Also heavily glitched; at least goes in-game
Vigilante: Same as Alien Crush

EDIT: More and more CPU and VDC fixes later, most of which were for more dumb mistakes (writing to the wrong VDC registers, etc.):

(http://i.imgur.com/Zvg3l.png)(http://i.imgur.com/N7mKr.png)(http://i.imgur.com/Yhws6.png)(http://i.imgur.com/TiogM.png)(http://i.imgur.com/2CWC3.png)(http://i.imgur.com/MWYgu.png)

Besides the still missing sprite support...

Parodius: Appears to work; some graphical glitches
PC Genjin: Appears to work as well
Space Harrier: Appears to works; ground now appears in-game, title screen still broken
Super Star Soldier: Appears to work, no more glitches

EDIT: Tiny bit of sprite emulation done; now you can sorta see how it's supposed to look like:

(http://i.imgur.com/C6i6d.png)(http://i.imgur.com/LW03C.png)
Title: Re: Random junk
Post by: xdaniel on November 18, 2011, 01:03:35 AM
Well, this actually went somewhere, I guess:

(http://i.imgur.com/Nf9Rj.png)(http://i.imgur.com/BhD43.png)(http://i.imgur.com/hmT1U.png)(http://i.imgur.com/0yEJQ.png)

Another bunch of screenshots: http://imgur.com/ey1ER, http://imgur.com/Nf9Rj, http://imgur.com/1HFAG, http://imgur.com/xz5CP, http://imgur.com/BJN8x, http://imgur.com/NUkxo, http://imgur.com/BhD43, http://imgur.com/1WRXI, http://imgur.com/49FNG, http://imgur.com/98nxX, http://imgur.com/OEe22, http://imgur.com/hmT1U, http://imgur.com/liCIe, http://imgur.com/0yEJQ

Basic sprite emulation is done, although at least vertical mirroring is broken (horizontal seems correct), and priorities may be incorrect sometimes; all CPU opcodes - 6502, 65C02 and HuC6280-specific - are now emulated as well. Many finer points of the hardware are still off, however, from some timing aspects to IRQ acknowledgement. Certain things like VRAM-to-VRAM DMA transfers aren't yet emulated at all, either. There's also some curious issues with the I/O port used by the joypad, as the controls are unresponsive in certain games in-game - meaning they work up to that point, allowing me to get in-game in the first place. Anyway, compatibility assessment:

Alien Crush: Playable
China Warrior: Playable (forgot about this one)
Parodius: Goes in-game, controls unresponsive; Konami logo doesn't work and needs to be skipped
PC Genjin: Playable
R-Type: Still many strange glitches (missing sprites, can't start game, demo mode very glitched)
Space Harrier: Goes in-game, controls unresponsive
Super Star Soldier: Playable
Vigilante: Playable

...all with the aforementioned glitches, to varying degrees - ex. Super Star Soldier seems pretty much perfect, while PC Genjin has sprite glitches -, and of course without sound.

Will I keep working on this and eventually release it? Hmm, I dunno. I'll probably look into the broken controls, try to fix sprite mirroring and look for a game that uses In-VRAM DMA to implement that. After that, we'll see.

EDIT: More opcode fixes later - especially TST - and more and more games go in-game or even are playable! Control problems appear to be gone in most games (Space Harrier, Parodius, Bomberman '93 and '94 and more), the Konami logo screen in ex. Parodius and Detana!! Twinbee works, and the general weirdness of certain games like R-Type or Gunhed has been fixed. There's still a host of other problems, tho, from graphics errors (inaccurate VDC emulation?) to games not even booting correctly and/or crashing soon after with invalid opcodes (memory mapping?). But anyway, some screenshots representative of the fixed things:

(http://i.imgur.com/oIv6W.png)(http://i.imgur.com/a926N.png)(http://i.imgur.com/xyMNG.png)(http://i.imgur.com/qJPh5.png)

Also, an updated compatibility list (previous test cases, plus a few others):

Aero Blasters: Playable
Alien Crush: Playable
Bomberman '93: Playable
Bomberman '94: Playable
China Warrior: Playable
Darius Alpha: Goes in-game, missing title logo, missing background, unstable?
Detana!! Twinbee: Playable
Parodius: Goes in-game, controls still unresponsive
PC Genjin: Playable
R-Type: Playable
Space Harrier: Playable
Super Star Soldier: Playable
Vigilante: Playable

(...still need more games beyond the letter D, tho.)

EDIT 2: Huh, I knew some lines on the cartridge connector got switched in the TG-16 as opposed to the PC Engine, but that this was also reflected in many dumped ROMs...? It's like byteswapped N64 ROMs all over again, just with swapped bits this time around! So yeah, borrowing the logic from MESS, loading of those swapped US ROMs is now supported - that in turn fixes emulation of my copies of Blazing Lazers (US version of Gunhed) and Darkwing Duck:

(http://i.imgur.com/QSI3t.png)(http://i.imgur.com/2bKlz.png)
Title: Re: Random junk
Post by: xdaniel on November 21, 2011, 01:58:55 AM
http://www.youtube.com/watch?v=l5xkYNhKdoQ
Title: Re: Random junk
Post by: spinout on November 21, 2011, 04:44:10 PM
Very nice work, xdaniel. It would be interesting to see an algorithm like the one described in this (http://research.microsoft.com/en-us/um/people/kopf/pixelart/paper/pixel.pdf) paper to be implemented, though I'm sure you want to get accurate emulation first.
Title: Re: Random junk
Post by: Euler on November 21, 2011, 06:14:19 PM
Did you notice the performance data in that paper, spinout? Doing it for the full frame in real-time would be challenging (not that I'm saying it's impossible).

Of course, I may just be biased since I have my own approach that I think is more tenable.
Title: Re: Random junk
Post by: spinout on November 22, 2011, 04:53:20 AM
Did you notice the performance data in that paper, spinout? Doing it for the full frame in real-time would be challenging (not that I'm saying it's impossible).

Of course, I may just be biased since I have my own approach that I think is more tenable.
You might be right, vectorization of the whole screen might not be possible for an emulator. But if the sprites are vectorized as they are used, the emulator would only have to vectorize them the first time they are used, and it would have a cache.
Title: Re: Random junk
Post by: xdaniel on November 23, 2011, 12:42:13 AM
I had heard about and skimmed through that paper before, not really sure if I'd be able to implement it. Also, yeah, I'll rather focus on getting the actual emulation of the system more accurate.

That said, it appears that I really need to go through each and every opcode and double-check their implementation again, because I just fixed another one which again prevented games from working correctly. Darius Alpha now shows the title screen and level backgrounds correctly and appears to be stable (although I suck at it, and it doesn't help that enemy bullets are the same color as the background, so I'm not 100% sure), but still suffers from some timing problems - ex. flickering status bar, scrolling issues -, and Parodius' controls are now working in-game:

(http://i.imgur.com/uWdVC.png)(http://i.imgur.com/aYJYq.png)
(http://i.imgur.com/wqHJz.png)(http://i.imgur.com/KUbs2.png)

(Plus, there's a screenshot function now :P)
Title: Re: Random junk
Post by: Euler on November 24, 2011, 04:04:14 AM
You might be right, vectorization of the whole screen might not be possible for an emulator. But if the sprites are vectorized as they are used, the emulator would only have to vectorize them the first time they are used, and it would have a cache.

That might work. At that point you are basically doing what I did in the GB emulator, but creating the high-res sprites automatically. The problem case would be when a character is composed of several sprites; vectorizing each one separately is going to lead to problems on their boundaries.
Title: Re: Random junk
Post by: xdaniel on February 15, 2012, 01:22:28 AM
Random project is random, is done in C# (like 99% of my projects these days), and will probably soon be abandoned for half a year or more (like 99% of my projects these days!)...

(http://i.imgur.com/BExOw.png)

Saving doesn't exist yet, map properties dialog isn't done, no dialog for event editing yet, bunch of stuff to look into that can technically be edited, but I have never messed around with before (map connections, warp-to points), etc., etc.
Title: Re: Random junk
Post by: xdaniel on March 03, 2012, 04:09:40 AM
No C or C# or anything this time, just some HTML5, CSS3, PHP and JavaScript; mostly coded from scratch, save for some helper routines I found on the web (comments on php.net, for example):

(http://i.imgur.com/nH9VO.png)
(http://i.imgur.com/bTrHc.png)
(http://i.imgur.com/cdqIG.png)

See it in action - that is, not the admin center of course - on my website.

(The screenshot add-on ruins the anti-aliasing on the fonts apparently, but what the hell...)
Title: Re: Random junk
Post by: cooliscool on July 07, 2012, 08:22:05 AM
xdaniel - respect.
Title: Re: Random junk
Post by: xdaniel on July 08, 2012, 04:08:24 AM
Heh, thanks, I only wish I'd actually finish all the crap I start coding :P

...and that said...



(http://i.imgur.com/qw0Tb.png)

Hello there, disfigured limbs of Roll Casket from Mega Man Legends (PSX)! ...also, hello there sun, it's only 6 AM so why the hell are you rising already?!