Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

Reply
 
Thread Tools Display Modes
Old May 29th, 2012, 17:22   #381
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
An arithmetic shift left (SAL) and logical shift left (SHL) are the same thing, as you are not extending the sign bit. Both mnemonics are present in the spec and assembler for completeness only.
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote

Advertisement [Remove Advertisement]

Old May 30th, 2012, 14:20   #382
sbeng
Registered User
 
Join Date: Feb 2009
Location: Italy
Posts: 27
Hi,
i'm processing BC_Testrom.c16 rom. Into the rom there is follow opcode:

001200AC

In doc there is written that 00 = NOPE. What is mean 001200AC opcode? It should be 00000000?
Best regards.
sbeng is offline   Reply With Quote

Old May 30th, 2012, 21:43   #383
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Since there is no opcode "001200AC" I'm guessing that might be some data you are looking at in the ROM, not an opcode...
paul_nicholls is offline   Reply With Quote

Old June 1st, 2012, 09:35   #384
sbeng
Registered User
 
Join Date: Feb 2009
Location: Italy
Posts: 27
Hi,
in C# i need declare Registry array as ushort (unsigned 16bit) or short?
sbeng is offline   Reply With Quote

Old June 1st, 2012, 09:50   #385
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
The registers are signed, so short should do.

Remember the addresses are unsigned though, so you will have to convert sometimes.
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote

Old June 1st, 2012, 10:19   #386
sbeng
Registered User
 
Join Date: Feb 2009
Location: Italy
Posts: 27
Hi,
i've written in C# this function for 0x21 opcode:

private static void loadSP(byte[] opcode)
{
//21 00 LL HH LDI SP, HHLL Point SP to the specified address. Does not move existing values in memory to new location.
int pos = 0;
String strOpcode = BitConverter.ToString(opcode).Replace("-", string.Empty);
String HHLL = strOpcode.Substring(6) + "" + strOpcode.Substring(4, 2);
pos = FromHex(HHLL);
SP = memory[pos];
}

SP is an ushort variable (16 bit), memory is a byte array (8 bit).
In SP variable i need point memory[pos] or also memory[pos+1] so i can let to SP a 16 bit value?
sbeng is offline   Reply With Quote

Old June 1st, 2012, 12:55   #387
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
Your code doesn't make much sense. All you have to do for that opcode is to load immediate value to SP, i.e. SP = HHLL.
Also, learn to use bitwise operators please, all those string manipulation looks ugly and takes more processing.
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote

Old June 3rd, 2012, 16:40   #388
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Hi all,
Now i am working on prototype of CHIP16 debugger, because without it i can't write complex alghoritms or programs for CHIP16.
c16debug.PNG
tronix286 is offline   Reply With Quote

Old June 3rd, 2012, 16:45   #389
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
Quote:
Originally Posted by tronix286 View Post
Hi all,
Now i am working on prototype of CHIP16 debugger, because without it i can't write complex alghoritms or programs for CHIP16.
Attachment 217947
Very good, I look forward to being able to use this.
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote

Old June 4th, 2012, 00:48   #390
paul_nicholls
Registered User
 
Join Date: Sep 2011
Location: Australia, Tasmania
Posts: 180
Quote:
Originally Posted by tronix286 View Post
Hi all,
Now i am working on prototype of CHIP16 debugger, because without it i can't write complex alghoritms or programs for CHIP16.
Attachment 217947
Looking very nice
paul_nicholls is offline   Reply With Quote

Old June 4th, 2012, 16:52   #391
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
For those interested in writing chip16 assembly, and who use Notepad++, here is a custom syntax highlight file.
Unzip it into %APPDATA%\Notepad++. It handles *.s and *.casm files.
Enjoy
Attached Files
File Type: zip userDefineLang.zip (914 Bytes, 1 views)
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote

Old June 4th, 2012, 18:04   #392
@ruantec
Crazy GFX coder
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Dominican Republic/Austria
Posts: 8,283
Nice! i use Notepad++ quite a lot so i guess it may be very useful thanks!
__________________


Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6
@ruantec is offline   Reply With Quote

Old June 4th, 2012, 20:03   #393
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
Quote:
Originally Posted by @ruantec View Post
Nice! i use Notepad++ quite a lot so i guess it may be very useful thanks!
Cool, switching user-defined languages makes my np++ crash though!

Also, I'll quickly say that a bug affecting hex DB's has been corrected in tchip16.

EDIT: Made a quick little demo, a little bouncing ball with gravity and sound. Press START to restart.

bounce.png

Download attached!
Attached Files
File Type: zip Bounce.zip (1.0 KB, 4 views)
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64

Last edited by tykel; June 5th, 2012 at 01:48..
tykel is offline   Reply With Quote

Old June 5th, 2012, 16:19   #394
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by tykel View Post
Also, I'll quickly say that a bug affecting hex DB's has been corrected in tchip16.
What kind of bug? It's described in Issues at google.code?

Quote:
Originally Posted by tykel View Post
EDIT: Made a quick little demo, a little bouncing ball with gravity and sound. Press START to restart.
Small and nice. Maybe this should be the sprite of realy volleyball ball?
tronix286 is offline   Reply With Quote

Old June 5th, 2012, 16:25   #395
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
Quote:
Originally Posted by tronix286 View Post
What kind of bug? It's described in Issues at google.code?
Yes, issue 10. Basically all hex digits > 9 were being converted wrong.
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64
tykel is offline   Reply With Quote

Old June 5th, 2012, 19:50   #396
ShendoXT
Moderator
 
ShendoXT's Avatar
 
Join Date: Feb 2006
Location: Croatia
Posts: 4,605
@tronix286: Very neat looking debugger, I like it.
@tykel: As always, good work. You should put it in the program pack
__________________
Shendo's software blog

Core i5 2400 3.1 Ghz | ASRock H67M | GTX460 768Mb | 8GB DDR3 1333 | 1500 Gb HDD
Grundig VLC 7121 C (1080p) 32" | Razer DeathAdder | Logitech G110 | Windows 7 x64

Don't PM or ask me about VMP-MCR conversions. I will ignore you if you do.
ShendoXT is offline   Reply With Quote

Old June 6th, 2012, 11:58   #397
tykel
Sober coder
 
tykel's Avatar
 
Join Date: Aug 2010
Location: London, UK
Posts: 434
@Shendo: Thanks, I have another little one in the works, nearly finished

EDIT: Here it is, a demo called Water.
It depicts a view on the sea, with a boat moving in the distance. You hear the waves crashing in, and on occasion, the boat sounding its horn.
I did my best for the glitter on the sea.
Feel free to make it better!

Water.png

Enjoy
Attached Files
File Type: zip Water.zip (2.5 KB, 7 views)
__________________
tchip16 (chip16 assembler) Js16 (browser chip16 emulator)
mash16 (chip16 emulator) img16 (chip16 sprite converter)
______________________________________

Desktop: i5 750 @ 3.6 Ghz, 4GB ram, GTX 570 OC | Windows 7 Pro 64
Laptop: (Thinkpad) i5 430M, 4GB ram, Intel IGP | Arch Linux, Windows 7 Pro 64

Last edited by tykel; June 6th, 2012 at 12:26..
tykel is offline   Reply With Quote

Old June 6th, 2012, 17:45   #398
Prads
Registered User
 
Prads's Avatar
 
Join Date: Sep 2011
Location: Australia
Posts: 89
So, I had some free time today (which I thought I would spend reading XBox documentation but blueshogun hasn't sent me documentation yet for some reason :P) and I decided to play around with the chip16 compiler code a little. I added an inbuilt function that lets you to write text on chip16 screen.

Hello World demo:

Code:
ConstString hello = "Hello World!!!";

void main() {
	print(hello, 10, 10);
}
Compiler still doesn't do much but I will try and update it in my free time.
Attached Images
File Type: png hello.png (44.5 KB, 10 views)
Attached Files
File Type: zip hello world.zip (992 Bytes, 3 views)
__________________
My Programming Projects: www.pradsprojects.com
Prads is offline   Reply With Quote

Old June 7th, 2012, 07:54   #399
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Quote:
Originally Posted by tykel View Post
EDIT: Here it is, a demo called Water.
It depicts a view on the sea, with a boat moving in the distance. You hear the waves crashing in, and on occasion, the boat sounding its horn.
I did my best for the glitter on the sea.
Feel free to make it better!

Attachment 217961

Enjoy
Awesome!
tronix286 is offline   Reply With Quote

Old June 7th, 2012, 18:46   #400
tronix286
Registered User
 
tronix286's Avatar
 
Join Date: Aug 2010
Location: Russia, Moscow
Posts: 48
Some progress with my chip-16 debugger. It alpha, but it work's!

KNOWN LIMITATION ver0.1 alpha:

- All sound opcodes ignored (interpreted as NOP)
- All FLIP opcodes ignored (interpreted as NOP)
- All PAL opcodes ignored (interpreted as NOP)

- Only one debugging mode: step by step (Trace)
- One-pass dissasembler when ROM loaded into memory. No 'on the fly'
dissasembler after each opcode execution.
- No breakpoints
- No code/memory/registers editor
- Not working stack view panel. Maybe i should refactoring this

Now at: http://code.google.com/p/chip16debugger/
Attached Images
File Type: png ch16debug.png (57.6 KB, 12 views)

Last edited by tronix286; June 14th, 2012 at 17:28..
tronix286 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 15:31.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.