Skip to content

Commit

Permalink
Add GBDK 2020 linux binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaltby committed Jul 7, 2020
1 parent 9a47640 commit 3c5b77a
Show file tree
Hide file tree
Showing 434 changed files with 9,655 additions and 43,468 deletions.
21 changes: 21 additions & 0 deletions buildTools/linux-x64/gbdk/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
gbdk3-3.1
- Banked functions are working!
- Check this [post](https://gbdev.gg8.se/forums/viewtopic.php?id=700) for more info
- Check the examples/gb/banked code for basic usage
- USE_SFR_FOR_REG is the default now [check here why](https://gbdev.gg8.se/forums/viewtopic.php?id=697)
- Fixed examples that were not compiling in the previous version and some improvements in a few of them. Removed all warnings caused by changing to the new SDCC
- Fixed bug in lcc that was causing some files in the temp folder not being deleted
- Removed as-gbz80 (the lib is now compiled with sdasgb thanks to this [workaround](https://github.com/Zal0/gbdk-2020/commit/d2caafa4a66eb08998a14b258cb66af041a0e5c8))
- Profile support with bgb emulator
- Basic support including <gb/bgb_emu.h> and using the macros BGB_PROFILE_BEGIN and BGB_PROFILE_END. More info in this [post](https://gbdev.gg8.se/forums/viewtopic.php?id=703)
- For full profiling [check this repo](https://github.com/untoxa/bgb_profiling_toolkit/blob/master/readme.md) and this [post](https://gbdev.gg8.se/forums/viewtopic.php?id=710)

gbdk3-3.00
Updated SDCC to v4.0
The new linker is not working so the old version is still there
There is an issue with sdagb compiling drawing.s (the JP in
line 32 after ".org .MODE_TABLE+4*.G_MODE" it's writing more
than 4 bytes invading some addresses required by input.s:41)
Because of this, all .s files in libc have been assembled
with the old as-gbz80 and that's why it is still included

gbdk3-2.96
* Many changes. Code generated is now much more reliable and
passes all of sdcc's regression suite. Added support for large
Expand Down
14 changes: 1 addition & 13 deletions buildTools/linux-x64/gbdk/README
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
gbdk-2.96 - http://gbdk.sourceforge.net/
gbdk-3.1 - https://github.com/Zal0/gbdk-2020/releases
----------------------------------------
(C) 2001 Michael Hope <michaelh@juju.net.nz>

This is a early-release beta. Please report any bugs :)

Short story:
------------
win32:
Expand All @@ -28,16 +26,6 @@ Linux:
e.g. export GBDKDIR=/home/michaelh/gbdk/
* Try compiling the examples as above

Notes for this release:
-----------------------
2.96 is a special maintenance release which includes all of the bug
fixes from a year of development of sdcc. The code generated should
now be more reliable, and all examples run correctly. Banked
functions, the 'sfr' keyword, and targeting assemblers other than
asxxxx is unsupported in this release, but will be in the next. All
testing was done with xgnuboy on Linux/ppc - thanks to them for making
a cross platform emulator.

Special note:
-------------
I've reverted the WORD to 16 bit unsigned change that required
Expand Down
181 changes: 181 additions & 0 deletions buildTools/linux-x64/gbdk/bin/SDCC/bin/as2gbmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
#!/usr/bin/env python

# as2gbmap - asxxxx to gb map file converter
#
# Copyright (c) 2010 Borut Razem
#
# This file is part of sdcc.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
# 2. Altered source versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
#
# Borut Razem
# borut.razem@siol.net

from __future__ import print_function

import sys
import os
import re
from optparse import OptionParser
import operator

def main():
'''asxxxx to gb map file converter'''
usage = "usage: %prog [options] [<input_asxxxx_map_file> [<output_gb_file>]]"
parser = OptionParser(usage = usage, version = "1.0")
parser.set_defaults(no_gmb = False)
parser.add_option("-j", "--no$gmb", action = "store_true", dest = "no_gmb", help = "generate no$gmb symbol file (default: rrgb)")
(options, args) = parser.parse_args()

if len(args) > 0 and args[0] != "-":
try:
fin = open(args[0], "r")
except IOError as xxx_todo_changeme:
(errno, strerror) = xxx_todo_changeme.args
print("%s: can't open %s: %s" % (os.path.basename(sys.argv[0]), args[0], strerror), file=sys.stderr)
return 1
else:
fin = sys.stdin

if len(args) > 1 and args[1] != "-":
try:
fout = open(args[1], "w")
except IOError as xxx_todo_changeme1:
(errno, strerror) = xxx_todo_changeme1.args
print("%s: can't create %s: %s" % (os.path.basename(sys.argv[1]), args[1], strerror), file=sys.stderr)
return 1
else:
fout = sys.stdout;

areas = []
modules = []
libraries = []
ubads = []

radix = 'HEX'
state = None
area = None

# process asxxxx map file
for line in fin:
if re.match(r"^Hexadecimal$", line):
radix = 'HEX';
continue

if re.match(r"^Area +Addr +Size +Decimal +Bytes +\(Attributes\)$", line):
line = next(fin)
if re.match(r"^[- ]+$", line):
line = next(fin)
m = re.match(r"^([^ ]+) +([0-9A-Fa-f]{4}) +([0-9A-Fa-f]{4}) += +\d+\. +\w+ +\(([^\)]+)\)$", line)
if m:
if area:
if m.group(1) != area['area']:
areas.append(area)
area = {'area': m.group(1), 'radix': radix, 'base': int(m.group(2), 16), 'size': int(m.group(3), 16), 'attrib': m.group(4).replace(',', ' '), 'globals': []}
else:
area = {'area': m.group(1), 'radix': radix, 'base': int(m.group(2), 16), 'size': int(m.group(3), 16), 'attrib': m.group(4).replace(',', ' '), 'globals': []}
state = 'IN_AREA'
continue

m = re.match(r"^ +([0-9A-Fa-f]{4}) +([^ ]+) +$", line)
if state == 'IN_AREA' and m:
area['globals'].append({'value': int(m.group(1), 16), 'global': m.group(2)})
continue

m = re.match(r"Files Linked +\[ module\(s\) \]$", line)
if m:
state = 'IN_MODULES'
continue

m = re.match(r"Libraries Linked +\[ object file \]$", line)
if m:
state = 'IN_LIBRARIES'
continue

m = re.match(r"User Base Address Definitions$", line)
if m:
state = 'IN_UBAD'
continue

m = re.match(r"^([^ ]+) +\[ ([^ ]*) \]$", line)
if m:
if state == 'IN_MODULES':
modules.append({'file': m.group(1), 'name': m.group(2)})
continue

if state == 'IN_LIBRARIES':
libraries.append({'library': m.group(1), 'module': m.group(2)})
continue

m = re.match(r"^([^ ]+) += +0x([0-9A-Fa-f]{4})$", line)
if state == 'IN_UBAD' and m:
ubads.append({'symbol': m.group(1), 'value': m.group(2)})
continue

if area:
areas.append(area)


if options.no_gmb:
# generate no$gmp map file
print('; no$gmb format .sym file', file=fout)
print('; Generated automagically by %s' % os.path.basename(sys.argv[0]), file=fout)
for e in areas:
print('; Area: %s' % e['area'], file=fout)
if e['globals']:
e['globals'].sort(key = operator.itemgetter('value'))
for g in e['globals']:
if g['global'][0:3] != 'l__':
if g['value'] > 0x7FFF:
print('00:%04X %s' % (g['value'], g['global']), file=fout)
else:
print('%02X:%04X %s' % (g['value'] // 16384, g['value'], g['global']), file=fout)
else:
# generate rrgb map file
for e in areas:
print('AREA %s' % e['area'], file=fout)
print('\tRADIX %s' % e['radix'], file=fout)
print('\tBASE %04X' % e['base'], file=fout)
print('\tSIZE %04X' % e['size'], file=fout)
print('\tATTRIB %s' % e['attrib'], file=fout)
if e['globals']:
e['globals'].sort(key = operator.itemgetter('value'))
print('\tGLOBALS', file=fout)
for g in e['globals']:
print('\t\t%s\t%04X' % (g['global'], g['value']), file=fout)

if modules:
print('MODULES', file=fout)
for m in modules:
print('\tFILE %s' % m['file'], file=fout)
if m['name']:
print('\t\tNAME %s' % m['name'], file=fout)

if libraries:
print('LIBRARIES', file=fout)
for m in libraries:
print('\tLIBRARY %s' % m['library'], file=fout)
print('\t\tMODULE %s' % m['module'], file=fout)

if ubads:
print('USERBASEDEF', file=fout)
for m in ubads:
print('\t%s = 0x%04X' % (m['symbol'], int(m['value'], 16)), file=fout)
return 0

if __name__ == '__main__':
sys.exit(main())
Binary file added buildTools/linux-x64/gbdk/bin/SDCC/bin/makebin
Binary file not shown.
Binary file added buildTools/linux-x64/gbdk/bin/SDCC/bin/packihx
Binary file not shown.
Binary file added buildTools/linux-x64/gbdk/bin/SDCC/bin/sdar
Binary file not shown.
Binary file added buildTools/linux-x64/gbdk/bin/SDCC/bin/sdasgb
Binary file not shown.
Binary file added buildTools/linux-x64/gbdk/bin/SDCC/bin/sdcc
Binary file not shown.
Binary file added buildTools/linux-x64/gbdk/bin/SDCC/bin/sdcdb
Binary file not shown.
Loading

0 comments on commit 3c5b77a

Please sign in to comment.