What's new

emucoding

GuestX

New member
i´m trying to code a GB-Emu for fun but i don´t now how to
"Declare" this in the opcodes
Like:
LDI (HL), A
i´m trying
with
Public Const LDI As Long = 0
..
...
The NES is easier to understand....
 

Cyberman

Moderator
Moderator
I strongly urg you to grab MAME source code and look at the Z80 CPU emulator they have in it.. unless you wish to completely make your own. However I suggest you also grab the Z80 Users Manual for quick reference.
The Z80 opcodes are not the same length some are 1 byte some are 2 bytes some are 3 bytes some are 4 bytes in length. I'm not sure how you intend on interpreting the opcodes in memory I'm not going to ask either ;)

Cyb
 
OP
G

GuestX

New member
Thnx Cyberman, is the Gameboy emulateable with the Z80 processor. i currently added GB opcodes:
Code:
Public Const LDI As Long = 0
Public Const HL As Long = 1
Public Const A As Long = 2
Select Case xxxxx
case LDI, HL, A

i cant write LDI (HL), A
 
OP
G

GuestX

New member
SculleatR said:
Thnx Cyberman, is the Gameboy emulateable with the Z80 processor. i currently added GB opcodes:
Code:
Public Const LDI As Long = 0
Public Const HL As Long = 1
Public Const A As Long = 2
Select Case xxxxx
case LDI, HL, A
i cant write LDI (HL), A
:blush:
 
OP
G

GuestX

New member
SculleatR said:
Thnx Cyberman, is the Gameboy emulateable with the Z80 processor. i currently added GB opcodes:
Code:
Public Const LDI As Long = 0
Public Const HL As Long = 1
Public Const A As Long = 2
Select Case xxxxx
case LDI, HL, A

i cant write LDI (HL), A [/B][/QUOTE] 

but ofcourse i added all (i think) opcodes
 
OP
G

GuestX

New member
but the 6502 processor is featured than the Z80, right ?
and the NES is emulated with very fast graphics in Visual Basic,
look at basicNES (NES emu in VB). Than GB must be emulateable
or Z80 in VB.
 
OP
G

GuestX

New member
NES emus coded in VB that i saw:
basicNES
Vertendo
Liss NES
MarioNES
all written in Visual Basic
 

Doomulation

?????????????????????????
Don't post so many posts in a row. Generally, more than 3 or 2 posts in a row is concidered "spam". There is an edit button. Use it!
 

Cyberman

Moderator
Moderator
As far as I know the Game Boy uses the Z80 not the 6502 for it's processor. This is because the 6502 didn't have a low power core when they made the GB. The Z80 is a classic CISC toy so it's not too bad :)

As for MAME try that URL :p :)

:linux:

Oh.. as Doom suggested try to make your messages in a complete thought. IE think before you instantly reply too a message. This isn't IM and thousands of people are reading it probably going "What the heck is he talking about?"

Cyb
 

aprentice

Moderator
SculleatR said:
Thnx Cyberman, is the Gameboy emulateable with the Z80 processor. i currently added GB opcodes:
Code:
Public Const LDI As Long = 0
Public Const HL As Long = 1
Public Const A As Long = 2
Select Case xxxxx
case LDI, HL, A

i cant write LDI (HL), A [/B][/QUOTE] 

First of all, you dont declare every opcode. You read the opcode first then run a switch statement.

opcode = ReadByte(from_rom)
switch(opcode)
case 0x1 etc...

I would say more, but I think you'd be better off getting some more experience in programming.
 

ScottJC

At your service, dood!
Visual Basic is nice, but its not exactly the best thing to develop an emulator in, in fact i'd say its the worst thing, its more for people who want to develop quick applications, not games/emulators;

But: Delphi does that better than Visual Basic does, alot better in fact, but thats still not much good for emulators or games, except you can use assembler in delphi i suppose! lol :)
(its faster than vb, and yer executables don't need those damn runtime librarys!)

ultimately it comes down to c/c++, because of its speed, etc, i'd like to figure out how the heck the gui stuff works, whenever i look at it, it just looks like golbledegook to me, i can do c++, just this gui stuff eludes me at the moment

but then again, why am I to preach? you can do it in whatever language you like, ^_^
 
OP
G

GuestX

New member
aprentice said:
First of all, you dont declare every opcode. You read the opcode first then run a switch statement.

opcode = ReadByte(from_rom)
switch(opcode)
case 0x1 etc...

I would say more, but I think you'd be better off getting some more experience in programming.

thnx apri, forgetted totaly switch, i´m a idi :blush:

" but I think you'd be better off getting some more experience in programming. "

you´re right...
 
Last edited:

Doomulation

?????????????????????????
Note though that delphis exes are damn big :(
But i suppose that he could try vb first to gain some programming experience...
 
OP
G

GuestX

New member
Fixed. Found very good info :phone:
i´m working now :)
---------------------------------------------------------------------- my current opcode code, Like:
Code:
If xxx = 10 Then           ' RLC (HL)
regHL = rlc(regHL)
opcodes = 8
similar to my code...
this is a way of my opcodes.....

I'll emulate the sound with DirectX7, because Gameboy
is wav, or ?
 
Last edited:
OP
G

GuestX

New member
well, i have stopped work on GBemu because Visual
Basic is TO slow for Emulation.
 
Last edited:

Top