What's new

Game Boy

HyperHacker

Raving Lunatic
What I did when I couldn't see any video output was to hack the drawing code to draw whatever was in VRAM instead, that way I could at least verify the drawing routines worked and the game had loaded some graphics.
 

ShizZy

Emulator Developer
Thanks guys! Ladies and Gentlemen, I think he's done it! :party:
Ahh.. so maybe it isn't much, but it's something! Finally I get video :bouncy: Sure made my day. (Big Scroller Demo btw, and everything else still crashes hahaha)

I'm currently stumped on a problem with my f0 opcode, which would be LDH an immediate to A. I've double and triple checked my code, and I'm sure that it's right. What it is doing is setting AF to 0x4440 in the Big Scroller Demo, when it should be setting it to 0x4040 - which leads me to believe that somewhere else I am setting A wrong, or somewhere else I'm not setting A at all... which is puzzling. Here's my LDH code:

Code:
void Interpreter::z80_LDH_A_n8()
{
	/* load reg.A with mem at address 0xFF00+immediate */
	reg.A=mem.memory[0xFF00+mem.memory[reg.PC++]];

	/* add the cycles */
	cpu.cycles+=4;	
}
Any suggestions? Thanks!

Cheers!
 

bcrew1375

New member
Congratulations! :bouncy: Sure is a mess, but it's a start! :happy: Heh, Big Scroller Demo was the first to show anything for me as well. I got the background blocks, but they weren't swaying, they were just sitting there, doing nothing :p. Give yourself a pat on the back(if you haven't already), things become alot more fun now :).

Of course there's nothing wrong with the 0xF0 opcode. You've been checking the wrong thing for errors. :p You're loading A with the values of the memory area from 0xFF00 to 0xFFFF, right? If A contains an incorrect value, you're probably not handling the I/O registers correctly. Find out what address it's loading the data from, and check over the code that's handling that address.
 
Last edited:

aprentice

Moderator
ShizZie said:
Thanks guys! Ladies and Gentlemen, I think he's done it! :party:
Ahh.. so maybe it isn't much, but it's something! Finally I get video :bouncy: Sure made my day. (Big Scroller Demo btw, and everything else still crashes hahaha)

I'm currently stumped on a problem with my f0 opcode, which would be LDH an immediate to A. I've double and triple checked my code, and I'm sure that it's right. What it is doing is setting AF to 0x4440 in the Big Scroller Demo, when it should be setting it to 0x4040 - which leads me to believe that somewhere else I am setting A wrong, or somewhere else I'm not setting A at all... which is puzzling. Here's my LDH code:

Code:
void Interpreter::z80_LDH_A_n8()
{
	/* load reg.A with mem at address 0xFF00+immediate */
	reg.A=mem.memory[0xFF00+mem.memory[reg.PC++]];

	/* add the cycles */
	cpu.cycles+=4;	
}
Any suggestions? Thanks!

Cheers!

looks fine to me, what memory location in 0xFF00 are you talking about?
 

ShizZy

Emulator Developer
Thanks guys!
things become alot more fun now
I hope you mean that in a good way :happy: Somewhere I'm setting that address in high ram to a wrong value before loading it into AF, so as long as I pinpoint that spot things should work out. I'm going to work through it some more tomarrow.
 

ChaosBlade

My Heart Chose.. Revenge.
Nice to see you advance aswell, ShizZie :)

Status update on the rest of our coders ? im interested to see how far did people go :)
 

ShizZy

Emulator Developer
Thanks ChaosBlade :) I'm curious to see where Zenogais is going with his...

Right off the bat my high-ram is completelly empty... that could be a problem :blush:

Edit: Nevermind, that's not it...
 
Last edited:

ShizZy

Emulator Developer
Okay, here's what's happening. AF = 0xA40, and memory at address 0xFFF0 is currenty 0. Register A is being set to memory[0xFFF0], and now AF = 0x4440. And like I said, it should be being set to 0x4040. What's going on here?
 

bcrew1375

New member
Okay, Big Scroller Demo never tries to load the contents of 0xFFF0 into A for me. What is the Program Counter when this happens? That might help.
 

ShizZy

Emulator Developer
It's F0, so it's basically saying that memory[0xf0] = 0xf0, which is coincidentially odd. (because of the syntax of my LDH call)
 

bcrew1375

New member
Are you sure the Program Counter is 0xF0? It never goes there for me. I'm asking for the value of the Program Counter register. Not the data in memory at the Program Counter's address. Also, if you think there's something wrong with one of the instructions, you could post the source and let us see if we can find a problem.
 
Last edited:

ShizZy

Emulator Developer
Thanks for the tips bcrew... I'm going to take a further look at it tomarrow.

I've attached my current cpu source. If anyone can point out any mistakes that would cause these bugs for me, I'd very much appreciate it. Thanks!
 

bcrew1375

New member
Hmm, I don't see anything horribly wrong. I see a few things left out, but you probably just haven't gotten to those yet. I'll look over it a bit more. By the way, it looks like your code might have been inspired by mine a bit. I don't mind you using it, but I consider it slow, sloppy, and it is probably still riddled with bugs :p.
 

ShizZy

Emulator Developer
I know, some of it is. I took a look at some of yours to see how some things were done that I was unsure about until I saw how it worked, and then I was planning on optimizing/recoding a lot of them.
 

zenogais

New member
Hey all, been a while. I've been extremely extremely busy as this school year winds down it seems like my plate is constantly full :blush: I've been trying to work on NeoGameBoy, but progress is pretty slow @ the minute. I managed to get executables loading, and to play around with a few other things but nothing concrete as I haven't had the time.

I've also been screening various GUI libraries, I've decided after do some tests with a few libraries, namely FLTK, wxWidgets, and win32gui. I finally decided on win32gui, because the design was much more thought-out than any of the others and the author actually took the time to eliminate common GUI design problems like graphical controls, its simple to use, and unlike wxWidgets, which is basically cross-platform MFC, it actually increases my productivity significantly, we're talking ~20 lines of code to get a window with a small menu and menu event handlers working.

Back to NeoGameBoy, I'm having a problem understanding the video system, so I've been looking at the sources of a few other emu (cheating, I know) and checking what I find with the docs to increase my understanding. I want to get this working, but it'll take me some time. Hope to be back into developing once things really wind down, nice to see you progress Shizzie :)

EDIT: btw Shizzie, my real name is Eric too :p
 
Last edited:

Top