| View previous topic :: View next topic |
| Author |
Message |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Mon Feb 27, 2006 12:32 pm Post subject: NEW Goomba Color ROM Builder released! |
|
|
NEW Goomba Color ROM Builder I wrote.
Compatible with new trim feature.
Any comments are welcome.
Download |
|
| Back to top |
|
 |
kingkong Member
Joined: 06 Jan 2006 Posts: 35
|
Posted: Tue Feb 28, 2006 1:48 pm Post subject: |
|
|
it looks really cool, sweet design.
and its nice how it makes the goomba.gba so it fits on a flashcard(space).
perfect would be when it would automatically trim the roms before adding  |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Tue Feb 28, 2006 2:07 pm Post subject: |
|
|
I think itīs possible if Dwedit shares the source code of GBCTRIM.  |
|
| Back to top |
|
 |
Dwedit Administrator

Joined: 26 Feb 2004 Posts: 2218 Location: Chicago!
|
Posted: Tue Feb 28, 2006 2:14 pm Post subject: |
|
|
Disregard previous version of this post...
Here's the source to gbctrim as a VB .frm file:
| Code: | VERSION 5.00
Begin VB.Form frm
Caption = "GBCTrim, drag .GBC files on!"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
OLEDropMode = 1 'Manual
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
End
Attribute VB_Name = "frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, Y As Single)
Dim I
Dim z As String
Dim msg As VbMsgBoxResult
Dim error As Integer
For I = 1 To Data.Files.Count
z = Data.Files(I)
msg = MsgBox("Trim this file: " + z + "?", vbYesNo)
If msg = vbYes Then
MsgBox "Trimmed " + Trim(Str(TrimFile(z))) + " bytes off " + z
End If
Next
End Sub
Function GetLength(Arr() As Byte)
On Error GoTo getlengtherror
GetLength = UBound(Arr) + 1
On Error GoTo 0
Exit Function
getlengtherror:
GetLength = 0
Exit Function
End Function
Sub AppendSub(Arr1() As Byte, Arr2() As Byte, Start1 As Long, Size1in As Long)
Dim L1 As Long, L2 As Long
Dim Size1 As Long
Size1 = Size1in
L1 = GetLength(Arr1)
L2 = GetLength(Arr2)
If (Start1 < 0) Then
Size1 = Size1 + Start1
Start1 = 0
End If
If (Start1 + Size1) > L1 Then
Size1 = L1 - Start1
End If
If (Size1 < 0) Then
Exit Sub
End If
Dim I As Long
ReDim Preserve Arr2(L2 + Size1in - 1)
For I = 0 To Size1 - 1
Arr2(L2 + I) = Arr1(Start1 + I)
Next
End Sub
Sub SetWord(Arr1() As Byte, Address As Long, Data As Long)
Arr1(Address) = Data And 255
Arr1(Address + 1) = ((Data \ 256) And 255)
Arr1(Address + 2) = ((Data \ 65536) And 255)
Arr1(Address + 3) = ((Data \ 16777216) And 255)
End Sub
Function TrimFile(file As String) As Long
Dim NumBanks As Long
Dim OnBank As Long
Dim BankBase As Long
Dim BankEnd As Long
Dim Outptr As Long
Dim Inptr As Long
Dim FileNum As Integer
Dim FileSize As Long
'Dim NewFileSize As Long
'Dim LastChar As Byte
'Dim GetChar As Byte
Dim OutBankSize As Long
Dim InData() As Byte
Dim OutData() As Byte
FileSize = FileLen(file)
ReDim InData(FileSize - 1)
NumBanks = FileSize \ 16384
Outptr = 8 + NumBanks * 4
ReDim OutData(Outptr - 1)
FileNum = FreeFile
Open file For Binary As FileNum
Get FileNum, , InData
Close FileNum
For OnBank = 0 To NumBanks - 1
'start address of bank
SetWord OutData, 8 + OnBank * 4, Outptr
BankBase = OnBank * 16384
BankEnd = BankBase + 16384
Inptr = BankEnd - 1
Dim MatchByte As Byte
MatchByte = InData(Inptr - 1)
Do While (Inptr - 1 >= BankBase And InData(Inptr - 1) = MatchByte)
Inptr = Inptr - 1
Loop
If Inptr <> BankBase Then
'word align
Inptr = Inptr - 1
Inptr = Inptr Or 3
Inptr = Inptr + 1
'give back bytes
Inptr = Inptr + 16
If Inptr > BankEnd Then Inptr = BankEnd
End If
OutBankSize = Inptr - BankBase
AppendSub InData, OutData, BankBase, OutBankSize
Outptr = Outptr + OutBankSize
Next
'file size
SetWord OutData, 4, Outptr
SetWord OutData, 0, &H4D495254
Open file + ".trim" For Binary As FileNum
Put FileNum, , OutData
Close FileNum
TrimFile = FileSize - Outptr
End Function |
_________________ Here come the fortune cookies! Here come the fortune cookies!
They're wearing paper hats! |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Tue Feb 28, 2006 2:18 pm Post subject: |
|
|
Thank you Dwedit!!!
I will work on it in this week!!! |
|
| Back to top |
|
 |
WhiteX Member

Joined: 14 Dec 2005 Posts: 87
|
Posted: Tue Feb 28, 2006 3:11 pm Post subject: |
|
|
Marcelo, zip support would be good as well, if not asking too much. _________________ THX for DominicanZero for my ava! |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Tue Feb 28, 2006 6:31 pm Post subject: |
|
|
Thatīs ok WhiteX, but I will try to work on the trim feature first.
Zip feature are comming soon in the next versions too. |
|
| Back to top |
|
 |
kingkong Member
Joined: 06 Jan 2006 Posts: 35
|
Posted: Wed Mar 01, 2006 7:11 pm Post subject: |
|
|
also i personally would prefer to choose from a list of roms and decide which i want to add (and hopefully trim, and then add to a goomba.gba) and it showing me the size
instead of adding a whole dir |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Fri Mar 10, 2006 4:33 pm Post subject: |
|
|
I (finally) finish the trim code.
It was the hardest part (programming language differences).
Now I am rewriting the main code to add the trim and others new functions.
I will release the new version in the next week. |
|
| Back to top |
|
 |
kennyk Member

Joined: 22 Feb 2004 Posts: 245 Location: Keelhaul Key
|
Posted: Sun Mar 12, 2006 2:06 am Post subject: |
|
|
| Sounds great. Hope everything works out. |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Tue Mar 14, 2006 4:31 pm Post subject: |
|
|
Goomba rom builder update!
Main changes:
- Built-in rom trimming
- Unzip support
- Zip output roms after compiling (optional)
- Source code open for downloading
Download |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Tue Mar 14, 2006 4:32 pm Post subject: |
|
|
Dwedit, when I was updating my rom builder, I observe
that goomba color freezes if I try to add a splash screen...
It is a bug, or this is disabled right now? |
|
| Back to top |
|
 |
Dwedit Administrator

Joined: 26 Feb 2004 Posts: 2218 Location: Chicago!
|
Posted: Tue Mar 14, 2006 5:10 pm Post subject: |
|
|
It's a bug. I never use splash screens, so I didn't notice they were broken. _________________ Here come the fortune cookies! Here come the fortune cookies!
They're wearing paper hats! |
|
| Back to top |
|
 |
marcelo Member

Joined: 26 Nov 2004 Posts: 102 Location: Brazil
|
Posted: Wed Mar 15, 2006 11:06 am Post subject: |
|
|
Ok! anyways, thanks for gbc emu! that's was the reason I heave to write a rom builder!  |
|
| Back to top |
|
 |
kingkong Member
Joined: 06 Jan 2006 Posts: 35
|
Posted: Wed Mar 22, 2006 1:34 pm Post subject: |
|
|
rom builder works perfect.
maybe it can be included in next goomba color release (whenever there is one) |
|
| Back to top |
|
 |
|